Average Error: 5.0 → 2.1
Time: 22.2s
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 r261566 = x;
        double r261567 = y;
        double r261568 = z;
        double r261569 = r261567 * r261568;
        double r261570 = t;
        double r261571 = r261570 / r261567;
        double r261572 = tanh(r261571);
        double r261573 = r261566 / r261567;
        double r261574 = tanh(r261573);
        double r261575 = r261572 - r261574;
        double r261576 = r261569 * r261575;
        double r261577 = r261566 + r261576;
        return r261577;
}

double f(double x, double y, double z, double t) {
        double r261578 = x;
        double r261579 = y;
        double r261580 = z;
        double r261581 = t;
        double r261582 = r261581 / r261579;
        double r261583 = tanh(r261582);
        double r261584 = r261578 / r261579;
        double r261585 = tanh(r261584);
        double r261586 = r261583 - r261585;
        double r261587 = r261580 * r261586;
        double r261588 = r261579 * r261587;
        double r261589 = r261578 + r261588;
        return r261589;
}

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.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 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.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 2019179 
(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))))))