Average Error: 3.1 → 0.1
Time: 14.9s
Precision: 64
\[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
\[x + \frac{1}{1.12837916709551256 \cdot \frac{e^{z}}{y} - x}\]
x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}
x + \frac{1}{1.12837916709551256 \cdot \frac{e^{z}}{y} - x}
double f(double x, double y, double z) {
        double r337998 = x;
        double r337999 = y;
        double r338000 = 1.1283791670955126;
        double r338001 = z;
        double r338002 = exp(r338001);
        double r338003 = r338000 * r338002;
        double r338004 = r337998 * r337999;
        double r338005 = r338003 - r338004;
        double r338006 = r337999 / r338005;
        double r338007 = r337998 + r338006;
        return r338007;
}

double f(double x, double y, double z) {
        double r338008 = x;
        double r338009 = 1.0;
        double r338010 = 1.1283791670955126;
        double r338011 = z;
        double r338012 = exp(r338011);
        double r338013 = y;
        double r338014 = r338012 / r338013;
        double r338015 = r338010 * r338014;
        double r338016 = r338015 - r338008;
        double r338017 = r338009 / r338016;
        double r338018 = r338008 + r338017;
        return r338018;
}

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

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

Derivation

  1. Initial program 3.1

    \[x + \frac{y}{1.12837916709551256 \cdot e^{z} - x \cdot y}\]
  2. Taylor expanded around inf 3.1

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

    \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(y, -x, 1.12837916709551256 \cdot e^{z}\right)}}\]
  4. Using strategy rm
  5. Applied clear-num2.0

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, -x, 1.12837916709551256 \cdot e^{z}\right)}{y}}}\]
  6. Taylor expanded around inf 0.1

    \[\leadsto x + \frac{1}{\color{blue}{1.12837916709551256 \cdot \frac{e^{z}}{y} - x}}\]
  7. Final simplification0.1

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

Reproduce

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