Average Error: 4.9 → 2.0
Time: 7.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 r319391 = x;
        double r319392 = y;
        double r319393 = z;
        double r319394 = r319392 * r319393;
        double r319395 = t;
        double r319396 = r319395 / r319392;
        double r319397 = tanh(r319396);
        double r319398 = r319391 / r319392;
        double r319399 = tanh(r319398);
        double r319400 = r319397 - r319399;
        double r319401 = r319394 * r319400;
        double r319402 = r319391 + r319401;
        return r319402;
}

double f(double x, double y, double z, double t) {
        double r319403 = x;
        double r319404 = y;
        double r319405 = z;
        double r319406 = t;
        double r319407 = r319406 / r319404;
        double r319408 = tanh(r319407);
        double r319409 = r319403 / r319404;
        double r319410 = tanh(r319409);
        double r319411 = r319408 - r319410;
        double r319412 = r319405 * r319411;
        double r319413 = r319404 * r319412;
        double r319414 = r319403 + r319413;
        return r319414;
}

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