Average Error: 4.8 → 2.0
Time: 6.5s
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 r264292 = x;
        double r264293 = y;
        double r264294 = z;
        double r264295 = r264293 * r264294;
        double r264296 = t;
        double r264297 = r264296 / r264293;
        double r264298 = tanh(r264297);
        double r264299 = r264292 / r264293;
        double r264300 = tanh(r264299);
        double r264301 = r264298 - r264300;
        double r264302 = r264295 * r264301;
        double r264303 = r264292 + r264302;
        return r264303;
}

double f(double x, double y, double z, double t) {
        double r264304 = x;
        double r264305 = y;
        double r264306 = z;
        double r264307 = t;
        double r264308 = r264307 / r264305;
        double r264309 = tanh(r264308);
        double r264310 = r264304 / r264305;
        double r264311 = tanh(r264310);
        double r264312 = r264309 - r264311;
        double r264313 = r264306 * r264312;
        double r264314 = r264305 * r264313;
        double r264315 = r264304 + r264314;
        return r264315;
}

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