Average Error: 15.6 → 15.1
Time: 21.9s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}}{\frac{1 \cdot 1 + \left(\sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot 1 + 0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}{\sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}}{\frac{1 \cdot 1 + \left(\sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot 1 + 0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}{\sqrt{1 \cdot \left(1 \cdot 1\right) - \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)} \cdot \left(0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)\right)}}}
double f(double x) {
        double r7007773 = 1.0;
        double r7007774 = 0.5;
        double r7007775 = x;
        double r7007776 = hypot(r7007773, r7007775);
        double r7007777 = r7007773 / r7007776;
        double r7007778 = r7007773 + r7007777;
        double r7007779 = r7007774 * r7007778;
        double r7007780 = sqrt(r7007779);
        double r7007781 = r7007773 - r7007780;
        return r7007781;
}

double f(double x) {
        double r7007782 = 1.0;
        double r7007783 = r7007782 * r7007782;
        double r7007784 = r7007782 * r7007783;
        double r7007785 = 0.5;
        double r7007786 = x;
        double r7007787 = hypot(r7007782, r7007786);
        double r7007788 = r7007782 / r7007787;
        double r7007789 = r7007788 + r7007782;
        double r7007790 = r7007785 * r7007789;
        double r7007791 = sqrt(r7007790);
        double r7007792 = r7007791 * r7007790;
        double r7007793 = r7007784 - r7007792;
        double r7007794 = sqrt(r7007793);
        double r7007795 = r7007791 * r7007782;
        double r7007796 = r7007795 + r7007790;
        double r7007797 = r7007783 + r7007796;
        double r7007798 = r7007797 / r7007794;
        double r7007799 = r7007794 / r7007798;
        return r7007799;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.6

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

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

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

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

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

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

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

Reproduce

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