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.14779953698363994 \cdot 10^{156} \lor \neg \left(y \le 1.60579202525289377 \cdot 10^{127}\right):\\
\;\;\;\;x + z \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(y \cdot \left({\left(\tanh \left(\frac{t}{y}\right)\right)}^{3} - {\left(\tanh \left(\frac{x}{y}\right)\right)}^{3}\right)\right)}{\tanh \left(\frac{t}{y}\right) \cdot \tanh \left(\frac{t}{y}\right) + \left(\tanh \left(\frac{x}{y}\right) \cdot \tanh \left(\frac{x}{y}\right) + \tanh \left(\frac{t}{y}\right) \cdot \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 (((y <= -2.14779953698364e+156) || !(y <= 1.6057920252528938e+127))) {
VAR = (x + (z * (t - x)));
} else {
VAR = (x + ((z * (y * (pow(tanh((t / y)), 3.0) - pow(tanh((x / y)), 3.0)))) / ((tanh((t / y)) * tanh((t / y))) + ((tanh((x / y)) * tanh((x / y))) + (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.5 |
|---|---|
| Target | 2.1 |
| Herbie | 5.4 |
if y < -2.14779953698364e+156 or 1.6057920252528938e+127 < y Initial program 15.7
rmApplied *-commutative15.7
Applied associate-*l*5.7
Taylor expanded around 0 6.9
if -2.14779953698364e+156 < y < 1.6057920252528938e+127Initial program 1.0
rmApplied *-commutative1.0
Applied associate-*l*0.3
rmApplied flip3--4.4
Applied associate-*r/4.7
Applied associate-*r/4.9
Final simplification5.4
herbie shell --seed 2020078
(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))))))