#4228: atanh (-1) returns NaN instead of -Infinity
---------------------------------+------------------------------------------
    Reporter:  sbroadhead        |        Owner:                             
        Type:  bug               |       Status:  patch                      
    Priority:  normal            |    Milestone:  6.14.1                     
   Component:  Prelude           |      Version:  6.12.1                     
    Keywords:                    |     Testcase:                             
   Blockedby:                    |   Difficulty:                             
          Os:  Unknown/Multiple  |     Blocking:                             
Architecture:  Unknown/Multiple  |      Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------
Changes (by norriscm):

 * cc: g...@… (added)
  * status:  new => patch


Comment:

 By using a different (but mathematically equivalent) formula for atanh, we
 can get the desired behavior without explicitly handling the branch cuts:

 {{{
 atanh x = 0.5 * log ((1.0+x) / (1.0-x))
 }}}

 This definition gives atanh 1 == Infinity and atanh -1 == -Infinity.  The
 attached patch makes the changes in GHC.Float and Data.Complex for the
 Float, Double, and Complex a instances.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4228#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to