(*  hermite_poly_prob_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the probabilist's Hermite *)
(*    polynomials at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  13 February 2012 *)
(*  Author:  John Burkardt *)

nvec = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 5, 5, 5, 5};
xvec={5,5,5,5,5,5,5,5,5,5,5,5,5,0, 1/2,1,3,10};
fvec = {};
num = Length [ xvec ];

Do [ { n=nvec[[i]],x = xvec[[i]] / Sqrt[2], f = HermiteH[n,x]/2^(n/2) ,
fvec = Append[fvec,f],
      Print["  H[",n,",",x,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["/Users/jburkardt/public_html/math_src/test_values/hermite_poly_prob_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  hermite_poly_prob_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  n  x  f"];
Write[fileout,"#"];
Do[{n=nvec[[i]];x=xvec[[i]];f=fvec[[i]];Write[fileout,n,"  ",N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];