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 -5.39442978055282742 \cdot 10^{133}:\\
\;\;\;\;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}double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -5.394429780552827e+133)) {
VAR = ((double) (x + ((double) (z * ((double) (t - x))))));
} else {
VAR = ((double) (x + ((double) (y * ((double) (z * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.1 |
|---|---|
| Target | 1.8 |
| Herbie | 1.8 |
if y < -5.39442978055282742e133Initial program 14.7
rmApplied flip--25.3
Applied associate-*r/25.3
Taylor expanded around 0 6.7
Simplified6.7
if -5.39442978055282742e133 < y Initial program 2.6
rmApplied associate-*l*1.1
Final simplification1.8
herbie shell --seed 2020168
(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))))))