Average Error: 2.8 → 0.0
Time: 12.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 r286673 = x;
        double r286674 = y;
        double r286675 = 1.1283791670955126;
        double r286676 = z;
        double r286677 = exp(r286676);
        double r286678 = r286675 * r286677;
        double r286679 = r286673 * r286674;
        double r286680 = r286678 - r286679;
        double r286681 = r286674 / r286680;
        double r286682 = r286673 + r286681;
        return r286682;
}

double f(double x, double y, double z) {
        double r286683 = x;
        double r286684 = 1.0;
        double r286685 = 1.1283791670955126;
        double r286686 = y;
        double r286687 = r286685 / r286686;
        double r286688 = z;
        double r286689 = exp(r286688);
        double r286690 = -r286683;
        double r286691 = fma(r286687, r286689, r286690);
        double r286692 = r286684 / r286691;
        double r286693 = r286683 + r286692;
        return r286693;
}

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 2019326 +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)))))