[Haskell-cafe] GHC handles badly with math formulas

2011-06-13 Thread Grigory Sarnitskiy
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

Re: [Haskell-cafe] GHC handles badly with math formulas

2011-06-13 Thread Daniel Fischer
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))

Re: [Haskell-cafe] GHC handles badly with math formulas

2011-06-13 Thread Chris Smith
On Mon, 2011-06-13 at 19:46 +0400, 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 /