[Haskell-cafe] ANN: The Herbie GHC Plugin

Christopher Allen cma at bitemyapp.com
Tue Sep 22 17:19:21 UTC 2015


That's what I suggested might be the case and this makes sense. Thank you :)

On Tue, Sep 22, 2015 at 12:17 PM, Mike Izbicki <mike at izbicki.me> wrote:

> > My thoughts exactly, I think this would be *really* cool as an
> HLint-style tool.
>
> The main problem with this is that numerically stable expressions are
> often very opaque.  If you look at the first example in the README, I
> would definitely rather have:
>
> w far near = -(2 * far * near) / (far - near)
>
> in my code than
>
> w near far = if near < -1.7210442634149447e+81
>     then (2.0 * near / (near - far)) * far
>     else if near < 8.364504563556443e+16
>         then (2.0 * near) / ((near - far) / far)
>         else ((2.0 * near) / (near - far)) * far
>
> One of the reasons I use Haskell is because the code is "at the level
> of thought" and GHC translates this into awesome speed without the
> programmer needing to worry about the gory details in most cases.  I
> want that same experience for numerical stability.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>



-- 
Chris Allen
Currently working on http://haskellbook.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150922/6108cd56/attachment.html>


More information about the Haskell-Cafe mailing list