This is the mail archive of the glibc-bugs@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]

[Bug math/15418] New: PowerPC: spurious overflow for hypot


http://sourceware.org/bugzilla/show_bug.cgi?id=15418

             Bug #: 15418
           Summary: PowerPC: spurious overflow for hypot
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: azanella@linux.vnet.ibm.com
    Classification: Unclassified


The hypot implementation for PowerPC (sysdeps/powerpc/fpu/e_hypot.c) generates
spurious overflow exception for subnormal arguments. This is due it checks
if arg1/arg2 > 2^60 (arg1 > arg2) by using a FP division.

A possible fix would be to instead of check:

  if (arg1/arg2 > 2^60)
    return x+y

To check:

  if (arg2 > (LDBL_MAX/2^60))
    if (x/y > 2^60)
      return x+y
  else
    if (x > (y*2^60)
      return x+y

The FP division will be use only for large inputs.

I will send a patch to libc-alpha with a fix.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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