Re: What to do about tgammal?

From: Marc Fonvieille <blackend_at_freebsd.org>
Date: Mon, 20 Dec 2021 10:15:53 UTC
Le 18.12.2021 17:59, Mark Murray a écrit :
> 
> 
> > On 18 Dec 2021, at 17:51, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> > 
> > On Sat, Dec 18, 2021 at 10:41:14AM +0000, Mark Murray wrote:
> >> 
> >> Hmm. I think my understanding of ULP is missing something?
> >> 
> >> I thought that ULP could not be greater than the mantissa size
> >> in bits?
> >> 
> >> I.e., I thought it represents average rounding error (compared with
> >> "perfect rounding"), not truncation error, as the above very large
> >> ULPs suggest.
> >> 
> > 
> > The definition of ULP differs according which expert you
> > choose to follow. :-)  For me (a non-expert), ULP is measured
> > in the system of the "accurate answer", which is assumed to
> > have many more bits of precision than the "approximate answer".
> > From a very old das@ email and for long double I have
> 
> <snip>
> 
> Thank you!
> 
> I checked the definition that I was used to, and it is roughly
> "how many bits of the mantissa are inaccurate (because of
> rounding error)".
>

Hi,

ULP (Unit in the last place) is at first the weight of the least
significant bit of the mantissa.  E.g., in IEEE 754 single precision =
2^-23.
It can also be seen as the distance between 2 consecutive significands
(which is not the distance between 2 consecutive floating numbers).
Some people, use ULP (or number of ULP) as Units (plural) in the Last
Place to show the number of bits in error in the least significant bits
of the significand.
I assume what Steve is talking about is the corresponding value in
decimal of the number of ULP.

This thread is really interesting (even if I'm loosely following it).

> I can see how both work. For utterly massive numbers like
> from Gamma(), I can see how accounting for a much larger
> range works.
> 
> It still feels slightly tricky, as e.g. how many digits after the
> floating point do you account for?
> 
> > I don't print out the hex representation in ld128, but you see
> > the number of correct decimal digits is 33 digits compared to
> > 36.
> 
> Looking good!
> 
> M
> --
> Mark R V Murray
> 



-- 
Marc