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) を求める。
- (1) :
- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される)
- (3) :
float
型規定 - (4) :
long double
型規定
戻り値
引数 x
の第2種ベッセル関数
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);
}
17
#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
処理系
- Clang: ??
- GCC: 7.1.0 ✅
- ICC: ??
- Visual C++: ??
備考
GCC (libstdc++)
GCC 7.1.0–8.0.0 では nu < 0
のときに std::domain_error
を送出する。
関連項目
- 第1種ベッセル関数
cyl_bessel_j
- 第2種変形ベッセル関数
cyl_bessel_k
- 第2種球ベッセル関数
sph_neumann
参照
- N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions
- WG21 P0226R1 Mathematical Special Functions for C++17, v5
- ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions
- P1467R9 Extended floating-point types and standard names