Average Error: 2.9 → 0.5
Time: 10.1s
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 r482125 = x;
        double r482126 = y;
        double r482127 = 1.1283791670955126;
        double r482128 = z;
        double r482129 = exp(r482128);
        double r482130 = r482127 * r482129;
        double r482131 = r482125 * r482126;
        double r482132 = r482130 - r482131;
        double r482133 = r482126 / r482132;
        double r482134 = r482125 + r482133;
        return r482134;
}

double f(double x, double y, double z) {
        double r482135 = z;
        double r482136 = -744.9862889647827;
        bool r482137 = r482135 <= r482136;
        double r482138 = 1.0094249434383811e-88;
        bool r482139 = r482135 <= r482138;
        double r482140 = !r482139;
        bool r482141 = r482137 || r482140;
        double r482142 = x;
        double r482143 = 1.0;
        double r482144 = 1.1283791670955126;
        double r482145 = y;
        double r482146 = exp(r482135);
        double r482147 = r482145 / r482146;
        double r482148 = 3.0;
        double r482149 = pow(r482147, r482148);
        double r482150 = cbrt(r482149);
        double r482151 = r482144 / r482150;
        double r482152 = r482151 - r482142;
        double r482153 = r482143 / r482152;
        double r482154 = r482142 + r482153;
        double r482155 = r482144 * r482146;
        double r482156 = r482142 * r482145;
        double r482157 = r482155 - r482156;
        double r482158 = r482145 / r482157;
        double r482159 = r482142 + r482158;
        double r482160 = r482141 ? r482154 : r482159;
        return r482160;
}

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 +o rules:numerics
(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)))))