(FPCore (x y z t a)
:precision binary64
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
↓
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x (* z y)) (sqrt (- (* z z) (* t a))))))
(if (<= z -5.2e-19)
(* x (- y))
(if (<= z -1e-300)
t_1
(if (<= z 1e-185)
(* x (* y (* z (* (pow (/ -1.0 t) 0.5) (pow a -0.5)))))
(if (<= z 6.2e+33) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * (z * y)) / sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -5.2e-19) {
tmp = x * -y;
} else if (z <= -1e-300) {
tmp = t_1;
} else if (z <= 1e-185) {
tmp = x * (y * (z * (pow((-1.0 / t), 0.5) * pow(a, -0.5))));
} else if (z <= 6.2e+33) {
tmp = t_1;
} else {
tmp = x * y;
}
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) / sqrt(((z * z) - (t * a)))
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) :: tmp
t_1 = (x * (z * y)) / sqrt(((z * z) - (t * a)))
if (z <= (-5.2d-19)) then
tmp = x * -y
else if (z <= (-1d-300)) then
tmp = t_1
else if (z <= 1d-185) then
tmp = x * (y * (z * ((((-1.0d0) / t) ** 0.5d0) * (a ** (-0.5d0)))))
else if (z <= 6.2d+33) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
↓
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * (z * y)) / Math.sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -5.2e-19) {
tmp = x * -y;
} else if (z <= -1e-300) {
tmp = t_1;
} else if (z <= 1e-185) {
tmp = x * (y * (z * (Math.pow((-1.0 / t), 0.5) * Math.pow(a, -0.5))));
} else if (z <= 6.2e+33) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
herbie shell --seed 2022228
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))