Hermite Function
Returns a Hermite Polynomial of order N evaluated at X.

Unit
QESBPCSMath

Declaration
Function Hermite(const X: Extended; const N: LongWord): Extended;

Parameters
Value to process.
Order of Hermite.

Category
Arithmetic Routines for Floats

Implementation

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;


HTML generated by Time2HELP
http://www.time2help.com