#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 ------------------------------------------+--------------------------------- Changes (by daniel.is.fischer):
* status: infoneeded => patch Comment: The new patch contains implementations of `rint` and `rintf`, so we don't depend on the installed glibc version. The double version is somewhat slower than glibc's `rint`, but still a lot faster than what we have now. The float version is even a bit faster than glibc's `rintf` here. Since the bugs for `double rint(double)` seem to have been fixed pretty quickly, in contrast to the `rintf` bug, we could call out to math.h's `rint` instead of using our own if we're willing to risk a very few users with buggy versions and also the rare cases where the platforms rounding mode has been set to something other than round to nearest, ties to even. I've tested and benchmarked the patch on my box (32-bit, i686), test also on 64-bits and other platforms before merging. Re the rewrite rules for IntN and WordN, any recommendations where to stick them? -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2271#comment:22> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs