1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\begin{array}{l}
\mathbf{if}\;x \le -9.494777107334507744267060314058426229167 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{{\left(1 \cdot 1\right)}^{3} \cdot {\left(1 \cdot 1\right)}^{3} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} \cdot {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}{{\left(1 \cdot 1\right)}^{3} \cdot \mathsf{fma}\left(1, {1}^{3}, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)\right) + {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3} \cdot \mathsf{fma}\left(1, {1}^{3}, \mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\\
\mathbf{elif}\;x \le 6.663327301348302570196957539394588820869 \cdot 10^{-4}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{0.25}{{\left(\sqrt{1}\right)}^{3}}, {x}^{2}, 0.5 - \mathsf{fma}\left(\frac{0.1875}{{\left(\sqrt{1}\right)}^{5}}, {x}^{4}, \frac{0.5}{\sqrt{1}}\right)\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{\left(1 \cdot 1\right)}^{3} - {\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}}{\mathsf{fma}\left(1, {1}^{3}, \mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(1, 1, 0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right) \cdot \left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)\right)\right)\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\\
\end{array}double f(double x) {
double r305431 = 1.0;
double r305432 = 0.5;
double r305433 = x;
double r305434 = hypot(r305431, r305433);
double r305435 = r305431 / r305434;
double r305436 = r305431 + r305435;
double r305437 = r305432 * r305436;
double r305438 = sqrt(r305437);
double r305439 = r305431 - r305438;
return r305439;
}
double f(double x) {
double r305440 = x;
double r305441 = -9.494777107334508e-05;
bool r305442 = r305440 <= r305441;
double r305443 = 1.0;
double r305444 = r305443 * r305443;
double r305445 = 3.0;
double r305446 = pow(r305444, r305445);
double r305447 = r305446 * r305446;
double r305448 = hypot(r305443, r305440);
double r305449 = r305443 / r305448;
double r305450 = r305443 + r305449;
double r305451 = 0.5;
double r305452 = r305450 * r305451;
double r305453 = pow(r305452, r305445);
double r305454 = r305453 * r305453;
double r305455 = r305447 - r305454;
double r305456 = pow(r305443, r305445);
double r305457 = r305451 * r305450;
double r305458 = fma(r305443, r305443, r305457);
double r305459 = r305458 * r305452;
double r305460 = fma(r305443, r305456, r305459);
double r305461 = r305446 * r305460;
double r305462 = r305453 * r305460;
double r305463 = r305461 + r305462;
double r305464 = r305455 / r305463;
double r305465 = sqrt(r305457);
double r305466 = r305443 + r305465;
double r305467 = r305464 / r305466;
double r305468 = 0.0006663327301348303;
bool r305469 = r305440 <= r305468;
double r305470 = 0.25;
double r305471 = sqrt(r305443);
double r305472 = pow(r305471, r305445);
double r305473 = r305470 / r305472;
double r305474 = 2.0;
double r305475 = pow(r305440, r305474);
double r305476 = 0.1875;
double r305477 = 5.0;
double r305478 = pow(r305471, r305477);
double r305479 = r305476 / r305478;
double r305480 = 4.0;
double r305481 = pow(r305440, r305480);
double r305482 = r305451 / r305471;
double r305483 = fma(r305479, r305481, r305482);
double r305484 = r305451 - r305483;
double r305485 = fma(r305473, r305475, r305484);
double r305486 = r305485 / r305466;
double r305487 = r305446 - r305453;
double r305488 = log1p(r305459);
double r305489 = expm1(r305488);
double r305490 = fma(r305443, r305456, r305489);
double r305491 = r305487 / r305490;
double r305492 = r305491 / r305466;
double r305493 = r305469 ? r305486 : r305492;
double r305494 = r305442 ? r305467 : r305493;
return r305494;
}



Bits error versus x
if x < -9.494777107334508e-05Initial program 1.2
rmApplied flip--1.2
Simplified0.2
rmApplied flip3--0.2
Simplified0.2
rmApplied flip--0.2
Applied associate-/l/0.2
rmApplied distribute-rgt-in0.2
if -9.494777107334508e-05 < x < 0.0006663327301348303Initial program 30.0
rmApplied flip--30.0
Simplified30.0
Taylor expanded around 0 30.0
Simplified0.2
if 0.0006663327301348303 < x Initial program 1.1
rmApplied flip--1.1
Simplified0.1
rmApplied flip3--0.1
Simplified0.1
rmApplied expm1-log1p-u0.1
Final simplification0.2
herbie shell --seed 2019323 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
:precision binary64
(- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))