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 -1.3707252738241185 \cdot 10^{46} \lor \neg \left(z \le 1.24701807694061 \cdot 10^{-80}\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) - \left(\sqrt[3]{\tanh \left(\frac{x}{y}\right)} \cdot \sqrt[3]{\tanh \left(\frac{x}{y}\right)}\right) \cdot \sqrt[3]{\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 <= -1.3707252738241185e+46) || !(z <= 1.2470180769406097e-80))) {
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) (((double) (((double) cbrt(((double) tanh(((double) (x / y)))))) * ((double) cbrt(((double) tanh(((double) (x / y)))))))) * ((double) cbrt(((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.4 |
|---|---|
| Target | 2.1 |
| Herbie | 1.6 |
if z < -1.3707252738241185e+46 or 1.2470180769406097e-80 < z Initial program 8.4
rmApplied associate-*l*2.7
if -1.3707252738241185e+46 < z < 1.2470180769406097e-80Initial program 0.5
rmApplied add-cube-cbrt0.6
Final simplification1.6
herbie shell --seed 2020140
(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))))))