Print[ "--------------------------------------------------"]
Print[ "1doc saying Good Morning Mr. Babbage" ]
(* form sine values over computing range *)
Print[ "form sine values over computing range" ]
maxDegrees = 23
sin1Deg=Table[Sin[x*Pi/180],{x,maxDegrees}]
(* table of sin(?,45,step 1 degree *)
evalSin1Deg = N[sin1Deg,65] (* evaluate the list *)
gs=ListPlot[evalSin1Deg] (* plot the list *)
(* make computing polynomial *)
Print[ "make computing polynomial" ]
x=. (* clear any previous value of x *)
polyTable = Table[x^i,{i,0,7}] (* make polynomial in x degree ??? *)
?polyTable (* print it *)
polyFit = Fit[evalSin1Deg, polyTable ,x] (* make coefficients for poly *)
?polyFit (* print it *)
(* verify a point *)
Print[ "verify a point" ]
x = N[20.0000000000000000000000000000000000000000000000000000000000000000,65]
?x
polyEvalX = N[polyFit,65] (* evaluate polynomial using x degrees *)
?polyEvalX
checkValX = N[Sin[x*Pi/180],65]
?checkValX
error = 100*(polyEvalX-checkValX)/checkValX
?error
(* OK, we have the polynomial, with coefficients, in "polyfit" *)
-----------------------------------------------------------------------------------------------------------
----- the following are the coefficients determined from the above program ---------
-----------------------------------------------------------------------------------------------------------
Global`polyFit
polyFit = - 1.0112257866802907976508313939764368438889972408265365*10-12
+ 0.0174532925216557274769549250801631315294033707496965080599625406*x1
- 9.650085084723510264829688370560080405677175961808051*10-13*x2
- 8.8609590190158230245840290299003852696908836849183542081556*10-7*x3
- 3.559895737182358512650535465409020916300876450096534*10-14*x4
+ 1.34988036474326106427099346582466021689704504399525639404*10-11*x5
- 1.1822156380312276038279665456578797618653765115294092*10-16*x6
- 9.56366792081574516308224691444599782291947611648516203*10-17*x7