Average Error: 4.6 → 1.9
Time: 7.3s
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 r264175 = x;
        double r264176 = y;
        double r264177 = z;
        double r264178 = r264176 * r264177;
        double r264179 = t;
        double r264180 = r264179 / r264176;
        double r264181 = tanh(r264180);
        double r264182 = r264175 / r264176;
        double r264183 = tanh(r264182);
        double r264184 = r264181 - r264183;
        double r264185 = r264178 * r264184;
        double r264186 = r264175 + r264185;
        return r264186;
}

double f(double x, double y, double z, double t) {
        double r264187 = x;
        double r264188 = y;
        double r264189 = z;
        double r264190 = t;
        double r264191 = r264190 / r264188;
        double r264192 = tanh(r264191);
        double r264193 = r264187 / r264188;
        double r264194 = tanh(r264193);
        double r264195 = r264192 - r264194;
        double r264196 = r264189 * r264195;
        double r264197 = r264188 * r264196;
        double r264198 = r264187 + r264197;
        return r264198;
}

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

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