Average Error: 0.0 → 0.0
Time: 2.6s
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(\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}, 0.707110000000000016, 0.707110000000000016 \cdot \left(-x\right)\right) + 0.707110000000000016 \cdot \mathsf{fma}\left(-x, 1, x\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(\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}, 0.707110000000000016, 0.707110000000000016 \cdot \left(-x\right)\right) + 0.707110000000000016 \cdot \mathsf{fma}\left(-x, 1, x\right)
double f(double x) {
        double r105658 = 0.70711;
        double r105659 = 2.30753;
        double r105660 = x;
        double r105661 = 0.27061;
        double r105662 = r105660 * r105661;
        double r105663 = r105659 + r105662;
        double r105664 = 1.0;
        double r105665 = 0.99229;
        double r105666 = 0.04481;
        double r105667 = r105660 * r105666;
        double r105668 = r105665 + r105667;
        double r105669 = r105660 * r105668;
        double r105670 = r105664 + r105669;
        double r105671 = r105663 / r105670;
        double r105672 = r105671 - r105660;
        double r105673 = r105658 * r105672;
        return r105673;
}

double f(double x) {
        double r105674 = 0.27061;
        double r105675 = x;
        double r105676 = 2.30753;
        double r105677 = fma(r105674, r105675, r105676);
        double r105678 = 0.04481;
        double r105679 = 0.99229;
        double r105680 = fma(r105678, r105675, r105679);
        double r105681 = 1.0;
        double r105682 = fma(r105675, r105680, r105681);
        double r105683 = r105677 / r105682;
        double r105684 = 0.70711;
        double r105685 = -r105675;
        double r105686 = r105684 * r105685;
        double r105687 = fma(r105683, r105684, r105686);
        double r105688 = 1.0;
        double r105689 = fma(r105685, r105688, r105675);
        double r105690 = r105684 * r105689;
        double r105691 = r105687 + r105690;
        return r105691;
}

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. Using strategy rm
  3. Applied add-cube-cbrt0.6

    \[\leadsto 0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}\right)\]
  4. Applied add-sqr-sqrt8.9

    \[\leadsto 0.707110000000000016 \cdot \left(\color{blue}{\sqrt{\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}} \cdot \sqrt{\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}}} - \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)\]
  5. Applied prod-diff8.9

    \[\leadsto 0.707110000000000016 \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt{\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}}, \sqrt{\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}}, -\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{x}, \sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)\right)}\]
  6. Applied distribute-lft-in8.9

    \[\leadsto \color{blue}{0.707110000000000016 \cdot \mathsf{fma}\left(\sqrt{\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}}, \sqrt{\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}}, -\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right) + 0.707110000000000016 \cdot \mathsf{fma}\left(-\sqrt[3]{x}, \sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)}\]
  7. Simplified0.1

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

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

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

Reproduce

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