Average Error: 4.8 → 2.0
Time: 6.2s
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 r342963 = x;
        double r342964 = y;
        double r342965 = z;
        double r342966 = r342964 * r342965;
        double r342967 = t;
        double r342968 = r342967 / r342964;
        double r342969 = tanh(r342968);
        double r342970 = r342963 / r342964;
        double r342971 = tanh(r342970);
        double r342972 = r342969 - r342971;
        double r342973 = r342966 * r342972;
        double r342974 = r342963 + r342973;
        return r342974;
}

double f(double x, double y, double z, double t) {
        double r342975 = x;
        double r342976 = y;
        double r342977 = z;
        double r342978 = t;
        double r342979 = r342978 / r342976;
        double r342980 = tanh(r342979);
        double r342981 = r342975 / r342976;
        double r342982 = tanh(r342981);
        double r342983 = r342980 - r342982;
        double r342984 = r342977 * r342983;
        double r342985 = r342976 * r342984;
        double r342986 = r342975 + r342985;
        return r342986;
}

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