[GHC] #2450: Data.Complex.magnitude squares using ^(2 :: Int), which is slow

GHC ghc-devs at haskell.org
Thu Jan 23 19:57:02 UTC 2014


#2450: Data.Complex.magnitude squares using ^(2 :: Int), which is slow
--------------------------------------------+------------------------------
        Reporter:  igloo                    |            Owner:
            Type:  bug                      |           Status:  new
        Priority:  lowest                   |        Milestone:  7.6.2
       Component:  libraries/base           |          Version:  6.8.3
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by cdk):

 It looks like this has been resolved, `Data.Complex.magnitude` now uses
 `sqr z = z * z` and `GHC.Real` has rewrite rules for small, known constant
 exponents:

 https://github.com/ghc/packages-base/blob/master/Data/Complex.hs
 https://github.com/ghc/packages-base/blob/master/GHC/Real.lhs

 I found this bug on the list of 'getting started' bugs, but it's already
 been fixed. Time to close?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/2450#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list