4 #include "vdt/sincos.h" 10 x = par.constAt(ti, 0, 0);
11 y = par.constAt(ti, 1, 0);
12 z = par.constAt(ti, 2, 0);
13 const float pt = 1.0f / par.constAt(ti, 3, 0);
28 const float k = 1.0f /
inv_k;
31 const float oo_curv = 1.0f / curv;
42 float td = (
R - r0) * curv;
43 float id = oo_curv * td * (1.0f + 0.16666666f * td * td);
53 vdt::fast_sincosf(
alpha, sina, cosa);
57 c.x +=
k * (
c.px * sina -
c.py * (1.0f - cosa));
58 c.y +=
k * (
c.py * sina +
c.px * (1.0f - cosa));
60 const float o_px =
c.px;
61 c.px =
c.px * cosa -
c.py * sina;
62 c.py =
c.py * cosa + o_px * sina;
81 const float k = 1.0f /
inv_k;
83 const float dz =
Z -
z;
87 vdt::fast_sincosf(
alpha, sina, cosa);
90 c.x =
x +
k * (
px * sina -
py * (1.0f - cosa));
91 c.y =
y +
k * (
py * sina +
px * (1.0f - cosa));
94 if (update_momentum) {
95 c.px =
px * cosa -
py * sina;
96 c.py =
py * cosa +
px * sina;
111 for (
int i = 0;
i < y.kTotSize; ++
i) {
112 t[
i] = vdt::fast_atan2f(y[
i],
x[
i]);
119 for (
int i = 0;
i <
a.kTotSize; ++
i) {
120 t[
i] = vdt::fast_tanf(
a[
i]);
126 for (
int i = 0;
i <
a.kTotSize; ++
i) {
127 vdt::fast_sincosf(
a[
i],
s[
i],
c[
i]);
132 x = par.ReduceFixedIJ(0, 0);
133 y = par.ReduceFixedIJ(1, 0);
134 z = par.ReduceFixedIJ(2, 0);
135 const MPF pt = 1.0f / par.ReduceFixedIJ(3, 0);
156 const MPF oo_curv = 1.0f / curv;
167 MPF td = (
R - r0) * curv;
168 MPF id = oo_curv * td * (1.0f + 0.16666666f * td * td);
183 c.x +=
k * (
c.px * sina -
c.py * (1.0f - cosa));
184 c.y +=
k * (
c.py * sina +
c.px * (1.0f - cosa));
187 c.px =
c.px * cosa -
c.py * sina;
188 c.py =
c.py * cosa + o_px * sina;
199 for (
int i = 0;
i < N_proc; ++
i) {
226 c.x =
x +
k * (
px * sina -
py * (1.0f - cosa));
227 c.y =
y +
k * (
py * sina +
px * (1.0f - cosa));
230 if (update_momentum) {
231 c.px =
px * cosa -
py * sina;
232 c.py =
py * cosa +
px * sina;
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Sin< T >::type sin(const T &t)
int propagate_to_r(PropAlgo_e algo, const MPF &R, StatePlex &c, bool update_momentum, int N_proc=NN) const
int propagate_to_z(PropAlgo_e algo, const MPF &Z, StatePlex &c, bool update_momentum, int N_proc=NN) const
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
bool propagate_to_z(PropAlgo_e algo, float Z, State &c, bool update_momentum) const
Cos< T >::type cos(const T &t)
MPF fast_tan(const MPF &a)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
DecomposeProduct< arg, typename Div::arg > D
MPF fast_atan2(const MPF &y, const MPF &x)
void fast_sincos(const MPF &a, MPF &s, MPF &c)
bool propagate_to_r(PropAlgo_e algo, float R, State &c, bool update_momentum) const