(*  hyper_2f1_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the 2F1 hypergeometric *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  08 September 2007 *)
(*  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/10, 33/30, 33/30, 33/10,
  33/10, 33/30, 33/30, 33/10,
  33/10, 33/30, 33/30, 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 };
cvec={
  67/10, 67/10, 67/10, 67/10,
  67/10, 67/10, 67/10, 67/10,
  67/10, 67/10, 67/10, 67/10,
-55/10, -5/10, 5/10, 45/10,
-55/10, -5/10, 5/10, 45/10,
-55/10, -5/10, 5/10, 45/10,
-55/10, -5/10, 5/10, 45/10 };
xvec={
25/100, 25/100, 25/100, 25/100,
55/100, 55/100, 55/100, 55/100,
85/100, 85/100, 85/100, 85/100,
25/100, 25/100, 25/100, 25/100,
55/100, 55/100, 55/100, 55/100,
85/100, 85/100, 85/100, 85/100 };
num = Length [ xvec ];
fvec = {};

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

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