From owner-freebsd-hackers Sat Jul 14 11:30:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.disney.com (mail.disney.com [204.128.192.15]) by hub.freebsd.org (Postfix) with ESMTP id 979E837B401 for ; Sat, 14 Jul 2001 11:30:23 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from pain10.corp.disney.com (root@pain10.corp.disney.com [153.7.110.100]) by mail.disney.com (Switch-2.0.1/Switch-2.0.1) with SMTP id f6EITbI16334 for ; Sat, 14 Jul 2001 11:29:37 -0700 (PDT) Received: from [172.30.50.1] by pain.corp.disney.com with ESMTP for freebsd-hackers@FreeBSD.ORG; Sat, 14 Jul 2001 11:31:17 -0700 Received: from plio.fan.fa.disney.com (plio.fan.fa.disney.com [153.7.118.2]) by pecos.fa.disney.com (8.11.3/8.11.3) with ESMTP id f6EIUMs14645 for ; Sat, 14 Jul 2001 11:30:22 -0700 (PDT) Received: from mercury.fan.fa.disney.com (mercury.fan.fa.disney.com [153.7.119.1]) by plio.fan.fa.disney.com (8.9.2/8.9.2) with ESMTP id LAA17467 for ; Sat, 14 Jul 2001 11:30:21 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from [172.30.46.50] by mercury.fan.fa.disney.com with ESMTP; Sat, 14 Jul 2001 11:30:20 -0700 Date: Sat, 14 Jul 2001 11:30:22 -0700 From: Jim Pirzyk Content-Type: text/plain; format=flowed; charset=us-ascii Subject: Re: math library difference between linux emulation and native freebsd (and native linux) Cc: freebsd-hackers@FreeBSD.ORG To: Stephen Montgomery-Smith X-Mailer: Apple Mail (2.388) In-Reply-To: <3B508E2D.41FAC546@math.missouri.edu> Mime-Version: 1.0 (Apple Message framework v388) Content-Transfer-Encoding: 7bit Message-Id: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 >> #include >> #include >> >> 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