Average Error: 2.6 → 0.1
Time: 16.8s
Precision: 64
\[x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\]
\[x + \frac{1}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.128379167095512558560699289955664426088, -x\right)}\]
x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}
x + \frac{1}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.128379167095512558560699289955664426088, -x\right)}
double f(double x, double y, double z) {
        double r259238 = x;
        double r259239 = y;
        double r259240 = 1.1283791670955126;
        double r259241 = z;
        double r259242 = exp(r259241);
        double r259243 = r259240 * r259242;
        double r259244 = r259238 * r259239;
        double r259245 = r259243 - r259244;
        double r259246 = r259239 / r259245;
        double r259247 = r259238 + r259246;
        return r259247;
}

double f(double x, double y, double z) {
        double r259248 = x;
        double r259249 = 1.0;
        double r259250 = z;
        double r259251 = exp(r259250);
        double r259252 = y;
        double r259253 = r259251 / r259252;
        double r259254 = 1.1283791670955126;
        double r259255 = -r259248;
        double r259256 = fma(r259253, r259254, r259255);
        double r259257 = r259249 / r259256;
        double r259258 = r259248 + r259257;
        return r259258;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 2.6

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

    \[\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{e^{z}}{y}, 1.128379167095512558560699289955664426088, -x\right)}}\]
  5. Final simplification0.1

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

Reproduce

herbie shell --seed 2019304 +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)))))