1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\begin{array}{l}
\mathbf{if}\;x \le -0.001253099710940862093408454391862960619619:\\
\;\;\;\;\frac{{1}^{3} - {\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}^{\frac{3}{2}}}{\mathsf{fma}\left(1, 1, \mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot \frac{\sqrt{0.5 \cdot \left({1}^{3} + {\left(\frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}\right)}}{\sqrt{1 \cdot 1 + \left(\frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)} - 1 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}}\right)\right)}\\
\mathbf{elif}\;x \le 3.762439779952672451977802037248466149322 \cdot 10^{-4}:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{\frac{{\left({1}^{3}\right)}^{3} - {\left({\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}^{\frac{3}{2}}\right)}^{3}}{\mathsf{fma}\left({\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}^{\frac{3}{2}}, {1}^{3} + {\left(0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)\right)}^{\frac{3}{2}}, {1}^{6}\right)}}{\mathsf{fma}\left(1, 1, \mathsf{fma}\left(0.5, 1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}, 1 \cdot \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\right)\right)}\\
\end{array}double f(double x) {
double r243957 = 1.0;
double r243958 = 0.5;
double r243959 = x;
double r243960 = hypot(r243957, r243959);
double r243961 = r243957 / r243960;
double r243962 = r243957 + r243961;
double r243963 = r243958 * r243962;
double r243964 = sqrt(r243963);
double r243965 = r243957 - r243964;
return r243965;
}
double f(double x) {
double r243966 = x;
double r243967 = -0.001253099710940862;
bool r243968 = r243966 <= r243967;
double r243969 = 1.0;
double r243970 = 3.0;
double r243971 = pow(r243969, r243970);
double r243972 = 0.5;
double r243973 = hypot(r243969, r243966);
double r243974 = r243969 / r243973;
double r243975 = r243969 + r243974;
double r243976 = r243972 * r243975;
double r243977 = 1.5;
double r243978 = pow(r243976, r243977);
double r243979 = r243971 - r243978;
double r243980 = pow(r243974, r243970);
double r243981 = r243971 + r243980;
double r243982 = r243972 * r243981;
double r243983 = sqrt(r243982);
double r243984 = r243969 * r243969;
double r243985 = r243974 * r243974;
double r243986 = r243969 * r243974;
double r243987 = r243985 - r243986;
double r243988 = r243984 + r243987;
double r243989 = sqrt(r243988);
double r243990 = r243983 / r243989;
double r243991 = r243969 * r243990;
double r243992 = fma(r243972, r243975, r243991);
double r243993 = fma(r243969, r243969, r243992);
double r243994 = r243979 / r243993;
double r243995 = 0.00037624397799526725;
bool r243996 = r243966 <= r243995;
double r243997 = 0.25;
double r243998 = 2.0;
double r243999 = pow(r243966, r243998);
double r244000 = sqrt(r243969);
double r244001 = pow(r244000, r243970);
double r244002 = r243999 / r244001;
double r244003 = 1.0;
double r244004 = r244003 / r244000;
double r244005 = 0.1875;
double r244006 = 4.0;
double r244007 = pow(r243966, r244006);
double r244008 = 5.0;
double r244009 = pow(r244000, r244008);
double r244010 = r244007 / r244009;
double r244011 = r244005 * r244010;
double r244012 = fma(r243972, r244004, r244011);
double r244013 = r243972 - r244012;
double r244014 = fma(r243997, r244002, r244013);
double r244015 = sqrt(r243976);
double r244016 = r243969 + r244015;
double r244017 = r244014 / r244016;
double r244018 = pow(r243971, r243970);
double r244019 = pow(r243978, r243970);
double r244020 = r244018 - r244019;
double r244021 = r243971 + r243978;
double r244022 = 6.0;
double r244023 = pow(r243969, r244022);
double r244024 = fma(r243978, r244021, r244023);
double r244025 = r244020 / r244024;
double r244026 = r243969 * r244015;
double r244027 = fma(r243972, r243975, r244026);
double r244028 = fma(r243969, r243969, r244027);
double r244029 = r244025 / r244028;
double r244030 = r243996 ? r244017 : r244029;
double r244031 = r243968 ? r243994 : r244030;
return r244031;
}



Bits error versus x
if x < -0.001253099710940862Initial program 1.1
rmApplied flip3--1.6
Simplified1.1
rmApplied pow1/21.1
Applied pow-pow0.1
Simplified0.1
rmApplied flip3-+0.1
Applied associate-*r/0.1
Applied sqrt-div0.1
if -0.001253099710940862 < x < 0.00037624397799526725Initial program 29.9
rmApplied flip--29.9
Simplified29.9
Taylor expanded around 0 29.9
Simplified0.3
if 0.00037624397799526725 < x Initial program 1.0
rmApplied flip3--1.6
Simplified1.0
rmApplied pow1/21.0
Applied pow-pow0.1
Simplified0.1
rmApplied flip3--1.0
Simplified0.1
Final simplification0.2
herbie shell --seed 2019362 +o rules:numerics
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
:precision binary64
(- 1 (sqrt (* 0.5 (+ 1 (/ 1 (hypot 1 x)))))))