Average Error: 4.5 → 1.9
Time: 24.5s
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)
double f(double x, double y, double z, double t) {
        double r467863 = x;
        double r467864 = y;
        double r467865 = z;
        double r467866 = r467864 * r467865;
        double r467867 = t;
        double r467868 = r467867 / r467864;
        double r467869 = tanh(r467868);
        double r467870 = r467863 / r467864;
        double r467871 = tanh(r467870);
        double r467872 = r467869 - r467871;
        double r467873 = r467866 * r467872;
        double r467874 = r467863 + r467873;
        return r467874;
}

double f(double x, double y, double z, double t) {
        double r467875 = x;
        double r467876 = y;
        double r467877 = z;
        double r467878 = t;
        double r467879 = r467878 / r467876;
        double r467880 = tanh(r467879);
        double r467881 = r467875 / r467876;
        double r467882 = tanh(r467881);
        double r467883 = r467880 - r467882;
        double r467884 = r467877 * r467883;
        double r467885 = r467876 * r467884;
        double r467886 = r467875 + r467885;
        return r467886;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original4.5
Target1.9
Herbie1.9
\[x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\]

Derivation

  1. Initial program 4.5

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
  2. Using strategy rm
  3. Applied associate-*l*1.9

    \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)}\]
  4. Final simplification1.9

    \[\leadsto x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\]

Reproduce

herbie shell --seed 2019209 
(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))))))