Average Error: 15.2 → 14.7
Time: 9.4s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \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)}
\frac{1}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}} \cdot \left(\left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)
double f(double x) {
        double r161951 = 1.0;
        double r161952 = 0.5;
        double r161953 = x;
        double r161954 = hypot(r161951, r161953);
        double r161955 = r161951 / r161954;
        double r161956 = r161951 + r161955;
        double r161957 = r161952 * r161956;
        double r161958 = sqrt(r161957);
        double r161959 = r161951 - r161958;
        return r161959;
}

double f(double x) {
        double r161960 = 1.0;
        double r161961 = 0.5;
        double r161962 = x;
        double r161963 = hypot(r161960, r161962);
        double r161964 = r161960 / r161963;
        double r161965 = r161960 + r161964;
        double r161966 = r161961 * r161965;
        double r161967 = sqrt(r161966);
        double r161968 = r161960 + r161967;
        double r161969 = r161960 / r161968;
        double r161970 = r161960 - r161961;
        double r161971 = r161961 / r161963;
        double r161972 = r161970 - r161971;
        double r161973 = r161969 * r161972;
        return r161973;
}

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

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

Reproduce

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