最終更新日時(UTC):
が更新

履歴 編集

function
<cmath>

std::sph_neumann(C++17)

namespace std {
  double
    sph_neumann(unsigned int n,
                double x);              // (1) C++17
  floating-point-type
    sph_neumann(unsigned int n,
                floating-point-type x); // (1) C++23

  Promoted
    sph_neumann(unsigned int n,
                Arithmetic x);          // (2) C++17

  float
    sph_neumannf(unsigned int n,
                 float x);              // (3) C++17

  long double
    sph_neumannl(unsigned int n,
                 long double x);        // (4) C++17
}

概要

第2種球ベッセル関数 (spherical Bessel functions of the second kind)、球ノイマン関数 (spherical Neumann functions) を求める。

戻り値

引数 n, x の第2種球ベッセル関数 $$ n_n(x) = \sqrt{\frac{\pi}{2x}} N_{n + 1/2}(x) \quad \text{for } x \ge 0 $$ を返す。 $N$ は第2種ベッセル関数 (cyl_neumann)。

備考

#include <cmath>
#include <iostream>

constexpr double pi = 3.141592653589793;

void p(unsigned n) {
  for (double r : {0., 0.25, 0.5})
    std::cout << "sph_neumann(" << n << ", " << r << " pi) = " << std::sph_neumann(n, r * pi) << "\n";
  std::cout << "\n";
}

int main() {
  p(0); // sph_neumann(0, x) = -cos(x) / x
  p(1); // sph_neumann(1, x) = -cos(x) / x^2 - sin(x) / x
  p(2); // sph_neumann(2, x) = (-3 / x^3 + 1 / x) * cos(x) - (3 / x^2) * sin(x)
}

出力例

sph_neumann(0, 0 pi) = -inf
sph_neumann(0, 0.25 pi) = -0.900316
sph_neumann(0, 0.5 pi) = -7.66616e-18

sph_neumann(1, 0 pi) = -inf
sph_neumann(1, 0.25 pi) = -2.04663
sph_neumann(1, 0.5 pi) = -0.63662

sph_neumann(2, 0 pi) = -inf
sph_neumann(2, 0.25 pi) = -6.91725
sph_neumann(2, 0.5 pi) = -1.21585

バージョン

言語

  • C++17

処理系

実装例

漸化式

$$ n_n(x) = \frac{2n-1}{x} n_{n-1}(x) - n_{n-2}(x); n_0(x) = - \frac{\cos x}{x}, n_1(x) = - \frac{\cos x}{x^2} - \frac{\sin x}{x} $$

関連項目

参照