Average Error: 5.0 → 2.0
Time: 17.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 r192736 = x;
        double r192737 = y;
        double r192738 = z;
        double r192739 = r192737 * r192738;
        double r192740 = t;
        double r192741 = r192740 / r192737;
        double r192742 = tanh(r192741);
        double r192743 = r192736 / r192737;
        double r192744 = tanh(r192743);
        double r192745 = r192742 - r192744;
        double r192746 = r192739 * r192745;
        double r192747 = r192736 + r192746;
        return r192747;
}

double f(double x, double y, double z, double t) {
        double r192748 = x;
        double r192749 = y;
        double r192750 = z;
        double r192751 = t;
        double r192752 = r192751 / r192749;
        double r192753 = tanh(r192752);
        double r192754 = r192748 / r192749;
        double r192755 = tanh(r192754);
        double r192756 = r192753 - r192755;
        double r192757 = r192750 * r192756;
        double r192758 = r192749 * r192757;
        double r192759 = r192748 + r192758;
        return r192759;
}

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

Original5.0
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 5.0

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