\[\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
(let* ((t_0 (pow (* c a) 4.0)))
(-
(fma
-0.25
(/ (+ (* 4.0 t_0) (* t_0 16.0)) (* a (pow b 7.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) {
double t_0 = pow((c * a), 4.0);
return fma(-0.25, (((4.0 * t_0) + (t_0 * 16.0)) / (a * pow(b, 7.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 2023097
(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)))