Average Error: 15.2 → 14.7
Time: 19.7s
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 r199191 = 1.0;
        double r199192 = 0.5;
        double r199193 = x;
        double r199194 = hypot(r199191, r199193);
        double r199195 = r199191 / r199194;
        double r199196 = r199191 + r199195;
        double r199197 = r199192 * r199196;
        double r199198 = sqrt(r199197);
        double r199199 = r199191 - r199198;
        return r199199;
}

double f(double x) {
        double r199200 = 0.5;
        double r199201 = 1.0;
        double r199202 = x;
        double r199203 = hypot(r199201, r199202);
        double r199204 = r199200 / r199203;
        double r199205 = r199200 + r199204;
        double r199206 = r199205 / r199203;
        double r199207 = r199200 + r199206;
        double r199208 = r199200 * r199207;
        double r199209 = r199200 - r199204;
        double r199210 = r199209 / r199208;
        double r199211 = r199208 * r199210;
        double r199212 = r199201 / r199203;
        double r199213 = r199201 + r199212;
        double r199214 = r199200 * r199213;
        double r199215 = sqrt(r199214);
        double r199216 = r199201 + r199215;
        double r199217 = r199211 / r199216;
        return r199217;
}

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