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 2.04366666294127525 \cdot 10^{303}\right):\\
\;\;\;\;\left(\sqrt[3]{\mathsf{fma}\left(y, z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), x\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), x\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(y, \left(\sqrt[3]{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \cdot \sqrt[3]{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}\right) \cdot \sqrt[3]{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, x\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 f(double x, double y, double z, double t) {
double r304553 = x;
double r304554 = y;
double r304555 = z;
double r304556 = r304554 * r304555;
double r304557 = t;
double r304558 = r304557 / r304554;
double r304559 = tanh(r304558);
double r304560 = r304553 / r304554;
double r304561 = tanh(r304560);
double r304562 = r304559 - r304561;
double r304563 = r304556 * r304562;
double r304564 = r304553 + r304563;
return r304564;
}
double f(double x, double y, double z, double t) {
double r304565 = x;
double r304566 = y;
double r304567 = z;
double r304568 = r304566 * r304567;
double r304569 = t;
double r304570 = r304569 / r304566;
double r304571 = tanh(r304570);
double r304572 = r304565 / r304566;
double r304573 = tanh(r304572);
double r304574 = r304571 - r304573;
double r304575 = r304568 * r304574;
double r304576 = r304565 + r304575;
double r304577 = -inf.0;
bool r304578 = r304576 <= r304577;
double r304579 = 2.0436666629412752e+303;
bool r304580 = r304576 <= r304579;
double r304581 = !r304580;
bool r304582 = r304578 || r304581;
double r304583 = r304567 * r304574;
double r304584 = fma(r304566, r304583, r304565);
double r304585 = cbrt(r304584);
double r304586 = r304585 * r304585;
double r304587 = cbrt(r304583);
double r304588 = r304587 * r304587;
double r304589 = r304588 * r304587;
double r304590 = fma(r304566, r304589, r304565);
double r304591 = cbrt(r304590);
double r304592 = r304586 * r304591;
double r304593 = r304582 ? r304592 : r304576;
return r304593;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 4.7 |
|---|---|
| Target | 2.1 |
| Herbie | 1.6 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -inf.0 or 2.0436666629412752e+303 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 59.9
Simplified15.2
rmApplied add-cube-cbrt15.9
rmApplied add-cube-cbrt15.9
if -inf.0 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 2.0436666629412752e+303Initial program 0.5
Final simplification1.6
herbie shell --seed 2020021 +o rules:numerics
(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))))))