This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix ctan, ctanh of subnormals in round-upwards mode (bug 14328)


On 07/08/2012 09:57 AM, Adhemerval Zanella wrote:
> On 07/03/2012 06:32 PM, Joseph S. Myers wrote:
>> Bug 14328 is inaccuracy from ctan and ctanh on certain cases of
>> subnormal inputs, in round-upwards mode only.
>>
> This patch is the same correction, but for IBM long double plus PPC
> ulps update. The correction relies on LDBL_EPSILON value, however
> for IBM long double, GCC builtin sets LDBL_EPSILON as LDBL_DENORM_MIN
> and thus the comparison:
>
> if (fabsl (sinhrx) > fabsl (cosix) * LDBL_EPSILON)
>
> Issues a FE_UNDERFLOW exception in the multiplication for some values.
> To fix this I used the constant 2^-106 as IBM long double epsilon
> (since IBM long double format target this precision). The ULPs for
> different rounding are quite high mainly because the IBM long double
> arithmetic operators only guarantees good precision in FE_TONEAREST
> rounding mode.
>
> Any thoughts, tips, advices?
>
Forgot to add: tested on PPC and PPC64.


-- 
Adhemerval Zanella Netto
  Software Engineer
  Linux Technology Center Brazil
  Toolchain / GLIBC on Power Architecture
  azanella@linux.vnet.ibm.com / azanella@br.ibm.com
  +55 61 8642-9890


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]