Average Error: 4.7 → 1.9
Time: 21.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 r314325 = x;
        double r314326 = y;
        double r314327 = z;
        double r314328 = r314326 * r314327;
        double r314329 = t;
        double r314330 = r314329 / r314326;
        double r314331 = tanh(r314330);
        double r314332 = r314325 / r314326;
        double r314333 = tanh(r314332);
        double r314334 = r314331 - r314333;
        double r314335 = r314328 * r314334;
        double r314336 = r314325 + r314335;
        return r314336;
}

double f(double x, double y, double z, double t) {
        double r314337 = x;
        double r314338 = y;
        double r314339 = z;
        double r314340 = t;
        double r314341 = r314340 / r314338;
        double r314342 = tanh(r314341);
        double r314343 = r314337 / r314338;
        double r314344 = tanh(r314343);
        double r314345 = r314342 - r314344;
        double r314346 = r314339 * r314345;
        double r314347 = r314338 * r314346;
        double r314348 = r314337 + r314347;
        return r314348;
}

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

    \[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.9

    \[\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.9

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