Average Error: 3.0 → 0.1
Time: 13.7s
Precision: 64
\[x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}\]
\[x + \frac{1}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.128379167095512558560699289955664426088, -x\right)}\]
x + \frac{y}{1.128379167095512558560699289955664426088 \cdot e^{z} - x \cdot y}
x + \frac{1}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.128379167095512558560699289955664426088, -x\right)}
double f(double x, double y, double z) {
        double r201656 = x;
        double r201657 = y;
        double r201658 = 1.1283791670955126;
        double r201659 = z;
        double r201660 = exp(r201659);
        double r201661 = r201658 * r201660;
        double r201662 = r201656 * r201657;
        double r201663 = r201661 - r201662;
        double r201664 = r201657 / r201663;
        double r201665 = r201656 + r201664;
        return r201665;
}

double f(double x, double y, double z) {
        double r201666 = x;
        double r201667 = 1.0;
        double r201668 = z;
        double r201669 = exp(r201668);
        double r201670 = y;
        double r201671 = r201669 / r201670;
        double r201672 = 1.1283791670955126;
        double r201673 = -r201666;
        double r201674 = fma(r201671, r201672, r201673);
        double r201675 = r201667 / r201674;
        double r201676 = r201666 + r201675;
        return r201676;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

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

Derivation

  1. Initial program 3.0

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

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

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

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

Reproduce

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