1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\begin{array}{l}
\mathbf{if}\;x \le -1.0893735711112895 \cdot 10^{-4}:\\
\;\;\;\;e^{\log \left(\frac{\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)}}\right)}\\
\mathbf{elif}\;x \le 0.0020644081023471453:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.25, \frac{{x}^{2}}{{\left(\sqrt{1}\right)}^{3}}, 0.5 - \mathsf{fma}\left(0.5, \frac{1}{\sqrt{1}}, 0.1875 \cdot \frac{{x}^{4}}{{\left(\sqrt{1}\right)}^{5}}\right)\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(\log \left(\frac{\log \left(e^{\mathsf{fma}\left(-0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot 1\right)}\right)}{1 + \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\right)\right)}\\
\end{array}double f(double x) {
double r281254 = 1.0;
double r281255 = 0.5;
double r281256 = x;
double r281257 = hypot(r281254, r281256);
double r281258 = r281254 / r281257;
double r281259 = r281254 + r281258;
double r281260 = r281255 * r281259;
double r281261 = sqrt(r281260);
double r281262 = r281254 - r281261;
return r281262;
}
double f(double x) {
double r281263 = x;
double r281264 = -0.00010893735711112895;
bool r281265 = r281263 <= r281264;
double r281266 = 0.5;
double r281267 = -r281266;
double r281268 = 1.0;
double r281269 = hypot(r281268, r281263);
double r281270 = r281268 / r281269;
double r281271 = r281268 + r281270;
double r281272 = r281268 * r281268;
double r281273 = fma(r281267, r281271, r281272);
double r281274 = r281266 * r281271;
double r281275 = sqrt(r281274);
double r281276 = r281268 + r281275;
double r281277 = r281273 / r281276;
double r281278 = log(r281277);
double r281279 = exp(r281278);
double r281280 = 0.0020644081023471453;
bool r281281 = r281263 <= r281280;
double r281282 = 0.25;
double r281283 = 2.0;
double r281284 = pow(r281263, r281283);
double r281285 = sqrt(r281268);
double r281286 = 3.0;
double r281287 = pow(r281285, r281286);
double r281288 = r281284 / r281287;
double r281289 = 1.0;
double r281290 = r281289 / r281285;
double r281291 = 0.1875;
double r281292 = 4.0;
double r281293 = pow(r281263, r281292);
double r281294 = 5.0;
double r281295 = pow(r281285, r281294);
double r281296 = r281293 / r281295;
double r281297 = r281291 * r281296;
double r281298 = fma(r281266, r281290, r281297);
double r281299 = r281266 - r281298;
double r281300 = fma(r281282, r281288, r281299);
double r281301 = r281300 / r281276;
double r281302 = exp(1.0);
double r281303 = exp(r281273);
double r281304 = log(r281303);
double r281305 = r281304 / r281276;
double r281306 = log(r281305);
double r281307 = pow(r281302, r281306);
double r281308 = r281281 ? r281301 : r281307;
double r281309 = r281265 ? r281279 : r281308;
return r281309;
}



Bits error versus x
if x < -0.00010893735711112895Initial program 1.2
rmApplied flip--1.2
Simplified0.2
rmApplied add-exp-log0.2
Applied add-exp-log0.2
Applied div-exp0.2
Simplified0.2
if -0.00010893735711112895 < x < 0.0020644081023471453Initial program 30.0
rmApplied flip--30.0
Simplified30.0
Taylor expanded around 0 30.0
Simplified0.2
if 0.0020644081023471453 < x Initial program 1.0
rmApplied flip--1.0
Simplified0.1
rmApplied add-exp-log0.1
Applied add-exp-log0.1
Applied div-exp0.1
Simplified0.1
rmApplied add-log-exp0.1
rmApplied pow10.1
Applied log-pow0.1
Applied exp-prod0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2020047 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
:precision binary64
(- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))