3 ms·
A related question is how to solve quadratic equations robustly using IEEE floating point. When solving ax² + bx + c, the most common problem is when a is very
by raphlinus 5y ago
A related question is how to solve quadratic equations robustly using IEEE floating point. When solving ax² + bx + c, the most common problem is when a is very tiny, or even zero (then it becomes a linear equation, which is easy, but the classic solution becomes undefined). There are other things that can go wrong.
At some point I might write up a solution, but in the meantime I'll point to code that implements it[1].
[1]: https://docs.rs/kurbo/0.8.1/src/kurbo/common.rs.html#105-149 https://docs.rs/kurbo/0.8.1/src/kurbo/common.rs.html#105-149