Average Error: 2.6 → 1.1
Time: 3.6s
Precision: 64
\[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;e^{z} \le 0.0:\\ \;\;\;\;x - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{y}{\sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y} \cdot \sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}}}{\sqrt[3]{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}\;e^{z} \le 0.0:\\
\;\;\;\;x - \frac{1}{x}\\

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

\end{array}
double f(double x, double y, double z) {
        double r465047 = x;
        double r465048 = y;
        double r465049 = 1.1283791670955126;
        double r465050 = z;
        double r465051 = exp(r465050);
        double r465052 = r465049 * r465051;
        double r465053 = r465047 * r465048;
        double r465054 = r465052 - r465053;
        double r465055 = r465048 / r465054;
        double r465056 = r465047 + r465055;
        return r465056;
}

double f(double x, double y, double z) {
        double r465057 = z;
        double r465058 = exp(r465057);
        double r465059 = 0.0;
        bool r465060 = r465058 <= r465059;
        double r465061 = x;
        double r465062 = 1.0;
        double r465063 = r465062 / r465061;
        double r465064 = r465061 - r465063;
        double r465065 = y;
        double r465066 = 1.1283791670955126;
        double r465067 = r465066 * r465058;
        double r465068 = r465061 * r465065;
        double r465069 = r465067 - r465068;
        double r465070 = cbrt(r465069);
        double r465071 = r465070 * r465070;
        double r465072 = r465065 / r465071;
        double r465073 = r465072 / r465070;
        double r465074 = r465061 + r465073;
        double r465075 = r465060 ? r465064 : r465074;
        return r465075;
}

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.6
Target0.0
Herbie1.1
\[x + \frac{1}{\frac{1.12837916709551256}{y} \cdot e^{z} - x}\]

Derivation

  1. Split input into 2 regimes
  2. if (exp z) < 0.0

    1. Initial program 7.5

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
    2. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{x - \frac{1}{x}}\]

    if 0.0 < (exp z)

    1. Initial program 1.0

      \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt1.4

      \[\leadsto x + \frac{y}{\color{blue}{\left(\sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y} \cdot \sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}\right) \cdot \sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}}}\]
    4. Applied associate-/r*1.4

      \[\leadsto x + \color{blue}{\frac{\frac{y}{\sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y} \cdot \sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}}}{\sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{z} \le 0.0:\\ \;\;\;\;x - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{y}{\sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y} \cdot \sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}}}{\sqrt[3]{1.12837916709551256 \cdot e^{z} - x \cdot y}}\\ \end{array}\]

Reproduce

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