[Haskell-cafe] GHC handles badly with math formulas
Daniel Fischer
daniel.is.fischer at googlemail.com
Mon Jun 13 17:57:25 CEST 2011
On Monday 13 June 2011, 17:46:23, Grigory Sarnitskiy wrote:
> I've noted several times that GHC doesn't evaluate formulas for Double
> values during compilation.
>
> That is using
> 4.2326514735445615 instead of (512 / 0.844)**(1/3)
> or
> 0.906179845938664 instead of (1/3) * sqrt(5 + 2 * sqrt(10 / 7))
>
> This can lead to significant slowdown if such values are called often.
> It's not always convenient to use where or let to reduce the number of
> calculations of such constants so I wonder how to force GHC to evaluate
> them during compilation?
http://hackage.haskell.org/trac/ghc/ticket/4101
More information about the Haskell-Cafe
mailing list