Average Error: 4.6 → 1.9
Time: 19.0s
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 r201622 = x;
        double r201623 = y;
        double r201624 = z;
        double r201625 = r201623 * r201624;
        double r201626 = t;
        double r201627 = r201626 / r201623;
        double r201628 = tanh(r201627);
        double r201629 = r201622 / r201623;
        double r201630 = tanh(r201629);
        double r201631 = r201628 - r201630;
        double r201632 = r201625 * r201631;
        double r201633 = r201622 + r201632;
        return r201633;
}

double f(double x, double y, double z, double t) {
        double r201634 = x;
        double r201635 = y;
        double r201636 = z;
        double r201637 = t;
        double r201638 = r201637 / r201635;
        double r201639 = tanh(r201638);
        double r201640 = r201634 / r201635;
        double r201641 = tanh(r201640);
        double r201642 = r201639 - r201641;
        double r201643 = r201636 * r201642;
        double r201644 = r201635 * r201643;
        double r201645 = r201634 + r201644;
        return r201645;
}

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 2019323 +o rules:numerics
(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))))))