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:\\
\;\;\;\;x + y \cdot \frac{t \cdot z}{y}\\
\mathbf{elif}\;x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \le 9.752063034210752310871810357187000409691 \cdot 10^{287}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\
\end{array}double f(double x, double y, double z, double t) {
double r323825 = x;
double r323826 = y;
double r323827 = z;
double r323828 = r323826 * r323827;
double r323829 = t;
double r323830 = r323829 / r323826;
double r323831 = tanh(r323830);
double r323832 = r323825 / r323826;
double r323833 = tanh(r323832);
double r323834 = r323831 - r323833;
double r323835 = r323828 * r323834;
double r323836 = r323825 + r323835;
return r323836;
}
double f(double x, double y, double z, double t) {
double r323837 = x;
double r323838 = y;
double r323839 = z;
double r323840 = r323838 * r323839;
double r323841 = t;
double r323842 = r323841 / r323838;
double r323843 = tanh(r323842);
double r323844 = r323837 / r323838;
double r323845 = tanh(r323844);
double r323846 = r323843 - r323845;
double r323847 = r323840 * r323846;
double r323848 = r323837 + r323847;
double r323849 = -inf.0;
bool r323850 = r323848 <= r323849;
double r323851 = r323841 * r323839;
double r323852 = r323851 / r323838;
double r323853 = r323838 * r323852;
double r323854 = r323837 + r323853;
double r323855 = 9.752063034210752e+287;
bool r323856 = r323848 <= r323855;
double r323857 = r323837 * r323839;
double r323858 = r323837 - r323857;
double r323859 = r323856 ? r323848 : r323858;
double r323860 = r323850 ? r323854 : r323859;
return r323860;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.6 |
|---|---|
| Target | 2.1 |
| Herbie | 3.5 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -inf.0Initial program 64.0
rmApplied associate-*l*2.5
Taylor expanded around inf 30.6
if -inf.0 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 9.752063034210752e+287Initial program 0.8
rmApplied associate-*l*1.2
rmApplied associate-*r*0.8
if 9.752063034210752e+287 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 42.1
Taylor expanded around 0 35.3
Final simplification3.5
herbie shell --seed 2020002
(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))))))