Average Error: 4.6 → 1.1
Time: 22.6s
Precision: 64
\[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\]
\[\begin{array}{l} \mathbf{if}\;y \le -9.35923728687513776866525293540503635053 \cdot 10^{208}:\\ \;\;\;\;x + \left(t - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y\right) + x\\ \end{array}\]
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\begin{array}{l}
\mathbf{if}\;y \le -9.35923728687513776866525293540503635053 \cdot 10^{208}:\\
\;\;\;\;x + \left(t - x\right) \cdot z\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y\right) + x\\

\end{array}
double f(double x, double y, double z, double t) {
        double r15558625 = x;
        double r15558626 = y;
        double r15558627 = z;
        double r15558628 = r15558626 * r15558627;
        double r15558629 = t;
        double r15558630 = r15558629 / r15558626;
        double r15558631 = tanh(r15558630);
        double r15558632 = r15558625 / r15558626;
        double r15558633 = tanh(r15558632);
        double r15558634 = r15558631 - r15558633;
        double r15558635 = r15558628 * r15558634;
        double r15558636 = r15558625 + r15558635;
        return r15558636;
}

double f(double x, double y, double z, double t) {
        double r15558637 = y;
        double r15558638 = -9.359237286875138e+208;
        bool r15558639 = r15558637 <= r15558638;
        double r15558640 = x;
        double r15558641 = t;
        double r15558642 = r15558641 - r15558640;
        double r15558643 = z;
        double r15558644 = r15558642 * r15558643;
        double r15558645 = r15558640 + r15558644;
        double r15558646 = r15558641 / r15558637;
        double r15558647 = tanh(r15558646);
        double r15558648 = r15558640 / r15558637;
        double r15558649 = tanh(r15558648);
        double r15558650 = r15558647 - r15558649;
        double r15558651 = r15558650 * r15558637;
        double r15558652 = r15558643 * r15558651;
        double r15558653 = r15558652 + r15558640;
        double r15558654 = r15558639 ? r15558645 : r15558653;
        return r15558654;
}

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.6
Target1.9
Herbie1.1
\[x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)\]

Derivation

  1. Split input into 2 regimes
  2. if y < -9.359237286875138e+208

    1. Initial program 19.6

      \[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*11.2

      \[\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-cbrt11.5

      \[\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*11.5

      \[\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 pow111.5

      \[\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 pow111.5

      \[\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-down11.5

      \[\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 pow111.5

      \[\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-down11.5

      \[\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 pow111.5

      \[\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 pow111.5

      \[\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-down11.5

      \[\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-down11.5

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

      \[\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. Taylor expanded around 0 4.8

      \[\leadsto x + {\left(\color{blue}{\left(t - x\right)} \cdot z\right)}^{1}\]

    if -9.359237286875138e+208 < y

    1. Initial program 3.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*1.2

      \[\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-cbrt1.6

      \[\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*1.6

      \[\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 pow11.6

      \[\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 pow11.6

      \[\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-down1.6

      \[\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 pow11.6

      \[\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-down1.6

      \[\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 pow11.6

      \[\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 pow11.6

      \[\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-down1.6

      \[\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-down1.6

      \[\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. Simplified0.9

      \[\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}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -9.35923728687513776866525293540503635053 \cdot 10^{208}:\\ \;\;\;\;x + \left(t - x\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \cdot y\right) + x\\ \end{array}\]

Reproduce

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