Average Error: 4.8 → 2.0
Time: 7.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 r373901 = x;
        double r373902 = y;
        double r373903 = z;
        double r373904 = r373902 * r373903;
        double r373905 = t;
        double r373906 = r373905 / r373902;
        double r373907 = tanh(r373906);
        double r373908 = r373901 / r373902;
        double r373909 = tanh(r373908);
        double r373910 = r373907 - r373909;
        double r373911 = r373904 * r373910;
        double r373912 = r373901 + r373911;
        return r373912;
}

double f(double x, double y, double z, double t) {
        double r373913 = x;
        double r373914 = y;
        double r373915 = z;
        double r373916 = t;
        double r373917 = r373916 / r373914;
        double r373918 = tanh(r373917);
        double r373919 = r373913 / r373914;
        double r373920 = tanh(r373919);
        double r373921 = r373918 - r373920;
        double r373922 = r373915 * r373921;
        double r373923 = r373914 * r373922;
        double r373924 = r373913 + r373923;
        return r373924;
}

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