(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 (/ x y))) (t_2 (- (tanh (/ t y)) t_1)))
(if (<= y -1.25e+177)
(+ x (* z (- t (* y t_1))))
(if (<= y -1.45e+112)
(+ x (* (* y z) t_2))
(if (<= y 2.6e+155) (+ x (* y (* z t_2))) (+ x (* z (- t x))))))))
double code(double x, double y, double z, double t) {
double t_1 = tanh((x / y));
double t_2 = tanh((t / y)) - t_1;
double tmp;
if (y <= -1.25e+177) {
tmp = x + (z * (t - (y * t_1)));
} else if (y <= -1.45e+112) {
tmp = x + ((y * z) * t_2);
} else if (y <= 2.6e+155) {
tmp = x + (y * (z * 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((x / y))
t_2 = tanh((t / y)) - t_1
if (y <= (-1.25d+177)) then
tmp = x + (z * (t - (y * t_1)))
else if (y <= (-1.45d+112)) then
tmp = x + ((y * z) * t_2)
else if (y <= 2.6d+155) then
tmp = x + (y * (z * 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((x / y));
double t_2 = Math.tanh((t / y)) - t_1;
double tmp;
if (y <= -1.25e+177) {
tmp = x + (z * (t - (y * t_1)));
} else if (y <= -1.45e+112) {
tmp = x + ((y * z) * t_2);
} else if (y <= 2.6e+155) {
tmp = x + (y * (z * 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((x / y))
t_2 = math.tanh((t / y)) - t_1
tmp = 0
if y <= -1.25e+177:
tmp = x + (z * (t - (y * t_1)))
elif y <= -1.45e+112:
tmp = x + ((y * z) * t_2)
elif y <= 2.6e+155:
tmp = x + (y * (z * 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 2023151
(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))))))