Average Error: 4.7 → 2.0
Time: 3.7s
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 r160103 = x;
        double r160104 = y;
        double r160105 = z;
        double r160106 = r160104 * r160105;
        double r160107 = t;
        double r160108 = r160107 / r160104;
        double r160109 = tanh(r160108);
        double r160110 = r160103 / r160104;
        double r160111 = tanh(r160110);
        double r160112 = r160109 - r160111;
        double r160113 = r160106 * r160112;
        double r160114 = r160103 + r160113;
        return r160114;
}

double f(double x, double y, double z, double t) {
        double r160115 = x;
        double r160116 = y;
        double r160117 = z;
        double r160118 = t;
        double r160119 = r160118 / r160116;
        double r160120 = tanh(r160119);
        double r160121 = r160115 / r160116;
        double r160122 = tanh(r160121);
        double r160123 = r160120 - r160122;
        double r160124 = r160117 * r160123;
        double r160125 = r160116 * r160124;
        double r160126 = r160115 + r160125;
        return r160126;
}

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
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.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*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 2020003 
(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))))))