Average Error: 4.8 → 1.9
Time: 13.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 r333227 = x;
        double r333228 = y;
        double r333229 = z;
        double r333230 = r333228 * r333229;
        double r333231 = t;
        double r333232 = r333231 / r333228;
        double r333233 = tanh(r333232);
        double r333234 = r333227 / r333228;
        double r333235 = tanh(r333234);
        double r333236 = r333233 - r333235;
        double r333237 = r333230 * r333236;
        double r333238 = r333227 + r333237;
        return r333238;
}

double f(double x, double y, double z, double t) {
        double r333239 = x;
        double r333240 = y;
        double r333241 = z;
        double r333242 = t;
        double r333243 = r333242 / r333240;
        double r333244 = tanh(r333243);
        double r333245 = r333239 / r333240;
        double r333246 = tanh(r333245);
        double r333247 = r333244 - r333246;
        double r333248 = r333241 * r333247;
        double r333249 = r333240 * r333248;
        double r333250 = r333239 + r333249;
        return r333250;
}

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