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.01509898314466614:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\frac{-\sqrt{\frac{1}{2}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)}}\right), \left(\frac{\sqrt{\frac{1}{2}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}}\right), \left(\frac{\sqrt{\frac{1}{2}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}}\right)\right) + \mathsf{fma}\left(1, \frac{1}{2}, \left(-\frac{\sqrt{\frac{1}{2}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{\sqrt{\frac{1}{2}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}}\right)\right)}{1 + \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}\\
\mathbf{elif}\;x \le 0.0112517724140347:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right), \frac{-11}{128}, \left(\mathsf{fma}\left(\frac{1}{8}, \left(x \cdot x\right), \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\frac{69}{1024} \cdot \left(x \cdot x\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\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 \frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right)}\right)\right) + \mathsf{fma}\left(\left(-\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right)}\right), \left(\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}\right), \left(\frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{\sqrt{\frac{1}{8}}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}\right)\right)}{\mathsf{fma}\left(\left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right), \left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}\right), \frac{1}{4}\right)}}{1 + \sqrt{\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)} + \frac{1}{2}}}\\
\end{array}double f(double x) {
double r3078483 = 1.0;
double r3078484 = 0.5;
double r3078485 = x;
double r3078486 = hypot(r3078483, r3078485);
double r3078487 = r3078483 / r3078486;
double r3078488 = r3078483 + r3078487;
double r3078489 = r3078484 * r3078488;
double r3078490 = sqrt(r3078489);
double r3078491 = r3078483 - r3078490;
return r3078491;
}
double f(double x) {
double r3078492 = x;
double r3078493 = -0.01509898314466614;
bool r3078494 = r3078492 <= r3078493;
double r3078495 = 0.5;
double r3078496 = sqrt(r3078495);
double r3078497 = -r3078496;
double r3078498 = 1.0;
double r3078499 = hypot(r3078498, r3078492);
double r3078500 = cbrt(r3078499);
double r3078501 = r3078497 / r3078500;
double r3078502 = r3078500 * r3078500;
double r3078503 = r3078496 / r3078502;
double r3078504 = r3078496 / r3078500;
double r3078505 = r3078504 * r3078503;
double r3078506 = fma(r3078501, r3078503, r3078505);
double r3078507 = -r3078505;
double r3078508 = fma(r3078498, r3078495, r3078507);
double r3078509 = r3078506 + r3078508;
double r3078510 = r3078495 / r3078499;
double r3078511 = r3078510 + r3078495;
double r3078512 = sqrt(r3078511);
double r3078513 = r3078498 + r3078512;
double r3078514 = r3078509 / r3078513;
double r3078515 = 0.0112517724140347;
bool r3078516 = r3078492 <= r3078515;
double r3078517 = r3078492 * r3078492;
double r3078518 = r3078517 * r3078517;
double r3078519 = -0.0859375;
double r3078520 = 0.125;
double r3078521 = 0.0673828125;
double r3078522 = r3078521 * r3078517;
double r3078523 = r3078518 * r3078522;
double r3078524 = fma(r3078520, r3078517, r3078523);
double r3078525 = fma(r3078518, r3078519, r3078524);
double r3078526 = sqrt(r3078520);
double r3078527 = -r3078526;
double r3078528 = r3078499 * r3078499;
double r3078529 = r3078527 / r3078528;
double r3078530 = r3078526 / r3078499;
double r3078531 = r3078529 * r3078530;
double r3078532 = fma(r3078498, r3078520, r3078531);
double r3078533 = -r3078530;
double r3078534 = r3078526 / r3078528;
double r3078535 = r3078530 * r3078534;
double r3078536 = fma(r3078533, r3078534, r3078535);
double r3078537 = r3078532 + r3078536;
double r3078538 = 0.25;
double r3078539 = fma(r3078510, r3078511, r3078538);
double r3078540 = r3078537 / r3078539;
double r3078541 = r3078540 / r3078513;
double r3078542 = r3078516 ? r3078525 : r3078541;
double r3078543 = r3078494 ? r3078514 : r3078542;
return r3078543;
}



Bits error versus x
if x < -0.01509898314466614Initial program 1.0
Simplified1.0
rmApplied flip--1.0
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied add-sqr-sqrt0.1
Applied times-frac0.1
Applied *-un-lft-identity0.1
Applied prod-diff0.1
if -0.01509898314466614 < x < 0.0112517724140347Initial program 29.4
Simplified29.4
Taylor expanded around 0 0.0
Simplified0.0
if 0.0112517724140347 < x Initial program 1.0
Simplified1.0
rmApplied flip--1.0
Simplified0.1
rmApplied flip3--0.1
Simplified0.1
Simplified0.1
rmApplied add-sqr-sqrt0.1
Applied times-frac0.1
Applied *-un-lft-identity0.1
Applied prod-diff0.1
Final simplification0.0
herbie shell --seed 2019130 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
(- 1 (sqrt (* 1/2 (+ 1 (/ 1 (hypot 1 x)))))))