| Hermite Function |
Unit
QESBPCSMath
Declaration
Function Hermite(const X: Extended; const N: LongWord): Extended;
| Parameters |
| X | Value to process. |
| N | Order of Hermite. |
Category
Arithmetic Routines for FloatsImplementation
function Hermite (const X: Extended; const N: LongWord): Extended;
var
I: LongWord;
HNplus1, HN, HNminus1: Extended;
begin
if N = 0 then // H0(x)=1
Result := 1
else if N = 1 then //H1(x)=2x
Result := 2 * X
else
begin
I := 1;
HN := 2 * X;
HNminus1 := 1;
repeat
Inc (I);
HNplus1 := 2 * X * HN - 2 * (I - 1) * HNminus1;
if I <> N then
begin
HNminus1 := HN;
HN := HNplus1;
end;
until I = N;
Result := HNPlus1;
end;
End; |
|
|