x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\begin{array}{l}
\mathbf{if}\;x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \leq 5.667699237603602 \cdot 10^{+297}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot t\right) - x \cdot z\\
\end{array}(FPCore (x y z t) :precision binary64 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
(FPCore (x y z t)
:precision binary64
(if (<=
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y)))))
5.667699237603602e+297)
(+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
(- (+ x (* z t)) (* x z))))double code(double x, double y, double z, double t) {
return x + ((y * z) * (tanh(t / y) - tanh(x / y)));
}
double code(double x, double y, double z, double t) {
double tmp;
if ((x + ((y * z) * (tanh(t / y) - tanh(x / y)))) <= 5.667699237603602e+297) {
tmp = x + (y * (z * (tanh(t / y) - tanh(x / y))));
} else {
tmp = (x + (z * t)) - (x * z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.3 |
|---|---|
| Target | 1.8 |
| Herbie | 1.4 |
if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 5.66769923760360178e297Initial program 2.0
rmApplied add-cbrt-cube_binary64_79575.4
Simplified5.4
rmApplied associate-*l*_binary64_78625.1
Simplified0.9
if 5.66769923760360178e297 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) Initial program 50.6
Taylor expanded around inf 10.1
Final simplification1.4
herbie shell --seed 2021098
(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))))))