Average Error: 5.0 → 5.0
Time: 6.7s
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x
double f(double x, double y, double z, double t) {
        double r251575 = x;
        double r251576 = y;
        double r251577 = z;
        double r251578 = r251576 * r251577;
        double r251579 = t;
        double r251580 = r251579 / r251576;
        double r251581 = tanh(r251580);
        double r251582 = r251575 / r251576;
        double r251583 = tanh(r251582);
        double r251584 = r251581 - r251583;
        double r251585 = r251578 * r251584;
        double r251586 = r251575 + r251585;
        return r251586;
}

double f(double x, double y, double z, double t) {
        double r251587 = y;
        double r251588 = z;
        double r251589 = r251587 * r251588;
        double r251590 = t;
        double r251591 = r251590 / r251587;
        double r251592 = tanh(r251591);
        double r251593 = x;
        double r251594 = r251593 / r251587;
        double r251595 = tanh(r251594);
        double r251596 = r251592 - r251595;
        double r251597 = r251589 * r251596;
        double r251598 = r251597 + r251593;
        return r251598;
}

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
Herbie5.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 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 +-commutative5.0

    \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x}\]
  4. Final simplification5.0

    \[\leadsto \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x\]

Reproduce

herbie shell --seed 2020024 
(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))))))