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.010775316190533964:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{512} - \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)} \cdot \left(\frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)} \cdot \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}\right)}{\mathsf{fma}\left(\frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}, \frac{1}{8} + \frac{\frac{\frac{1}{8}}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}, \frac{1}{64}\right)}}{\mathsf{fma}\left(\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}, \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}, \frac{1}{4}\right)}}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\\
\mathbf{elif}\;x \le 0.012795833219468917:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{4}, x \cdot x, \mathsf{fma}\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right), \frac{5}{32}, \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \frac{-3}{16}\right)\right)}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{2} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}\right)\right)}{1 + \sqrt{\frac{1}{2} + \frac{\frac{1}{2}}{\mathsf{hypot}\left(1, x\right)}}}\\
\end{array}double f(double x) {
double r4601290 = 1.0;
double r4601291 = 0.5;
double r4601292 = x;
double r4601293 = hypot(r4601290, r4601292);
double r4601294 = r4601290 / r4601293;
double r4601295 = r4601290 + r4601294;
double r4601296 = r4601291 * r4601295;
double r4601297 = sqrt(r4601296);
double r4601298 = r4601290 - r4601297;
return r4601298;
}
double f(double x) {
double r4601299 = x;
double r4601300 = -0.010775316190533964;
bool r4601301 = r4601299 <= r4601300;
double r4601302 = 0.001953125;
double r4601303 = 0.125;
double r4601304 = 1.0;
double r4601305 = hypot(r4601304, r4601299);
double r4601306 = r4601303 / r4601305;
double r4601307 = r4601305 * r4601305;
double r4601308 = r4601306 / r4601307;
double r4601309 = r4601308 * r4601308;
double r4601310 = r4601308 * r4601309;
double r4601311 = r4601302 - r4601310;
double r4601312 = r4601303 + r4601308;
double r4601313 = 0.015625;
double r4601314 = fma(r4601308, r4601312, r4601313);
double r4601315 = r4601311 / r4601314;
double r4601316 = 0.5;
double r4601317 = r4601316 / r4601305;
double r4601318 = r4601316 + r4601317;
double r4601319 = 0.25;
double r4601320 = fma(r4601318, r4601317, r4601319);
double r4601321 = r4601315 / r4601320;
double r4601322 = sqrt(r4601318);
double r4601323 = r4601304 + r4601322;
double r4601324 = r4601321 / r4601323;
double r4601325 = 0.012795833219468917;
bool r4601326 = r4601299 <= r4601325;
double r4601327 = r4601299 * r4601299;
double r4601328 = r4601327 * r4601327;
double r4601329 = r4601328 * r4601327;
double r4601330 = 0.15625;
double r4601331 = -0.1875;
double r4601332 = r4601328 * r4601331;
double r4601333 = fma(r4601329, r4601330, r4601332);
double r4601334 = fma(r4601319, r4601327, r4601333);
double r4601335 = r4601334 / r4601323;
double r4601336 = expm1(r4601317);
double r4601337 = log1p(r4601336);
double r4601338 = r4601316 - r4601337;
double r4601339 = r4601338 / r4601323;
double r4601340 = r4601326 ? r4601335 : r4601339;
double r4601341 = r4601301 ? r4601324 : r4601340;
return r4601341;
}



Bits error versus x
if x < -0.010775316190533964Initial program 1.0
Simplified1.0
rmApplied flip--1.0
Simplified0.0
rmApplied flip3--0.1
Simplified0.1
Simplified0.1
rmApplied associate-/r*0.1
rmApplied flip3--0.1
Simplified0.1
Simplified0.1
if -0.010775316190533964 < x < 0.012795833219468917Initial program 29.4
Simplified29.4
rmApplied flip--29.5
Simplified29.4
Taylor expanded around 0 0.0
Simplified0.0
if 0.012795833219468917 < x Initial program 1.0
Simplified1.0
rmApplied flip--1.0
Simplified0.1
rmApplied log1p-expm1-u0.1
Final simplification0.0
herbie shell --seed 2019138 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
(- 1 (sqrt (* 1/2 (+ 1 (/ 1 (hypot 1 x)))))))