Average Error: 4.6 → 2.1
Time: 30.2s
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 r21419378 = x;
        double r21419379 = y;
        double r21419380 = z;
        double r21419381 = r21419379 * r21419380;
        double r21419382 = t;
        double r21419383 = r21419382 / r21419379;
        double r21419384 = tanh(r21419383);
        double r21419385 = r21419378 / r21419379;
        double r21419386 = tanh(r21419385);
        double r21419387 = r21419384 - r21419386;
        double r21419388 = r21419381 * r21419387;
        double r21419389 = r21419378 + r21419388;
        return r21419389;
}

double f(double x, double y, double z, double t) {
        double r21419390 = x;
        double r21419391 = y;
        double r21419392 = z;
        double r21419393 = t;
        double r21419394 = r21419393 / r21419391;
        double r21419395 = tanh(r21419394);
        double r21419396 = r21419390 / r21419391;
        double r21419397 = tanh(r21419396);
        double r21419398 = r21419395 - r21419397;
        double r21419399 = r21419392 * r21419398;
        double r21419400 = r21419391 * r21419399;
        double r21419401 = r21419390 + r21419400;
        return r21419401;
}

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
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.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*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 2019171 
(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))))))