\[\left(\left(1.1102230246251565 \cdot 10^{-16} < a \land a < 9007199254740992\right) \land \left(1.1102230246251565 \cdot 10^{-16} < b \land b < 9007199254740992\right)\right) \land \left(1.1102230246251565 \cdot 10^{-16} < c \land c < 9007199254740992\right)\]
(FPCore (a b c)
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
↓
(FPCore (a b c)
:precision binary64
(-
(-
(fma
-0.25
(/ (pow a 3.0) (/ (pow b 7.0) (* (pow c 4.0) 20.0)))
(/ (* (* a (* a -2.0)) (pow c 3.0)) (pow b 5.0)))
(/ c b))
(* a (/ (* c c) (pow b 3.0)))))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
↓
double code(double a, double b, double c) {
return (fma(-0.25, (pow(a, 3.0) / (pow(b, 7.0) / (pow(c, 4.0) * 20.0))), (((a * (a * -2.0)) * pow(c, 3.0)) / pow(b, 5.0))) - (c / b)) - (a * ((c * c) / pow(b, 3.0)));
}
function code(a, b, c)
return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
herbie shell --seed 2023125
(FPCore (a b c)
:name "Quadratic roots, medium range"
:precision binary64
:pre (and (and (and (< 1.1102230246251565e-16 a) (< a 9007199254740992.0)) (and (< 1.1102230246251565e-16 b) (< b 9007199254740992.0))) (and (< 1.1102230246251565e-16 c) (< c 9007199254740992.0)))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))