Average Error: 15.9 → 15.4
Time: 16.8s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\frac{{1}^{12} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{6}}{{\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} + {1}^{6}}}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{\frac{{1}^{12} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{6}}{{\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} + {1}^{6}}}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r172229 = 1.0;
        double r172230 = 0.5;
        double r172231 = x;
        double r172232 = hypot(r172229, r172231);
        double r172233 = r172229 / r172232;
        double r172234 = r172229 + r172233;
        double r172235 = r172230 * r172234;
        double r172236 = sqrt(r172235);
        double r172237 = r172229 - r172236;
        return r172237;
}

double f(double x) {
        double r172238 = 1.0;
        double r172239 = 12.0;
        double r172240 = pow(r172238, r172239);
        double r172241 = x;
        double r172242 = hypot(r172238, r172241);
        double r172243 = r172238 / r172242;
        double r172244 = r172238 + r172243;
        double r172245 = 0.5;
        double r172246 = r172244 * r172245;
        double r172247 = 6.0;
        double r172248 = pow(r172246, r172247);
        double r172249 = r172240 - r172248;
        double r172250 = 3.0;
        double r172251 = pow(r172246, r172250);
        double r172252 = pow(r172238, r172247);
        double r172253 = r172251 + r172252;
        double r172254 = r172249 / r172253;
        double r172255 = r172245 * r172244;
        double r172256 = fma(r172238, r172238, r172255);
        double r172257 = 4.0;
        double r172258 = pow(r172238, r172257);
        double r172259 = fma(r172246, r172256, r172258);
        double r172260 = r172254 / r172259;
        double r172261 = sqrt(r172255);
        double r172262 = r172238 + r172261;
        double r172263 = r172260 / r172262;
        return r172263;
}

Error

Bits error versus x

Derivation

  1. Initial program 15.9

    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Using strategy rm
  3. Applied flip--15.9

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \cdot \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}\]
  4. Simplified15.4

    \[\leadsto \frac{\color{blue}{1 \cdot 1 - \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  5. Using strategy rm
  6. Applied flip3--15.4

    \[\leadsto \frac{\color{blue}{\frac{{\left(1 \cdot 1\right)}^{3} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) + \left(\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right) + \left(1 \cdot 1\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  7. Simplified15.4

    \[\leadsto \frac{\frac{\color{blue}{{1}^{6} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}}{\left(1 \cdot 1\right) \cdot \left(1 \cdot 1\right) + \left(\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right) + \left(1 \cdot 1\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  8. Simplified15.4

    \[\leadsto \frac{\frac{{1}^{6} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}{\color{blue}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  9. Using strategy rm
  10. Applied flip--15.4

    \[\leadsto \frac{\frac{\color{blue}{\frac{{1}^{6} \cdot {1}^{6} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} \cdot {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}{{1}^{6} + {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}}}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Simplified15.4

    \[\leadsto \frac{\frac{\frac{\color{blue}{{1}^{12} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{6}}}{{1}^{6} + {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  12. Simplified15.4

    \[\leadsto \frac{\frac{\frac{{1}^{12} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{6}}{\color{blue}{{\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} + {1}^{6}}}}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  13. Final simplification15.4

    \[\leadsto \frac{\frac{\frac{{1}^{12} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{6}}{{\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} + {1}^{6}}}{\mathsf{fma}\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))