Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2001 11:30:22 -0700
From:      Jim Pirzyk <Jim.Pirzyk@disney.com>
To:        Stephen Montgomery-Smith <stephen@math.missouri.edu>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: math library difference between linux emulation and native freebsd (and native linux)
Message-ID:  <iss.47b4.3b508fbc.595f8.1@mercury.fan.fa.disney.com>
In-Reply-To: <3B508E2D.41FAC546@math.missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On Saturday, July 14, 2001, at 11:23 AM, Stephen Montgomery-Smith wrote:

> The correct answer to the level of accuracy you quote is:
> 137581029243568295877658.36934931
>
> Both are correct to about 15 sig figs, which is about what the precision
> of IEEE double precision arithmetic is supposed to be.

This would explain why the alpha zero's out the last places before
the decimal.   The problem is here is we need to emulate the
Linux performance exactly regardless if it is correct :(

- JimP

>
> Jim.Pirzyk@disney.com wrote:
>>
>> So I have stumbled across a linux emulation bug in freebsd.  Below
>> is the program that returns different results based on FreeBSD,
>> Linux or Linux emulation under FreeBSD.
>>
>> Running natively under FreeBSD:
>>
>> x = 53.27850000
>> exp(x) = 137581029243568449912832.00000000
>>
>> Running natively under Linux:
>>
>> x = 53.278500
>> exp(x) = 137581029243568449912832.000000
>>
>> Running under FreeBSD in Linux emulation mode:
>>
>> x = 53.27850000
>> exp(x) = 137581029243567812378624.00000000
>>
>> #include <stdio.h>
>> #include <math.h>
>> #include <stdlib.h>
>>
>> int main (int argc, char **argv) {
>>      double x = 53.278500;
>>
>>      printf ("x = %8lf\n", x);
>>      printf ("exp(x) = %8lf\n", exp(x));
>>
>>      exit (0);
>> }
>>
>> There are only two shared libaries in common (libc and libm) and
>> both are the same on FreeBSD (in /compat/linux) and Linux.
>>
>> So any ideas on where the program is going wrong?
>>
>> - JimP
>> --
>> --- @(#) $Id: dot.signature,v 1.10 2001/05/17 23:38:49 Jim.Pirzyk Exp $
>>     __o   Jim.Pirzyk@disney.com ------------- pirzyk@freebsd.org
>>  _'\<,_   Senior Systems Engineer, Walt Disney Feature Animation
>> (*)/ (*)
>>
>> To Unsubscribe: send mail to majordomo@FreeBSD.org
>> with "unsubscribe freebsd-hackers" in the body of the message
>
> --
> 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?iss.47b4.3b508fbc.595f8.1>