www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/31/16:35:00

From: Morten Welinder <terra AT diku DOT dk>
Date: Wed, 31 May 1995 21:14:15 +0200
To: ljeste01 AT msuacad DOT morehead-st DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Math/rounding errors?

I thought this over and I assume that the emulator is just doing
a bad job for the expression "atan(1.)".  If you don't want to
have pi (see also http://www.diku.dk/~terra/pi.html) as a constant
in there use the formula

	pi = 16.0*atan(1.0/5.0) - 4.0*atan(1.0/239.0);

Exercises for the readers:

1. Why does the emulator do a bad job for atan(1.0)?
2. Prove the above formula.  Why does the emulator do better?
3. How many weeks ago did I complain over the lack of accuracy
   in the emulator on the mailing list for V2 developers?
4. Is the alternative emulator (wmemu) better?

There will be a test tomorrow, :-)  [This is a joke -- don't send
me the answers, please]




From: Larry Estep <ljeste01 AT msuacad DOT morehead-st DOT edu>

> 
> >     For instance, passing 5.0 to the function should result in a value
> > of 120.0.  Instead I get 118.401 from the djgpp version.  This is just
> > not acceptable.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019