Average Error: 2.8 → 0.0
Time: 12.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 r190021 = x;
        double r190022 = y;
        double r190023 = 1.1283791670955126;
        double r190024 = z;
        double r190025 = exp(r190024);
        double r190026 = r190023 * r190025;
        double r190027 = r190021 * r190022;
        double r190028 = r190026 - r190027;
        double r190029 = r190022 / r190028;
        double r190030 = r190021 + r190029;
        return r190030;
}

double f(double x, double y, double z) {
        double r190031 = x;
        double r190032 = 1.0;
        double r190033 = 1.1283791670955126;
        double r190034 = y;
        double r190035 = r190033 / r190034;
        double r190036 = z;
        double r190037 = exp(r190036);
        double r190038 = -r190031;
        double r190039 = fma(r190035, r190037, r190038);
        double r190040 = r190032 / r190039;
        double r190041 = r190031 + r190040;
        return r190041;
}

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