Average Error: 4.5 → 1.8
Time: 6.9s
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 r350233 = x;
        double r350234 = y;
        double r350235 = z;
        double r350236 = r350234 * r350235;
        double r350237 = t;
        double r350238 = r350237 / r350234;
        double r350239 = tanh(r350238);
        double r350240 = r350233 / r350234;
        double r350241 = tanh(r350240);
        double r350242 = r350239 - r350241;
        double r350243 = r350236 * r350242;
        double r350244 = r350233 + r350243;
        return r350244;
}

double f(double x, double y, double z, double t) {
        double r350245 = x;
        double r350246 = y;
        double r350247 = z;
        double r350248 = t;
        double r350249 = r350248 / r350246;
        double r350250 = tanh(r350249);
        double r350251 = r350245 / r350246;
        double r350252 = tanh(r350251);
        double r350253 = r350250 - r350252;
        double r350254 = r350247 * r350253;
        double r350255 = r350246 * r350254;
        double r350256 = r350245 + r350255;
        return r350256;
}

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.5
Target1.8
Herbie1.8
\[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.5

    \[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*1.8

    \[\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 simplification1.8

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