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 -2.0912622621729367 \cdot 10^{206}:\\
\;\;\;\;x + y \cdot \left(z \cdot \tanh \left(\frac{t}{y}\right) + -1 \cdot \frac{x \cdot z}{y}\right)\\
\mathbf{elif}\;y \le 6.07031039754652855 \cdot 10^{71}:\\
\;\;\;\;x + \left(\left(y \cdot z\right) \cdot \left(\sqrt[3]{\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)} \cdot \sqrt[3]{\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)}\right)\right) \cdot \sqrt[3]{\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \sqrt{y} \cdot \left(\sqrt{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\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 ((y <= -2.0912622621729367e+206)) {
VAR = (x + (y * ((z * tanh((t / y))) + (-1.0 * ((x * z) / y)))));
} else {
double VAR_1;
if ((y <= 6.070310397546529e+71)) {
VAR_1 = (x + (((y * z) * (cbrt((tanh((t / y)) - tanh((x / y)))) * cbrt((tanh((t / y)) - tanh((x / y)))))) * cbrt((tanh((t / y)) - tanh((x / y))))));
} else {
VAR_1 = (x + (sqrt(y) * (sqrt(y) * (z * (tanh((t / y)) - tanh((x / y)))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.7 |
|---|---|
| Target | 2.1 |
| Herbie | 2.7 |
if y < -2.0912622621729367e+206Initial program 19.1
rmApplied associate-*l*10.0
rmApplied sub-neg10.0
Applied distribute-lft-in10.0
Taylor expanded around inf 8.3
if -2.0912622621729367e+206 < y < 6.070310397546529e+71Initial program 1.4
rmApplied add-cube-cbrt1.6
Applied associate-*r*1.6
if 6.070310397546529e+71 < y Initial program 13.0
rmApplied associate-*l*5.4
rmApplied add-sqr-sqrt5.5
Applied associate-*l*5.5
Final simplification2.7
herbie shell --seed 2020103
(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))))))