diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-11-28 09:39:50 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-11-28 09:39:50 -0500 |
commit | 2d47971cd11677ede752786be93ad821ef2d8e87 (patch) | |
tree | 3d46d398612a431bccb0c74ce5609345dc34a1db | |
parent | c5a019d1cd72089619431de2c56aace44c96e245 (diff) | |
download | vecmathlib-2d47971cd11677ede752786be93ad821ef2d8e87.zip vecmathlib-2d47971cd11677ede752786be93ad821ef2d8e87.tar.gz |
Indent
-rw-r--r-- | mathfuncs_asin.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mathfuncs_asin.h b/mathfuncs_asin.h index ce15fe9..3dd9c75 100644 --- a/mathfuncs_asin.h +++ b/mathfuncs_asin.h @@ -181,16 +181,22 @@ namespace vecmathlib { template<typename realvec_t> realvec_t mathfuncs<realvec_t>::vml_atan2(realvec_t y, realvec_t x) { + // Algorithm taken from SLEEF 2.80 + realvec_t r = atan2k(fabs(y), x); r = mulsign(r, x); r = ifthen(isinf(x) || x == RV(0.0), - ifthen(isinf(x), RV(M_PI_2) - copysign(RV(M_PI_2), x), RV(M_PI_2)), + ifthen(isinf(x), + RV(M_PI_2) - copysign(RV(M_PI_2), x), + RV(M_PI_2)), r); r = ifthen(isinf(y), - ifthen(isinf(x), RV(M_PI_2) - copysign(RV(M_PI_4), x), RV(M_PI_2)), + ifthen(isinf(x), + RV(M_PI_2) - copysign(RV(M_PI_4), x), + RV(M_PI_2)), r); r = ifthen(y == RV(0.0), |