(FPCore (x y z t)
:precision binary64
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (tanh (/ t y)) (tanh (/ x y)))) (t_2 (+ x (* (* y z) t_1))))
(if (<= t_2 -2e-58)
(+ x (* y (* z t_1)))
(if (<= t_2 4e+279) t_2 (+ x (* z (- t x)))))))
double code(double x, double y, double z, double t) {
double t_1 = tanh((t / y)) - tanh((x / y));
double t_2 = x + ((y * z) * t_1);
double tmp;
if (t_2 <= -2e-58) {
tmp = x + (y * (z * t_1));
} else if (t_2 <= 4e+279) {
tmp = t_2;
} else {
tmp = x + (z * (t - x));
}
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) * (tanh((t / y)) - tanh((x / y))))
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) :: t_2
real(8) :: tmp
t_1 = tanh((t / y)) - tanh((x / y))
t_2 = x + ((y * z) * t_1)
if (t_2 <= (-2d-58)) then
tmp = x + (y * (z * t_1))
else if (t_2 <= 4d+279) then
tmp = t_2
else
tmp = x + (z * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = Math.tanh((t / y)) - Math.tanh((x / y));
double t_2 = x + ((y * z) * t_1);
double tmp;
if (t_2 <= -2e-58) {
tmp = x + (y * (z * t_1));
} else if (t_2 <= 4e+279) {
tmp = t_2;
} else {
tmp = x + (z * (t - x));
}
return tmp;
}
def code(x, y, z, t):
return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
↓
def code(x, y, z, t):
t_1 = math.tanh((t / y)) - math.tanh((x / y))
t_2 = x + ((y * z) * t_1)
tmp = 0
if t_2 <= -2e-58:
tmp = x + (y * (z * t_1))
elif t_2 <= 4e+279:
tmp = t_2
else:
tmp = x + (z * (t - x))
return tmp
function code(x, y, z, t)
return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
herbie shell --seed 2022364
(FPCore (x y z t)
:name "SynthBasics:moogVCF from YampaSynth-0.2"
:precision binary64
:herbie-target
(+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))