Average Error: 4.6 → 1.9
Time: 19.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 r218420 = x;
        double r218421 = y;
        double r218422 = z;
        double r218423 = r218421 * r218422;
        double r218424 = t;
        double r218425 = r218424 / r218421;
        double r218426 = tanh(r218425);
        double r218427 = r218420 / r218421;
        double r218428 = tanh(r218427);
        double r218429 = r218426 - r218428;
        double r218430 = r218423 * r218429;
        double r218431 = r218420 + r218430;
        return r218431;
}

double f(double x, double y, double z, double t) {
        double r218432 = x;
        double r218433 = y;
        double r218434 = z;
        double r218435 = t;
        double r218436 = r218435 / r218433;
        double r218437 = tanh(r218436);
        double r218438 = r218432 / r218433;
        double r218439 = tanh(r218438);
        double r218440 = r218437 - r218439;
        double r218441 = r218434 * r218440;
        double r218442 = r218433 * r218441;
        double r218443 = r218432 + r218442;
        return r218443;
}

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