Average Error: 4.5 → 2.0
Time: 6.1s
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 r372890 = x;
        double r372891 = y;
        double r372892 = z;
        double r372893 = r372891 * r372892;
        double r372894 = t;
        double r372895 = r372894 / r372891;
        double r372896 = tanh(r372895);
        double r372897 = r372890 / r372891;
        double r372898 = tanh(r372897);
        double r372899 = r372896 - r372898;
        double r372900 = r372893 * r372899;
        double r372901 = r372890 + r372900;
        return r372901;
}

double f(double x, double y, double z, double t) {
        double r372902 = x;
        double r372903 = y;
        double r372904 = z;
        double r372905 = t;
        double r372906 = r372905 / r372903;
        double r372907 = tanh(r372906);
        double r372908 = r372902 / r372903;
        double r372909 = tanh(r372908);
        double r372910 = r372907 - r372909;
        double r372911 = r372904 * r372910;
        double r372912 = r372903 * r372911;
        double r372913 = r372902 + r372912;
        return r372913;
}

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
Target2.0
Herbie2.0
\[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*2.0

    \[\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 simplification2.0

    \[\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 2020065 
(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))))))