Average Error: 4.8 → 2.1
Time: 9.0s
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 r276934 = x;
        double r276935 = y;
        double r276936 = z;
        double r276937 = r276935 * r276936;
        double r276938 = t;
        double r276939 = r276938 / r276935;
        double r276940 = tanh(r276939);
        double r276941 = r276934 / r276935;
        double r276942 = tanh(r276941);
        double r276943 = r276940 - r276942;
        double r276944 = r276937 * r276943;
        double r276945 = r276934 + r276944;
        return r276945;
}

double f(double x, double y, double z, double t) {
        double r276946 = x;
        double r276947 = y;
        double r276948 = z;
        double r276949 = t;
        double r276950 = r276949 / r276947;
        double r276951 = tanh(r276950);
        double r276952 = r276946 / r276947;
        double r276953 = tanh(r276952);
        double r276954 = r276951 - r276953;
        double r276955 = r276948 * r276954;
        double r276956 = r276947 * r276955;
        double r276957 = r276946 + r276956;
        return r276957;
}

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.1
Herbie2.1
\[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.1

    \[\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.1

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