Average Error: 2.9 → 0.5
Time: 9.4s
Precision: 64
\[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;z \le -744.98628896478272 \lor \neg \left(z \le 1.00942494343838114 \cdot 10^{-88}\right):\\ \;\;\;\;x + \frac{1}{\frac{1.12837916709551256}{\sqrt[3]{{\left(\frac{y}{e^{z}}\right)}^{3}}} - x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\\ \end{array}\]
x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}
\begin{array}{l}
\mathbf{if}\;z \le -744.98628896478272 \lor \neg \left(z \le 1.00942494343838114 \cdot 10^{-88}\right):\\
\;\;\;\;x + \frac{1}{\frac{1.12837916709551256}{\sqrt[3]{{\left(\frac{y}{e^{z}}\right)}^{3}}} - x}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\\

\end{array}
double f(double x, double y, double z) {
        double r681770 = x;
        double r681771 = y;
        double r681772 = 1.1283791670955126;
        double r681773 = z;
        double r681774 = exp(r681773);
        double r681775 = r681772 * r681774;
        double r681776 = r681770 * r681771;
        double r681777 = r681775 - r681776;
        double r681778 = r681771 / r681777;
        double r681779 = r681770 + r681778;
        return r681779;
}

double f(double x, double y, double z) {
        double r681780 = z;
        double r681781 = -744.9862889647827;
        bool r681782 = r681780 <= r681781;
        double r681783 = 1.0094249434383811e-88;
        bool r681784 = r681780 <= r681783;
        double r681785 = !r681784;
        bool r681786 = r681782 || r681785;
        double r681787 = x;
        double r681788 = 1.0;
        double r681789 = 1.1283791670955126;
        double r681790 = y;
        double r681791 = exp(r681780);
        double r681792 = r681790 / r681791;
        double r681793 = 3.0;
        double r681794 = pow(r681792, r681793);
        double r681795 = cbrt(r681794);
        double r681796 = r681789 / r681795;
        double r681797 = r681796 - r681787;
        double r681798 = r681788 / r681797;
        double r681799 = r681787 + r681798;
        double r681800 = r681789 * r681791;
        double r681801 = r681787 * r681790;
        double r681802 = r681800 - r681801;
        double r681803 = r681790 / r681802;
        double r681804 = r681787 + r681803;
        double r681805 = r681786 ? r681799 : r681804;
        return r681805;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.9
Target0.0
Herbie0.5
\[x + \frac{1}{\frac{1.12837916709551256}{y} \cdot e^{z} - x}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -744.9862889647827 or 1.0094249434383811e-88 < z

    1. Initial program 5.0

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
    2. Using strategy rm
    3. Applied clear-num5.0

      \[\leadsto x + \color{blue}{\frac{1}{\frac{1.12837916709551256 \cdot e^{z} - x \cdot y}{y}}}\]
    4. Using strategy rm
    5. Applied div-sub5.0

      \[\leadsto x + \frac{1}{\color{blue}{\frac{1.12837916709551256 \cdot e^{z}}{y} - \frac{x \cdot y}{y}}}\]
    6. Simplified5.0

      \[\leadsto x + \frac{1}{\color{blue}{\frac{1.12837916709551256}{\frac{y}{e^{z}}}} - \frac{x \cdot y}{y}}\]
    7. Simplified0.0

      \[\leadsto x + \frac{1}{\frac{1.12837916709551256}{\frac{y}{e^{z}}} - \color{blue}{x}}\]
    8. Using strategy rm
    9. Applied add-cbrt-cube0.0

      \[\leadsto x + \frac{1}{\frac{1.12837916709551256}{\frac{y}{\color{blue}{\sqrt[3]{\left(e^{z} \cdot e^{z}\right) \cdot e^{z}}}}} - x}\]
    10. Applied add-cbrt-cube18.7

      \[\leadsto x + \frac{1}{\frac{1.12837916709551256}{\frac{\color{blue}{\sqrt[3]{\left(y \cdot y\right) \cdot y}}}{\sqrt[3]{\left(e^{z} \cdot e^{z}\right) \cdot e^{z}}}} - x}\]
    11. Applied cbrt-undiv18.7

      \[\leadsto x + \frac{1}{\frac{1.12837916709551256}{\color{blue}{\sqrt[3]{\frac{\left(y \cdot y\right) \cdot y}{\left(e^{z} \cdot e^{z}\right) \cdot e^{z}}}}} - x}\]
    12. Simplified0.9

      \[\leadsto x + \frac{1}{\frac{1.12837916709551256}{\sqrt[3]{\color{blue}{{\left(\frac{y}{e^{z}}\right)}^{3}}}} - x}\]

    if -744.9862889647827 < z < 1.0094249434383811e-88

    1. Initial program 0.0

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -744.98628896478272 \lor \neg \left(z \le 1.00942494343838114 \cdot 10^{-88}\right):\\ \;\;\;\;x + \frac{1}{\frac{1.12837916709551256}{\sqrt[3]{{\left(\frac{y}{e^{z}}\right)}^{3}}} - x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\\ \end{array}\]

Reproduce

herbie shell --seed 2020042 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (+ x (/ 1 (- (* (/ 1.1283791670955126 y) (exp z)) x)))

  (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))