Average Error: 4.5 → 2.1
Time: 1.6m
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 r1115674 = x;
        double r1115675 = y;
        double r1115676 = z;
        double r1115677 = r1115675 * r1115676;
        double r1115678 = t;
        double r1115679 = r1115678 / r1115675;
        double r1115680 = tanh(r1115679);
        double r1115681 = r1115674 / r1115675;
        double r1115682 = tanh(r1115681);
        double r1115683 = r1115680 - r1115682;
        double r1115684 = r1115677 * r1115683;
        double r1115685 = r1115674 + r1115684;
        return r1115685;
}

double f(double x, double y, double z, double t) {
        double r1115686 = x;
        double r1115687 = y;
        double r1115688 = z;
        double r1115689 = t;
        double r1115690 = r1115689 / r1115687;
        double r1115691 = tanh(r1115690);
        double r1115692 = r1115686 / r1115687;
        double r1115693 = tanh(r1115692);
        double r1115694 = r1115691 - r1115693;
        double r1115695 = r1115688 * r1115694;
        double r1115696 = r1115687 * r1115695;
        double r1115697 = r1115686 + r1115696;
        return r1115697;
}

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 2019198 
(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))))))