Average Error: 4.7 → 1.9
Time: 28.5s
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 r269676 = x;
        double r269677 = y;
        double r269678 = z;
        double r269679 = r269677 * r269678;
        double r269680 = t;
        double r269681 = r269680 / r269677;
        double r269682 = tanh(r269681);
        double r269683 = r269676 / r269677;
        double r269684 = tanh(r269683);
        double r269685 = r269682 - r269684;
        double r269686 = r269679 * r269685;
        double r269687 = r269676 + r269686;
        return r269687;
}

double f(double x, double y, double z, double t) {
        double r269688 = x;
        double r269689 = y;
        double r269690 = z;
        double r269691 = t;
        double r269692 = r269691 / r269689;
        double r269693 = tanh(r269692);
        double r269694 = r269688 / r269689;
        double r269695 = tanh(r269694);
        double r269696 = r269693 - r269695;
        double r269697 = r269690 * r269696;
        double r269698 = r269689 * r269697;
        double r269699 = r269688 + r269698;
        return r269699;
}

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

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