Average Error: 4.8 → 2.1
Time: 8.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 r340820 = x;
        double r340821 = y;
        double r340822 = z;
        double r340823 = r340821 * r340822;
        double r340824 = t;
        double r340825 = r340824 / r340821;
        double r340826 = tanh(r340825);
        double r340827 = r340820 / r340821;
        double r340828 = tanh(r340827);
        double r340829 = r340826 - r340828;
        double r340830 = r340823 * r340829;
        double r340831 = r340820 + r340830;
        return r340831;
}

double f(double x, double y, double z, double t) {
        double r340832 = x;
        double r340833 = y;
        double r340834 = z;
        double r340835 = t;
        double r340836 = r340835 / r340833;
        double r340837 = tanh(r340836);
        double r340838 = r340832 / r340833;
        double r340839 = tanh(r340838);
        double r340840 = r340837 - r340839;
        double r340841 = r340834 * r340840;
        double r340842 = r340833 * r340841;
        double r340843 = r340832 + r340842;
        return r340843;
}

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.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.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.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 2019356 
(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))))))