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 6.498537120547806 \cdot 10^{+217}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot t - x \cdot z\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 6.498537120547806e+217) (+ 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 (y <= 6.498537120547806e+217) {
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.9 |
|---|---|
| Target | 2.2 |
| Herbie | 1.7 |
if y < 6.4985371205478062e217Initial program 3.8
rmApplied associate-*l*_binary64_85441.5
if 6.4985371205478062e217 < y Initial program 21.8
Taylor expanded around inf 4.1
Simplified4.1
Taylor expanded around 0 4.1
Final simplification1.7
herbie shell --seed 2021047
(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))))))