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(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) = -\infty:\\
\;\;\;\;y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) + x\\
\mathbf{elif}\;x + \left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \le 8.124775333408145 \cdot 10^{-45}:\\
\;\;\;\;x + \left(z \cdot y\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) + x\\
\end{array}double f(double x, double y, double z, double t) {
double r18089336 = x;
double r18089337 = y;
double r18089338 = z;
double r18089339 = r18089337 * r18089338;
double r18089340 = t;
double r18089341 = r18089340 / r18089337;
double r18089342 = tanh(r18089341);
double r18089343 = r18089336 / r18089337;
double r18089344 = tanh(r18089343);
double r18089345 = r18089342 - r18089344;
double r18089346 = r18089339 * r18089345;
double r18089347 = r18089336 + r18089346;
return r18089347;
}
double f(double x, double y, double z, double t) {
double r18089348 = x;
double r18089349 = z;
double r18089350 = y;
double r18089351 = r18089349 * r18089350;
double r18089352 = t;
double r18089353 = r18089352 / r18089350;
double r18089354 = tanh(r18089353);
double r18089355 = r18089348 / r18089350;
double r18089356 = tanh(r18089355);
double r18089357 = r18089354 - r18089356;
double r18089358 = r18089351 * r18089357;
double r18089359 = r18089348 + r18089358;
double r18089360 = -inf.0;
bool r18089361 = r18089359 <= r18089360;
double r18089362 = r18089349 * r18089357;
double r18089363 = r18089350 * r18089362;
double r18089364 = r18089363 + r18089348;
double r18089365 = 8.124775333408145e-45;
bool r18089366 = r18089359 <= r18089365;
double r18089367 = r18089366 ? r18089359 : r18089364;
double r18089368 = r18089361 ? r18089364 : r18089367;
return r18089368;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.1 |
|---|---|
| Target | 1.9 |
| Herbie | 1.4 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -inf.0 or 8.124775333408145e-45 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 9.4
rmApplied associate-*l*2.3
if -inf.0 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 8.124775333408145e-45Initial program 0.8
Final simplification1.4
herbie shell --seed 2019162
(FPCore (x y z t)
:name "SynthBasics:moogVCF from YampaSynth-0.2"
:herbie-target
(+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))
(+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))