Average Error: 4.5 → 2.1
Time: 7.1m
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 r61456594 = x;
        double r61456595 = y;
        double r61456596 = z;
        double r61456597 = r61456595 * r61456596;
        double r61456598 = t;
        double r61456599 = r61456598 / r61456595;
        double r61456600 = tanh(r61456599);
        double r61456601 = r61456594 / r61456595;
        double r61456602 = tanh(r61456601);
        double r61456603 = r61456600 - r61456602;
        double r61456604 = r61456597 * r61456603;
        double r61456605 = r61456594 + r61456604;
        return r61456605;
}

double f(double x, double y, double z, double t) {
        double r61456606 = x;
        double r61456607 = y;
        double r61456608 = z;
        double r61456609 = t;
        double r61456610 = r61456609 / r61456607;
        double r61456611 = tanh(r61456610);
        double r61456612 = r61456606 / r61456607;
        double r61456613 = tanh(r61456612);
        double r61456614 = r61456611 - r61456613;
        double r61456615 = r61456608 * r61456614;
        double r61456616 = r61456607 * r61456615;
        double r61456617 = r61456606 + r61456616;
        return r61456617;
}

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

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