Average Error: 15.2 → 14.7
Time: 4.3s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{\frac{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left({1}^{3} - {0.5}^{3}\right)\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \left(\left(0.5 \cdot 1\right) \cdot \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}{\mathsf{hypot}\left(1, x\right) \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\right)}}{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)}}\]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\frac{\frac{\frac{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left({1}^{3} - {0.5}^{3}\right)\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \left(\left(0.5 \cdot 1\right) \cdot \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}{\mathsf{hypot}\left(1, x\right) \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\right)}}{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)}}
double f(double x) {
        double r285398 = 1.0;
        double r285399 = 0.5;
        double r285400 = x;
        double r285401 = hypot(r285398, r285400);
        double r285402 = r285398 / r285401;
        double r285403 = r285398 + r285402;
        double r285404 = r285399 * r285403;
        double r285405 = sqrt(r285404);
        double r285406 = r285398 - r285405;
        return r285406;
}

double f(double x) {
        double r285407 = 1.0;
        double r285408 = 0.5;
        double r285409 = r285407 - r285408;
        double r285410 = r285407 * r285409;
        double r285411 = 3.0;
        double r285412 = pow(r285407, r285411);
        double r285413 = pow(r285408, r285411);
        double r285414 = r285412 - r285413;
        double r285415 = r285407 * r285414;
        double r285416 = r285410 * r285415;
        double r285417 = x;
        double r285418 = hypot(r285407, r285417);
        double r285419 = r285416 * r285418;
        double r285420 = r285407 * r285407;
        double r285421 = r285408 * r285408;
        double r285422 = r285407 * r285408;
        double r285423 = r285421 + r285422;
        double r285424 = r285420 + r285423;
        double r285425 = r285408 * r285407;
        double r285426 = r285407 / r285418;
        double r285427 = r285408 * r285426;
        double r285428 = r285425 * r285427;
        double r285429 = r285424 * r285428;
        double r285430 = r285419 - r285429;
        double r285431 = r285408 + r285407;
        double r285432 = r285408 * r285431;
        double r285433 = r285432 + r285420;
        double r285434 = r285418 * r285433;
        double r285435 = r285430 / r285434;
        double r285436 = r285410 + r285427;
        double r285437 = r285435 / r285436;
        double r285438 = r285407 + r285426;
        double r285439 = r285408 * r285438;
        double r285440 = sqrt(r285439);
        double r285441 = r285407 + r285440;
        double r285442 = r285437 / r285441;
        return r285442;
}

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. Using strategy rm
  6. Applied flip--14.7

    \[\leadsto \frac{\color{blue}{\frac{\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left(1 - 0.5\right)\right) - \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}{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)}}\]
  7. Using strategy rm
  8. Applied associate-*r/14.7

    \[\leadsto \frac{\frac{\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left(1 - 0.5\right)\right) - \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}}{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)}}\]
  9. Applied associate-*r/14.7

    \[\leadsto \frac{\frac{\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left(1 - 0.5\right)\right) - \color{blue}{\frac{\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot 1\right)}{\mathsf{hypot}\left(1, x\right)}}}{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)}}\]
  10. Applied flip3--14.7

    \[\leadsto \frac{\frac{\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \color{blue}{\frac{{1}^{3} - {0.5}^{3}}{1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)}}\right) - \frac{\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot 1\right)}{\mathsf{hypot}\left(1, x\right)}}{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)}}\]
  11. Applied associate-*r/14.7

    \[\leadsto \frac{\frac{\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \color{blue}{\frac{1 \cdot \left({1}^{3} - {0.5}^{3}\right)}{1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)}} - \frac{\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot 1\right)}{\mathsf{hypot}\left(1, x\right)}}{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)}}\]
  12. Applied associate-*r/14.7

    \[\leadsto \frac{\frac{\color{blue}{\frac{\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left({1}^{3} - {0.5}^{3}\right)\right)}{1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)}} - \frac{\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot 1\right)}{\mathsf{hypot}\left(1, x\right)}}{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)}}\]
  13. Applied frac-sub14.7

    \[\leadsto \frac{\frac{\color{blue}{\frac{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left({1}^{3} - {0.5}^{3}\right)\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \left(\left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot \left(0.5 \cdot 1\right)\right)}{\left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)}}}{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)}}\]
  14. Simplified14.7

    \[\leadsto \frac{\frac{\frac{\color{blue}{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left({1}^{3} - {0.5}^{3}\right)\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \left(\left(0.5 \cdot 1\right) \cdot \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}}{\left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \mathsf{hypot}\left(1, x\right)}}{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)}}\]
  15. Simplified14.7

    \[\leadsto \frac{\frac{\frac{\left(\left(1 \cdot \left(1 - 0.5\right)\right) \cdot \left(1 \cdot \left({1}^{3} - {0.5}^{3}\right)\right)\right) \cdot \mathsf{hypot}\left(1, x\right) - \left(1 \cdot 1 + \left(0.5 \cdot 0.5 + 1 \cdot 0.5\right)\right) \cdot \left(\left(0.5 \cdot 1\right) \cdot \left(0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}{\color{blue}{\mathsf{hypot}\left(1, x\right) \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\right)}}}{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)}}\]
  16. Final simplification14.7

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

Reproduce

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