// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, (%rdi)
andq $0x0, (%rsi)
xorpd %xmm1, %xmm1
movaps %xmm0, (%rsp)
callq 0x24239
movl %eax, %ebp
testb %al, %al
jne 0x1148b
movapd (%rsp), %xmm0
jmp 0x11498
movapd (%rsp), %xmm0
xorpd 0x1ed18(%rip), %xmm0    # 0x301b0
movapd %xmm0, (%rsp)
xorpd %xmm1, %xmm1
callq 0x241f5
testb %al, %al
je 0x114bb
andq $0x0, (%r14)
movsd 0x1f1a2(%rip), %xmm4    # 0x30658
jmp 0x119cf
movsd 0x1fe3d(%rip), %xmm1    # 0x31300
movaps (%rsp), %xmm0
callq 0x24279
testb %al, %al
je 0x11511
movapd (%rsp), %xmm0
movq %r15, %rdi
callq 0x24532
movapd (%rsp), %xmm2
divsd %xmm2, %xmm0
movsd 0x20052(%rip), %xmm1    # 0x31540
subsd %xmm0, %xmm1
movsd %xmm1, (%r14)
movapd %xmm2, %xmm0
movq %r15, %rdi
callq 0x2452d
movapd %xmm0, %xmm4
divsd (%rsp), %xmm4
jmp 0x119cf
movsd 0x1eccf(%rip), %xmm1    # 0x301e8
movaps (%rsp), %xmm0
callq 0x24259
testb %al, %al
je 0x1168e
movapd (%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0x204b1(%rip), %xmm5    # 0x319f0
mulsd %xmm1, %xmm5
addsd 0x204ad(%rip), %xmm5    # 0x319f8
mulsd %xmm1, %xmm5
addsd 0x204a9(%rip), %xmm5    # 0x31a00
mulsd %xmm1, %xmm5
addsd 0x204a5(%rip), %xmm5    # 0x31a08
mulsd %xmm1, %xmm5
addsd 0x204a1(%rip), %xmm5    # 0x31a10
movsd 0x204a1(%rip), %xmm2    # 0x31a18
mulsd %xmm1, %xmm2
addsd 0x2049d(%rip), %xmm2    # 0x31a20
mulsd %xmm1, %xmm2
addsd 0x20499(%rip), %xmm2    # 0x31a28
mulsd %xmm1, %xmm2
addsd 0x20495(%rip), %xmm2    # 0x31a30
mulsd %xmm1, %xmm2
addsd 0x20491(%rip), %xmm2    # 0x31a38
movsd 0x20491(%rip), %xmm6    # 0x31a40
mulsd %xmm1, %xmm6
addsd 0x2048d(%rip), %xmm6    # 0x31a48
mulsd %xmm1, %xmm6
addsd 0x20489(%rip), %xmm6    # 0x31a50
mulsd %xmm1, %xmm6
addsd 0x20485(%rip), %xmm6    # 0x31a58
mulsd %xmm1, %xmm5
mulsd %xmm1, %xmm6
addsd 0x2047d(%rip), %xmm6    # 0x31a60
movsd 0x1ec0d(%rip), %xmm3    # 0x301f8
mulsd %xmm1, %xmm6
addsd 0x1ec09(%rip), %xmm6    # 0x30200
movsd 0x20469(%rip), %xmm4    # 0x31a68
mulsd %xmm1, %xmm4
addsd 0x20465(%rip), %xmm4    # 0x31a70
addsd %xmm3, %xmm5
mulsd %xmm1, %xmm4
addsd 0x2045d(%rip), %xmm4    # 0x31a78
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm4
addsd 0x20455(%rip), %xmm4    # 0x31a80
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm4
addsd 0x2044d(%rip), %xmm4    # 0x31a88
mulsd %xmm0, %xmm5
mulsd %xmm1, %xmm4
addsd 0x1eb9d(%rip), %xmm4    # 0x301e8
divsd %xmm2, %xmm5
mulsd %xmm1, %xmm6
divsd %xmm4, %xmm6
movsd %xmm6, 0x10(%rsp)
testb %bpl, %bpl
je 0x1166a
xorpd 0x1eb46(%rip), %xmm5    # 0x301b0
movsd %xmm5, (%r14)
movq %r15, %rdi
callq 0x2455f
addsd 0x1edf9(%rip), %xmm0    # 0x30478
movsd 0x10(%rsp), %xmm4
addsd %xmm0, %xmm4
jmp 0x119cf
movaps (%rsp), %xmm0
movq %r15, %rdi
callq 0x2452d
movsd %xmm0, 0x10(%rsp)
movaps (%rsp), %xmm0
movq %r15, %rdi
callq 0x24532
movsd %xmm0, 0x18(%rsp)
movapd (%rsp), %xmm0
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x1eb31(%rip), %xmm1    # 0x301f8
divsd %xmm2, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd 0x1ef9f(%rip), %xmm1    # 0x30678
callq 0x24239
testb %al, %al
je 0x11816
movsd 0x2027a(%rip), %xmm4    # 0x31968
movapd 0x20(%rsp), %xmm6
mulsd %xmm6, %xmm4
addsd 0x20270(%rip), %xmm4    # 0x31970
mulsd %xmm6, %xmm4
addsd 0x2026c(%rip), %xmm4    # 0x31978
mulsd %xmm6, %xmm4
addsd 0x20268(%rip), %xmm4    # 0x31980
mulsd %xmm6, %xmm4
addsd 0x20264(%rip), %xmm4    # 0x31988
mulsd %xmm6, %xmm4
addsd 0x20260(%rip), %xmm4    # 0x31990
mulsd %xmm6, %xmm4
addsd 0x2025c(%rip), %xmm4    # 0x31998
movsd 0x2025c(%rip), %xmm1    # 0x319a0
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x20254(%rip), %xmm1    # 0x319a8
mulsd %xmm6, %xmm1
addsd 0x20250(%rip), %xmm1    # 0x319b0
mulsd %xmm6, %xmm1
addsd 0x2024c(%rip), %xmm1    # 0x319b8
mulsd %xmm6, %xmm1
addsd 0x20248(%rip), %xmm1    # 0x319c0
mulsd %xmm6, %xmm1
addsd 0x20244(%rip), %xmm1    # 0x319c8
mulsd %xmm6, %xmm1
addsd 0x20240(%rip), %xmm1    # 0x319d0
movsd 0x20240(%rip), %xmm0    # 0x319d8
mulsd %xmm6, %xmm0
addsd 0x2023c(%rip), %xmm0    # 0x319e0
movsd 0x2023c(%rip), %xmm2    # 0x319e8
addsd %xmm6, %xmm2
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movapd %xmm6, %xmm2
unpcklpd %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0]
mulpd %xmm2, %xmm0
addpd 0x20b38(%rip), %xmm0    # 0x32300
mulpd %xmm2, %xmm0
addpd 0x20b3c(%rip), %xmm0    # 0x32310
mulpd %xmm2, %xmm0
addpd 0x20b40(%rip), %xmm0    # 0x32320
mulpd %xmm2, %xmm0
addpd 0x20b44(%rip), %xmm0    # 0x32330
movapd (%rsp), %xmm3
mulsd %xmm1, %xmm3
mulpd %xmm2, %xmm0
addpd 0x20b3f(%rip), %xmm0    # 0x32340
divsd %xmm3, %xmm4
mulpd %xmm2, %xmm0
addpd 0x20b3f(%rip), %xmm0    # 0x32350
jmp 0x11971
movsd 0x200c2(%rip), %xmm4    # 0x318e0
movapd 0x20(%rsp), %xmm6
mulsd %xmm6, %xmm4
addsd 0x200b8(%rip), %xmm4    # 0x318e8
mulsd %xmm6, %xmm4
addsd 0x200b4(%rip), %xmm4    # 0x318f0
mulsd %xmm6, %xmm4
addsd 0x200b0(%rip), %xmm4    # 0x318f8
mulsd %xmm6, %xmm4
addsd 0x200ac(%rip), %xmm4    # 0x31900
mulsd %xmm6, %xmm4
addsd 0x200a8(%rip), %xmm4    # 0x31908
mulsd %xmm6, %xmm4
addsd 0x200a4(%rip), %xmm4    # 0x31910
mulsd %xmm6, %xmm4
addsd 0x200a0(%rip), %xmm4    # 0x31918
movsd 0x200a8(%rip), %xmm1    # 0x31928
addsd %xmm6, %xmm1
mulsd %xmm6, %xmm1
addsd 0x200a0(%rip), %xmm1    # 0x31930
mulsd %xmm6, %xmm1
addsd 0x2009c(%rip), %xmm1    # 0x31938
mulsd %xmm6, %xmm1
addsd 0x20098(%rip), %xmm1    # 0x31940
mulsd %xmm6, %xmm1
addsd 0x20094(%rip), %xmm1    # 0x31948
mulsd %xmm6, %xmm1
addsd 0x20090(%rip), %xmm1    # 0x31950
mulsd %xmm6, %xmm1
addsd 0x2008c(%rip), %xmm1    # 0x31958
movsd 0x2008c(%rip), %xmm2    # 0x31960
addsd %xmm6, %xmm2
movapd 0x20990(%rip), %xmm0    # 0x32270
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movapd %xmm6, %xmm2
unpcklpd %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0]
mulpd %xmm2, %xmm0
addpd 0x20988(%rip), %xmm0    # 0x32280
mulsd %xmm6, %xmm4
mulpd %xmm2, %xmm0
addpd 0x20988(%rip), %xmm0    # 0x32290
movsd 0x20010(%rip), %xmm3    # 0x31920
mulpd %xmm2, %xmm0
addpd 0x20984(%rip), %xmm0    # 0x322a0
addsd %xmm3, %xmm4
mulpd %xmm2, %xmm0
addpd 0x20984(%rip), %xmm0    # 0x322b0
mulsd %xmm6, %xmm1
mulpd %xmm2, %xmm0
addpd 0x20984(%rip), %xmm0    # 0x322c0
addsd %xmm3, %xmm1
mulpd %xmm2, %xmm0
addpd 0x20984(%rip), %xmm0    # 0x322d0
movapd (%rsp), %xmm3
mulsd %xmm1, %xmm3
mulpd %xmm2, %xmm0
addpd 0x2097f(%rip), %xmm0    # 0x322e0
divsd %xmm3, %xmm4
mulpd %xmm2, %xmm0
addpd 0x2097f(%rip), %xmm0    # 0x322f0
movapd %xmm4, %xmm1
movsd 0x18(%rsp), %xmm5
mulsd %xmm5, %xmm1
movsd 0x1fbb9(%rip), %xmm2    # 0x31540
subsd %xmm1, %xmm2
movapd 0x1e81d(%rip), %xmm1    # 0x301b0
xorpd %xmm1, %xmm6
mulsd %xmm0, %xmm6
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
divsd %xmm0, %xmm6
movapd %xmm6, %xmm0
movsd 0x10(%rsp), %xmm3
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
testb %bpl, %bpl
je 0x119be
xorpd %xmm1, %xmm0
movsd %xmm0, (%r14)
mulsd %xmm6, %xmm5
mulsd %xmm3, %xmm4
addsd %xmm5, %xmm4
movsd %xmm4, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq