Average Error: 4.5 → 1.8
Time: 6.4s
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 r298203 = x;
        double r298204 = y;
        double r298205 = z;
        double r298206 = r298204 * r298205;
        double r298207 = t;
        double r298208 = r298207 / r298204;
        double r298209 = tanh(r298208);
        double r298210 = r298203 / r298204;
        double r298211 = tanh(r298210);
        double r298212 = r298209 - r298211;
        double r298213 = r298206 * r298212;
        double r298214 = r298203 + r298213;
        return r298214;
}

double f(double x, double y, double z, double t) {
        double r298215 = x;
        double r298216 = y;
        double r298217 = z;
        double r298218 = t;
        double r298219 = r298218 / r298216;
        double r298220 = tanh(r298219);
        double r298221 = r298215 / r298216;
        double r298222 = tanh(r298221);
        double r298223 = r298220 - r298222;
        double r298224 = r298217 * r298223;
        double r298225 = r298216 * r298224;
        double r298226 = r298215 + r298225;
        return r298226;
}

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.5
Target1.8
Herbie1.8
\[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.5

    \[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.8

    \[\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.8

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