Average Error: 15.2 → 14.7
Time: 18.4s
Precision: 64
\[1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{1}{\frac{\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}}{\frac{1}{8} - \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}\]
1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{1}{\frac{\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}}{\frac{1}{8} - \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)}}}{\sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}} + 1}
double f(double x) {
        double r4540258 = 1.0;
        double r4540259 = 0.5;
        double r4540260 = x;
        double r4540261 = hypot(r4540258, r4540260);
        double r4540262 = r4540258 / r4540261;
        double r4540263 = r4540258 + r4540262;
        double r4540264 = r4540259 * r4540263;
        double r4540265 = sqrt(r4540264);
        double r4540266 = r4540258 - r4540265;
        return r4540266;
}

double f(double x) {
        double r4540267 = 1.0;
        double r4540268 = 0.5;
        double r4540269 = x;
        double r4540270 = hypot(r4540267, r4540269);
        double r4540271 = r4540268 / r4540270;
        double r4540272 = r4540271 + r4540268;
        double r4540273 = r4540271 * r4540272;
        double r4540274 = 0.25;
        double r4540275 = r4540273 + r4540274;
        double r4540276 = 0.125;
        double r4540277 = r4540271 * r4540271;
        double r4540278 = r4540271 * r4540277;
        double r4540279 = r4540276 - r4540278;
        double r4540280 = r4540275 / r4540279;
        double r4540281 = r4540267 / r4540280;
        double r4540282 = sqrt(r4540272);
        double r4540283 = r4540282 + r4540267;
        double r4540284 = r4540281 / r4540283;
        return r4540284;
}

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\frac{1}{8} - \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \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. Using strategy rm
  11. Applied clear-num14.7

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\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}}{\frac{1}{8} - \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}}}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\]
  12. Simplified14.7

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

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

Reproduce

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