1 - \sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\begin{array}{l}
\mathbf{if}\;x \le -0.01161705812947232:\\
\;\;\;\;\frac{\mathsf{fma}\left(1, \frac{1}{8}, \left(\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)} \cdot \left(-\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right)}\right)\right)\right)}{\sqrt{1 + \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}} \cdot \left(\left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right) + \frac{1}{4}\right)} \cdot \frac{1}{\sqrt{1 + \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}}\\
\mathbf{elif}\;x \le 0.01069117617427654:\\
\;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right), \left(\mathsf{fma}\left(\frac{69}{1024}, \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \frac{1}{8}\right)\right), \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{-11}{128}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(1, \frac{1}{8}, \left(\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)} \cdot \left(-\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right)}\right)\right)\right)}{\sqrt{1 + \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}} \cdot \left(\left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right) + \frac{1}{4}\right)} \cdot \frac{1}{\sqrt{1 + \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}}\\
\end{array}double f(double x) {
double r41626579 = 1.0;
double r41626580 = 0.5;
double r41626581 = x;
double r41626582 = hypot(r41626579, r41626581);
double r41626583 = r41626579 / r41626582;
double r41626584 = r41626579 + r41626583;
double r41626585 = r41626580 * r41626584;
double r41626586 = sqrt(r41626585);
double r41626587 = r41626579 - r41626586;
return r41626587;
}
double f(double x) {
double r41626588 = x;
double r41626589 = -0.01161705812947232;
bool r41626590 = r41626588 <= r41626589;
double r41626591 = 1.0;
double r41626592 = 0.125;
double r41626593 = sqrt(r41626592);
double r41626594 = hypot(r41626591, r41626588);
double r41626595 = r41626594 * r41626594;
double r41626596 = r41626593 / r41626595;
double r41626597 = r41626593 / r41626594;
double r41626598 = -r41626597;
double r41626599 = r41626596 * r41626598;
double r41626600 = fma(r41626591, r41626592, r41626599);
double r41626601 = 0.5;
double r41626602 = r41626601 / r41626594;
double r41626603 = r41626602 + r41626601;
double r41626604 = sqrt(r41626603);
double r41626605 = r41626591 + r41626604;
double r41626606 = sqrt(r41626605);
double r41626607 = r41626602 * r41626601;
double r41626608 = r41626602 * r41626602;
double r41626609 = r41626607 + r41626608;
double r41626610 = 0.25;
double r41626611 = r41626609 + r41626610;
double r41626612 = r41626606 * r41626611;
double r41626613 = r41626600 / r41626612;
double r41626614 = r41626591 / r41626606;
double r41626615 = r41626613 * r41626614;
double r41626616 = 0.01069117617427654;
bool r41626617 = r41626588 <= r41626616;
double r41626618 = r41626588 * r41626588;
double r41626619 = 0.0673828125;
double r41626620 = r41626618 * r41626618;
double r41626621 = fma(r41626619, r41626620, r41626592);
double r41626622 = -0.0859375;
double r41626623 = r41626620 * r41626622;
double r41626624 = fma(r41626618, r41626621, r41626623);
double r41626625 = r41626617 ? r41626624 : r41626615;
double r41626626 = r41626590 ? r41626615 : r41626625;
return r41626626;
}



Bits error versus x
if x < -0.01161705812947232 or 0.01069117617427654 < x Initial program 1.0
Simplified1.0
rmApplied flip--1.0
rmApplied add-sqr-sqrt1.6
Applied *-un-lft-identity1.6
Applied times-frac1.0
Simplified0.1
rmApplied flip3--0.1
Applied associate-/l/0.1
Simplified0.1
rmApplied add-sqr-sqrt0.1
Applied times-frac0.1
Applied *-un-lft-identity0.1
Applied prod-diff0.1
Simplified0.1
if -0.01161705812947232 < x < 0.01069117617427654Initial program 30.6
Simplified30.6
Taylor expanded around 0 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019120 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
(- 1 (sqrt (* 1/2 (+ 1 (/ 1 (hypot 1 x)))))))