Average Error: 4.2 → 2.0
Time: 18.1s
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 r209842 = x;
        double r209843 = y;
        double r209844 = z;
        double r209845 = r209843 * r209844;
        double r209846 = t;
        double r209847 = r209846 / r209843;
        double r209848 = tanh(r209847);
        double r209849 = r209842 / r209843;
        double r209850 = tanh(r209849);
        double r209851 = r209848 - r209850;
        double r209852 = r209845 * r209851;
        double r209853 = r209842 + r209852;
        return r209853;
}

double f(double x, double y, double z, double t) {
        double r209854 = x;
        double r209855 = y;
        double r209856 = z;
        double r209857 = t;
        double r209858 = r209857 / r209855;
        double r209859 = tanh(r209858);
        double r209860 = r209854 / r209855;
        double r209861 = tanh(r209860);
        double r209862 = r209859 - r209861;
        double r209863 = r209856 * r209862;
        double r209864 = r209855 * r209863;
        double r209865 = r209854 + r209864;
        return r209865;
}

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