Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2001 14:43:57 -0500
From:      Stephen Montgomery-Smith <stephen@math.missouri.edu>
To:        jmcoopr@webmail.bmi.net
Cc:        Jim.Pirzyk@disney.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: math library difference between linux emulation and native freebsd   (and native linux)
Message-ID:  <3B50A0FD.4E501941@math.missouri.edu>
References:  <200107141907.MAA07030@smtp.bmi.net>

next in thread | previous in thread | raw e-mail | index | archive | help
jmcoopr@webmail.bmi.net wrote:
> 
> 
> >I also tried the same experiment with sin and gamma - then the problem
> >does not occur.  Well except that the answer for gamma(53.278500) is
> >reported as 157.464664 which is way wrong.
> 
> >When I tried it for x=52 they gave almost the same answer, only
> >seperated by the last bit (the decimal versions were reported as the
> >same).  For x=54 they both gave the same wrong answer 160.331128.
> 
> >I don't know a whole lot about IEEE.  What is the largest number it is
> >supposed to handle?  Looking at man math it says it should handle
> >numbers as large as 1.8e308 - we certainly are not in that range!!!
> 
> But remember, floating point is DIFFERENT--nothing is exact.  You can
> create a number with a magnitude about 1.8e308, but you sure don't get
> 308 significant digits.

You missed my point (or I didn't explain it well).  I was wondering if
the problem was because we were dealing with such large numbers that the
arithmetic got out of wack.

exp(54) = 160.331128 is way way wrong, by orders of magnitude.  Same for
gamma(53.27850) = 157.464664.  My point is that the correct answers are
way less than 1e308, so there is no excuse for the wrong answers.

By the way, Mathematica, which is Linux binary running under emulation,
gets the answers correct.

-- 
Stephen Montgomery-Smith
stephen@math.missouri.edu
http://www.math.missouri.edu/~stephen

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B50A0FD.4E501941>