Average Error: 2.8 → 1.1
Time: 14.3s
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 r20062324 = x;
        double r20062325 = y;
        double r20062326 = 1.1283791670955126;
        double r20062327 = z;
        double r20062328 = exp(r20062327);
        double r20062329 = r20062326 * r20062328;
        double r20062330 = r20062324 * r20062325;
        double r20062331 = r20062329 - r20062330;
        double r20062332 = r20062325 / r20062331;
        double r20062333 = r20062324 + r20062332;
        return r20062333;
}

double f(double x, double y, double z) {
        double r20062334 = x;
        double r20062335 = y;
        double r20062336 = z;
        double r20062337 = exp(r20062336);
        double r20062338 = 1.1283791670955126;
        double r20062339 = r20062337 * r20062338;
        double r20062340 = r20062334 * r20062335;
        double r20062341 = r20062339 - r20062340;
        double r20062342 = r20062335 / r20062341;
        double r20062343 = r20062334 + r20062342;
        double r20062344 = 5.241345650251777e+241;
        bool r20062345 = r20062343 <= r20062344;
        double r20062346 = 1.0;
        double r20062347 = r20062346 / r20062334;
        double r20062348 = r20062334 - r20062347;
        double r20062349 = r20062345 ? r20062343 : r20062348;
        return r20062349;
}

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)))))