(*  hyper_1f1_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the 1F1 hypergeometric *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  28 March 2010 *)
(*  Author:  John Burkardt *)

avec = { -25/10, -5/10, 5/10, 25/10,
-25/10, -5/10, 5/10, 25/10,
-25/10, -5/10, 5/10, 25/10,
  33/40, 33/30, 33/20, 33/10,
  33/40, 33/30, 33/20, 33/10,
  33/40, 33/30, 33/20, 33/10 };

bvec={
  33/10, 33/30, 33/30, 33/10,
  33/10, 33/30, 33/30, 33/10,
  33/10, 33/30, 33/30, 33/10,
  67/10, 67/10, 67/10, 67/10,
  67/10, 67/10, 67/10, 67/10,
  67/10, 67/10, 67/10, 67/10 };
xvec={
25/100, 25/100, 25/100, 25/100,
155/100, 155/100, 155/100, 155/100,
285/100, 285/100, 285/100,285/100,
25/100, 25/100, 25/100, 25/100,
155/100, 155/100, 155/100, 155/100,
285/100, 285/100, 285/100, 285/100 };
num = Length [ xvec ];
fvec = {};

Do [ {  
a = avec[[i]],
b = bvec[[i]],
x=xvec[[i]], 
f = Hypergeometric1F1[a,b,x] ,
fvec = Append[fvec,f],
 Print[ "1F1[", a,",",b,",",x,"] = ",N[f,20]] 
}, {i,1, num,1} ]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/hyper_1f1_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  hyper_1f1_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  a  b  x  f"];
Write[fileout,"#"];
Do[{a=avec[[i]];b=bvec[[i]];x=xvec[[i]];f=fvec[[i]];Write[fileout,N[a,10],"  ",N[b,10],"  ",N[x,10],"  ",N[f,20]]},{i,1,num,1}];Close[fileout];