Average Error: 2.7 → 0.0
Time: 16.0s
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 r223953 = x;
        double r223954 = y;
        double r223955 = 1.1283791670955126;
        double r223956 = z;
        double r223957 = exp(r223956);
        double r223958 = r223955 * r223957;
        double r223959 = r223953 * r223954;
        double r223960 = r223958 - r223959;
        double r223961 = r223954 / r223960;
        double r223962 = r223953 + r223961;
        return r223962;
}

double f(double x, double y, double z) {
        double r223963 = x;
        double r223964 = 1.0;
        double r223965 = 1.1283791670955126;
        double r223966 = y;
        double r223967 = r223965 / r223966;
        double r223968 = z;
        double r223969 = exp(r223968);
        double r223970 = -r223963;
        double r223971 = fma(r223967, r223969, r223970);
        double r223972 = r223964 / r223971;
        double r223973 = r223963 + r223972;
        return r223973;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 2.7

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

    \[\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 2019306 +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)))))