News for hackers. Stuff that matters.
Re:Herbie: Automatically rewrites expressions to minimize fl... by adamjs on Sunday January 24, 2016 @09:01PM (#10965164)
The OP copied only half my tweet, full title should be "...to minimize floating-point precision errors". This tool is specifically for improving the numerical accuracy of equations when translated into floating-point code-- "minimizing errors" makes no sense without the qualifiers.

I do a lot of procedural graphics on the GPU and am constantly plagued by precision issues (you cannot copy equations verbatim into code, you must observe overflow/underflow and other numerical issues). Herbie is pretty magical in that it can _automatically_ translate math expressions into a form that's friendlier for computers.

Also the reason why the GitHub site source was linked is because the website [1] crashed under traffic earlier today (full site contains an interactive solver and examples).

[1] http://herbie.uwplse.org/

Re:Herbie: Automatically rewrites expressions to minimize fl... by jacobolus on Sunday January 24, 2016 @09:22PM (#10965236)
Do you have an example of a graphics algorithm that you were helped with by this tool / a description of how that went?
Re:Herbie: Automatically rewrites expressions to minimize fl... by adamjs on Sunday January 24, 2016 @09:41PM (#10965276)
There's actually a great write-up on how Herbie was used in the real-world to fix and improve math.js: https://pavpanchekha.com/blog/casio-mathjs.html

I've personally used it for improving some distance-field approximation code on the GPU (made it easier to translate the math into numerically-stable code).

Re:Herbie: Automatically rewrites expressions to minimize fl... by pavpanchekha on Monday January 25, 2016 @11:23AM (#10968016)
Adam, I'm one of the authors of Herbie. I'd love to hear about the distance-field approximation code you improved using Herbie. Is there any chance you can email me some details? You can use my personal email (on my profile) or the [email protected] mailing list.
Re:Herbie: Automatically rewrites expressions to minimize fl... by dang on Monday January 25, 2016 @12:25AM (#10965752)
Ok, we changed the title from "Herbie: A tool to automatically rewrite arithmetic expressions to minimize error" to be closer to what you've said here. If anyone can suggest a better (more accurate and neutral) title, we can change it again.
Re:Herbie: Automatically rewrites expressions to minimize fl... by _0ffh on Monday January 25, 2016 @07:46AM (#10966852)
Wouldn't it need to know the probable value ranges of the input variables?
Re:Herbie: Automatically rewrites expressions to minimize fl... by Natsu on Monday January 25, 2016 @12:54AM (#10965819)
I think it would be interesting if something like this could be chosen as a compiler optimization.
Re:Herbie: Automatically rewrites expressions to minimize fl... by davmre on Monday January 25, 2016 @01:00AM (#10965834)
Re:Herbie: Automatically rewrites expressions to minimize fl... by OxO4 on Sunday January 24, 2016 @07:43PM (#10964868)
Looks quite interesting. Is there a paper/tech report that describes the approach? The website [1] seems to be down at the moment.

[1] http://herbie.uwplse.org/

Re:Herbie: Automatically rewrites expressions to minimize fl... by davmre on Sunday January 24, 2016 @08:10PM (#10964973)
Yes, this was a best paper award at PLDI '15: http://homes.cs.washington.edu/~jrw12/herbie.pdf
Re:Herbie: Automatically rewrites expressions to minimize fl... by ChristianBundy on Sunday January 24, 2016 @07:55PM (#10964914)
Re:Herbie: Automatically rewrites expressions to minimize fl... by drinknderive on Sunday January 24, 2016 @07:31PM (#10964828)
The heck is Racket?
Re:Herbie: Automatically rewrites expressions to minimize fl... by mahmud on Sunday January 24, 2016 @08:25PM (#10965028)
The language that this site is written in.
Re:Herbie: Automatically rewrites expressions to minimize fl... by TazeTSchnitzel on Sunday January 24, 2016 @08:36PM (#10965067)
Huh? Isn't HN written in Arc?
Re:Herbie: Automatically rewrites expressions to minimize fl... by mahmud on Sunday January 24, 2016 @08:58PM (#10965150)
Right, meant to say "the platform that powers this site".

Arc itself is an interpreter written in Racket. The site runs on racket.

Re:Herbie: Automatically rewrites expressions to minimize fl... by barrkel on Sunday January 24, 2016 @09:07PM (#10965190)
The Arc compiler converts Arc expressions into Scheme (in the mzscheme dialect) as implemented by Racket.
Re:Herbie: Automatically rewrites expressions to minimize fl... by lifthrasiir on Sunday January 24, 2016 @08:58PM (#10965152)
LISP people likes to refer a language modification to a "language", partly because its lexical structure is so simple and its metaprogramming makes such modification easy. But yeah, Racket and Arc are only similar in the surface syntax.
Re:Herbie: Automatically rewrites expressions to minimize fl... by ufo on Sunday January 24, 2016 @07:59PM (#10964932)
Re:Herbie: Automatically rewrites expressions to minimize fl... by kuschku on Sunday January 24, 2016 @07:48PM (#10964892)
A scheme dialect formerly known as DrScheme or PLT Scheme