Average Error: 2.8 → 0.0
Time: 4.4s
Precision: 64
\[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
\[x + \frac{1}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.12837916709551256, -x\right)}\]
x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}
x + \frac{1}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.12837916709551256, -x\right)}
double f(double x, double y, double z) {
        double r401113 = x;
        double r401114 = y;
        double r401115 = 1.1283791670955126;
        double r401116 = z;
        double r401117 = exp(r401116);
        double r401118 = r401115 * r401117;
        double r401119 = r401113 * r401114;
        double r401120 = r401118 - r401119;
        double r401121 = r401114 / r401120;
        double r401122 = r401113 + r401121;
        return r401122;
}

double f(double x, double y, double z) {
        double r401123 = x;
        double r401124 = 1.0;
        double r401125 = z;
        double r401126 = exp(r401125);
        double r401127 = y;
        double r401128 = r401126 / r401127;
        double r401129 = 1.1283791670955126;
        double r401130 = -r401123;
        double r401131 = fma(r401128, r401129, r401130);
        double r401132 = r401124 / r401131;
        double r401133 = r401123 + r401132;
        return r401133;
}

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.12837916709551256}{y} \cdot e^{z} - x}\]

Derivation

  1. Initial program 2.8

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

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

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

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

Reproduce

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