Average Error: 5.0 → 2.0
Time: 10.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 r326804 = x;
        double r326805 = y;
        double r326806 = z;
        double r326807 = r326805 * r326806;
        double r326808 = t;
        double r326809 = r326808 / r326805;
        double r326810 = tanh(r326809);
        double r326811 = r326804 / r326805;
        double r326812 = tanh(r326811);
        double r326813 = r326810 - r326812;
        double r326814 = r326807 * r326813;
        double r326815 = r326804 + r326814;
        return r326815;
}

double f(double x, double y, double z, double t) {
        double r326816 = x;
        double r326817 = y;
        double r326818 = z;
        double r326819 = t;
        double r326820 = r326819 / r326817;
        double r326821 = tanh(r326820);
        double r326822 = r326816 / r326817;
        double r326823 = tanh(r326822);
        double r326824 = r326821 - r326823;
        double r326825 = r326818 * r326824;
        double r326826 = r326817 * r326825;
        double r326827 = r326816 + r326826;
        return r326827;
}

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