(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) (- t z))))
(if (<= t_1 2e-161)
(/ (/ x (- z y)) (- z t))
(if (<= t_1 1e+157) (/ x t_1) (/ (/ x (- z t)) (- z y))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e-161) {
tmp = (x / (z - y)) / (z - t);
} else if (t_1 <= 1e+157) {
tmp = x / t_1;
} else {
tmp = (x / (z - t)) / (z - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x / ((y - z) * (t - z))
end function
↓
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * (t - z)
if (t_1 <= 2d-161) then
tmp = (x / (z - y)) / (z - t)
else if (t_1 <= 1d+157) then
tmp = x / t_1
else
tmp = (x / (z - t)) / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * (t - z);
double tmp;
if (t_1 <= 2e-161) {
tmp = (x / (z - y)) / (z - t);
} else if (t_1 <= 1e+157) {
tmp = x / t_1;
} else {
tmp = (x / (z - t)) / (z - y);
}
return tmp;
}
def code(x, y, z, t):
return x / ((y - z) * (t - z))
↓
def code(x, y, z, t):
t_1 = (y - z) * (t - z)
tmp = 0
if t_1 <= 2e-161:
tmp = (x / (z - y)) / (z - t)
elif t_1 <= 1e+157:
tmp = x / t_1
else:
tmp = (x / (z - t)) / (z - y)
return tmp
function code(x, y, z, t)
return Float64(x / Float64(Float64(y - z) * Float64(t - z)))
end
herbie shell --seed 2023031
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
:herbie-target
(if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))
(/ x (* (- y z) (- t z))))