Average Error: 0.0 → 0.0
Time: 2.2s
Precision: 64
\[0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)\]
\[\mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \left(0.27061000000000002 \cdot x\right) + 0.707110000000000016 \cdot 2.30753}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\]
0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)
\mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \left(0.27061000000000002 \cdot x\right) + 0.707110000000000016 \cdot 2.30753}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)
double f(double x) {
        double r88542 = 0.70711;
        double r88543 = 2.30753;
        double r88544 = x;
        double r88545 = 0.27061;
        double r88546 = r88544 * r88545;
        double r88547 = r88543 + r88546;
        double r88548 = 1.0;
        double r88549 = 0.99229;
        double r88550 = 0.04481;
        double r88551 = r88544 * r88550;
        double r88552 = r88549 + r88551;
        double r88553 = r88544 * r88552;
        double r88554 = r88548 + r88553;
        double r88555 = r88547 / r88554;
        double r88556 = r88555 - r88544;
        double r88557 = r88542 * r88556;
        return r88557;
}

double f(double x) {
        double r88558 = x;
        double r88559 = -r88558;
        double r88560 = 0.70711;
        double r88561 = 0.27061;
        double r88562 = r88561 * r88558;
        double r88563 = r88560 * r88562;
        double r88564 = 2.30753;
        double r88565 = r88560 * r88564;
        double r88566 = r88563 + r88565;
        double r88567 = 0.04481;
        double r88568 = 0.99229;
        double r88569 = fma(r88567, r88558, r88568);
        double r88570 = 1.0;
        double r88571 = fma(r88558, r88569, r88570);
        double r88572 = r88566 / r88571;
        double r88573 = fma(r88559, r88560, r88572);
        return r88573;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \color{blue}{\left(0.27061000000000002 \cdot x + 2.30753\right)}}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\]
  5. Applied distribute-lft-in0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \frac{\color{blue}{0.707110000000000016 \cdot \left(0.27061000000000002 \cdot x\right) + 0.707110000000000016 \cdot 2.30753}}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\]
  6. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \left(0.27061000000000002 \cdot x\right) + 0.707110000000000016 \cdot 2.30753}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\]

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, B"
  :precision binary64
  (* 0.70711 (- (/ (+ 2.30753 (* x 0.27061)) (+ 1 (* x (+ 0.99229 (* x 0.04481))))) x)))