• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <cmath>

    std::cyl_neumann

    namespace std {
      double
        cyl_neumann(double nu,
                    double x);              // (1) C++17
      floating-point-type
        cyl_neumann(floating-point-type nu,
                    floating-point-type x); // (1) C++23
    
      Promoted
        cyl_neumann(Arithmetic1 nu,
                    Arithmetic2 x);         // (2) C++17
    
      float
        cyl_neumannf(float nu,
                     float x);              // (3) C++17
    
      long double
        cyl_neumannl(long double nu,
                     long double x);        // (4) C++17
    }
    

    概要

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

    戻り値

    引数 x の第2種ベッセル関数 Nν(x)=Jν(x)cosνπJν(x)sinνπfor x0 を返す。 J は第1種ベッセル関数 (cyl_bessel_j) である。

    備考

    #include <cmath>
    #include <iostream>
    
    constexpr double pi = 3.141592653589793;
    
    void p(double nu) {
      for (double r : {0., 1./3., 2./3.})
        std::cout << "cyl_neumann(" << nu << ", " << r << " pi) = " << std::cyl_neumann(nu, r * pi) << "\n";
      std::cout << "\n";
    }
    
    int main() {
      p(0.0);
      p(0.5); // cyl_neumann(1/2, x) = -sqrt(2 / πx) * cos(x)
      p(1.0);
    }
    

    出力例

    cyl_neumann(0, 0 pi) = -inf
    cyl_neumann(0, 0.333333 pi) = 0.124174
    cyl_neumann(0, 0.666667 pi) = 0.517996
    
    cyl_neumann(0.5, 0 pi) = -inf
    cyl_neumann(0.5, 0.333333 pi) = -0.389848
    cyl_neumann(0.5, 0.666667 pi) = 0.275664
    
    cyl_neumann(1, 0 pi) = -inf
    cyl_neumann(1, 0.333333 pi) = -0.741089
    cyl_neumann(1, 0.666667 pi) = -0.054725
    
    

    バージョン

    言語

    • C++17

    処理系

    備考

    GCC (libstdc++)

    GCC 7.1.0–8.0.0 では nu < 0 のときに std::domain_error を送出する。

    関連項目

    参照