15 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 24 #include "vdt/vdtMath.h" 27 void sincosint(
float x,
float& sint,
float& cint);
31 int dzero(
float a,
float b,
float& x0,
float& rv,
float eps,
int mxf,
F func);
44 const float xp[9] = {9.29, 2.47, .89, .36, .15, .07, .03, .02, 0.0};
45 const float xq[7] = {.012, .03, .08, .26, .87, 3.83, 11.0};
47 float q, u,
x,
c1, c2, c3, c4,
d1, h4, h5, h6, q2,
x1,
d, ll, ul, xf1, xf2, rv;
61 float invKappa = 1.f /
kappa;
62 h_[4] = 1.f - beta2 * 0.42278433999999998f + (7.6f * invKappa);
65 h4 = -(7.6f * invKappa) - (beta2 * .57721566
f + 1.
f);
74 for (lp = 0; lp < 9; ++lp) {
78 ll = -
float(lp) - 1.5f;
79 for (lq = 0; lq < 7; ++lq) {
84 auto f2 = [h_](
float x) {
93 h_[0] =
kappa * (beta2 * .57721566f + 2.f) + 9.9166128600000008
f;
97 h_[1] = beta2 *
kappa;
99 h_[3] =
omega_ * 1.5707963250000001f;
106 a_[
n - 1] =
omega_ * .31830988654751274f;
110 for (
k = 1;
k <
n; ++
k) {
116 vdt::fast_sincosf(
x1, c3, c4);
117 xf1 =
kappa * (beta2 *
c1 - c4) -
x * c2;
120 vdt::fast_sincosf(xf2,
s,
c);
129 a_[
n - 1] += q2 *
a_[
l - 1];
145 const float xp[9] = {9.29, 2.47, .89, .36, .15, .07, .03, .02, 0.0};
146 const float xq[7] = {.012, .03, .08, .26, .87, 3.83, 11.0};
148 float q, u,
x,
c1, c2, c3, c4,
d1, h4, h5, h6, q2,
x1,
d, ll, ul, xf1, xf2, rv;
158 float invKappa = 1.f /
kappa;
159 h_[4] = 0.57721566f + (7.6f * invKappa);
160 h4 = -(7.6f * invKappa) - 1.57721566
f;
169 for (lp = 0; lp < 9; ++lp) {
173 ll = -
float(lp) - 1.5f;
174 for (lq = 0; lq < 7; ++lq) {
185 h_[0] =
kappa * 2.57721566f + 9.9166128600000008f;
187 h_[0] += 6.90775527f;
191 h_[3] =
omega_ * 1.5707963250000001f;
199 for (
k = 1;
k <
n; ++
k) {
205 vdt::fast_sincosf(
x1, c3, c4);
209 vdt::fast_sincosf(xf2,
s,
c);
213 a_[
n - 1] += q2 *
a_[
l - 1];
229 float f, u,
y,
a0, a1;
237 }
else if (
x <=
t1_) {
239 u =
omega_ *
y - 3.141592653589793f;
241 vdt::fast_sincosf(u, su, cu);
246 for (
k = 2;
k <= n1; ++
k) {
249 a0 =
a_[
k - 1] + cof * a1 -
a2;
253 for (
k = 2;
k <=
n; ++
k) {
290 const float zero = 0.;
291 const float q2[7] = {
292 .10340013040487, 3.319092135933, 20.449478501379, 41.280784189142, 32.426421069514, 10.041164382905, 1.};
293 const float p3[6] = {
294 -2.3909964453136, -147.98219500504, -254.3763397689, -119.55761038372, -19.630408535939, -.9999999999036};
295 const float q3[6] = {177.60070940351, 530.68509610812, 462.23027156148, 156.81843364539, 21.630408494238, 1.};
296 const float p4[8] = {-8.6693733995107,
304 const float q4[8] = {34.171875,
312 const float a1[8] = {-2.1808638152072,
320 const float b1[8] = {0.,
328 const float a2[8] = {-3.4833465360285,
336 const float b2[8] = {0.,
344 const float a3[6] = {
345 -27.780928934438, -10.10479081576, -9.1483008216736, -5.0223317461851, -3.0000077799358, 1.0000000000704};
346 const float one = 1.;
347 const float b3[6] = {0., 122.39993926823, 2.7276100778779, -7.1897518395045, -2.9990118065262, 1.999999942826};
348 const float two = 2.;
349 const float three = 3.;
350 const float x0 = .37250741078137;
351 const float xl[6] = {-24., -12., -6., 0., 1., 4.};
352 const float p1[5] = {4.293125234321, 39.894153870321, 292.52518866921, 425.69682638592, -434.98143832952};
353 const float q1[5] = {1., 18.899288395003, 150.95038744251, 568.05252718987, 753.58564359843};
354 const float p2[7] = {.43096783946939,
363 float v, y, ap, bp, aq,
dp, bq, dq;
367 for (
int i__ = 2; i__ <= 5; ++i__) {
368 ap = a3[i__ - 1] -
x +
b3[i__ - 1] / ap;
371 }
else if (
x <= xl[1]) {
373 for (
int i__ = 2; i__ <= 7; ++i__) {
374 ap =
a2[i__ - 1] -
x +
b2[i__ - 1] / ap;
377 }
else if (
x <= xl[2]) {
379 for (
int i__ = 2; i__ <= 7; ++i__) {
380 ap = a1[i__ - 1] -
x +
b1[i__ - 1] / ap;
383 }
else if (
x < xl[3]) {
387 for (
int i__ = 2; i__ <= 8; ++i__) {
390 dp = p4[i__ - 1] - ap +
v * bp;
394 for (
int i__ = 2; i__ <= 8; ++i__) {
397 dq = q4[i__ - 1] - aq +
v * bq;
400 }
else if (
x == xl[3]) {
402 }
else if (
x < xl[4]) {
405 for (
int i__ = 2; i__ <= 5; ++i__) {
406 ap =
p1[i__ - 1] +
x * ap;
407 aq = q1[i__ - 1] +
x * aq;
410 }
else if (
x <= xl[5]) {
414 for (
int i__ = 2; i__ <= 7; ++i__) {
415 ap =
p2[i__ - 1] + y * ap;
416 aq = q2[i__ - 1] + y * aq;
423 for (
int i__ = 2; i__ <= 6; ++i__) {
424 ap =
p3[i__ - 1] + y * ap;
425 aq = q3[i__ - 1] + y * aq;
432 template <
typename F>
435 float d__1, d__2, d__3, d__4;
438 float f1,
f2, f3,
u1,
u2,
x1,
x2,
u3, u4, x3, ca, cb, cc, fa, fb, ee,
ff;
440 float xa, xb,
fx,
xx, su4;
447 rv = (xb - xa) * -2.
f;
453 x0 = (xa + xb) * 0.5
f;
469 rv = (d__1 = xb - xa, fabs(d__1)) * -0.5
f;
485 if (
u2 == 0.
f || u4 == 0.
f) {
494 cc = (
x1 - x0) *
f1 -
x1 * (ca *
x1 + cb);
501 u3 = cb / (ca * 2.f);
502 u4 =
u3 *
u3 - cc / ca;
512 if (x0 < xa || x0 > xb) {
516 d__3 = (d__1 = x0 - x3,
std::abs(d__1));
557 rv = (d__1 = xb - xa,
std::abs(d__1)) * -0.5
f;
const int mode_
returns the limits on the non-zero (mode=0) or normalized region (mode=1)
void sincosint(float x, float &sint, float &cint)
void limits(float &xl, float &xu) const
density (mode=0) or distribution (mode=1) function
Abs< T >::type abs(const T &t)
int dzero(float a, float b, float &x0, float &rv, float eps, int mxf, F func)
Private version of the exponential integral.
float expint(float x)
Private version of the cosine and sine integral.
static constexpr float a0
VVIObjF(float kappa, float beta2, int mode)
Constructor.
static constexpr float b2
static constexpr float b0
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
static constexpr float d1
static constexpr float b1
int sicif(float xx, float &si, float &ci)