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 -3.8397005902903564 \cdot 10^{+130}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, 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 -3.8397005902903564e+130) (fma (- t x) z 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 <= -3.8397005902903564e+130) {
tmp = fma((t - x), z, 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
| Original | 4.5 |
|---|---|
| Target | 2.0 |
| Herbie | 2.0 |
if y < -3.8397005902903564e130Initial program 14.6
Taylor expanded in y around inf 7.0
Applied add-cbrt-cube_binary6428.2
Simplified28.2
Taylor expanded in x around 0 7.0
Simplified7.0
if -3.8397005902903564e130 < y Initial program 3.1
Applied associate-*l*_binary641.3
Final simplification2.0
herbie shell --seed 2022024
(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))))))