Average Error: 2.9 → 0.1
Time: 13.0s
Precision: 64
\[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
\[x + \frac{1}{\left(1.12837916709551256 \cdot e^{z}\right) \cdot \frac{1}{y} - x}\]
x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}
x + \frac{1}{\left(1.12837916709551256 \cdot e^{z}\right) \cdot \frac{1}{y} - x}
double f(double x, double y, double z) {
        double r257505 = x;
        double r257506 = y;
        double r257507 = 1.1283791670955126;
        double r257508 = z;
        double r257509 = exp(r257508);
        double r257510 = r257507 * r257509;
        double r257511 = r257505 * r257506;
        double r257512 = r257510 - r257511;
        double r257513 = r257506 / r257512;
        double r257514 = r257505 + r257513;
        return r257514;
}

double f(double x, double y, double z) {
        double r257515 = x;
        double r257516 = 1.0;
        double r257517 = 1.1283791670955126;
        double r257518 = z;
        double r257519 = exp(r257518);
        double r257520 = r257517 * r257519;
        double r257521 = y;
        double r257522 = r257516 / r257521;
        double r257523 = r257520 * r257522;
        double r257524 = r257523 - r257515;
        double r257525 = r257516 / r257524;
        double r257526 = r257515 + r257525;
        return r257526;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 2.9

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

    \[\leadsto x + \color{blue}{\frac{1}{\frac{1.12837916709551256 \cdot e^{z} - x \cdot y}{y}}}\]
  4. Taylor expanded around inf 0.1

    \[\leadsto x + \frac{1}{\color{blue}{1.12837916709551256 \cdot \frac{e^{z}}{y} - x}}\]
  5. Using strategy rm
  6. Applied div-inv0.1

    \[\leadsto x + \frac{1}{1.12837916709551256 \cdot \color{blue}{\left(e^{z} \cdot \frac{1}{y}\right)} - x}\]
  7. Applied associate-*r*0.1

    \[\leadsto x + \frac{1}{\color{blue}{\left(1.12837916709551256 \cdot e^{z}\right) \cdot \frac{1}{y}} - x}\]
  8. Final simplification0.1

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

Reproduce

herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y z)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"

  :herbie-target
  (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))

  (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))