
We can also add special case for raising to 1 to increase accuracy But I'm not so sure. Special cases are not just messy code; they produce messy values. I've seen an explanation from a numerical analyst that they need a function
#8539: Data.Complex shouldn't use default implementation of (**) -------------------------------------+------------------------------------- Reporter: jjaredsimpson | Owner: Type: bug | Status: patch Priority: low | Milestone: Component: Prelude | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by yalas): Replying to [comment:16 Scott Turner]: that's mathematically monotonic, such as log, to be numerically monotonic when computed. It's hard to guarantee smooth computational behavior if special cases are thrown in, in order to gain perfect accuracy.
In my opinion it would be better to leave {{{ x ** y = exp (log x * y) }}} in effect, except when x is 0 or infinite.
Ok. But why we don't want to handle infinity in other functions, such as sqrt, exp, (/) or (*)? Why is (!**) so special? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8539#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler