Average Error: 16.1 → 15.6
Time: 12.0s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \left(1 - \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}{\sqrt{\left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{0.5}{\sqrt{\mathsf{hypot}\left(1, x\right)}} + 0.5\right) \cdot 1} + 1}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{1 \cdot \left(1 - \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right)}{\sqrt{\left(\frac{1}{\sqrt{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{0.5}{\sqrt{\mathsf{hypot}\left(1, x\right)}} + 0.5\right) \cdot 1} + 1}
double f(double x) {
        double r184881 = 1.0;
        double r184882 = 0.5;
        double r184883 = x;
        double r184884 = hypot(r184881, r184883);
        double r184885 = r184881 / r184884;
        double r184886 = r184881 + r184885;
        double r184887 = r184882 * r184886;
        double r184888 = sqrt(r184887);
        double r184889 = r184881 - r184888;
        return r184889;
}

double f(double x) {
        double r184890 = 1.0;
        double r184891 = 0.5;
        double r184892 = x;
        double r184893 = hypot(r184890, r184892);
        double r184894 = r184891 / r184893;
        double r184895 = r184891 + r184894;
        double r184896 = r184890 - r184895;
        double r184897 = r184890 * r184896;
        double r184898 = 1.0;
        double r184899 = sqrt(r184893);
        double r184900 = r184898 / r184899;
        double r184901 = r184891 / r184899;
        double r184902 = r184900 * r184901;
        double r184903 = r184902 + r184891;
        double r184904 = r184903 * r184890;
        double r184905 = sqrt(r184904);
        double r184906 = r184905 + r184890;
        double r184907 = r184897 / r184906;
        return r184907;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 16.1

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

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

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

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

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

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

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

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

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

Reproduce

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