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 \le -2.9957314611234766 \cdot 10^{247} \lor \neg \left(y \le 1.3781839898159729 \cdot 10^{137}\right):\\
\;\;\;\;\mathsf{fma}\left(t, z, x - x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x\\
\end{array}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 VAR;
if (((y <= -2.9957314611234766e+247) || !(y <= 1.378183989815973e+137))) {
VAR = fma(t, z, (x - (x * z)));
} else {
VAR = (((y * z) * (tanh((t / y)) - tanh((x / y)))) + x);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 2.1 |
| Herbie | 2.7 |
if y < -2.9957314611234766e+247 or 1.378183989815973e+137 < y Initial program 16.5
Simplified8.3
rmApplied sub-neg8.3
Applied distribute-lft-in8.3
Taylor expanded around inf 10.4
Taylor expanded around inf 5.5
Simplified5.5
if -2.9957314611234766e+247 < y < 1.378183989815973e+137Initial program 2.2
Simplified0.9
rmApplied sub-neg0.9
Applied distribute-lft-in0.9
rmApplied fma-udef0.9
Simplified2.2
Final simplification2.7
herbie shell --seed 2020078 +o rules:numerics
(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))))))