Average Error: 0.0 → 0.0
Time: 21.5s
Precision: 64
\[0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)\]
\[\mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, -x\right) \cdot 0.70711\]
0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)
\mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, -x\right) \cdot 0.70711
double f(double x) {
        double r3411673 = 0.70711;
        double r3411674 = 2.30753;
        double r3411675 = x;
        double r3411676 = 0.27061;
        double r3411677 = r3411675 * r3411676;
        double r3411678 = r3411674 + r3411677;
        double r3411679 = 1.0;
        double r3411680 = 0.99229;
        double r3411681 = 0.04481;
        double r3411682 = r3411675 * r3411681;
        double r3411683 = r3411680 + r3411682;
        double r3411684 = r3411675 * r3411683;
        double r3411685 = r3411679 + r3411684;
        double r3411686 = r3411678 / r3411685;
        double r3411687 = r3411686 - r3411675;
        double r3411688 = r3411673 * r3411687;
        return r3411688;
}

double f(double x) {
        double r3411689 = 1.0;
        double r3411690 = x;
        double r3411691 = r3411690 * r3411690;
        double r3411692 = 0.04481;
        double r3411693 = 0.99229;
        double r3411694 = 1.0;
        double r3411695 = fma(r3411690, r3411693, r3411694);
        double r3411696 = fma(r3411691, r3411692, r3411695);
        double r3411697 = cbrt(r3411696);
        double r3411698 = r3411697 * r3411697;
        double r3411699 = r3411689 / r3411698;
        double r3411700 = 0.27061;
        double r3411701 = 2.30753;
        double r3411702 = fma(r3411700, r3411690, r3411701);
        double r3411703 = r3411702 / r3411697;
        double r3411704 = -r3411690;
        double r3411705 = fma(r3411699, r3411703, r3411704);
        double r3411706 = 0.70711;
        double r3411707 = r3411705 * r3411706;
        return r3411707;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(\frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1.0\right)} - x\right) \cdot 0.70711}\]
  3. Taylor expanded around 0 0.0

    \[\leadsto \left(\frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\color{blue}{0.99229 \cdot x + \left(0.04481 \cdot {x}^{2} + 1.0\right)}} - x\right) \cdot 0.70711\]
  4. Simplified0.0

    \[\leadsto \left(\frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\color{blue}{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}} - x\right) \cdot 0.70711\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.0

    \[\leadsto \left(\frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}} - x\right) \cdot 0.70711\]
  7. Applied *-un-lft-identity0.0

    \[\leadsto \left(\frac{\color{blue}{1 \cdot \mathsf{fma}\left(0.27061, x, 2.30753\right)}}{\left(\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}} - x\right) \cdot 0.70711\]
  8. Applied times-frac0.0

    \[\leadsto \left(\color{blue}{\frac{1}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}} \cdot \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}} - x\right) \cdot 0.70711\]
  9. Applied fma-neg0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, -x\right)} \cdot 0.70711\]
  10. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(\frac{1}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\sqrt[3]{\mathsf{fma}\left(x \cdot x, 0.04481, \mathsf{fma}\left(x, 0.99229, 1.0\right)\right)}}, -x\right) \cdot 0.70711\]

Reproduce

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