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 2.405759074108095109916766476323447027402 \cdot 10^{304}:\\
\;\;\;\;x + \left(z \cdot y\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 r15399024 = x;
double r15399025 = y;
double r15399026 = z;
double r15399027 = r15399025 * r15399026;
double r15399028 = t;
double r15399029 = r15399028 / r15399025;
double r15399030 = tanh(r15399029);
double r15399031 = r15399024 / r15399025;
double r15399032 = tanh(r15399031);
double r15399033 = r15399030 - r15399032;
double r15399034 = r15399027 * r15399033;
double r15399035 = r15399024 + r15399034;
return r15399035;
}
double f(double x, double y, double z, double t) {
double r15399036 = x;
double r15399037 = z;
double r15399038 = y;
double r15399039 = r15399037 * r15399038;
double r15399040 = t;
double r15399041 = r15399040 / r15399038;
double r15399042 = tanh(r15399041);
double r15399043 = r15399036 / r15399038;
double r15399044 = tanh(r15399043);
double r15399045 = r15399042 - r15399044;
double r15399046 = r15399039 * r15399045;
double r15399047 = r15399036 + r15399046;
double r15399048 = -inf.0;
bool r15399049 = r15399047 <= r15399048;
double r15399050 = r15399037 * r15399045;
double r15399051 = r15399038 * r15399050;
double r15399052 = r15399051 + r15399036;
double r15399053 = 2.405759074108095e+304;
bool r15399054 = r15399047 <= r15399053;
double r15399055 = r15399036 * r15399037;
double r15399056 = r15399036 - r15399055;
double r15399057 = r15399054 ? r15399047 : r15399056;
double r15399058 = r15399049 ? r15399052 : r15399057;
return r15399058;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 1.9 |
| Herbie | 1.9 |
if (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < -inf.0Initial program 64.0
rmApplied associate-*l*1.1
if -inf.0 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) < 2.405759074108095e+304Initial program 0.6
if 2.405759074108095e+304 < (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))) Initial program 59.0
Taylor expanded around 0 32.3
Final simplification1.9
herbie shell --seed 2019174
(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))))))