Average Error: 4.9 → 2.1
Time: 16.0s
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 r440778 = x;
        double r440779 = y;
        double r440780 = z;
        double r440781 = r440779 * r440780;
        double r440782 = t;
        double r440783 = r440782 / r440779;
        double r440784 = tanh(r440783);
        double r440785 = r440778 / r440779;
        double r440786 = tanh(r440785);
        double r440787 = r440784 - r440786;
        double r440788 = r440781 * r440787;
        double r440789 = r440778 + r440788;
        return r440789;
}

double f(double x, double y, double z, double t) {
        double r440790 = x;
        double r440791 = y;
        double r440792 = z;
        double r440793 = t;
        double r440794 = r440793 / r440791;
        double r440795 = tanh(r440794);
        double r440796 = r440790 / r440791;
        double r440797 = tanh(r440796);
        double r440798 = r440795 - r440797;
        double r440799 = r440792 * r440798;
        double r440800 = r440791 * r440799;
        double r440801 = r440790 + r440800;
        return r440801;
}

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

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