std:: hermite, std:: hermitef, std:: hermitel
|
double
hermite
(
unsigned
int
n,
double
x
)
;
double
hermite
(
unsigned
int
n,
float
x
)
;
|
(1) | |
|
double
hermite
(
unsigned
int
n, IntegralType x
)
;
|
(2) | |
与所有特殊函数一样,只有当实现将
__STDCPP_MATH_SPEC_FUNCS__
定义为至少 201003L 的值,并且用户在包含任何标准库头文件之前定义了
__STDCPP_WANT_MATH_SPEC_FUNCS__
时,才保证
hermite
在
<cmath>
中可用。
目录 |
参数
| n | - | 多项式的次数 |
| x | - | 参数,浮点或整数类型的值 |
返回值
If no errors occur, value of the order- n Hermite polynomial of x , that is (-1) ne x 2
|
d
n
|
|
dx
n
|
, is returned.
错误处理
错误报告方式可按照 math_errhandling 中的规定执行。
- 若参数为 NaN,则返回 NaN 且不报告定义域错误。
- 若 n 大于或等于 128,则行为由实现定义。
注释
不支持 TR 29124 但支持 TR 19768 的实现,在头文件
tr1/cmath
和命名空间
std::tr1
中提供此函数。
此函数的实现也可 在 boost.math 中找到 。
埃尔米特多项式是方程
u
,,
- 2xu
,
= -2nu
的多项式解。
前几个是:
- hermite(0, x) = 1 。
- hermite(1, x) = 2x 。
-
hermite(2, x) =
4x
2
- 2 。 -
hermite(3, x) =
8x
3
- 12x 。 -
hermite(4, x) =
16x
4
- 48x 2
+ 12 。
示例
(在 gcc 6.0 环境下运行结果如上所示)
#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 1 #include <cmath> #include <iostream> double H3(double x) { return 8 * std::pow(x, 3) - 12 * x; } double H4(double x) { return 16 * std::pow(x, 4) - 48 * x * x + 12; } int main() { // 点校验 std::cout << std::hermite(3, 10) << '=' << H3(10) << '\n' << std::hermite(4, 10) << '=' << H4(10) << '\n'; }
输出:
7880=7880 155212=155212
参见
|
拉盖尔多项式
(函数) |
|
|
勒让德多项式
(函数) |
外部链接
魏斯斯坦,埃里克·W。《埃尔米特多项式》 摘自 MathWorld——沃尔夫勒姆网络资源。