Average Error: 3.0 → 0.1
Time: 9.4s
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 r515408 = x;
        double r515409 = y;
        double r515410 = 1.1283791670955126;
        double r515411 = z;
        double r515412 = exp(r515411);
        double r515413 = r515410 * r515412;
        double r515414 = r515408 * r515409;
        double r515415 = r515413 - r515414;
        double r515416 = r515409 / r515415;
        double r515417 = r515408 + r515416;
        return r515417;
}

double f(double x, double y, double z) {
        double r515418 = x;
        double r515419 = 1.0;
        double r515420 = 1.1283791670955126;
        double r515421 = y;
        double r515422 = r515420 / r515421;
        double r515423 = z;
        double r515424 = exp(r515423);
        double r515425 = -r515418;
        double r515426 = fma(r515422, r515424, r515425);
        double r515427 = r515419 / r515426;
        double r515428 = r515418 + r515427;
        return r515428;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 3.0

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

    \[\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 2019351 +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.1283791670955126 y) (exp z)) x)))

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