Average Error: 4.6 → 1.9
Time: 17.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 r206986 = x;
        double r206987 = y;
        double r206988 = z;
        double r206989 = r206987 * r206988;
        double r206990 = t;
        double r206991 = r206990 / r206987;
        double r206992 = tanh(r206991);
        double r206993 = r206986 / r206987;
        double r206994 = tanh(r206993);
        double r206995 = r206992 - r206994;
        double r206996 = r206989 * r206995;
        double r206997 = r206986 + r206996;
        return r206997;
}

double f(double x, double y, double z, double t) {
        double r206998 = x;
        double r206999 = y;
        double r207000 = z;
        double r207001 = t;
        double r207002 = r207001 / r206999;
        double r207003 = tanh(r207002);
        double r207004 = r206998 / r206999;
        double r207005 = tanh(r207004);
        double r207006 = r207003 - r207005;
        double r207007 = r207000 * r207006;
        double r207008 = r206999 * r207007;
        double r207009 = r206998 + r207008;
        return r207009;
}

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.6
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.6

    \[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 2019323 +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))))))