Average Error: 4.8 → 2.0
Time: 32.3s
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 r405339 = x;
        double r405340 = y;
        double r405341 = z;
        double r405342 = r405340 * r405341;
        double r405343 = t;
        double r405344 = r405343 / r405340;
        double r405345 = tanh(r405344);
        double r405346 = r405339 / r405340;
        double r405347 = tanh(r405346);
        double r405348 = r405345 - r405347;
        double r405349 = r405342 * r405348;
        double r405350 = r405339 + r405349;
        return r405350;
}

double f(double x, double y, double z, double t) {
        double r405351 = x;
        double r405352 = y;
        double r405353 = z;
        double r405354 = t;
        double r405355 = r405354 / r405352;
        double r405356 = tanh(r405355);
        double r405357 = r405351 / r405352;
        double r405358 = tanh(r405357);
        double r405359 = r405356 - r405358;
        double r405360 = r405353 * r405359;
        double r405361 = r405352 * r405360;
        double r405362 = r405351 + r405361;
        return r405362;
}

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