Average Error: 2.8 → 1.1
Time: 12.7s
Precision: 64
\[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \le 5.241345650251777 \cdot 10^{+241}:\\ \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{1}{x}\\ \end{array}\]
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\begin{array}{l}
\mathbf{if}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \le 5.241345650251777 \cdot 10^{+241}:\\
\;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{1}{x}\\

\end{array}
double f(double x, double y, double z) {
        double r22093016 = x;
        double r22093017 = y;
        double r22093018 = 1.1283791670955126;
        double r22093019 = z;
        double r22093020 = exp(r22093019);
        double r22093021 = r22093018 * r22093020;
        double r22093022 = r22093016 * r22093017;
        double r22093023 = r22093021 - r22093022;
        double r22093024 = r22093017 / r22093023;
        double r22093025 = r22093016 + r22093024;
        return r22093025;
}

double f(double x, double y, double z) {
        double r22093026 = x;
        double r22093027 = y;
        double r22093028 = z;
        double r22093029 = exp(r22093028);
        double r22093030 = 1.1283791670955126;
        double r22093031 = r22093029 * r22093030;
        double r22093032 = r22093026 * r22093027;
        double r22093033 = r22093031 - r22093032;
        double r22093034 = r22093027 / r22093033;
        double r22093035 = r22093026 + r22093034;
        double r22093036 = 5.241345650251777e+241;
        bool r22093037 = r22093035 <= r22093036;
        double r22093038 = 1.0;
        double r22093039 = r22093038 / r22093026;
        double r22093040 = r22093026 - r22093039;
        double r22093041 = r22093037 ? r22093035 : r22093040;
        return r22093041;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))) < 5.241345650251777e+241

    1. Initial program 1.1

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\]
    2. Using strategy rm
    3. Applied div-inv1.3

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

      \[\leadsto x + \color{blue}{\frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}}\]

    if 5.241345650251777e+241 < (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y))))

    1. Initial program 19.3

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

      \[\leadsto \color{blue}{x - \frac{1}{x}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y} \le 5.241345650251777 \cdot 10^{+241}:\\ \;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{1}{x}\\ \end{array}\]

Reproduce

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

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

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