(FPCore (x y z t a)
:precision binary64
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
↓
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (* y (/ 0.5 a)))) (t_2 (+ (* x y) (* t (* z -9.0)))))
(if (<= t_2 -2e+251)
(+ t_1 (/ (* z -4.5) (/ a t)))
(if (<= t_2 5e+231)
(/ t_2 (* a 2.0))
(+ t_1 (* (/ z a) (/ -9.0 (/ 2.0 t))))))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
↓
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y * (0.5 / a));
double t_2 = (x * y) + (t * (z * -9.0));
double tmp;
if (t_2 <= -2e+251) {
tmp = t_1 + ((z * -4.5) / (a / t));
} else if (t_2 <= 5e+231) {
tmp = t_2 / (a * 2.0);
} else {
tmp = t_1 + ((z / a) * (-9.0 / (2.0 / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
↓
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (y * (0.5d0 / a))
t_2 = (x * y) + (t * (z * (-9.0d0)))
if (t_2 <= (-2d+251)) then
tmp = t_1 + ((z * (-4.5d0)) / (a / t))
else if (t_2 <= 5d+231) then
tmp = t_2 / (a * 2.0d0)
else
tmp = t_1 + ((z / a) * ((-9.0d0) / (2.0d0 / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
↓
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y * (0.5 / a));
double t_2 = (x * y) + (t * (z * -9.0));
double tmp;
if (t_2 <= -2e+251) {
tmp = t_1 + ((z * -4.5) / (a / t));
} else if (t_2 <= 5e+231) {
tmp = t_2 / (a * 2.0);
} else {
tmp = t_1 + ((z / a) * (-9.0 / (2.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a):
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
herbie shell --seed 2023090
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))