Average Error: 4.4 → 1.4
Time: 23.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 + z \cdot \left(y \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 + z \cdot \left(y \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 r18212939 = x;
        double r18212940 = y;
        double r18212941 = z;
        double r18212942 = r18212940 * r18212941;
        double r18212943 = t;
        double r18212944 = r18212943 / r18212940;
        double r18212945 = tanh(r18212944);
        double r18212946 = r18212939 / r18212940;
        double r18212947 = tanh(r18212946);
        double r18212948 = r18212945 - r18212947;
        double r18212949 = r18212942 * r18212948;
        double r18212950 = r18212939 + r18212949;
        return r18212950;
}

double f(double x, double y, double z, double t) {
        double r18212951 = x;
        double r18212952 = z;
        double r18212953 = y;
        double r18212954 = t;
        double r18212955 = r18212954 / r18212953;
        double r18212956 = tanh(r18212955);
        double r18212957 = r18212951 / r18212953;
        double r18212958 = tanh(r18212957);
        double r18212959 = r18212956 - r18212958;
        double r18212960 = r18212953 * r18212959;
        double r18212961 = r18212952 * r18212960;
        double r18212962 = r18212951 + r18212961;
        return r18212962;
}

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.4
Target1.9
Herbie1.4
\[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.4

    \[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 *-commutative4.4

    \[\leadsto x + \color{blue}{\left(z \cdot y\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
  4. Applied associate-*l*1.4

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

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

Reproduce

herbie shell --seed 2019158 
(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))))))