Average Error: 4.5 → 2.1
Time: 3.1m
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 r18825418 = x;
        double r18825419 = y;
        double r18825420 = z;
        double r18825421 = r18825419 * r18825420;
        double r18825422 = t;
        double r18825423 = r18825422 / r18825419;
        double r18825424 = tanh(r18825423);
        double r18825425 = r18825418 / r18825419;
        double r18825426 = tanh(r18825425);
        double r18825427 = r18825424 - r18825426;
        double r18825428 = r18825421 * r18825427;
        double r18825429 = r18825418 + r18825428;
        return r18825429;
}

double f(double x, double y, double z, double t) {
        double r18825430 = x;
        double r18825431 = y;
        double r18825432 = z;
        double r18825433 = t;
        double r18825434 = r18825433 / r18825431;
        double r18825435 = tanh(r18825434);
        double r18825436 = r18825430 / r18825431;
        double r18825437 = tanh(r18825436);
        double r18825438 = r18825435 - r18825437;
        double r18825439 = r18825432 * r18825438;
        double r18825440 = r18825431 * r18825439;
        double r18825441 = r18825430 + r18825440;
        return r18825441;
}

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
Target2.1
Herbie2.1
\[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*2.1

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

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