Average Error: 4.7 → 2.1
Time: 1.4m
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 r20261906 = x;
        double r20261907 = y;
        double r20261908 = z;
        double r20261909 = r20261907 * r20261908;
        double r20261910 = t;
        double r20261911 = r20261910 / r20261907;
        double r20261912 = tanh(r20261911);
        double r20261913 = r20261906 / r20261907;
        double r20261914 = tanh(r20261913);
        double r20261915 = r20261912 - r20261914;
        double r20261916 = r20261909 * r20261915;
        double r20261917 = r20261906 + r20261916;
        return r20261917;
}

double f(double x, double y, double z, double t) {
        double r20261918 = x;
        double r20261919 = y;
        double r20261920 = z;
        double r20261921 = t;
        double r20261922 = r20261921 / r20261919;
        double r20261923 = tanh(r20261922);
        double r20261924 = r20261918 / r20261919;
        double r20261925 = tanh(r20261924);
        double r20261926 = r20261923 - r20261925;
        double r20261927 = r20261920 * r20261926;
        double r20261928 = r20261919 * r20261927;
        double r20261929 = r20261918 + r20261928;
        return r20261929;
}

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.7
Target2.1
Herbie2.1
\[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.7

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

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

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