Average Error: 2.8 → 0.0
Time: 14.9s
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 r247105 = x;
        double r247106 = y;
        double r247107 = 1.1283791670955126;
        double r247108 = z;
        double r247109 = exp(r247108);
        double r247110 = r247107 * r247109;
        double r247111 = r247105 * r247106;
        double r247112 = r247110 - r247111;
        double r247113 = r247106 / r247112;
        double r247114 = r247105 + r247113;
        return r247114;
}

double f(double x, double y, double z) {
        double r247115 = x;
        double r247116 = 1.0;
        double r247117 = 1.1283791670955126;
        double r247118 = y;
        double r247119 = r247117 / r247118;
        double r247120 = z;
        double r247121 = exp(r247120);
        double r247122 = -r247115;
        double r247123 = fma(r247119, r247121, r247122);
        double r247124 = r247116 / r247123;
        double r247125 = r247115 + r247124;
        return r247125;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 2.8

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

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

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

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

Reproduce

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