pub fn hermite<N: ComplexField + FromPrimitive + Copy>(
n: u32,
tol: N::RealField,
) -> Result<Polynomial<N>, String>Expand description
Get the nth hermite polynomial.
Gets the nth physicist’s hermite polynomial over a specified field. This is done using the recurrance relation so the normalization is standard for the physicist’s hermite polynomial.
§Errors
Returns an error if tol is invalid.
§Panics
Panics if a u8 or u32 can not be converted into the generic type.
§Examples
use bacon_sci::special::hermite;
fn example() {
let h_3 = hermite::<f64>(3, 1e-8).unwrap();
assert_eq!(h_3.order(), 3);
assert!(h_3.get_coefficient(0).abs() < 0.0001);
assert!((h_3.get_coefficient(1) - 12.0).abs() < 0.0001);
assert!(h_3.get_coefficient(2).abs() < 0.0001);
assert!((h_3.get_coefficient(3) - 8.0).abs() < 0.0001);
}