Average Error: 4.4 → 1.9
Time: 24.2s
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[\left(\left(-z\right) \cdot \tanh \left(\frac{x}{y}\right) + \tanh \left(\frac{t}{y}\right) \cdot z\right) \cdot y + x\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\left(\left(-z\right) \cdot \tanh \left(\frac{x}{y}\right) + \tanh \left(\frac{t}{y}\right) \cdot z\right) \cdot y + x
double f(double x, double y, double z, double t) {
        double r16215253 = x;
        double r16215254 = y;
        double r16215255 = z;
        double r16215256 = r16215254 * r16215255;
        double r16215257 = t;
        double r16215258 = r16215257 / r16215254;
        double r16215259 = tanh(r16215258);
        double r16215260 = r16215253 / r16215254;
        double r16215261 = tanh(r16215260);
        double r16215262 = r16215259 - r16215261;
        double r16215263 = r16215256 * r16215262;
        double r16215264 = r16215253 + r16215263;
        return r16215264;
}

double f(double x, double y, double z, double t) {
        double r16215265 = z;
        double r16215266 = -r16215265;
        double r16215267 = x;
        double r16215268 = y;
        double r16215269 = r16215267 / r16215268;
        double r16215270 = tanh(r16215269);
        double r16215271 = r16215266 * r16215270;
        double r16215272 = t;
        double r16215273 = r16215272 / r16215268;
        double r16215274 = tanh(r16215273);
        double r16215275 = r16215274 * r16215265;
        double r16215276 = r16215271 + r16215275;
        double r16215277 = r16215276 * r16215268;
        double r16215278 = r16215277 + r16215267;
        return r16215278;
}

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.4
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.4

    \[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. Using strategy rm
  5. Applied sub-neg1.9

    \[\leadsto x + y \cdot \left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(-\tanh \left(\frac{x}{y}\right)\right)\right)}\right)\]
  6. Applied distribute-rgt-in1.9

    \[\leadsto x + y \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) \cdot z + \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}\]
  7. Final simplification1.9

    \[\leadsto \left(\left(-z\right) \cdot \tanh \left(\frac{x}{y}\right) + \tanh \left(\frac{t}{y}\right) \cdot z\right) \cdot y + x\]

Reproduce

herbie shell --seed 2019158 
(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))))))