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{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\left(\left({0.5}^{6} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{6}\right) + \frac{{0.5}^{6}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(0.5 \cdot 0.5 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\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{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{\left(\left({0.5}^{6} + {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{6}\right) + \frac{{0.5}^{6}}{{\left(\mathsf{hypot}\left(1, x\right)\right)}^{3}}\right) \cdot \left(0.5 \cdot 0.5 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r136350 = 1.0;
        double r136351 = 0.5;
        double r136352 = x;
        double r136353 = hypot(r136350, r136352);
        double r136354 = r136350 / r136353;
        double r136355 = r136350 + r136354;
        double r136356 = r136351 * r136355;
        double r136357 = sqrt(r136356);
        double r136358 = r136350 - r136357;
        return r136358;
}

double f(double x) {
        double r136359 = 0.5;
        double r136360 = 3.0;
        double r136361 = pow(r136359, r136360);
        double r136362 = pow(r136361, r136360);
        double r136363 = 1.0;
        double r136364 = x;
        double r136365 = hypot(r136363, r136364);
        double r136366 = r136359 / r136365;
        double r136367 = pow(r136366, r136360);
        double r136368 = pow(r136367, r136360);
        double r136369 = r136362 - r136368;
        double r136370 = 6.0;
        double r136371 = pow(r136359, r136370);
        double r136372 = pow(r136366, r136370);
        double r136373 = r136371 + r136372;
        double r136374 = pow(r136365, r136360);
        double r136375 = r136371 / r136374;
        double r136376 = r136373 + r136375;
        double r136377 = r136359 * r136359;
        double r136378 = r136359 + r136366;
        double r136379 = r136378 * r136366;
        double r136380 = r136377 + r136379;
        double r136381 = r136376 * r136380;
        double r136382 = r136369 / r136381;
        double r136383 = r136363 / r136365;
        double r136384 = r136363 + r136383;
        double r136385 = r136359 * r136384;
        double r136386 = sqrt(r136385);
        double r136387 = r136363 + r136386;
        double r136388 = r136382 / r136387;
        return r136388;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 - 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)}}\]
  5. Taylor expanded around 0 15.4

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

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

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

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

    \[\leadsto \frac{\frac{\color{blue}{\frac{{\left({0.5}^{3}\right)}^{3} - {\left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}^{3}}{{0.5}^{3} \cdot {0.5}^{3} + \left({\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3} \cdot {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3} + {0.5}^{3} \cdot {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}}}{0.5 \cdot 0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  12. Applied associate-/l/15.4

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

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

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

Reproduce

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