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)

◆ approx_asin_P< 11 >()

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

Definition at line 32 of file approx_asin.h.

References f, and ctppsOpticalFunctions_non_DB_cff::z.

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 }
double f[11][100]

◆ approx_asin_P< 3 >()

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

Definition at line 10 of file approx_asin.h.

References ctppsOpticalFunctions_non_DB_cff::z.

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

◆ approx_asin_P< 5 >()

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

Definition at line 15 of file approx_asin.h.

References ctppsOpticalFunctions_non_DB_cff::z.

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

◆ approx_asin_P< 7 >()

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

Definition at line 20 of file approx_asin.h.

References f, and ctppsOpticalFunctions_non_DB_cff::z.

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

◆ approx_asin_P< 9 >()

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

Definition at line 25 of file approx_asin.h.

References f, and ctppsOpticalFunctions_non_DB_cff::z.

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

◆ unsafe_acos()

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

Definition at line 96 of file approx_asin.h.

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

96  {
97  return (std::abs(x) < 0.71f) ? unsafe_acos07<DEGREE>(x) : unsafe_acos71<DEGREE>(x);
98 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float x

◆ unsafe_acos07()

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

Definition at line 70 of file approx_asin.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), M_PI, and x.

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

◆ unsafe_acos71()

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

Definition at line 77 of file approx_asin.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), M_PI, pi, mathSSE::sqrt(), x, and ctppsOpticalFunctions_non_DB_cff::z.

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 }
const Double_t pi
T sqrt(T t)
Definition: SSEVec.h:23
#define M_PI
float x

◆ unsafe_asin()

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

Definition at line 91 of file approx_asin.h.

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

91  {
92  return (std::abs(x) < 0.71f) ? unsafe_asin07<DEGREE>(x) : unsafe_asin71<DEGREE>(x);
93 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float x

◆ unsafe_asin07()

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

Definition at line 64 of file approx_asin.h.

References x, and ctppsOpticalFunctions_non_DB_cff::z.

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

◆ unsafe_asin71()

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

Definition at line 85 of file approx_asin.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), M_PI, and x.

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