Average Error: 4.2 → 1.9
Time: 4.7m
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(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z\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(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z\right)
double f(double x, double y, double z, double t) {
        double r26375864 = x;
        double r26375865 = y;
        double r26375866 = z;
        double r26375867 = r26375865 * r26375866;
        double r26375868 = t;
        double r26375869 = r26375868 / r26375865;
        double r26375870 = tanh(r26375869);
        double r26375871 = r26375864 / r26375865;
        double r26375872 = tanh(r26375871);
        double r26375873 = r26375870 - r26375872;
        double r26375874 = r26375867 * r26375873;
        double r26375875 = r26375864 + r26375874;
        return r26375875;
}

double f(double x, double y, double z, double t) {
        double r26375876 = x;
        double r26375877 = y;
        double r26375878 = t;
        double r26375879 = r26375878 / r26375877;
        double r26375880 = tanh(r26375879);
        double r26375881 = r26375876 / r26375877;
        double r26375882 = tanh(r26375881);
        double r26375883 = r26375880 - r26375882;
        double r26375884 = z;
        double r26375885 = r26375883 * r26375884;
        double r26375886 = r26375877 * r26375885;
        double r26375887 = r26375876 + r26375886;
        return r26375887;
}

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

    \[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. Using strategy rm
  5. Applied *-commutative1.9

    \[\leadsto x + \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y}\]
  6. Final simplification1.9

    \[\leadsto x + y \cdot \left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot z\right)\]

Reproduce

herbie shell --seed 2019164 
(FPCore (x y z t)
  :name "SynthBasics:moogVCF from YampaSynth-0.2"

  :herbie-target
  (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y))))))

  (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))