*To*: Julien PUYDT <julien.puydt@laposte.net>, 617894@bugs.debian.org*Subject*: Bug#617894: [ARMel] tgammal isn't accurate enough*From*: Aurelien Jarno <aurelien@aurel32.net>*Date*: Sun, 13 Mar 2011 15:49:18 +0100*Message-id*: <[🔎] 20110313144918.GA16916@hall.aurel32.net>*Reply-to*: Aurelien Jarno <aurelien@aurel32.net>, 617894@bugs.debian.org*In-reply-to*: <[🔎] 4D7B82D3.4010607@laposte.net>*References*: <[🔎] 4D7B3375.2020508@laposte.net> <[🔎] 20110312111134.GB6288@hall.aurel32.net> <[🔎] 4D7B82D3.4010607@laposte.net>

On Sat, Mar 12, 2011 at 03:27:31PM +0100, Julien PUYDT wrote: > Le 12/03/2011 12:11, Aurelien Jarno a écrit : > >On Sat, Mar 12, 2011 at 09:48:53AM +0100, Julien PUYDT wrote: > >>Package: libc6 > >>Version: 2.11.2-13 > >> > >>The following piece of code : > >> > >>#include<stdio.h> > >>#include<math.h> > >> > >>int > >>main (int argc, > >> char* argv[]) > >>{ > >> long double x = 6.0; > >> printf ("tgammal (%20Lf)=%20Lf\n", x, tgammal (x)); > >> return 0; > >>} > >> > >>Prints, on an x86 debian unstable (eglibc 2.11.2-11) : > >>tgammal ( 6.000000)= 120.000000 > >>And on an ARMel debian unstable (eglibc 2.11.2-13) : > >>tgammal (6.00000000000000000000)=119.99999999999997157829 > > > >On armel, long double is same the type as a double, and thus tgamma() > >and tgammal() are the same functions. On x86 long double and double are > >different types, and thus tgamma() and tgammal() are different > >functions. > > > >Your test code with long double and tgammal() on armel gives as expected > >exactly the same result as double and tgamma() on x86. I don't see any > >problem here, this function works as expected. > > Let's see : > 119.99999999999997157829 > 0123456789ABCD <- digit counting > That makes 12 good digits -- and 119 needs 7 more (it's between 2**6 > and 2**7), so that makes 19 good digits. > > Isn't that a little short? If I read > http://en.wikipedia.org/wiki/IEEE_754-2008#Basic_formats well, even > simple precision boasts 23 digits. 23 binary digits, which means 7.22 decimal digit. For double, it lists 15.95 digit, so your example is in the expected precision range. > The above computation may be a little naive. Can you point me to the > more precise place where the precision of those special functions is > normalized? > I don't thing the standard normalizes the precision of these functions, at least I haven't found anything. OTOH, it normalizes the precision of the different types. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net

**Follow-Ups**:**Bug#617894: [ARMel] tgammal isn't accurate enough***From:*Julien PUYDT <julien.puydt@laposte.net>

**References**:**Bug#617894: [ARMel] tgammal isn't accurate enough***From:*Julien PUYDT <julien.puydt@laposte.net>

**Bug#617894: [ARMel] tgammal isn't accurate enough***From:*Aurelien Jarno <aurelien@aurel32.net>

**Bug#617894: [ARMel] tgammal isn't accurate enough***From:*Julien PUYDT <julien.puydt@laposte.net>

- Prev by Date:
**r4582 - glibc-package/branches/eglibc-2.13/debian** - Next by Date:
**Bug#617894: [ARMel] tgammal isn't accurate enough** - Previous by thread:
**Bug#617894: [ARMel] tgammal isn't accurate enough** - Next by thread:
**Bug#617894: [ARMel] tgammal isn't accurate enough** - Index(es):