Re: BUG #16281: LN() function inaccurate at 1000th fractional digit - Mailing list pgsql-bugs

From Justin AnyhowStep
Subject Re: BUG #16281: LN() function inaccurate at 1000th fractional digit
Date
Msg-id SG2PR02MB4458A55D3751B606E571F84BDBE60@SG2PR02MB4458.apcprd02.prod.outlook.com
Whole thread Raw
In response to Re: BUG #16281: LN() function inaccurate at 1000th fractional digit  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #16281: LN() function inaccurate at 1000th fractional digit  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-bugs

> With this patch, all the examples originally posted return the correct
> results (calculated with bc). I'd be interested to know how the OP
> constructed these examples, and whether there were any that were off
> by more than 1 ULP.

> Yeah, that would be interesting.

I didn't do anything fancy. I'm learning how to write an arbitrary precision math library.
I couldn't come up with good test cases since so many numbers exist.
So, I sanity-checked my code by testing many random inputs against another library and pg, and compared the results.

Most of the time, the problem would be with my code.
But I found a few cases where it looked like pg was off.

I don't think I found any that were off by more than 1.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16281: LN() function inaccurate at 1000th fractional digit
Next
From: Dean Rasheed
Date:
Subject: Re: BUG #16281: LN() function inaccurate at 1000th fractional digit