Average Error: 2.7 → 0.1
Time: 10.8s
Precision: 64
\[x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\]
\[x + \frac{1}{\mathsf{fma}\left(\frac{1.128379167095512558560699289955664426088}{y}, e^{z}, -x\right)}\]
x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}
x + \frac{1}{\mathsf{fma}\left(\frac{1.128379167095512558560699289955664426088}{y}, e^{z}, -x\right)}
double f(double x, double y, double z) {
        double r290262 = x;
        double r290263 = y;
        double r290264 = 1.1283791670955126;
        double r290265 = z;
        double r290266 = exp(r290265);
        double r290267 = r290264 * r290266;
        double r290268 = r290262 * r290263;
        double r290269 = r290267 - r290268;
        double r290270 = r290263 / r290269;
        double r290271 = r290262 + r290270;
        return r290271;
}

double f(double x, double y, double z) {
        double r290272 = x;
        double r290273 = 1.0;
        double r290274 = 1.1283791670955126;
        double r290275 = y;
        double r290276 = r290274 / r290275;
        double r290277 = z;
        double r290278 = exp(r290277);
        double r290279 = -r290272;
        double r290280 = fma(r290276, r290278, r290279);
        double r290281 = r290273 / r290280;
        double r290282 = r290272 + r290281;
        return r290282;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original2.7
Target0.1
Herbie0.1
\[x + \frac{1}{\frac{1.128379167095512558560699289955664426088}{y} \cdot e^{z} - x}\]

Derivation

  1. Initial program 2.7

    \[x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\]
  2. Using strategy rm
  3. Applied clear-num2.7

    \[\leadsto x + \color{blue}{\frac{1}{\frac{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}{y}}}\]
  4. Simplified0.1

    \[\leadsto x + \frac{1}{\color{blue}{\mathsf{fma}\left(\frac{1.128379167095512558560699289955664426088}{y}, e^{z}, -x\right)}}\]
  5. Final simplification0.1

    \[\leadsto x + \frac{1}{\mathsf{fma}\left(\frac{1.128379167095512558560699289955664426088}{y}, e^{z}, -x\right)}\]

Reproduce

herbie shell --seed 2019303 +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.12837916709551256 y) (exp z)) x)))

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