Average Error: 4.6 → 4.6
Time: 14.9s
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[\left(\left(\left(-y\right) \cdot z\right) \cdot \tanh \left(\frac{x}{y}\right) + \left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right)\right) + x\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\left(\left(\left(-y\right) \cdot z\right) \cdot \tanh \left(\frac{x}{y}\right) + \left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right)\right) + x
double f(double x, double y, double z, double t) {
        double r6810735 = x;
        double r6810736 = y;
        double r6810737 = z;
        double r6810738 = r6810736 * r6810737;
        double r6810739 = t;
        double r6810740 = r6810739 / r6810736;
        double r6810741 = tanh(r6810740);
        double r6810742 = r6810735 / r6810736;
        double r6810743 = tanh(r6810742);
        double r6810744 = r6810741 - r6810743;
        double r6810745 = r6810738 * r6810744;
        double r6810746 = r6810735 + r6810745;
        return r6810746;
}

double f(double x, double y, double z, double t) {
        double r6810747 = y;
        double r6810748 = -r6810747;
        double r6810749 = z;
        double r6810750 = r6810748 * r6810749;
        double r6810751 = x;
        double r6810752 = r6810751 / r6810747;
        double r6810753 = tanh(r6810752);
        double r6810754 = r6810750 * r6810753;
        double r6810755 = r6810747 * r6810749;
        double r6810756 = t;
        double r6810757 = r6810756 / r6810747;
        double r6810758 = tanh(r6810757);
        double r6810759 = r6810755 * r6810758;
        double r6810760 = r6810754 + r6810759;
        double r6810761 = r6810760 + r6810751;
        return r6810761;
}

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

    \[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 sub-neg4.6

    \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(-\tanh \left(\frac{x}{y}\right)\right)\right)}\]
  4. Applied distribute-rgt-in4.6

    \[\leadsto x + \color{blue}{\left(\tanh \left(\frac{t}{y}\right) \cdot \left(y \cdot z\right) + \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot \left(y \cdot z\right)\right)}\]
  5. Final simplification4.6

    \[\leadsto \left(\left(\left(-y\right) \cdot z\right) \cdot \tanh \left(\frac{x}{y}\right) + \left(y \cdot z\right) \cdot \tanh \left(\frac{t}{y}\right)\right) + x\]

Reproduce

herbie shell --seed 2019156 
(FPCore (x y z t)
  :name "SynthBasics:moogVCF from YampaSynth-0.2"

  :herbie-target
  (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))

  (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))