Average Error: 4.5 → 2.1
Time: 16.7s
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 r287463 = x;
        double r287464 = y;
        double r287465 = z;
        double r287466 = r287464 * r287465;
        double r287467 = t;
        double r287468 = r287467 / r287464;
        double r287469 = tanh(r287468);
        double r287470 = r287463 / r287464;
        double r287471 = tanh(r287470);
        double r287472 = r287469 - r287471;
        double r287473 = r287466 * r287472;
        double r287474 = r287463 + r287473;
        return r287474;
}

double f(double x, double y, double z, double t) {
        double r287475 = x;
        double r287476 = y;
        double r287477 = z;
        double r287478 = t;
        double r287479 = r287478 / r287476;
        double r287480 = tanh(r287479);
        double r287481 = r287475 / r287476;
        double r287482 = tanh(r287481);
        double r287483 = r287480 - r287482;
        double r287484 = r287477 * r287483;
        double r287485 = r287476 * r287484;
        double r287486 = r287475 + r287485;
        return r287486;
}

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