Average Error: 15.5 → 15.0
Time: 6.2s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{1 \cdot \left(\left({1}^{3} - {0.5}^{3}\right) \cdot \mathsf{hypot}\left(1, x\right) - 0.5 \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\right)\right)}{\mathsf{hypot}\left(1, x\right) \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\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{1 \cdot \left(\left({1}^{3} - {0.5}^{3}\right) \cdot \mathsf{hypot}\left(1, x\right) - 0.5 \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\right)\right)}{\mathsf{hypot}\left(1, x\right) \cdot \left(0.5 \cdot \left(0.5 + 1\right) + 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}
double f(double x) {
        double r209357 = 1.0;
        double r209358 = 0.5;
        double r209359 = x;
        double r209360 = hypot(r209357, r209359);
        double r209361 = r209357 / r209360;
        double r209362 = r209357 + r209361;
        double r209363 = r209358 * r209362;
        double r209364 = sqrt(r209363);
        double r209365 = r209357 - r209364;
        return r209365;
}

double f(double x) {
        double r209366 = 1.0;
        double r209367 = 3.0;
        double r209368 = pow(r209366, r209367);
        double r209369 = 0.5;
        double r209370 = pow(r209369, r209367);
        double r209371 = r209368 - r209370;
        double r209372 = x;
        double r209373 = hypot(r209366, r209372);
        double r209374 = r209371 * r209373;
        double r209375 = r209369 + r209366;
        double r209376 = r209369 * r209375;
        double r209377 = r209366 * r209366;
        double r209378 = r209376 + r209377;
        double r209379 = r209369 * r209378;
        double r209380 = r209374 - r209379;
        double r209381 = r209366 * r209380;
        double r209382 = r209373 * r209378;
        double r209383 = r209381 / r209382;
        double r209384 = r209366 / r209373;
        double r209385 = r209366 + r209384;
        double r209386 = r209369 * r209385;
        double r209387 = sqrt(r209386);
        double r209388 = r209366 + r209387;
        double r209389 = r209383 / r209388;
        return r209389;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.5

    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
  2. Using strategy rm
  3. Applied flip--15.5

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

    \[\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 associate-*r/15.0

    \[\leadsto \frac{1 \cdot \left(1 - 0.5\right) - \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  7. Applied flip3--15.0

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

    \[\leadsto \frac{\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{0.5 \cdot 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 frac-sub15.0

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

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

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

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

Reproduce

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