Average Error: 4.4 → 1.5
Time: 1.2m
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[z \cdot \left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) + x\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
z \cdot \left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) + x
double f(double x, double y, double z, double t) {
        double r19620794 = x;
        double r19620795 = y;
        double r19620796 = z;
        double r19620797 = r19620795 * r19620796;
        double r19620798 = t;
        double r19620799 = r19620798 / r19620795;
        double r19620800 = tanh(r19620799);
        double r19620801 = r19620794 / r19620795;
        double r19620802 = tanh(r19620801);
        double r19620803 = r19620800 - r19620802;
        double r19620804 = r19620797 * r19620803;
        double r19620805 = r19620794 + r19620804;
        return r19620805;
}

double f(double x, double y, double z, double t) {
        double r19620806 = z;
        double r19620807 = y;
        double r19620808 = t;
        double r19620809 = r19620808 / r19620807;
        double r19620810 = tanh(r19620809);
        double r19620811 = x;
        double r19620812 = r19620811 / r19620807;
        double r19620813 = tanh(r19620812);
        double r19620814 = r19620810 - r19620813;
        double r19620815 = r19620807 * r19620814;
        double r19620816 = r19620806 * r19620815;
        double r19620817 = r19620816 + r19620811;
        return r19620817;
}

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
Target2.0
Herbie1.5
\[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 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. Using strategy rm
  5. Applied add-cube-cbrt2.3

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

    \[\leadsto x + \color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\right)}\]
  7. Using strategy rm
  8. Applied pow12.3

    \[\leadsto x + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(z \cdot \color{blue}{{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}^{1}}\right)\right)\]
  9. Applied pow12.3

    \[\leadsto x + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(\color{blue}{{z}^{1}} \cdot {\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}^{1}\right)\right)\]
  10. Applied pow-prod-down2.3

    \[\leadsto x + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \color{blue}{{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)}^{1}}\right)\]
  11. Applied pow12.3

    \[\leadsto x + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{1}} \cdot {\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)}^{1}\right)\]
  12. Applied pow-prod-down2.3

    \[\leadsto x + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \color{blue}{{\left(\sqrt[3]{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\right)}^{1}}\]
  13. Applied pow12.3

    \[\leadsto x + \left(\sqrt[3]{y} \cdot \color{blue}{{\left(\sqrt[3]{y}\right)}^{1}}\right) \cdot {\left(\sqrt[3]{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\right)}^{1}\]
  14. Applied pow12.3

    \[\leadsto x + \left(\color{blue}{{\left(\sqrt[3]{y}\right)}^{1}} \cdot {\left(\sqrt[3]{y}\right)}^{1}\right) \cdot {\left(\sqrt[3]{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\right)}^{1}\]
  15. Applied pow-prod-down2.3

    \[\leadsto x + \color{blue}{{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)}^{1}} \cdot {\left(\sqrt[3]{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\right)}^{1}\]
  16. Applied pow-prod-down2.3

    \[\leadsto x + \color{blue}{{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\sqrt[3]{y} \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\right)\right)}^{1}}\]
  17. Simplified1.5

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

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

Reproduce

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