delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/01/19/12:42:32

Date: Sun, 19 Jan 2003 19:40:55 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp-workers AT delorie DOT com
Message-Id: <7263-Sun19Jan2003194055+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <200301181746.h0IHkRf21623@brother.ludd.luth.se>
(lnobody AT delorie DOT com)
Subject: Re: math function verification
References: <200301181746 DOT h0IHkRf21623 AT brother DOT ludd DOT luth DOT se>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: lnobody AT delorie DOT com
> Date: Sat, 18 Jan 2003 18:46:27 +0100 (MET)
> 
> tsin without -lm gives (perhaps that is to be expected as its supposed
> to be fast instead of correct to the last bit)):
> sin(355) = -3.01443533594889079e-05 from math library.
> sin(355) = -3.01443533594884505e-05 is correct answer.
> About 7.09 bits are wrong out of 53.00 total bits.
> That is about 135.00 ULPs (Units Last Place) bits error.

I think this is expected, since x87's argument reduction near
0 + n * 2Pi is known to lose accuracy.  IIRC, the Intel manual
on Pentium CPUs describes this.

> tbin2dec compiled (with or without -lm) gives:
> FAIL: dig=40, errno=0, rc=42, kk=7
> , %e=>9.400000000000014508012846636830772695248e-40000000000000000000000000000000000000000000000000000000000000
> , %f=>0.0...010 (... is 36 0s)
> , %f[41] should be 9 (based upon %e)
> FAIL: dig=40, errno=0, rc=42, kk=6
> , %e=>9.400000000000012874770694004666893306421e-40000000000000000000000000000000000000000000000000000000000000
> , %f=>0.0...010 (... is 36 0s)
> , %f[41] should be 9 (based upon %e)
> FAIL: dig=40, errno=0, rc=42, kk=5
> , %e=>9.400000000000011241528541372503013917594e-40000000000000000000000000000000000000000000000000000000000000
> , %f=>0.0...010 (... is 36 0s)
> , %f[41] should be 9 (based upon %e)
> FAIL: dig=40, errno=0, rc=42, kk=4
> , %e=>9.400000000000009612623197430281152264797e-40000000000000000000000000000000000000000000000000000000000000
> , %f=>0.0...010 (... is 36 0s)
> , %f[41] should be 9 (based upon %e)
> FAIL: dig=40, errno=0, rc=42, kk=3
> , %e=>9.400000000000007981115768274094079970382e-40000000000000000000000000000000000000000000000000000000000000
> , %f=>0.0...010 (... is 36 0s)
> , %f[41] should be 9 (based upon %e)

I don't understand these failures.  Could you please tell more
details about what is the failure here?  Like what was the code and
what is the expected result?

- Raw text -


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