CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
approx_asin.h File Reference
#include <cmath>

Go to the source code of this file.

Functions

template<int DEGREE>
float approx_asin_P (float z)
 
template<>
float approx_asin_P< 11 > (float z)
 
template<>
float approx_asin_P< 3 > (float z)
 
template<>
float approx_asin_P< 5 > (float z)
 
template<>
float approx_asin_P< 7 > (float z)
 
template<>
float approx_asin_P< 9 > (float z)
 
template<int DEGREE>
float unsafe_acos (float x)
 
template<int DEGREE>
float unsafe_acos07 (float x)
 
template<int DEGREE>
float unsafe_acos71 (float x)
 
template<int DEGREE>
float unsafe_asin (float x)
 
template<int DEGREE>
float unsafe_asin07 (float x)
 
template<int DEGREE>
float unsafe_asin71 (float x)
 

Function Documentation

template<int DEGREE>
float approx_asin_P ( float  z)
inline
template<>
float approx_asin_P< 11 > ( float  z)
inline

Definition at line 26 of file approx_asin.h.

References f, and detailsBasic3DVector::z.

26  {
27  return 1.f + z * (0.1668075025081634521484375f + z * (7.20207393169403076171875e-2f + z * (6.607978045940399169921875e-2f + z * ((-3.6048568785190582275390625e-2f) + z * 0.10574872791767120361328125f))));
28 }
float float float z
double f[11][100]
template<>
float approx_asin_P< 3 > ( float  z)
inline

Definition at line 10 of file approx_asin.h.

References detailsBasic3DVector::z.

10  {
11  return 1.f + z * 0.2133004963397979736328125f;
12 }
float float float z
template<>
float approx_asin_P< 5 > ( float  z)
inline

Definition at line 14 of file approx_asin.h.

References detailsBasic3DVector::z.

14  {
15  return 1.f + z * (0.154711246490478515625f + z * 0.1322681009769439697265625f);
16 }
float float float z
template<>
float approx_asin_P< 7 > ( float  z)
inline

Definition at line 18 of file approx_asin.h.

References f, and detailsBasic3DVector::z.

18  {
19  return 1.f + z * (0.169519245624542236328125f + z * (4.9031913280487060546875e-2f + z * 0.10941398143768310546875));
20 }
float float float z
double f[11][100]
template<>
float approx_asin_P< 9 > ( float  z)
inline

Definition at line 22 of file approx_asin.h.

References f, and detailsBasic3DVector::z.

22  {
23  return 1.f + z * (0.166020572185516357421875f + z * (8.44048559665679931640625e-2f + z * (1.11602735705673694610595703125e-3f + z * 0.103476583957672119140625f)));
24 }
float float float z
double f[11][100]
template<int DEGREE>
float unsafe_acos ( float  x)
inline

Definition at line 90 of file approx_asin.h.

References funct::abs(), f, and x().

90  {
91  return (std::abs(x)<0.71f) ? unsafe_acos07<DEGREE>(x) : unsafe_acos71<DEGREE>(x);
92 }
T x() const
Cartesian x coordinate.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
template<int DEGREE>
float unsafe_acos07 ( float  x)
inline

Definition at line 63 of file approx_asin.h.

References constexpr, M_PI, and x().

63  {
64  constexpr float pihalf = M_PI/2;
65  return pihalf - unsafe_asin07<DEGREE>(x);
66 }
#define constexpr
T x() const
Cartesian x coordinate.
#define M_PI
template<int DEGREE>
float unsafe_acos71 ( float  x)
inline

Definition at line 71 of file approx_asin.h.

References constexpr, M_PI, pi, mathSSE::sqrt(), x(), and detailsBasic3DVector::z.

71  {
72  constexpr float pi = M_PI;
73  auto z=1.f-x*x;
74  z= std::sqrt(z)*approx_asin_P<DEGREE>(z);
75  return x>0 ? z : pi-z;
76 }
#define constexpr
float float float z
const Double_t pi
T x() const
Cartesian x coordinate.
T sqrt(T t)
Definition: SSEVec.h:18
#define M_PI
template<int DEGREE>
float unsafe_asin ( float  x)
inline

Definition at line 85 of file approx_asin.h.

References funct::abs(), f, and x().

85  {
86  return (std::abs(x)<0.71f) ? unsafe_asin07<DEGREE>(x) : unsafe_asin71<DEGREE>(x);
87 }
T x() const
Cartesian x coordinate.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
template<int DEGREE>
float unsafe_asin07 ( float  x)
inline

Definition at line 57 of file approx_asin.h.

References x(), and detailsBasic3DVector::z.

57  {
58  auto z=x*x;
59  return x*approx_asin_P<DEGREE>(z);
60 }
float float float z
T x() const
Cartesian x coordinate.
template<int DEGREE>
float unsafe_asin71 ( float  x)
inline

Definition at line 79 of file approx_asin.h.

References constexpr, M_PI, and x().

79  {
80  constexpr float pihalf = M_PI/2;
81  return pihalf - unsafe_acos71<DEGREE>(x);
82 }
#define constexpr
T x() const
Cartesian x coordinate.
#define M_PI