Average Error: 15.2 → 14.7
Time: 19.7s
Precision: 64
\[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{1}{\frac{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right) + \frac{1}{4}}{\frac{1}{8} - \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}\]
1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{1}{\frac{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right) + \frac{1}{4}}{\frac{1}{8} - \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}
double f(double x) {
        double r5113674 = 1.0;
        double r5113675 = 0.5;
        double r5113676 = x;
        double r5113677 = hypot(r5113674, r5113676);
        double r5113678 = r5113674 / r5113677;
        double r5113679 = r5113674 + r5113678;
        double r5113680 = r5113675 * r5113679;
        double r5113681 = sqrt(r5113680);
        double r5113682 = r5113674 - r5113681;
        return r5113682;
}

double f(double x) {
        double r5113683 = 1.0;
        double r5113684 = 0.5;
        double r5113685 = x;
        double r5113686 = hypot(r5113683, r5113685);
        double r5113687 = r5113684 / r5113686;
        double r5113688 = r5113687 + r5113684;
        double r5113689 = r5113687 * r5113688;
        double r5113690 = 0.25;
        double r5113691 = r5113689 + r5113690;
        double r5113692 = 0.125;
        double r5113693 = r5113687 * r5113687;
        double r5113694 = r5113687 * r5113693;
        double r5113695 = r5113692 - r5113694;
        double r5113696 = r5113691 / r5113695;
        double r5113697 = r5113683 / r5113696;
        double r5113698 = sqrt(r5113688);
        double r5113699 = r5113698 + r5113683;
        double r5113700 = r5113697 / r5113699;
        return r5113700;
}

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{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Simplified15.2

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

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}}\]
  5. Simplified14.7

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

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

    \[\leadsto \frac{\frac{\color{blue}{\frac{1}{8} - \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}}{\frac{1}{2} \cdot \frac{1}{2} + \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  9. Simplified14.7

    \[\leadsto \frac{\frac{\frac{1}{8} - \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}{\color{blue}{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right) + \frac{1}{4}}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  10. Using strategy rm
  11. Applied clear-num14.7

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right) + \frac{1}{4}}{\frac{1}{8} - \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  12. Simplified14.7

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

    \[\leadsto \frac{\frac{1}{\frac{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right) + \frac{1}{4}}{\frac{1}{8} - \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}\]

Reproduce

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