MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Plot, Cursor and Spelling Errors questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14450] RE: [mg14393] Plot, Cursor and Spelling Errors questions
  • From: Ranko Bojanic <bojanic at math.ohio-state.edu>
  • Date: Wed, 21 Oct 1998 03:32:47 -0400
  • Organization: Ohio State University
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Ted!

Thanks for your suggestions. This problem of plotting curves whose
magnitude is smaller than the machine precision has bothered me for
many years while I was writing a Pascal program for the construction of
polynomials of best approximation to continuous function. If you have a
Macintosh computer, see Remez68K.sea.hqx  or RemezPPC.sea.hqx at
fttp://ftp.math.ohio-state.edu/pub/users/bojanic or look for Remez at 
http://archives.math.utk.edu/
software/mac/numericalAnalysis/.directory.html The program I posted is
just the first step in the construction of the polynomial of best
approximation to Exp[x] on [-1,1], of degree 14. If you want a
polynomial of degree 30, set n=31 and the precision 50 istead of 17
since the magnitude of the error curve is  10^(-42). The PrecisionPlot
module works fine in this case as well.

I still do not understand why anh how your module works.

PrecisionPlot[f_,{x_,xmin_,xmax_},opts___?OptionQ]/;
  Head[f]=!=List:=
    Module[{g,h},
      g=Evaluate[f/.x->#]&;
      h=g[SetPrecision[#,17]]&;
      Plot[h[x],{x,xmin,xmax}, opts]
    ]

If you write a simpler module along these lines just to evaluate a
function f at a poin a with  p decimal digits, you may write

 eval[f_,a_,p_]:=   Module[{g,h,x},
                      g=Evaluate[f[x]/.x->#]&;
                      h=g[SetPrecision[#,p]]&;
                      Return[h[a]]]
This gives
In[1]    := eval[Exp,2.3, 30]
Out [1]  = 9.9741824548147189681868930533

It looks like we can evaluate Exp[2.3] with arbitrary precision. But

In[2]    := N[Exp[23/10],30]
Out[1]  = 9.9741824548147207399576151569

gives a different result.

Thanks again for your help.
Ranko

Ranko Bojanic
bojanic at math.ohio-state.edu



  • Prev by Date: Re: Plot, Cursor and Spelling Errors questions
  • Next by Date: FourierTransform on UnitStep
  • Previous by thread: Re: Re: Plot, Cursor and Spelling Errors questions
  • Next by thread: Re: Plot, Cursor and Spelling Errors questions