Average Error: 4.8 → 2.0
Time: 19.1s
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 r251420 = x;
        double r251421 = y;
        double r251422 = z;
        double r251423 = r251421 * r251422;
        double r251424 = t;
        double r251425 = r251424 / r251421;
        double r251426 = tanh(r251425);
        double r251427 = r251420 / r251421;
        double r251428 = tanh(r251427);
        double r251429 = r251426 - r251428;
        double r251430 = r251423 * r251429;
        double r251431 = r251420 + r251430;
        return r251431;
}

double f(double x, double y, double z, double t) {
        double r251432 = x;
        double r251433 = y;
        double r251434 = z;
        double r251435 = t;
        double r251436 = r251435 / r251433;
        double r251437 = tanh(r251436);
        double r251438 = r251432 / r251433;
        double r251439 = tanh(r251438);
        double r251440 = r251437 - r251439;
        double r251441 = r251434 * r251440;
        double r251442 = r251433 * r251441;
        double r251443 = r251432 + r251442;
        return r251443;
}

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.8
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.8

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