Average Error: 2.8 → 0.0
Time: 15.6s
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 r246603 = x;
        double r246604 = y;
        double r246605 = 1.1283791670955126;
        double r246606 = z;
        double r246607 = exp(r246606);
        double r246608 = r246605 * r246607;
        double r246609 = r246603 * r246604;
        double r246610 = r246608 - r246609;
        double r246611 = r246604 / r246610;
        double r246612 = r246603 + r246611;
        return r246612;
}

double f(double x, double y, double z) {
        double r246613 = x;
        double r246614 = 1.0;
        double r246615 = 1.1283791670955126;
        double r246616 = y;
        double r246617 = r246615 / r246616;
        double r246618 = z;
        double r246619 = exp(r246618);
        double r246620 = -r246613;
        double r246621 = fma(r246617, r246619, r246620);
        double r246622 = r246614 / r246621;
        double r246623 = r246613 + r246622;
        return r246623;
}

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