Average Error: 15.2 → 14.7
Time: 4.7s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \frac{\left(1 - 0.5\right) \cdot \left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\left(1 - 0.5\right) + \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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1 \cdot \frac{\left(1 - 0.5\right) \cdot \left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{\left(1 - 0.5\right) + \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)}}
double f(double x) {
        double r219845 = 1.0;
        double r219846 = 0.5;
        double r219847 = x;
        double r219848 = hypot(r219845, r219847);
        double r219849 = r219845 / r219848;
        double r219850 = r219845 + r219849;
        double r219851 = r219846 * r219850;
        double r219852 = sqrt(r219851);
        double r219853 = r219845 - r219852;
        return r219853;
}

double f(double x) {
        double r219854 = 1.0;
        double r219855 = 0.5;
        double r219856 = r219854 - r219855;
        double r219857 = r219856 * r219856;
        double r219858 = x;
        double r219859 = hypot(r219854, r219858);
        double r219860 = r219855 / r219859;
        double r219861 = r219860 * r219860;
        double r219862 = r219857 - r219861;
        double r219863 = r219856 + r219860;
        double r219864 = r219862 / r219863;
        double r219865 = r219854 * r219864;
        double r219866 = r219854 / r219859;
        double r219867 = r219854 + r219866;
        double r219868 = r219855 * r219867;
        double r219869 = sqrt(r219868);
        double r219870 = r219854 + r219869;
        double r219871 = r219865 / r219870;
        return r219871;
}

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 \left(\left(1 - 0.5\right) - \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)}}\]
  5. Using strategy rm
  6. Applied flip--14.7

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

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

Reproduce

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