#2271: floor, ceiling, round :: Double -> Int are awesomely slow
------------------------------------------+---------------------------------
Reporter: dons | Owner: daniel.is.fischer
Type: bug | Status: patch
Priority: low | Milestone: 7.0.1
Component: libraries/base | Version: 7.1
Keywords: performance, math, double | Testcase:
Blockedby: | Difficulty: Unknown
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
------------------------------------------+---------------------------------
Comment(by daniel.is.fischer):
There are a few functions which give different results with and without
optimisations. It's not nice, but what can one do? You can't change the
primops to have the non-optimised behaviour (without sacrificing
performance) and changing the non-optimised functions to match the primops
is perhaps not always possible (`realToFrac :: Float -> Double` would be
very hard to make `fromRational . toRational` match `float2Double`) and
practically always make the non-optimised functions unusably slow.
Regarding -0.0, since 0.0 == (-0.0), I don't see a strong reason to keep
the tests just to match prior behaviour in this case.
Patch for the rewrite rules is at #1434 btw.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2271#comment:33>
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