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}\;x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \le -8.80828766495906055 \cdot 10^{67}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\\
\mathbf{elif}\;x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \le 4.4392467528129733 \cdot 10^{305}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot z\\
\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 ((((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))))) <= -8.80828766495906e+67)) {
VAR = ((double) (x + ((double) (y * ((double) (z * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))))));
} else {
double VAR_1;
if ((((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y)))))))))) <= 4.439246752812973e+305)) {
VAR_1 = ((double) (x + ((double) (((double) (y * z)) * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))));
} else {
VAR_1 = ((double) (x + ((double) (t * z))));
}
VAR = VAR_1;
}
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 | 1.9 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -8.80828766495906055e67Initial program 5.2
rmApplied associate-*l*0.2
if -8.80828766495906055e67 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 4.4392467528129733e305Initial program 0.7
if 4.4392467528129733e305 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 60.3
rmApplied associate-*l*24.3
Taylor expanded around inf 33.3
Taylor expanded around inf 32.0
Final simplification1.9
herbie shell --seed 2020175
(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))))))