\[\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
(+
(- (+ (/ 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, 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)))