// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::sinecosineintegrals(double, double*, double*, alglib_impl::ae_state*)
void sinecosineintegrals(double x,
     double* si,
     double* ci,
     ae_state *_state)
{
    double z;
    double c;
    double s;
    double f;
    double g;
    ae_int_t sg;
    double sn;
    double sd;
    double cn;
    double cd;
    double fn;
    double fd;
    double gn;
    double gd;

    *si = 0;
    *ci = 0;

    if( ae_fp_less(x,0) )
    {
        sg = -1;
        x = -x;
    }
    else
    {
        sg = 0;
    }
    if( ae_fp_eq(x,0) )
    {
        *si = 0;
        *ci = -ae_maxrealnumber;
        return;
    }
    if( ae_fp_greater(x,1.0E9) )
    {
        *si = 1.570796326794896619-ae_cos(x, _state)/x;
        *ci = ae_sin(x, _state)/x;
        return;
    }
    if( ae_fp_less_eq(x,4) )
    {
        z = x*x;
        sn = -8.39167827910303881427E-11;
        sn = sn*z+4.62591714427012837309E-8;
        sn = sn*z-9.75759303843632795789E-6;
        sn = sn*z+9.76945438170435310816E-4;
        sn = sn*z-4.13470316229406538752E-2;
        sn = sn*z+1.00000000000000000302E0;
        sd = 2.03269266195951942049E-12;
        sd = sd*z+1.27997891179943299903E-9;
        sd = sd*z+4.41827842801218905784E-7;
        sd = sd*z+9.96412122043875552487E-5;
        sd = sd*z+1.42085239326149893930E-2;
        sd = sd*z+9.99999999999999996984E-1;
        s = x*sn/sd;
        cn = 2.02524002389102268789E-11;
        cn = cn*z-1.35249504915790756375E-8;
        cn = cn*z+3.59325051419993077021E-6;
        cn = cn*z-4.74007206873407909465E-4;
        cn = cn*z+2.89159652607555242092E-2;
        cn = cn*z-1.00000000000000000080E0;
        cd = 4.07746040061880559506E-12;
        cd = cd*z+3.06780997581887812692E-9;
        cd = cd*z+1.23210355685883423679E-6;
        cd = cd*z+3.17442024775032769882E-4;
        cd = cd*z+5.10028056236446052392E-2;
        cd = cd*z+4.00000000000000000080E0;
        c = z*cn/cd;
        if( sg!=0 )
        {
            s = -s;
        }
        *si = s;
        *ci = 0.57721566490153286061+ae_log(x, _state)+c;
        return;
    }
    s = ae_sin(x, _state);
    c = ae_cos(x, _state);
    z = 1.0/(x*x);
    if( ae_fp_less(x,8) )
    {
        fn = 4.23612862892216586994E0;
        fn = fn*z+5.45937717161812843388E0;
        fn = fn*z+1.62083287701538329132E0;
        fn = fn*z+1.67006611831323023771E-1;
        fn = fn*z+6.81020132472518137426E-3;
        fn = fn*z+1.08936580650328664411E-4;
        fn = fn*z+5.48900223421373614008E-7;
        fd = 1.00000000000000000000E0;
        fd = fd*z+8.16496634205391016773E0;
        fd = fd*z+7.30828822505564552187E0;
        fd = fd*z+1.86792257950184183883E0;
        fd = fd*z+1.78792052963149907262E-1;
        fd = fd*z+7.01710668322789753610E-3;
        fd = fd*z+1.10034357153915731354E-4;
        fd = fd*z+5.48900252756255700982E-7;
        f = fn/(x*fd);
        gn = 8.71001698973114191777E-2;
        gn = gn*z+6.11379109952219284151E-1;
        gn = gn*z+3.97180296392337498885E-1;
        gn = gn*z+7.48527737628469092119E-2;
        gn = gn*z+5.38868681462177273157E-3;
        gn = gn*z+1.61999794598934024525E-4;
        gn = gn*z+1.97963874140963632189E-6;
        gn = gn*z+7.82579040744090311069E-9;
        gd = 1.00000000000000000000E0;
        gd = gd*z+1.64402202413355338886E0;
        gd = gd*z+6.66296701268987968381E-1;
        gd = gd*z+9.88771761277688796203E-2;
        gd = gd*z+6.22396345441768420760E-3;
        gd = gd*z+1.73221081474177119497E-4;
        gd = gd*z+2.02659182086343991969E-6;
        gd = gd*z+7.82579218933534490868E-9;
        g = z*gn/gd;
    }
    else
    {
        fn = 4.55880873470465315206E-1;
        fn = fn*z+7.13715274100146711374E-1;
        fn = fn*z+1.60300158222319456320E-1;
        fn = fn*z+1.16064229408124407915E-2;
        fn = fn*z+3.49556442447859055605E-4;
        fn = fn*z+4.86215430826454749482E-6;
        fn = fn*z+3.20092790091004902806E-8;
        fn = fn*z+9.41779576128512936592E-11;
        fn = fn*z+9.70507110881952024631E-14;
        fd = 1.00000000000000000000E0;
        fd = fd*z+9.17463611873684053703E-1;
        fd = fd*z+1.78685545332074536321E-1;
        fd = fd*z+1.22253594771971293032E-2;
        fd = fd*z+3.58696481881851580297E-4;
        fd = fd*z+4.92435064317881464393E-6;
        fd = fd*z+3.21956939101046018377E-8;
        fd = fd*z+9.43720590350276732376E-11;
        fd = fd*z+9.70507110881952025725E-14;
        f = fn/(x*fd);
        gn = 6.97359953443276214934E-1;
        gn = gn*z+3.30410979305632063225E-1;
        gn = gn*z+3.84878767649974295920E-2;
        gn = gn*z+1.71718239052347903558E-3;
        gn = gn*z+3.48941165502279436777E-5;
        gn = gn*z+3.47131167084116673800E-7;
        gn = gn*z+1.70404452782044526189E-9;
        gn = gn*z+3.85945925430276600453E-12;
        gn = gn*z+3.14040098946363334640E-15;
        gd = 1.00000000000000000000E0;
        gd = gd*z+1.68548898811011640017E0;
        gd = gd*z+4.87852258695304967486E-1;
        gd = gd*z+4.67913194259625806320E-2;
        gd = gd*z+1.90284426674399523638E-3;
        gd = gd*z+3.68475504442561108162E-5;
        gd = gd*z+3.57043223443740838771E-7;
        gd = gd*z+1.72693748966316146736E-9;
        gd = gd*z+3.87830166023954706752E-12;
        gd = gd*z+3.14040098946363335242E-15;
        g = z*gn/gd;
    }
    *si = 1.570796326794896619-f*c-g*s;
    if( sg!=0 )
    {
        *si = -*si;
    }
    *ci = f*s-g*c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
movq %rax, (%rdi)
movq %rax, (%rsi)
xorpd %xmm1, %xmm1
movaps %xmm0, (%rsp)
callq 0x262fe
movl %eax, %ebp
testb %al, %al
jne 0x121ff
movapd (%rsp), %xmm0
jmp 0x1220c
movapd (%rsp), %xmm0
xorpd 0x21fd4(%rip), %xmm0    # 0x341e0
movapd %xmm0, (%rsp)
xorpd %xmm1, %xmm1
callq 0x262ba
testb %al, %al
je 0x12232
movq $0x0, (%r14)
movsd 0x22403(%rip), %xmm4    # 0x34630
jmp 0x127d2
movsd 0x232ce(%rip), %xmm1    # 0x35508
movaps (%rsp), %xmm0
callq 0x2633e
testb %al, %al
je 0x12288
movapd (%rsp), %xmm0
movq %r15, %rdi
callq 0x266a9
movapd (%rsp), %xmm2
divsd %xmm2, %xmm0
movsd 0x234e3(%rip), %xmm1    # 0x35748
subsd %xmm0, %xmm1
movsd %xmm1, (%r14)
movapd %xmm2, %xmm0
movq %r15, %rdi
callq 0x266a4
movapd %xmm0, %xmm4
divsd (%rsp), %xmm4
jmp 0x127d2
movsd 0x21f20(%rip), %xmm1    # 0x341b0
movaps (%rsp), %xmm0
callq 0x2631e
testb %al, %al
je 0x12405
movapd (%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0x23d02(%rip), %xmm5    # 0x35fb8
mulsd %xmm1, %xmm5
addsd 0x23cfe(%rip), %xmm5    # 0x35fc0
mulsd %xmm1, %xmm5
addsd 0x23cfa(%rip), %xmm5    # 0x35fc8
mulsd %xmm1, %xmm5
addsd 0x23cf6(%rip), %xmm5    # 0x35fd0
mulsd %xmm1, %xmm5
addsd 0x23cf2(%rip), %xmm5    # 0x35fd8
movsd 0x23cf2(%rip), %xmm2    # 0x35fe0
mulsd %xmm1, %xmm2
addsd 0x23cee(%rip), %xmm2    # 0x35fe8
mulsd %xmm1, %xmm2
addsd 0x23cea(%rip), %xmm2    # 0x35ff0
mulsd %xmm1, %xmm2
addsd 0x23ce6(%rip), %xmm2    # 0x35ff8
mulsd %xmm1, %xmm2
addsd 0x23ce2(%rip), %xmm2    # 0x36000
movsd 0x23ce2(%rip), %xmm6    # 0x36008
mulsd %xmm1, %xmm6
addsd 0x23cde(%rip), %xmm6    # 0x36010
mulsd %xmm1, %xmm6
addsd 0x23cda(%rip), %xmm6    # 0x36018
mulsd %xmm1, %xmm6
addsd 0x23cd6(%rip), %xmm6    # 0x36020
mulsd %xmm1, %xmm5
mulsd %xmm1, %xmm6
addsd 0x23cce(%rip), %xmm6    # 0x36028
movsd 0x21e3e(%rip), %xmm3    # 0x341a0
mulsd %xmm1, %xmm6
addsd 0x21e62(%rip), %xmm6    # 0x341d0
movsd 0x23cba(%rip), %xmm4    # 0x36030
mulsd %xmm1, %xmm4
addsd 0x23cb6(%rip), %xmm4    # 0x36038
addsd %xmm3, %xmm5
mulsd %xmm1, %xmm4
addsd 0x23cae(%rip), %xmm4    # 0x36040
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm4
addsd 0x23ca6(%rip), %xmm4    # 0x36048
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm4
addsd 0x23c9e(%rip), %xmm4    # 0x36050
mulsd %xmm0, %xmm5
mulsd %xmm1, %xmm4
addsd 0x21dee(%rip), %xmm4    # 0x341b0
divsd %xmm2, %xmm5
mulsd %xmm1, %xmm6
divsd %xmm4, %xmm6
movsd %xmm6, 0x10(%rsp)
testb %bpl, %bpl
je 0x123e1
xorpd 0x21dff(%rip), %xmm5    # 0x341e0
movsd %xmm5, (%r14)
movq %r15, %rdi
callq 0x266d6
addsd 0x2206a(%rip), %xmm0    # 0x34460
movsd 0x10(%rsp), %xmm4
addsd %xmm0, %xmm4
jmp 0x127d2
movaps (%rsp), %xmm0
movq %r15, %rdi
callq 0x266a4
movsd %xmm0, 0x10(%rsp)
movaps (%rsp), %xmm0
movq %r15, %rdi
callq 0x266a9
movsd %xmm0, 0x18(%rsp)
movapd (%rsp), %xmm0
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x21d62(%rip), %xmm1    # 0x341a0
divsd %xmm2, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd 0x22200(%rip), %xmm1    # 0x34650
callq 0x262fe
testb %al, %al
je 0x125c9
movsd 0x23a6b(%rip), %xmm4    # 0x35ed0
movapd 0x20(%rsp), %xmm6
mulsd %xmm6, %xmm4
addsd 0x23a61(%rip), %xmm4    # 0x35ed8
mulsd %xmm6, %xmm4
addsd 0x23a5d(%rip), %xmm4    # 0x35ee0
mulsd %xmm6, %xmm4
addsd 0x23a59(%rip), %xmm4    # 0x35ee8
mulsd %xmm6, %xmm4
addsd 0x23a55(%rip), %xmm4    # 0x35ef0
mulsd %xmm6, %xmm4
addsd 0x23a51(%rip), %xmm4    # 0x35ef8
mulsd %xmm6, %xmm4
addsd 0x23a4d(%rip), %xmm4    # 0x35f00
movsd 0x23a4d(%rip), %xmm2    # 0x35f08
addsd %xmm6, %xmm2
mulsd %xmm6, %xmm2
addsd 0x23a45(%rip), %xmm2    # 0x35f10
mulsd %xmm6, %xmm2
addsd 0x23a41(%rip), %xmm2    # 0x35f18
mulsd %xmm6, %xmm2
addsd 0x23a3d(%rip), %xmm2    # 0x35f20
mulsd %xmm6, %xmm2
addsd 0x23a39(%rip), %xmm2    # 0x35f28
mulsd %xmm6, %xmm2
addsd 0x23a35(%rip), %xmm2    # 0x35f30
mulsd %xmm6, %xmm2
addsd 0x23a31(%rip), %xmm2    # 0x35f38
movsd 0x23a31(%rip), %xmm0    # 0x35f40
mulsd %xmm6, %xmm0
addsd 0x23a2d(%rip), %xmm0    # 0x35f48
mulsd %xmm6, %xmm0
addsd 0x23a29(%rip), %xmm0    # 0x35f50
mulsd %xmm6, %xmm0
addsd 0x23a25(%rip), %xmm0    # 0x35f58
mulsd %xmm6, %xmm0
addsd 0x23a21(%rip), %xmm0    # 0x35f60
mulsd %xmm6, %xmm0
addsd 0x23a1d(%rip), %xmm0    # 0x35f68
mulsd %xmm6, %xmm0
addsd 0x23a19(%rip), %xmm0    # 0x35f70
mulsd %xmm6, %xmm0
addsd 0x23a15(%rip), %xmm0    # 0x35f78
movsd 0x23a15(%rip), %xmm1    # 0x35f80
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x23a0d(%rip), %xmm1    # 0x35f88
mulsd %xmm6, %xmm1
addsd 0x23a09(%rip), %xmm1    # 0x35f90
mulsd %xmm6, %xmm1
addsd 0x23a05(%rip), %xmm1    # 0x35f98
mulsd %xmm6, %xmm1
addsd 0x23a01(%rip), %xmm1    # 0x35fa0
movapd (%rsp), %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm6, %xmm1
addsd 0x239f4(%rip), %xmm1    # 0x35fa8
divsd %xmm3, %xmm4
mulsd %xmm6, %xmm1
addsd 0x239ec(%rip), %xmm1    # 0x35fb0
jmp 0x12778
movsd 0x237f7(%rip), %xmm4    # 0x35dc8
movapd 0x20(%rsp), %xmm6
mulsd %xmm6, %xmm4
addsd 0x237ed(%rip), %xmm4    # 0x35dd0
mulsd %xmm6, %xmm4
addsd 0x237e9(%rip), %xmm4    # 0x35dd8
mulsd %xmm6, %xmm4
addsd 0x237e5(%rip), %xmm4    # 0x35de0
mulsd %xmm6, %xmm4
addsd 0x237e1(%rip), %xmm4    # 0x35de8
mulsd %xmm6, %xmm4
addsd 0x237dd(%rip), %xmm4    # 0x35df0
mulsd %xmm6, %xmm4
addsd 0x237d9(%rip), %xmm4    # 0x35df8
mulsd %xmm6, %xmm4
addsd 0x237d5(%rip), %xmm4    # 0x35e00
movsd 0x237dd(%rip), %xmm1    # 0x35e10
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x237d5(%rip), %xmm1    # 0x35e18
mulsd %xmm6, %xmm1
addsd 0x237d1(%rip), %xmm1    # 0x35e20
mulsd %xmm6, %xmm1
addsd 0x237cd(%rip), %xmm1    # 0x35e28
mulsd %xmm6, %xmm1
addsd 0x237c9(%rip), %xmm1    # 0x35e30
mulsd %xmm6, %xmm1
addsd 0x237c5(%rip), %xmm1    # 0x35e38
mulsd %xmm6, %xmm4
mulsd %xmm6, %xmm1
addsd 0x237bd(%rip), %xmm1    # 0x35e40
movsd 0x237bd(%rip), %xmm0    # 0x35e48
mulsd %xmm6, %xmm0
addsd 0x237b9(%rip), %xmm0    # 0x35e50
movsd 0x23769(%rip), %xmm2    # 0x35e08
mulsd %xmm6, %xmm0
addsd 0x237ad(%rip), %xmm0    # 0x35e58
addsd %xmm2, %xmm4
mulsd %xmm6, %xmm0
addsd 0x237a5(%rip), %xmm0    # 0x35e60
mulsd %xmm6, %xmm1
mulsd %xmm6, %xmm0
addsd 0x2379d(%rip), %xmm0    # 0x35e68
addsd %xmm2, %xmm1
mulsd %xmm6, %xmm0
addsd 0x23795(%rip), %xmm0    # 0x35e70
movapd (%rsp), %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm6, %xmm0
addsd 0x23788(%rip), %xmm0    # 0x35e78
mulsd %xmm6, %xmm0
addsd 0x23784(%rip), %xmm0    # 0x35e80
movsd 0x2378c(%rip), %xmm1    # 0x35e90
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x23784(%rip), %xmm1    # 0x35e98
divsd %xmm2, %xmm4
mulsd %xmm6, %xmm1
addsd 0x2377c(%rip), %xmm1    # 0x35ea0
mulsd %xmm6, %xmm0
mulsd %xmm6, %xmm1
addsd 0x23774(%rip), %xmm1    # 0x35ea8
movsd 0x2374c(%rip), %xmm2    # 0x35e88
mulsd %xmm6, %xmm1
addsd 0x23768(%rip), %xmm1    # 0x35eb0
addsd %xmm2, %xmm0
mulsd %xmm6, %xmm1
addsd 0x23760(%rip), %xmm1    # 0x35eb8
mulsd %xmm6, %xmm1
addsd 0x2375c(%rip), %xmm1    # 0x35ec0
mulsd %xmm6, %xmm1
addsd 0x23758(%rip), %xmm1    # 0x35ec8
mulsd %xmm6, %xmm1
addsd %xmm2, %xmm1
movapd %xmm4, %xmm2
movsd 0x18(%rsp), %xmm5
mulsd %xmm5, %xmm2
movsd 0x22fba(%rip), %xmm3    # 0x35748
subsd %xmm2, %xmm3
movapd 0x21a46(%rip), %xmm2    # 0x341e0
xorpd %xmm2, %xmm6
mulsd %xmm0, %xmm6
divsd %xmm1, %xmm6
movapd %xmm6, %xmm0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd %xmm3, %xmm0
testb %bpl, %bpl
je 0x127c1
xorpd %xmm2, %xmm0
movsd %xmm0, (%r14)
mulsd %xmm6, %xmm5
mulsd %xmm1, %xmm4
addsd %xmm5, %xmm4
movsd %xmm4, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq