Average Error: 4.6 → 1.9
Time: 7.6s
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 r285639 = x;
        double r285640 = y;
        double r285641 = z;
        double r285642 = r285640 * r285641;
        double r285643 = t;
        double r285644 = r285643 / r285640;
        double r285645 = tanh(r285644);
        double r285646 = r285639 / r285640;
        double r285647 = tanh(r285646);
        double r285648 = r285645 - r285647;
        double r285649 = r285642 * r285648;
        double r285650 = r285639 + r285649;
        return r285650;
}

double f(double x, double y, double z, double t) {
        double r285651 = x;
        double r285652 = y;
        double r285653 = z;
        double r285654 = t;
        double r285655 = r285654 / r285652;
        double r285656 = tanh(r285655);
        double r285657 = r285651 / r285652;
        double r285658 = tanh(r285657);
        double r285659 = r285656 - r285658;
        double r285660 = r285653 * r285659;
        double r285661 = r285652 * r285660;
        double r285662 = r285651 + r285661;
        return r285662;
}

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.6
Target1.9
Herbie1.9
\[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.6

    \[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*1.9

    \[\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 simplification1.9

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