(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y (/ t (- z x))))) (t_2 (+ x (/ (* y (- z x)) t))))
(if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 1e+308) t_2 t_1))))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
↓
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (t / (z - x)));
double t_2 = x + ((y * (z - x)) / t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 1e+308) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = x + (y / (t / (z - x)));
double t_2 = x + ((y * (z - x)) / t);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 1e+308) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t):
return x + ((y * (z - x)) / t)
↓
def code(x, y, z, t):
t_1 = x + (y / (t / (z - x)))
t_2 = x + ((y * (z - x)) / t)
tmp = 0
if t_2 <= -math.inf:
tmp = t_1
elif t_2 <= 1e+308:
tmp = t_2
else:
tmp = t_1
return tmp
function code(x, y, z, t)
return Float64(x + Float64(Float64(y * Float64(z - x)) / t))
end
herbie shell --seed 2022317
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))