CMS 3D CMS Logo

Functions
approx_asin.h File Reference
#include <cmath>

Go to the source code of this file.

Functions

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

Function Documentation

◆ approx_asin_P()

template<int DEGREE>
constexpr float approx_asin_P ( float  z)
constexpr

◆ approx_asin_P< 11 >()

template<>
constexpr float approx_asin_P< 11 > ( float  z)
constexpr

Definition at line 32 of file approx_asin.h.

32  {
33  return 1.f + z * (0.1668075025081634521484375f +
34  z * (7.20207393169403076171875e-2f +
35  z * (6.607978045940399169921875e-2f +
36  z * ((-3.6048568785190582275390625e-2f) + z * 0.10574872791767120361328125f))));
37 }

References f, and detailsBasic3DVector::z.

◆ approx_asin_P< 3 >()

template<>
constexpr float approx_asin_P< 3 > ( float  z)
constexpr

Definition at line 10 of file approx_asin.h.

10  {
11  return 1.f + z * 0.2133004963397979736328125f;
12 }

References detailsBasic3DVector::z.

◆ approx_asin_P< 5 >()

template<>
constexpr float approx_asin_P< 5 > ( float  z)
constexpr

Definition at line 15 of file approx_asin.h.

15  {
16  return 1.f + z * (0.154711246490478515625f + z * 0.1322681009769439697265625f);
17 }

References detailsBasic3DVector::z.

◆ approx_asin_P< 7 >()

template<>
constexpr float approx_asin_P< 7 > ( float  z)
constexpr

Definition at line 20 of file approx_asin.h.

20  {
21  return 1.f + z * (0.169519245624542236328125f + z * (4.9031913280487060546875e-2f + z * 0.10941398143768310546875));
22 }

References f, and detailsBasic3DVector::z.

◆ approx_asin_P< 9 >()

template<>
constexpr float approx_asin_P< 9 > ( float  z)
constexpr

Definition at line 25 of file approx_asin.h.

25  {
26  return 1.f + z * (0.166020572185516357421875f +
27  z * (8.44048559665679931640625e-2f +
28  z * (1.11602735705673694610595703125e-3f + z * 0.103476583957672119140625f)));
29 }

References f, and detailsBasic3DVector::z.

◆ unsafe_acos()

template<int DEGREE>
constexpr float unsafe_acos ( float  x)
constexpr

Definition at line 96 of file approx_asin.h.

96  {
97  return (std::abs(x) < 0.71f) ? unsafe_acos07<DEGREE>(x) : unsafe_acos71<DEGREE>(x);
98 }

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

◆ unsafe_acos07()

template<int DEGREE>
constexpr float unsafe_acos07 ( float  x)
constexpr

Definition at line 70 of file approx_asin.h.

70  {
71  constexpr float pihalf = M_PI / 2;
72  return pihalf - unsafe_asin07<DEGREE>(x);
73 }

References M_PI, and vertices_cff::x.

◆ unsafe_acos71()

template<int DEGREE>
constexpr float unsafe_acos71 ( float  x)
constexpr

Definition at line 77 of file approx_asin.h.

77  {
78  constexpr float pi = M_PI;
79  auto z = 1.f - x * x;
80  z = std::sqrt(z) * approx_asin_P<DEGREE>(z);
81  return x > 0 ? z : pi - z;
82 }

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

◆ unsafe_asin()

template<int DEGREE>
constexpr float unsafe_asin ( float  x)
constexpr

Definition at line 91 of file approx_asin.h.

91  {
92  return (std::abs(x) < 0.71f) ? unsafe_asin07<DEGREE>(x) : unsafe_asin71<DEGREE>(x);
93 }

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

◆ unsafe_asin07()

template<int DEGREE>
constexpr float unsafe_asin07 ( float  x)
constexpr

Definition at line 64 of file approx_asin.h.

64  {
65  auto z = x * x;
66  return x * approx_asin_P<DEGREE>(z);
67 }

References vertices_cff::x, and detailsBasic3DVector::z.

◆ unsafe_asin71()

template<int DEGREE>
constexpr float unsafe_asin71 ( float  x)
constexpr

Definition at line 85 of file approx_asin.h.

85  {
86  constexpr float pihalf = M_PI / 2;
87  return pihalf - unsafe_acos71<DEGREE>(x);
88 }

References M_PI, and vertices_cff::x.

f
double f[11][100]
Definition: MuScleFitUtils.cc:78
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
unsafe_asin71
constexpr float unsafe_asin71(float x)
Definition: approx_asin.h:85
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
vertices_cff.x
x
Definition: vertices_cff.py:29
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
unsafe_acos71
constexpr float unsafe_acos71(float x)
Definition: approx_asin.h:77
pi
const Double_t pi
Definition: trackSplitPlot.h:36
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22