Average Error: 15.6 → 15.1
Time: 4.5m
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\left(\left(1 - 0.5\right) \cdot 1\right) \cdot \left(1 + 0.5\right)}{1 + 0.5}}{1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}} - \frac{\frac{0.5}{1 + 0.5} \cdot \frac{\left(1 + 0.5\right) \cdot 1}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{\left(\left(1 - 0.5\right) \cdot 1\right) \cdot \left(1 + 0.5\right)}{1 + 0.5}}{1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}} - \frac{\frac{0.5}{1 + 0.5} \cdot \frac{\left(1 + 0.5\right) \cdot 1}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}}
double f(double x) {
        double r918867 = 1.0;
        double r918868 = 0.5;
        double r918869 = x;
        double r918870 = hypot(r918867, r918869);
        double r918871 = r918867 / r918870;
        double r918872 = r918867 + r918871;
        double r918873 = r918868 * r918872;
        double r918874 = sqrt(r918873);
        double r918875 = r918867 - r918874;
        return r918875;
}

double f(double x) {
        double r918876 = 1.0;
        double r918877 = 0.5;
        double r918878 = r918876 - r918877;
        double r918879 = r918878 * r918876;
        double r918880 = r918876 + r918877;
        double r918881 = r918879 * r918880;
        double r918882 = r918881 / r918880;
        double r918883 = x;
        double r918884 = hypot(r918876, r918883);
        double r918885 = r918876 / r918884;
        double r918886 = r918885 + r918876;
        double r918887 = r918877 * r918886;
        double r918888 = sqrt(r918887);
        double r918889 = r918876 + r918888;
        double r918890 = r918882 / r918889;
        double r918891 = r918877 / r918880;
        double r918892 = r918880 * r918876;
        double r918893 = r918892 / r918884;
        double r918894 = r918891 * r918893;
        double r918895 = r918894 / r918889;
        double r918896 = r918890 - r918895;
        return r918896;
}

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 flip--15.6

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\mathsf{hypot}\left(1, x\right) \cdot \left(\left(1 + 0.5\right) \cdot \left(\left(1 - 0.5\right) \cdot 1\right)\right) - \left(\left(1 + 0.5\right) \cdot 1\right) \cdot 0.5}{\color{blue}{\mathsf{hypot}\left(1, x\right) \cdot \left(1 + 0.5\right)}}}{1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}}\]
  12. Using strategy rm
  13. Applied div-sub15.1

    \[\leadsto \frac{\color{blue}{\frac{\mathsf{hypot}\left(1, x\right) \cdot \left(\left(1 + 0.5\right) \cdot \left(\left(1 - 0.5\right) \cdot 1\right)\right)}{\mathsf{hypot}\left(1, x\right) \cdot \left(1 + 0.5\right)} - \frac{\left(\left(1 + 0.5\right) \cdot 1\right) \cdot 0.5}{\mathsf{hypot}\left(1, x\right) \cdot \left(1 + 0.5\right)}}}{1 + \sqrt{0.5 \cdot \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} + 1\right)}}\]
  14. Applied div-sub15.1

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

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

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

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

Reproduce

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