Average Error: 0.0 → 0.0
Time: 3.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(-x, 0.707110000000000016, \sqrt{0.707110000000000016} \cdot \left(\sqrt{0.707110000000000016} \cdot \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)}\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, \sqrt{0.707110000000000016} \cdot \left(\sqrt{0.707110000000000016} \cdot \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)}\right)\right)
double f(double x) {
        double r123183 = 0.70711;
        double r123184 = 2.30753;
        double r123185 = x;
        double r123186 = 0.27061;
        double r123187 = r123185 * r123186;
        double r123188 = r123184 + r123187;
        double r123189 = 1.0;
        double r123190 = 0.99229;
        double r123191 = 0.04481;
        double r123192 = r123185 * r123191;
        double r123193 = r123190 + r123192;
        double r123194 = r123185 * r123193;
        double r123195 = r123189 + r123194;
        double r123196 = r123188 / r123195;
        double r123197 = r123196 - r123185;
        double r123198 = r123183 * r123197;
        return r123198;
}

double f(double x) {
        double r123199 = x;
        double r123200 = -r123199;
        double r123201 = 0.70711;
        double r123202 = sqrt(r123201);
        double r123203 = 0.27061;
        double r123204 = 2.30753;
        double r123205 = fma(r123203, r123199, r123204);
        double r123206 = 0.04481;
        double r123207 = 0.99229;
        double r123208 = fma(r123206, r123199, r123207);
        double r123209 = 1.0;
        double r123210 = fma(r123199, r123208, r123209);
        double r123211 = r123205 / r123210;
        double r123212 = r123202 * r123211;
        double r123213 = r123202 * r123212;
        double r123214 = fma(r123200, r123201, r123213);
        return r123214;
}

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 *-un-lft-identity0.0

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

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{\frac{0.707110000000000016}{1} \cdot \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)}}\right)\]
  6. Simplified0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{0.707110000000000016} \cdot \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)}\right)\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{\left(\sqrt{0.707110000000000016} \cdot \sqrt{0.707110000000000016}\right)} \cdot \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)}\right)\]
  9. Applied associate-*l*0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{\sqrt{0.707110000000000016} \cdot \left(\sqrt{0.707110000000000016} \cdot \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)}\right)}\right)\]
  10. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \sqrt{0.707110000000000016} \cdot \left(\sqrt{0.707110000000000016} \cdot \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)}\right)\right)\]

Reproduce

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