Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::sph_neumann,std::sph_neumannf,std::sph_neumannl

      From cppreference.com
      <cpp‎ |numeric‎ |special functions
       
       
       
       
      Defined in header<cmath>
      (1)
      float       sph_neumann(unsigned n,float x);

      double      sph_neumann(unsigned n,double x);

      longdouble sph_neumann(unsigned n,longdouble x);
      (since C++17)
      (until C++23)
      /* floating-point-type */ sph_neumann(unsigned n,
                                             /* floating-point-type */ x);
      (since C++23)
      float       sph_neumannf(unsigned n,float x);
      (2)(since C++17)
      longdouble sph_neumannl(unsigned n,longdouble x);
      (3)(since C++17)
      Defined in header<cmath>
      template<class Integer>
      double      sph_neumann(unsigned n, Integer x);
      (A)(since C++17)
      1-3) Computes thespherical Bessel function of the second kind, also known as the spherical Neumann function, ofn andx. The library provides overloads ofstd::sph_neumann for all cv-unqualified floating-point types as the type of the parameterx.(since C++23)
      A) Additional overloads are provided for all integer types, which are treated asdouble.

      Contents

      [edit]Parameters

      n - the order of the function
      x - the argument of the function

      [edit]Return value

      If no errors occur, returns the value of the spherical Bessel function of the second kind (spherical Neumann function) ofn andx, that isnn(x) = (π/2x)1/2
      Nn+1/2(x)
      whereNn(x) isstd::cyl_neumann(n, x) andx≥0.

      [edit]Error handling

      Errors may be reported as specified inmath_errhandling

      • If the argument is NaN, NaN is returned and domain error is not reported
      • Ifn≥128, the behavior is implementation-defined

      [edit]Notes

      Implementations that do not support C++17, but supportISO 29124:2010, provide this function if__STDCPP_MATH_SPEC_FUNCS__ is defined by the implementation to a value at least 201003L and if the user defines__STDCPP_WANT_MATH_SPEC_FUNCS__ before including any standard library headers.

      Implementations that do not support ISO 29124:2010 but support TR 19768:2007 (TR1), provide this function in the headertr1/cmath and namespacestd::tr1.

      An implementation of this function is also available inboost.math.

      The additional overloads are not required to be provided exactly as(A). They only need to be sufficient to ensure that for their argumentnum of integer type,std::sph_neumann(int_num, num) has the same effect asstd::sph_neumann(int_num,static_cast<double>(num)).

      [edit]Example

      Run this code
      #include <cmath>#include <iostream> int main(){// spot check for n == 1double x=1.2345;std::cout<<"n_1("<< x<<") = "<< std::sph_neumann(1, x)<<'\n'; // exact solution for n_1std::cout<<"-cos(x)/x² - sin(x)/x = "<<-std::cos(x)/(x* x)-std::sin(x)/ x<<'\n';}

      Output:

      n_1(1.2345) = -0.981201-cos(x)/x² - sin(x)/x = -0.981201

      [edit]See also

      cylindrical Neumann functions
      (function)[edit]
      spherical Bessel functions (of the first kind)
      (function)[edit]

      [edit]External links

      Weisstein, Eric W. "Spherical Bessel Function of the Second Kind." From MathWorld — A Wolfram Web Resource.
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/special_functions/sph_neumann&oldid=149562"

      [8]ページ先頭

      ©2009-2025 Movatter.jp