back

by raphlinus·1y ago·view on hn ↗
The quadratic solver implementation in kurbo is designed to be fast and reasonably precise for a wide range of inputs. But for a definitive treatment of how to solve quadratic equations, see "The Ins and Outs of Solving Quadratic Equations with Floating-Point Arithmetic" by Goualard[2]. I thought I understood the problem space pretty well, then I came across that.

[1]: https://github.com/linebender/kurbo/blob/b5bd2aa856781c6cf46...

[2]: https://cnrs.hal.science/hal-04116310/document

2 comments
Seconded: great paper, clear and comprehensive.

I cited it from the first paragraph of https://en.wikipedia.org/wiki/Quadratic_formula#Numerical_ca... when I was working on it back in March but I'm sure the discussion could still be more complete there.