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 r93284 = 0.70711;
        double r93285 = 2.30753;
        double r93286 = x;
        double r93287 = 0.27061;
        double r93288 = r93286 * r93287;
        double r93289 = r93285 + r93288;
        double r93290 = 1.0;
        double r93291 = 0.99229;
        double r93292 = 0.04481;
        double r93293 = r93286 * r93292;
        double r93294 = r93291 + r93293;
        double r93295 = r93286 * r93294;
        double r93296 = r93290 + r93295;
        double r93297 = r93289 / r93296;
        double r93298 = r93297 - r93286;
        double r93299 = r93284 * r93298;
        return r93299;
}

double f(double x) {
        double r93300 = x;
        double r93301 = -r93300;
        double r93302 = 0.70711;
        double r93303 = 0.27061;
        double r93304 = r93303 * r93300;
        double r93305 = r93302 * r93304;
        double r93306 = 2.30753;
        double r93307 = r93302 * r93306;
        double r93308 = r93305 + r93307;
        double r93309 = 0.04481;
        double r93310 = 0.99229;
        double r93311 = fma(r93309, r93300, r93310);
        double r93312 = 1.0;
        double r93313 = fma(r93300, r93311, r93312);
        double r93314 = r93308 / r93313;
        double r93315 = fma(r93301, r93302, r93314);
        return r93315;
}

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 2020018 +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)))