1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\begin{array}{l}
\mathbf{if}\;x \le -0.002150518847943041871040303902873347396962:\\
\;\;\;\;\frac{1 \cdot 1 - \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5}{1 + \sqrt{0.5 \cdot \left(1 + \log \left(e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}\\
\mathbf{elif}\;x \le 0.001774327303338343181371428158854541834444:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.25, \frac{{x}^{2}}{{\left(\sqrt{1}\right)}^{3}}, 0.5 - \mathsf{fma}\left(\frac{{x}^{4}}{{\left(\sqrt{1}\right)}^{5}}, 0.1875, \frac{0.5}{\sqrt{1}}\right)\right)}{1 + \sqrt{0.5 \cdot \left(1 + \log \left(e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{1}^{6} - \mathsf{expm1}\left(\mathsf{log1p}\left({\left(\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right)}^{3}\right)\right)}{\mathsf{fma}\left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 0.5 \cdot \mathsf{fma}\left(1, 1, \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right) \cdot 0.5\right), {1}^{4}\right)}}{1 + \sqrt{0.5 \cdot \left(1 + \log \left(e^{\frac{1}{\mathsf{hypot}\left(1, x\right)}}\right)\right)}}\\
\end{array}double f(double x) {
double r125592 = 1.0;
double r125593 = 0.5;
double r125594 = x;
double r125595 = hypot(r125592, r125594);
double r125596 = r125592 / r125595;
double r125597 = r125592 + r125596;
double r125598 = r125593 * r125597;
double r125599 = sqrt(r125598);
double r125600 = r125592 - r125599;
return r125600;
}
double f(double x) {
double r125601 = x;
double r125602 = -0.002150518847943042;
bool r125603 = r125601 <= r125602;
double r125604 = 1.0;
double r125605 = r125604 * r125604;
double r125606 = hypot(r125604, r125601);
double r125607 = r125604 / r125606;
double r125608 = r125604 + r125607;
double r125609 = 0.5;
double r125610 = r125608 * r125609;
double r125611 = r125605 - r125610;
double r125612 = exp(r125607);
double r125613 = log(r125612);
double r125614 = r125604 + r125613;
double r125615 = r125609 * r125614;
double r125616 = sqrt(r125615);
double r125617 = r125604 + r125616;
double r125618 = r125611 / r125617;
double r125619 = 0.0017743273033383432;
bool r125620 = r125601 <= r125619;
double r125621 = 0.25;
double r125622 = 2.0;
double r125623 = pow(r125601, r125622);
double r125624 = sqrt(r125604);
double r125625 = 3.0;
double r125626 = pow(r125624, r125625);
double r125627 = r125623 / r125626;
double r125628 = 4.0;
double r125629 = pow(r125601, r125628);
double r125630 = 5.0;
double r125631 = pow(r125624, r125630);
double r125632 = r125629 / r125631;
double r125633 = 0.1875;
double r125634 = r125609 / r125624;
double r125635 = fma(r125632, r125633, r125634);
double r125636 = r125609 - r125635;
double r125637 = fma(r125621, r125627, r125636);
double r125638 = r125637 / r125617;
double r125639 = 6.0;
double r125640 = pow(r125604, r125639);
double r125641 = pow(r125610, r125625);
double r125642 = log1p(r125641);
double r125643 = expm1(r125642);
double r125644 = r125640 - r125643;
double r125645 = fma(r125604, r125604, r125610);
double r125646 = r125609 * r125645;
double r125647 = pow(r125604, r125628);
double r125648 = fma(r125608, r125646, r125647);
double r125649 = r125644 / r125648;
double r125650 = r125649 / r125617;
double r125651 = r125620 ? r125638 : r125650;
double r125652 = r125603 ? r125618 : r125651;
return r125652;
}



Bits error versus x
if x < -0.002150518847943042Initial program 1.0
rmApplied flip--1.0
Simplified0.1
rmApplied add-log-exp0.1
if -0.002150518847943042 < x < 0.0017743273033383432Initial program 29.9
rmApplied flip--29.9
Simplified29.9
rmApplied add-log-exp29.9
Taylor expanded around 0 29.9
Simplified0.2
if 0.0017743273033383432 < x Initial program 1.0
rmApplied flip--1.0
Simplified0.1
rmApplied add-log-exp0.1
rmApplied flip3--0.1
Simplified0.1
Simplified0.1
rmApplied expm1-log1p-u0.1
Final simplification0.2
herbie shell --seed 2019325 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
:precision binary64
(- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))