Average Error: 15.3 → 14.9
Time: 33.4s
Precision: 64
\[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\frac{1}{8} - \frac{\frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}}{\frac{1}{4} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{\frac{1}{8} - \frac{\frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}}{\frac{1}{4} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}
double f(double x) {
        double r1184913 = 1.0;
        double r1184914 = 0.5;
        double r1184915 = x;
        double r1184916 = hypot(r1184913, r1184915);
        double r1184917 = r1184913 / r1184916;
        double r1184918 = r1184913 + r1184917;
        double r1184919 = r1184914 * r1184918;
        double r1184920 = sqrt(r1184919);
        double r1184921 = r1184913 - r1184920;
        return r1184921;
}

double f(double x) {
        double r1184922 = 0.125;
        double r1184923 = 1.0;
        double r1184924 = x;
        double r1184925 = hypot(r1184923, r1184924);
        double r1184926 = r1184922 / r1184925;
        double r1184927 = r1184926 / r1184925;
        double r1184928 = r1184927 / r1184925;
        double r1184929 = r1184922 - r1184928;
        double r1184930 = 0.25;
        double r1184931 = 0.5;
        double r1184932 = r1184931 / r1184925;
        double r1184933 = r1184931 + r1184932;
        double r1184934 = r1184932 * r1184933;
        double r1184935 = r1184930 + r1184934;
        double r1184936 = r1184929 / r1184935;
        double r1184937 = sqrt(r1184933);
        double r1184938 = r1184923 + r1184937;
        double r1184939 = r1184936 / r1184938;
        return r1184939;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.3

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\frac{1}{2}}^{3} - {\left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}{\frac{1}{2} \cdot \frac{1}{2} + \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  8. Simplified14.9

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

    \[\leadsto \frac{\frac{\frac{1}{8} - \frac{\frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}}{\color{blue}{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right) + \frac{1}{4}}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  10. Final simplification14.9

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

Reproduce

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