\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
(FPCore (a b c)
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
↓
(FPCore (a b c)
:precision binary64
(+
(- (+ (/ c b) (/ (* a (pow c 2.0)) (pow b 3.0))))
(+
(* -2.0 (/ (* (pow c 3.0) (pow a 2.0)) (pow b 5.0)))
(* -0.25 (/ (* (pow (* c a) 4.0) 20.0) (* a (pow b 7.0)))))))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
↓
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = -((c / b) + ((a * (c ** 2.0d0)) / (b ** 3.0d0))) + (((-2.0d0) * (((c ** 3.0d0) * (a ** 2.0d0)) / (b ** 5.0d0))) + ((-0.25d0) * ((((c * a) ** 4.0d0) * 20.0d0) / (a * (b ** 7.0d0)))))
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
↓
public static double code(double a, double b, double c) {
return -((c / b) + ((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0))) + ((-2.0 * ((Math.pow(c, 3.0) * Math.pow(a, 2.0)) / Math.pow(b, 5.0))) + (-0.25 * ((Math.pow((c * a), 4.0) * 20.0) / (a * Math.pow(b, 7.0)))));
}
def code(a, b, c):
return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
herbie shell --seed 2023077
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:precision binary64
:pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))