Average Error: 4.9 → 2.0
Time: 1.1m
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 r18035432 = x;
        double r18035433 = y;
        double r18035434 = z;
        double r18035435 = r18035433 * r18035434;
        double r18035436 = t;
        double r18035437 = r18035436 / r18035433;
        double r18035438 = tanh(r18035437);
        double r18035439 = r18035432 / r18035433;
        double r18035440 = tanh(r18035439);
        double r18035441 = r18035438 - r18035440;
        double r18035442 = r18035435 * r18035441;
        double r18035443 = r18035432 + r18035442;
        return r18035443;
}

double f(double x, double y, double z, double t) {
        double r18035444 = x;
        double r18035445 = y;
        double r18035446 = z;
        double r18035447 = t;
        double r18035448 = r18035447 / r18035445;
        double r18035449 = tanh(r18035448);
        double r18035450 = r18035444 / r18035445;
        double r18035451 = tanh(r18035450);
        double r18035452 = r18035449 - r18035451;
        double r18035453 = r18035446 * r18035452;
        double r18035454 = r18035445 * r18035453;
        double r18035455 = r18035444 + r18035454;
        return r18035455;
}

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.9
Target2.0
Herbie2.0
\[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.9

    \[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.0

    \[\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.0

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