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 -6.2861121408684439 \cdot 10^{178}:\\
\;\;\;\;x + \left(t \cdot z + -1 \cdot \left(x \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\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 ((y <= -6.286112140868444e+178)) {
VAR = ((double) (x + ((double) (((double) (t * z)) + ((double) (-1.0 * ((double) (x * z))))))));
} else {
VAR = ((double) (x + ((double) (y * ((double) (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.7 |
|---|---|
| Target | 2.1 |
| Herbie | 1.7 |
if y < -6.2861121408684439e178Initial program 19.2
rmApplied sub-neg19.2
Applied distribute-lft-in19.2
Taylor expanded around 0 19.1
Taylor expanded around 0 5.7
if -6.2861121408684439e178 < y Initial program 3.3
rmApplied associate-*l*1.4
Final simplification1.7
herbie shell --seed 2020149
(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))))))