(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))))
(if (<= (+ x (* (* y z) (- t_2 t_1))) 2e+307)
(+ x (* y (- (* z t_2) (* z t_1))))
(+ x (* z (- t x))))))
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))
if ((x + ((y * z) * (t_2 - t_1))) <= 2d+307) then
tmp = x + (y * ((z * t_2) - (z * t_1)))
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));
double tmp;
if ((x + ((y * z) * (t_2 - t_1))) <= 2e+307) {
tmp = x + (y * ((z * t_2) - (z * t_1)));
} 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))
tmp = 0
if (x + ((y * z) * (t_2 - t_1))) <= 2e+307:
tmp = x + (y * ((z * t_2) - (z * t_1)))
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
(+.f64 x (*.f64 y (*.f64 z (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))): 15 points increase in error, 7 points decrease in error
Applied egg-rr1.0
\[\leadsto x + y \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) \cdot z + \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}
\]
Applied egg-rr1.0
\[\leadsto x + y \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) \cdot z - z \cdot \tanh \left(\frac{x}{y}\right)\right)}
\]
if 1.99999999999999997e307 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))
(+.f64 x (*.f64 y (*.f64 z (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))): 0 points increase in error, 0 points decrease in error
(+.f64 x (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))): 15 points increase in error, 7 points decrease in error
Taylor expanded in y around inf 5.5
\[\leadsto x + \color{blue}{z \cdot \left(t - x\right)}
\]
herbie shell --seed 2022329
(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))))))