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}\;z \le -6.5836496593785987 \cdot 10^{35} \lor \neg \left(z \le 2983.93446503404675\right):\\
\;\;\;\;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(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\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 (((z <= -6.583649659378599e+35) || !(z <= 2983.9344650340468))) {
VAR = ((double) (x + ((double) (y * ((double) (z * ((double) (((double) tanh(((double) (t / y)))) - ((double) tanh(((double) (x / y))))))))))));
} else {
VAR = ((double) (x + ((double) (((double) (y * 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.6 |
|---|---|
| Target | 2.1 |
| Herbie | 1.6 |
if z < -6.5836496593785987e35 or 2983.93446503404675 < z Initial program 10.1
rmApplied associate-*l*3.0
if -6.5836496593785987e35 < z < 2983.93446503404675Initial program 0.5
Final simplification1.6
herbie shell --seed 2020173
(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))))))