Average Error: 4.7 → 2.1
Time: 1.4m
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 r20353720 = x;
        double r20353721 = y;
        double r20353722 = z;
        double r20353723 = r20353721 * r20353722;
        double r20353724 = t;
        double r20353725 = r20353724 / r20353721;
        double r20353726 = tanh(r20353725);
        double r20353727 = r20353720 / r20353721;
        double r20353728 = tanh(r20353727);
        double r20353729 = r20353726 - r20353728;
        double r20353730 = r20353723 * r20353729;
        double r20353731 = r20353720 + r20353730;
        return r20353731;
}

double f(double x, double y, double z, double t) {
        double r20353732 = x;
        double r20353733 = y;
        double r20353734 = z;
        double r20353735 = t;
        double r20353736 = r20353735 / r20353733;
        double r20353737 = tanh(r20353736);
        double r20353738 = r20353732 / r20353733;
        double r20353739 = tanh(r20353738);
        double r20353740 = r20353737 - r20353739;
        double r20353741 = r20353734 * r20353740;
        double r20353742 = r20353733 * r20353741;
        double r20353743 = r20353732 + r20353742;
        return r20353743;
}

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

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