Average Error: 4.8 → 2.0
Time: 6.5s
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 r360133 = x;
        double r360134 = y;
        double r360135 = z;
        double r360136 = r360134 * r360135;
        double r360137 = t;
        double r360138 = r360137 / r360134;
        double r360139 = tanh(r360138);
        double r360140 = r360133 / r360134;
        double r360141 = tanh(r360140);
        double r360142 = r360139 - r360141;
        double r360143 = r360136 * r360142;
        double r360144 = r360133 + r360143;
        return r360144;
}

double f(double x, double y, double z, double t) {
        double r360145 = x;
        double r360146 = y;
        double r360147 = z;
        double r360148 = t;
        double r360149 = r360148 / r360146;
        double r360150 = tanh(r360149);
        double r360151 = r360145 / r360146;
        double r360152 = tanh(r360151);
        double r360153 = r360150 - r360152;
        double r360154 = r360147 * r360153;
        double r360155 = r360146 * r360154;
        double r360156 = r360145 + r360155;
        return r360156;
}

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