Average Error: 15.3 → 14.8
Time: 4.3s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}{1 + \frac{\sqrt{0.5 \cdot \left({1}^{3} + {\left(\frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}}{\sqrt{1 \cdot 1 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} - 1 \cdot \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 \left(1 - 0.5\right) - 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}{1 + \frac{\sqrt{0.5 \cdot \left({1}^{3} + {\left(\frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}}{\sqrt{1 \cdot 1 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} - 1 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}
double f(double x) {
        double r188288 = 1.0;
        double r188289 = 0.5;
        double r188290 = x;
        double r188291 = hypot(r188288, r188290);
        double r188292 = r188288 / r188291;
        double r188293 = r188288 + r188292;
        double r188294 = r188289 * r188293;
        double r188295 = sqrt(r188294);
        double r188296 = r188288 - r188295;
        return r188296;
}

double f(double x) {
        double r188297 = 1.0;
        double r188298 = 0.5;
        double r188299 = r188297 - r188298;
        double r188300 = r188297 * r188299;
        double r188301 = x;
        double r188302 = hypot(r188297, r188301);
        double r188303 = r188297 / r188302;
        double r188304 = r188298 * r188303;
        double r188305 = r188300 - r188304;
        double r188306 = 3.0;
        double r188307 = pow(r188297, r188306);
        double r188308 = pow(r188303, r188306);
        double r188309 = r188307 + r188308;
        double r188310 = r188298 * r188309;
        double r188311 = sqrt(r188310);
        double r188312 = r188297 * r188297;
        double r188313 = r188303 * r188303;
        double r188314 = r188297 * r188303;
        double r188315 = r188313 - r188314;
        double r188316 = r188312 + r188315;
        double r188317 = sqrt(r188316);
        double r188318 = r188311 / r188317;
        double r188319 = r188297 + r188318;
        double r188320 = r188305 / r188319;
        return r188320;
}

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{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Using strategy rm
  3. Applied flip--15.3

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

    \[\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. Using strategy rm
  6. Applied flip3-+14.8

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 \cdot \color{blue}{\frac{{1}^{3} + {\left(\frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}{1 \cdot 1 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} - 1 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}}}\]
  7. Applied associate-*r/14.8

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

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

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

Reproduce

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