Average Error: 15.7 → 15.2
Time: 23.4s
Precision: 64
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
\[\frac{\frac{{e}^{\left(\log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)\right)}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\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{{e}^{\left(\log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)\right)}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\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 r234416 = 1.0;
        double r234417 = 0.5;
        double r234418 = x;
        double r234419 = hypot(r234416, r234418);
        double r234420 = r234416 / r234419;
        double r234421 = r234416 + r234420;
        double r234422 = r234417 * r234421;
        double r234423 = sqrt(r234422);
        double r234424 = r234416 - r234423;
        return r234424;
}

double f(double x) {
        double r234425 = exp(1.0);
        double r234426 = 1.0;
        double r234427 = 4.0;
        double r234428 = pow(r234426, r234427);
        double r234429 = 0.5;
        double r234430 = x;
        double r234431 = hypot(r234426, r234430);
        double r234432 = r234426 / r234431;
        double r234433 = r234426 + r234432;
        double r234434 = r234429 * r234433;
        double r234435 = sqrt(r234434);
        double r234436 = pow(r234435, r234427);
        double r234437 = r234428 - r234436;
        double r234438 = log(r234437);
        double r234439 = pow(r234425, r234438);
        double r234440 = r234426 * r234426;
        double r234441 = fma(r234429, r234433, r234440);
        double r234442 = r234439 / r234441;
        double r234443 = r234426 + r234435;
        double r234444 = r234442 / r234443;
        return r234444;
}

Error

Bits error versus x

Derivation

  1. Initial program 15.7

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

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

    \[\leadsto \frac{\color{blue}{1 \cdot 1 - \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  5. Using strategy rm
  6. Applied flip--15.2

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

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

    \[\leadsto \frac{\frac{{1}^{3} \cdot 1 - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{\left(3 + 1\right)}}{\color{blue}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  9. Using strategy rm
  10. Applied add-exp-log15.2

    \[\leadsto \frac{\frac{\color{blue}{e^{\log \left({1}^{3} \cdot 1 - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{\left(3 + 1\right)}\right)}}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  11. Simplified15.2

    \[\leadsto \frac{\frac{e^{\color{blue}{\log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)}}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  12. Using strategy rm
  13. Applied pow115.2

    \[\leadsto \frac{\frac{e^{\log \color{blue}{\left({\left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)}^{1}\right)}}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  14. Applied log-pow15.2

    \[\leadsto \frac{\frac{e^{\color{blue}{1 \cdot \log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)}}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  15. Applied exp-prod15.2

    \[\leadsto \frac{\frac{\color{blue}{{\left(e^{1}\right)}^{\left(\log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)\right)}}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  16. Simplified15.2

    \[\leadsto \frac{\frac{{\color{blue}{e}}^{\left(\log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)\right)}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\]
  17. Final simplification15.2

    \[\leadsto \frac{\frac{{e}^{\left(\log \left({1}^{4} - {\left(\sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)}^{4}\right)\right)}}{\mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\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 2019305 +o rules:numerics
(FPCore (x)
  :name "Given's Rotation SVD example, simplified"
  :precision binary64
  (- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))