Average Error: 4.4 → 1.9
Time: 12.8s
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 r349002 = x;
        double r349003 = y;
        double r349004 = z;
        double r349005 = r349003 * r349004;
        double r349006 = t;
        double r349007 = r349006 / r349003;
        double r349008 = tanh(r349007);
        double r349009 = r349002 / r349003;
        double r349010 = tanh(r349009);
        double r349011 = r349008 - r349010;
        double r349012 = r349005 * r349011;
        double r349013 = r349002 + r349012;
        return r349013;
}

double f(double x, double y, double z, double t) {
        double r349014 = x;
        double r349015 = y;
        double r349016 = z;
        double r349017 = t;
        double r349018 = r349017 / r349015;
        double r349019 = tanh(r349018);
        double r349020 = r349014 / r349015;
        double r349021 = tanh(r349020);
        double r349022 = r349019 - r349021;
        double r349023 = r349016 * r349022;
        double r349024 = r349015 * r349023;
        double r349025 = r349014 + r349024;
        return r349025;
}

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

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