Average Error: 4.8 → 2.0
Time: 18.9s
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 r326739 = x;
        double r326740 = y;
        double r326741 = z;
        double r326742 = r326740 * r326741;
        double r326743 = t;
        double r326744 = r326743 / r326740;
        double r326745 = tanh(r326744);
        double r326746 = r326739 / r326740;
        double r326747 = tanh(r326746);
        double r326748 = r326745 - r326747;
        double r326749 = r326742 * r326748;
        double r326750 = r326739 + r326749;
        return r326750;
}

double f(double x, double y, double z, double t) {
        double r326751 = x;
        double r326752 = y;
        double r326753 = z;
        double r326754 = t;
        double r326755 = r326754 / r326752;
        double r326756 = tanh(r326755);
        double r326757 = r326751 / r326752;
        double r326758 = tanh(r326757);
        double r326759 = r326756 - r326758;
        double r326760 = r326753 * r326759;
        double r326761 = r326752 * r326760;
        double r326762 = r326751 + r326761;
        return r326762;
}

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))))))