Average Error: 4.8 → 2.0
Time: 1.0m
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 r312088 = x;
        double r312089 = y;
        double r312090 = z;
        double r312091 = r312089 * r312090;
        double r312092 = t;
        double r312093 = r312092 / r312089;
        double r312094 = tanh(r312093);
        double r312095 = r312088 / r312089;
        double r312096 = tanh(r312095);
        double r312097 = r312094 - r312096;
        double r312098 = r312091 * r312097;
        double r312099 = r312088 + r312098;
        return r312099;
}

double f(double x, double y, double z, double t) {
        double r312100 = x;
        double r312101 = y;
        double r312102 = z;
        double r312103 = t;
        double r312104 = r312103 / r312101;
        double r312105 = tanh(r312104);
        double r312106 = r312100 / r312101;
        double r312107 = tanh(r312106);
        double r312108 = r312105 - r312107;
        double r312109 = r312102 * r312108;
        double r312110 = r312101 * r312109;
        double r312111 = r312100 + r312110;
        return r312111;
}

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