From: | "Magnus Hagander" <mha(at)sollentuna(dot)net> |
---|---|
To: | "Martijn van Oosterhout" <kleptog(at)svana(dot)org> |
Cc: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Regression error on float8 |
Date: | 2006-04-24 20:03:57 |
Message-ID: | 6BCB9D8A16AC4241919521715F4D8BCEA0F934@algol.sollentuna.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> > 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...
That totally didn't work on visual c++ at least. It fixes those two
ones, but it breaks the other lines in the same test:
*** ./expected/float8-exp-three-digits-win32.out Wed Jun 8
23:15:29 2005
--- ./results/float8.out Mon Apr 24 21:57:40 2006
***************
*** 321,329 ****
SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
five | f1 | cbrt_f1
------+----------------------+-----------------------
! | 0 | 0
| 1004.3 | 10.014312837827
! | -34.84 | -3.26607421344208
| 1.2345678901234e+200 | 4.97933859234765e+066
| 1.2345678901234e-200 | 2.3112042409018e-067
(5 rows)
--- 321,329 ----
SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
five | f1 | cbrt_f1
------+----------------------+-----------------------
! | 0 | NaN
| 1004.3 | 10.014312837827
! | -34.84 | -1.08869140448069
| 1.2345678901234e+200 | 4.97933859234765e+066
| 1.2345678901234e-200 | 2.3112042409018e-067
(5 rows)
//Magnus
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2006-04-24 20:11:12 | Re: 2x compile warning |
Previous Message | Bruce Momjian | 2006-04-24 19:50:27 | Re: 2x compile warning |