From owner-freebsd-numerics@freebsd.org Tue Nov 5 21:51:39 2019 Return-Path: Delivered-To: freebsd-numerics@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2588C17A388 for ; Tue, 5 Nov 2019 21:51:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4773K70GXDz46Q1 for ; Tue, 5 Nov 2019 21:51:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 092B617A387; Tue, 5 Nov 2019 21:51:39 +0000 (UTC) Delivered-To: numerics@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08F5917A386 for ; Tue, 5 Nov 2019 21:51:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4773K66YWRz46Py for ; Tue, 5 Nov 2019 21:51:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C113B1B2D3 for ; Tue, 5 Nov 2019 21:51:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5LpcNT099265 for ; Tue, 5 Nov 2019 21:51:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xA5LpcAY099264 for numerics@FreeBSD.org; Tue, 5 Nov 2019 21:51:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: numerics@FreeBSD.org Subject: [Bug 237800] pow(3) returns inaccurate results Date: Tue, 05 Nov 2019 21:51:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: kargl@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: numerics@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 21:51:39 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237800 --- Comment #14 from Steve Kargl --- (In reply to me from comment #13) > > The test case I have at the moment is 0.6840442338072671 ** 2.4. > As I understand it, it should be 0.4019777798321958 but I am > getting 0.40197777983219574. The first number contains 16 digits. The second contains 17 digits, so cannot make a judgement on rounding. But, % ./testd -a 0.6840442338072671 2.4 libm =3D 4.0197777983219574e-01, /* 0x3fd9ba01, 0x02864520 */ mpfr =3D 4.0197777983219579e-01, /* 0x3fd9ba01, 0x02864521 */ ulp =3D 0.51122 MPFR is an arbitrary precision library where I have it set to use 212 bits of precision to compute pow(). pow() is FreeBSD's libm value with 53-bits of precision. You have a ULP of 0.51122. That is about as accurate as one might expect. See comment #8 for a pointer to Goldberg's paper. --=20 You are receiving this mail because: You are the assignee for the bug.=