Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,323
    • Issues 4,323
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 388
    • Merge Requests 388
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8532

Closed
Open
Opened Nov 14, 2013 by leftaroundabout@trac-leftaroundabout

Hyperbolic arc cosine fails on (-1) :: Complex r.

When allowing for complex results, the hyperbolic arc cosine is continuously defined on all ℝ.

In the (x < (-1)) real ray of the complex plane, acosh equals \z -> i * pi + acosh(abs z), which works fine for almost all arguments. Thus, acosh (-1) should equal i * pi; however due to the implementation as

acosh z = log (z + (z+1) * sqrt ((z-1)/(z+1)))

where the denominator in the root becomes zero at z = -1, this comes out as NaN :+ NaN.

Could be fixed trivially by adding a special case

acosh ((-1):+0) = 0:+pi

to the instance (RealFloat a) => Floating (Complex a) in Data.Complex.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component libraries/base
Test case acosh(-1) :: Complex Double
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.4.1
Milestone
8.4.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#8532