Average Error: 15.2 → 14.7
Time: 18.3s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\left(0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\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{\left(0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\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 r206100 = 1.0;
        double r206101 = 0.5;
        double r206102 = x;
        double r206103 = hypot(r206100, r206102);
        double r206104 = r206100 / r206103;
        double r206105 = r206100 + r206104;
        double r206106 = r206101 * r206105;
        double r206107 = sqrt(r206106);
        double r206108 = r206100 - r206107;
        return r206108;
}

double f(double x) {
        double r206109 = 0.5;
        double r206110 = 1.0;
        double r206111 = x;
        double r206112 = hypot(r206110, r206111);
        double r206113 = r206109 / r206112;
        double r206114 = r206109 + r206113;
        double r206115 = r206114 / r206112;
        double r206116 = r206109 + r206115;
        double r206117 = r206109 * r206116;
        double r206118 = r206109 - r206113;
        double r206119 = r206118 / r206117;
        double r206120 = r206117 * r206119;
        double r206121 = r206110 / r206112;
        double r206122 = r206110 + r206121;
        double r206123 = r206109 * r206122;
        double r206124 = sqrt(r206123);
        double r206125 = r206110 + r206124;
        double r206126 = r206120 / r206125;
        return r206126;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.2

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

    \[\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. Simplified14.7

    \[\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 14.7

    \[\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. Simplified14.7

    \[\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--14.7

    \[\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. Simplified14.7

    \[\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 *-un-lft-identity14.7

    \[\leadsto \frac{\frac{{0.5}^{3} - {\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}{\color{blue}{1 \cdot \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)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  12. Applied difference-cubes14.7

    \[\leadsto \frac{\frac{\color{blue}{\left(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)\right) \cdot \left(0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 \cdot \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)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  13. Applied times-frac14.7

    \[\leadsto \frac{\color{blue}{\frac{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} \cdot \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\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)}}\]
  14. Simplified14.7

    \[\leadsto \frac{\color{blue}{\left(0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}\right)\right)} \cdot \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\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)}}\]
  15. Simplified14.7

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

    \[\leadsto \frac{\left(0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{0.5 \cdot \left(0.5 + \frac{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\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 2019325 
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))