(*  exp_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the exponential *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  11 March 2008 *)
(*  Author:  John Burkardt *)

xvec = { -10, -5, -1, 0, 1/100000000,1/10000,1/1000,1/100,1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10, 8/10, 9/10, 1, 2, Pi, 5, 10, 20,40};
fvec = {};
num = Length [ xvec ];

Do [ { x = xvec[[i]],f = Exp[x],
fvec = Append [ fvec, f ],
      Print["  Exp[",x,"]=",N[f,20]] },{i,1, num,1}]

(* Write the data to a file. *)
fileout = OpenWrite [ "/Users/burkardt/public_html/math_src/test_values/exp_values.txt" ];
SetOptions [ fileout, FormatType ->TextForm];
Write[ fileout, "#  exp_values.txt" ];
today = DateList[];
Write [ fileout, "#  Created on ",today ];
Write [ fileout, "#"];
Write [ fileout, "#  x  fx" ];
Write [ fileout, "#"];
Do [ {
x = xvec[[i]];
f = fvec[[i]];
Write [ fileout,  N[x,20], "  ", N[f,20] ] },
{i,1,num,1}];
Close [ fileout ];