Re: Regression error on float8 - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Regression error on float8
Date
Msg-id 20060424182317.GD2747@svana.org
Whole thread Raw
In response to Re: Regression error on float8  ("Magnus Hagander" <mha@sollentuna.net>)
Responses Re: Regression error on float8  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Apr 24, 2006 at 03:01:51PM +0200, Magnus Hagander wrote:
> If I undefine HAVE_CBRT on Linux, I get the exact same failure! So it
> seems our own version of cbrt() is broken wrt our own regression tests
> :-( Must be that nobody else (at least on i386) uses that code.

<snip>

> What do you think is best - try to adapt that version, or update our
> regression tests outputs to accept the output from our current code?

Given that our output gets very very close, perhaps we should take a
hint from the end of the MinGW version, do a single Newton iteration to
fixup those last few digits.

Adding this before the last line of our version of cbrt():

tmpres -= ( tmpres - (x/(tmpres*tmpres)) )*0.33333333333333333333;

Makes it give the same result as my system version...
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Kris Jurka
Date:
Subject: Re: 2x compile warning
Next
From: Gevik Babakhani
Date:
Subject: Re: TODO Item: ACL_CONNECT