Average Error: 4.8 → 2.0
Time: 19.6s
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 r279985 = x;
        double r279986 = y;
        double r279987 = z;
        double r279988 = r279986 * r279987;
        double r279989 = t;
        double r279990 = r279989 / r279986;
        double r279991 = tanh(r279990);
        double r279992 = r279985 / r279986;
        double r279993 = tanh(r279992);
        double r279994 = r279991 - r279993;
        double r279995 = r279988 * r279994;
        double r279996 = r279985 + r279995;
        return r279996;
}

double f(double x, double y, double z, double t) {
        double r279997 = x;
        double r279998 = y;
        double r279999 = z;
        double r280000 = t;
        double r280001 = r280000 / r279998;
        double r280002 = tanh(r280001);
        double r280003 = r279997 / r279998;
        double r280004 = tanh(r280003);
        double r280005 = r280002 - r280004;
        double r280006 = r279999 * r280005;
        double r280007 = r279998 * r280006;
        double r280008 = r279997 + r280007;
        return r280008;
}

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

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