Average Error: 3.0 → 1.1
Time: 3.3s
Precision: 64
\[x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;z \le -17240082885981937598464:\\ \;\;\;\;x - \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + 1 \cdot \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\\ \end{array}\]
x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}
\begin{array}{l}
\mathbf{if}\;z \le -17240082885981937598464:\\
\;\;\;\;x - \frac{1}{x}\\

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

\end{array}
double f(double x, double y, double z) {
        double r381273 = x;
        double r381274 = y;
        double r381275 = 1.1283791670955126;
        double r381276 = z;
        double r381277 = exp(r381276);
        double r381278 = r381275 * r381277;
        double r381279 = r381273 * r381274;
        double r381280 = r381278 - r381279;
        double r381281 = r381274 / r381280;
        double r381282 = r381273 + r381281;
        return r381282;
}

double f(double x, double y, double z) {
        double r381283 = z;
        double r381284 = -1.7240082885981938e+22;
        bool r381285 = r381283 <= r381284;
        double r381286 = x;
        double r381287 = 1.0;
        double r381288 = r381287 / r381286;
        double r381289 = r381286 - r381288;
        double r381290 = y;
        double r381291 = 1.1283791670955126;
        double r381292 = exp(r381283);
        double r381293 = r381291 * r381292;
        double r381294 = r381286 * r381290;
        double r381295 = r381293 - r381294;
        double r381296 = r381290 / r381295;
        double r381297 = r381287 * r381296;
        double r381298 = r381286 + r381297;
        double r381299 = r381285 ? r381289 : r381298;
        return r381299;
}

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

Original3.0
Target0.1
Herbie1.1
\[x + \frac{1}{\frac{1.128379167095512558560699289955664426088}{y} \cdot e^{z} - x}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -1.7240082885981938e+22

    1. Initial program 7.9

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

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

    if -1.7240082885981938e+22 < z

    1. Initial program 1.4

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

      \[\leadsto x + \color{blue}{y \cdot \frac{1}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity1.5

      \[\leadsto x + \color{blue}{\left(1 \cdot y\right)} \cdot \frac{1}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\]
    6. Applied associate-*l*1.5

      \[\leadsto x + \color{blue}{1 \cdot \left(y \cdot \frac{1}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\right)}\]
    7. Simplified1.4

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

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

Reproduce

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

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

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