import mir.polynomial: polynomial; import mir.rc.array: rcarray; import mir.test: should; auto h0 = hermiteCoefficientsNorm(0).rcarray!(const double).polynomial; auto h1 = hermiteCoefficientsNorm(1).rcarray!(const double).polynomial; auto h2 = hermiteCoefficientsNorm(2).rcarray!(const double).polynomial; auto h3 = hermiteCoefficientsNorm(3).rcarray!(const double).polynomial; auto h4 = hermiteCoefficientsNorm(4).rcarray!(const double).polynomial; auto h5 = hermiteCoefficientsNorm(5).rcarray!(const double).polynomial; auto h6 = hermiteCoefficientsNorm(6).rcarray!(const double).polynomial; auto h7 = hermiteCoefficientsNorm(7).rcarray!(const double).polynomial; auto h8 = hermiteCoefficientsNorm(8).rcarray!(const double).polynomial; auto h9 = hermiteCoefficientsNorm(9).rcarray!(const double).polynomial; auto h10 = hermiteCoefficientsNorm(10).rcarray!(const double).polynomial; h0(3).should == 1; h1(3).should == 3; h2(3).should == 8; h3(3).should == 18; h4(3).should == 30; h5(3).should == 18; h6(3).should == -96; h7(3).should == -396; h8(3).should == -516; h9(3).should == 1_620; h10(3).should == 9_504;
Also works with @nogc CTFE
import mir.ndslice.slice: sliced; import mir.test: should; static immutable result = [-1, 0, 1]; static immutable hc2 = hermiteCoefficientsNorm(2); hc2.sliced.should == result;
Normalized (probabilist's) Hermite polynomial coefficients