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}\;y \leq -1.1428028320336448 \cdot 10^{+179}:\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\
\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 (<= y -1.1428028320336448e+179) (+ x (* z (- t x))) (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))))
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 (y <= -1.1428028320336448e+179) {
tmp = x + (z * (t - x));
} else {
tmp = x + (y * (z * (tanh(t / y) - tanh(x / y))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 2.0 |
| Herbie | 1.6 |
if y < -1.14280283203364483e179Initial program 18.8
rmApplied associate-*l*_binary649.0
rmApplied add-cube-cbrt_binary649.4
Applied associate-*l*_binary649.4
Simplified9.4
rmApplied flip--_binary6426.1
Applied associate-*l/_binary6426.4
Simplified26.4
Taylor expanded around 0 4.6
Simplified4.6
if -1.14280283203364483e179 < y Initial program 3.1
rmApplied associate-*l*_binary641.3
Final simplification1.6
herbie shell --seed 2020233
(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))))))