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) = -\infty \lor \neg \left(x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \le 9.69418639124574765 \cdot 10^{292}\right):\\
\;\;\;\;x + \left(\left(\sqrt[3]{y \cdot \left(\tanh \left(\frac{t}{y}\right) \cdot z\right)} \cdot \sqrt[3]{y \cdot \left(\tanh \left(\frac{t}{y}\right) \cdot z\right)}\right) \cdot \sqrt[3]{y \cdot \left(\tanh \left(\frac{t}{y}\right) \cdot z\right)} + y \cdot \left(\left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\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 (x + ((y * z) * (tanh((t / y)) - tanh((x / y)))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((x + ((y * z) * (tanh((t / y)) - tanh((x / y))))) <= -inf.0) || !((x + ((y * z) * (tanh((t / y)) - tanh((x / y))))) <= 9.694186391245748e+292))) {
VAR = (x + (((cbrt((y * (tanh((t / y)) * z))) * cbrt((y * (tanh((t / y)) * z)))) * cbrt((y * (tanh((t / y)) * z)))) + (y * (-tanh((x / y)) * z))));
} else {
VAR = (x + ((y * z) * (tanh((t / y)) - tanh((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.0 |
| Herbie | 1.8 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -inf.0 or 9.694186391245748e+292 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 52.7
rmApplied associate-*l*13.1
rmApplied sub-neg13.1
Applied distribute-lft-in13.1
Applied distribute-lft-in15.4
Simplified15.4
Simplified15.4
rmApplied add-cube-cbrt15.7
if -inf.0 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 9.694186391245748e+292Initial program 0.6
Final simplification1.8
herbie shell --seed 2020100
(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))))))