From owner-freebsd-standards Sun Feb 3 3:11:37 2002 Delivered-To: freebsd-standards@freebsd.org Received: from a96180.upc-a.chello.nl (a96180.upc-a.chello.nl [62.163.96.180]) by hub.freebsd.org (Postfix) with ESMTP id 7492237B405 for ; Sun, 3 Feb 2002 03:11:28 -0800 (PST) Received: by a96180.upc-a.chello.nl (Postfix, from userid 1001) id 88B612170; Sun, 3 Feb 2002 12:11:22 +0100 (CET) Date: Sun, 3 Feb 2002 12:11:22 +0100 From: Jeroen Ruigrok/asmodai To: standards@FreeBSD.ORG Subject: Possible math problems Message-ID: <20020203111121.GF52378@daemon.ninth-circle.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.24i Organisation: Ninth Circle Enterprises Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG While adding support for unix98 and ansi99 to TenDRA I passed the complex.h definitions in the spec and started hunting for the IEEE specs on mathematical support. I came to this page: http://win-www.uia.ac.be/u/cant/ieeecc754.html Which is a math testsuite, and linked to from the IEEE 754 page. In the basic operations I noticed the following: Testrun: ./IeeeCC754 -c -s BasicOp/testsets/divide Error Line 655: exponent different Error Line 655: mantissa different Operation: div Round to nearest Operand 1: 00bfffff Operand 2: 3fc00000 Flags expected: x u Flags returned: x u Correct result: 007fffff Returned result: 00800000 Error Line 658: exponent different Error Line 658: mantissa different Operation: div Round to nearest Operand 1: 80bfffff Operand 2: 3fc00000 Flags expected: x u Flags returned: x u Correct result: 807fffff Returned result: 80800000 Summary: -------- Warning: no special 'w' underflow cases in the testset Errors: 2/2153 Warnings: 0/2153 Skipped: 0/2153 Testrun: ./IeeeCC754 -c -s BasicOp/testsets/multiply Error Line 709: mantissa different Operation: mul Round to nearest Operand 1: 33000001 Operand 2: 00ffffff Flags expected: x u Flags returned: x u Correct result: 00000001 Returned result: 00000000 Error Line 709: mantissa different Operation: mul Round to nearest Operand 1: 00ffffff Operand 2: 33000001 Flags expected: x u Flags returned: x u Correct result: 00000001 Returned result: 00000000 [14 others] Summary: -------- Implementation signals underflow in case the result (1) is tiny after rounding and (2) suffers denormalization loss ('u' - underflow) Errors: 16/5408 Warnings: 0/5408 Skipped: 0/5408 Only problems happened with the multiply/division operations. But it becomes more interesting when doing long precision. The error rate increases a lot: Testrun: ./IeeeCC754 -c -d BasicOp/testsets/add Errors: 0/3152 Testrun: ./IeeeCC754 -c -l BasicOp/testsets/add Errors: 1788/3152 This was on 4.5-PRERELEASE with an AMD Athlon. Anyone else like testing this? The Conversions do not work, since it seems to require glibc's bits/mathinline.h header. -- Jeroen Ruigrok van der Werven / asmodai / Kita no Mono / xMach coreteam asmodai@[wxs.nl|xmach.org], finger asmodai@ninth-circle.org http://www.softweyr.com/asmodai/ Laat ons drinken op ons grote ongelijk... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message