Average Error: 4.2 → 2.0
Time: 18.7s
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 r183792 = x;
        double r183793 = y;
        double r183794 = z;
        double r183795 = r183793 * r183794;
        double r183796 = t;
        double r183797 = r183796 / r183793;
        double r183798 = tanh(r183797);
        double r183799 = r183792 / r183793;
        double r183800 = tanh(r183799);
        double r183801 = r183798 - r183800;
        double r183802 = r183795 * r183801;
        double r183803 = r183792 + r183802;
        return r183803;
}

double f(double x, double y, double z, double t) {
        double r183804 = x;
        double r183805 = y;
        double r183806 = z;
        double r183807 = t;
        double r183808 = r183807 / r183805;
        double r183809 = tanh(r183808);
        double r183810 = r183804 / r183805;
        double r183811 = tanh(r183810);
        double r183812 = r183809 - r183811;
        double r183813 = r183806 * r183812;
        double r183814 = r183805 * r183813;
        double r183815 = r183804 + r183814;
        return r183815;
}

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

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