// File: /workspace/github_cpp_makefile_star2_O2/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::exponentialintegralei(double, alglib_impl::ae_state*)
double exponentialintegralei(double x, ae_state *_state)
{
    double eul;
    double f;
    double f1;
    double f2;
    double w;
    double result;


    eul = 0.5772156649015328606065;
    if( ae_fp_less_eq(x,0) )
    {
        result = 0;
        return result;
    }
    if( ae_fp_less(x,2) )
    {
        f1 = -5.350447357812542947283;
        f1 = f1*x+218.5049168816613393830;
        f1 = f1*x-4176.572384826693777058;
        f1 = f1*x+55411.76756393557601232;
        f1 = f1*x-331338.1331178144034309;
        f1 = f1*x+1592627.163384945414220;
        f2 = 1.000000000000000000000;
        f2 = f2*x-52.50547959112862969197;
        f2 = f2*x+1259.616186786790571525;
        f2 = f2*x-17565.49581973534652631;
        f2 = f2*x+149306.2117002725991967;
        f2 = f2*x-729494.9239640527645655;
        f2 = f2*x+1592627.163384945429726;
        f = f1/f2;
        result = eul+ae_log(x, _state)+x*f;
        return result;
    }
    if( ae_fp_less(x,4) )
    {
        w = 1/x;
        f1 = 1.981808503259689673238E-2;
        f1 = f1*w-1.271645625984917501326;
        f1 = f1*w-2.088160335681228318920;
        f1 = f1*w+2.755544509187936721172;
        f1 = f1*w-4.409507048701600257171E-1;
        f1 = f1*w+4.665623805935891391017E-2;
        f1 = f1*w-1.545042679673485262580E-3;
        f1 = f1*w+7.059980605299617478514E-5;
        f2 = 1.000000000000000000000;
        f2 = f2*w+1.476498670914921440652;
        f2 = f2*w+5.629177174822436244827E-1;
        f2 = f2*w+1.699017897879307263248E-1;
        f2 = f2*w+2.291647179034212017463E-2;
        f2 = f2*w+4.450150439728752875043E-3;
        f2 = f2*w+1.727439612206521482874E-4;
        f2 = f2*w+3.953167195549672482304E-5;
        f = f1/f2;
        result = ae_exp(x, _state)*w*(1+w*f);
        return result;
    }
    if( ae_fp_less(x,8) )
    {
        w = 1/x;
        f1 = -1.373215375871208729803;
        f1 = f1*w-7.084559133740838761406E-1;
        f1 = f1*w+1.580806855547941010501;
        f1 = f1*w-2.601500427425622944234E-1;
        f1 = f1*w+2.994674694113713763365E-2;
        f1 = f1*w-1.038086040188744005513E-3;
        f1 = f1*w+4.371064420753005429514E-5;
        f1 = f1*w+2.141783679522602903795E-6;
        f2 = 1.000000000000000000000;
        f2 = f2*w+8.585231423622028380768E-1;
        f2 = f2*w+4.483285822873995129957E-1;
        f2 = f2*w+7.687932158124475434091E-2;
        f2 = f2*w+2.449868241021887685904E-2;
        f2 = f2*w+8.832165941927796567926E-4;
        f2 = f2*w+4.590952299511353531215E-4;
        f2 = f2*w+(-4.729848351866523044863E-6);
        f2 = f2*w+2.665195537390710170105E-6;
        f = f1/f2;
        result = ae_exp(x, _state)*w*(1+w*f);
        return result;
    }
    if( ae_fp_less(x,16) )
    {
        w = 1/x;
        f1 = -2.106934601691916512584;
        f1 = f1*w+1.732733869664688041885;
        f1 = f1*w-2.423619178935841904839E-1;
        f1 = f1*w+2.322724180937565842585E-2;
        f1 = f1*w+2.372880440493179832059E-4;
        f1 = f1*w-8.343219561192552752335E-5;
        f1 = f1*w+1.363408795605250394881E-5;
        f1 = f1*w-3.655412321999253963714E-7;
        f1 = f1*w+1.464941733975961318456E-8;
        f1 = f1*w+6.176407863710360207074E-10;
        f2 = 1.000000000000000000000;
        f2 = f2*w-2.298062239901678075778E-1;
        f2 = f2*w+1.105077041474037862347E-1;
        f2 = f2*w-1.566542966630792353556E-2;
        f2 = f2*w+2.761106850817352773874E-3;
        f2 = f2*w-2.089148012284048449115E-4;
        f2 = f2*w+1.708528938807675304186E-5;
        f2 = f2*w-4.459311796356686423199E-7;
        f2 = f2*w+1.394634930353847498145E-8;
        f2 = f2*w+6.150865933977338354138E-10;
        f = f1/f2;
        result = ae_exp(x, _state)*w*(1+w*f);
        return result;
    }
    if( ae_fp_less(x,32) )
    {
        w = 1/x;
        f1 = -2.458119367674020323359E-1;
        f1 = f1*w-1.483382253322077687183E-1;
        f1 = f1*w+7.248291795735551591813E-2;
        f1 = f1*w-1.348315687380940523823E-2;
        f1 = f1*w+1.342775069788636972294E-3;
        f1 = f1*w-7.942465637159712264564E-5;
        f1 = f1*w+2.644179518984235952241E-6;
        f1 = f1*w-4.239473659313765177195E-8;
        f2 = 1.000000000000000000000;
        f2 = f2*w-1.044225908443871106315E-1;
        f2 = f2*w-2.676453128101402655055E-1;
        f2 = f2*w+9.695000254621984627876E-2;
        f2 = f2*w-1.601745692712991078208E-2;
        f2 = f2*w+1.496414899205908021882E-3;
        f2 = f2*w-8.462452563778485013756E-5;
        f2 = f2*w+2.728938403476726394024E-6;
        f2 = f2*w-4.239462431819542051337E-8;
        f = f1/f2;
        result = ae_exp(x, _state)*w*(1+w*f);
        return result;
    }
    if( ae_fp_less(x,64) )
    {
        w = 1/x;
        f1 = 1.212561118105456670844E-1;
        f1 = f1*w-5.823133179043894485122E-1;
        f1 = f1*w+2.348887314557016779211E-1;
        f1 = f1*w-3.040034318113248237280E-2;
        f1 = f1*w+1.510082146865190661777E-3;
        f1 = f1*w-2.523137095499571377122E-5;
        f2 = 1.000000000000000000000;
        f2 = f2*w-1.002252150365854016662;
        f2 = f2*w+2.928709694872224144953E-1;
        f2 = f2*w-3.337004338674007801307E-2;
        f2 = f2*w+1.560544881127388842819E-3;
        f2 = f2*w-2.523137093603234562648E-5;
        f = f1/f2;
        result = ae_exp(x, _state)*w*(1+w*f);
        return result;
    }
    w = 1/x;
    f1 = -7.657847078286127362028E-1;
    f1 = f1*w+6.886192415566705051750E-1;
    f1 = f1*w-2.132598113545206124553E-1;
    f1 = f1*w+3.346107552384193813594E-2;
    f1 = f1*w-3.076541477344756050249E-3;
    f1 = f1*w+1.747119316454907477380E-4;
    f1 = f1*w-6.103711682274170530369E-6;
    f1 = f1*w+1.218032765428652199087E-7;
    f1 = f1*w-1.086076102793290233007E-9;
    f2 = 1.000000000000000000000;
    f2 = f2*w-1.888802868662308731041;
    f2 = f2*w+1.066691687211408896850;
    f2 = f2*w-2.751915982306380647738E-1;
    f2 = f2*w+3.930852688233823569726E-2;
    f2 = f2*w-3.414684558602365085394E-3;
    f2 = f2*w+1.866844370703555398195E-4;
    f2 = f2*w-6.345146083130515357861E-6;
    f2 = f2*w+1.239754287483206878024E-7;
    f2 = f2*w-1.086076102793126632978E-9;
    f = f1/f2;
    result = ae_exp(x, _state)*w*(1+w*f);
    return result;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movapd %xmm1, (%rsp)
movapd %xmm0, 0x10(%rsp)
callq 0x24259
testb %al, %al
jne 0xe0e9
movsd 0x22557(%rip), %xmm1    # 0x303f8
movaps 0x10(%rsp), %xmm0
callq 0x24239
testb %al, %al
je 0xdf4e
movsd 0x237a5(%rip), %xmm3    # 0x31660
movapd 0x10(%rsp), %xmm2
addsd %xmm2, %xmm3
movapd %xmm2, %xmm1
movapd %xmm2, %xmm0
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
movapd 0x242f7(%rip), %xmm2    # 0x321d0
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
mulpd %xmm1, %xmm2
addpd 0x242f7(%rip), %xmm2    # 0x321e0
mulpd %xmm1, %xmm2
addpd 0x242fb(%rip), %xmm2    # 0x321f0
mulpd %xmm1, %xmm2
addpd 0x242ff(%rip), %xmm2    # 0x32200
mulpd %xmm1, %xmm2
addpd 0x24303(%rip), %xmm2    # 0x32210
mulpd %xmm1, %xmm2
addpd 0x24307(%rip), %xmm2    # 0x32220
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
divsd %xmm1, %xmm2
movapd %xmm2, (%rsp)
movq %rbx, %rdi
callq 0x2455f
addsd 0x2253e(%rip), %xmm0    # 0x30478
movapd (%rsp), %xmm1
mulsd 0x10(%rsp), %xmm1
addsd %xmm1, %xmm0
jmp 0xe0ee
movsd 0x22292(%rip), %xmm1    # 0x301e8
movaps 0x10(%rsp), %xmm0
callq 0x24239
testb %al, %al
je 0xe00a
movsd 0x22288(%rip), %xmm3    # 0x301f8
movapd 0x10(%rsp), %xmm0
divsd %xmm0, %xmm3
movapd %xmm3, 0x20(%rsp)
movsd 0x236c0(%rip), %xmm2    # 0x31648
mulsd %xmm3, %xmm2
addsd 0x236bc(%rip), %xmm2    # 0x31650
movsd 0x236bc(%rip), %xmm1    # 0x31658
addsd %xmm3, %xmm1
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
movapd %xmm3, %xmm1
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm1, %xmm2
addpd 0x241b8(%rip), %xmm2    # 0x32170
mulpd %xmm1, %xmm2
addpd 0x241bc(%rip), %xmm2    # 0x32180
mulpd %xmm1, %xmm2
addpd 0x241c0(%rip), %xmm2    # 0x32190
mulpd %xmm1, %xmm2
addpd 0x241c4(%rip), %xmm2    # 0x321a0
mulpd %xmm1, %xmm2
addpd 0x241c8(%rip), %xmm2    # 0x321b0
mulpd %xmm1, %xmm2
addpd 0x241cc(%rip), %xmm2    # 0x321c0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
divsd %xmm1, %xmm2
movapd %xmm2, (%rsp)
jmp 0xe0bd
movsd 0x22666(%rip), %xmm1    # 0x30678
movaps 0x10(%rsp), %xmm0
callq 0x24239
testb %al, %al
je 0xe0f4
movsd 0x221cc(%rip), %xmm1    # 0x301f8
movapd 0x10(%rsp), %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd 0x235fc(%rip), %xmm2    # 0x31640
addsd %xmm1, %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movapd 0x2409c(%rip), %xmm3    # 0x320f0
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd %xmm1, %xmm3
addpd 0x2409c(%rip), %xmm3    # 0x32100
mulpd %xmm1, %xmm3
addpd 0x240a0(%rip), %xmm3    # 0x32110
mulpd %xmm1, %xmm3
addpd 0x240a4(%rip), %xmm3    # 0x32120
mulpd %xmm1, %xmm3
addpd 0x240a8(%rip), %xmm3    # 0x32130
mulpd %xmm1, %xmm3
addpd 0x240ac(%rip), %xmm3    # 0x32140
mulpd %xmm1, %xmm3
addpd 0x240b0(%rip), %xmm3    # 0x32150
mulpd %xmm1, %xmm3
addpd 0x240b4(%rip), %xmm3    # 0x32160
movapd %xmm3, %xmm1
unpckhpd %xmm3, %xmm1            # xmm1 = xmm1[1],xmm3[1]
divsd %xmm1, %xmm3
movapd %xmm3, (%rsp)
movq %rbx, %rdi
callq 0x24569
movapd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm0
movapd (%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd 0x22118(%rip), %xmm2    # 0x301f8
mulsd %xmm0, %xmm2
movapd %xmm2, (%rsp)
movapd (%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
retq
movsd 0x234f4(%rip), %xmm1    # 0x315f0
movaps 0x10(%rsp), %xmm0
callq 0x24239
testb %al, %al
je 0xe1b7
movsd 0x220e2(%rip), %xmm3    # 0x301f8
movapd 0x10(%rsp), %xmm0
divsd %xmm0, %xmm3
movapd %xmm3, 0x20(%rsp)
movsd 0x234fa(%rip), %xmm2    # 0x31628
mulsd %xmm3, %xmm2
addsd 0x234f6(%rip), %xmm2    # 0x31630
movsd 0x234f6(%rip), %xmm1    # 0x31638
addsd %xmm3, %xmm1
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
movapd %xmm3, %xmm1
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm1, %xmm2
addpd 0x23f12(%rip), %xmm2    # 0x32070
mulpd %xmm1, %xmm2
addpd 0x23f16(%rip), %xmm2    # 0x32080
mulpd %xmm1, %xmm2
addpd 0x23f1a(%rip), %xmm2    # 0x32090
mulpd %xmm1, %xmm2
addpd 0x23f1e(%rip), %xmm2    # 0x320a0
mulpd %xmm1, %xmm2
addpd 0x23f22(%rip), %xmm2    # 0x320b0
mulpd %xmm1, %xmm2
addpd 0x23f26(%rip), %xmm2    # 0x320c0
mulpd %xmm1, %xmm2
addpd 0x23f2a(%rip), %xmm2    # 0x320d0
mulpd %xmm1, %xmm2
addpd 0x23f2e(%rip), %xmm2    # 0x320e0
jmp 0xdff4
movsd 0x22ac9(%rip), %xmm1    # 0x30c88
movaps 0x10(%rsp), %xmm0
callq 0x24239
testb %al, %al
je 0xe25e
movsd 0x2201f(%rip), %xmm1    # 0x301f8
movapd 0x10(%rsp), %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd 0x2342f(%rip), %xmm2    # 0x31620
addsd %xmm1, %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movapd 0x23def(%rip), %xmm3    # 0x31ff0
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd %xmm1, %xmm3
addpd 0x23def(%rip), %xmm3    # 0x32000
mulpd %xmm1, %xmm3
addpd 0x23df3(%rip), %xmm3    # 0x32010
mulpd %xmm1, %xmm3
addpd 0x23df7(%rip), %xmm3    # 0x32020
mulpd %xmm1, %xmm3
addpd 0x23dfb(%rip), %xmm3    # 0x32030
mulpd %xmm1, %xmm3
addpd 0x23dff(%rip), %xmm3    # 0x32040
mulpd %xmm1, %xmm3
addpd 0x23e03(%rip), %xmm3    # 0x32050
mulpd %xmm1, %xmm3
addpd 0x23e07(%rip), %xmm3    # 0x32060
jmp 0xe0ac
movsd 0x23392(%rip), %xmm1    # 0x315f8
movaps 0x10(%rsp), %xmm0
callq 0x24239
movsd 0x21f80(%rip), %xmm1    # 0x301f8
divsd 0x10(%rsp), %xmm1
testb %al, %al
movapd %xmm1, 0x20(%rsp)
je 0xe2e9
movsd 0x23378(%rip), %xmm2    # 0x31608
mulsd %xmm1, %xmm2
addsd 0x23374(%rip), %xmm2    # 0x31610
movsd 0x23374(%rip), %xmm0    # 0x31618
addsd %xmm1, %xmm0
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movapd %xmm1, %xmm0
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
mulpd %xmm0, %xmm2
addpd 0x23cf0(%rip), %xmm2    # 0x31fb0
mulpd %xmm0, %xmm2
addpd 0x23cf4(%rip), %xmm2    # 0x31fc0
mulpd %xmm0, %xmm2
addpd 0x23cf8(%rip), %xmm2    # 0x31fd0
mulpd %xmm0, %xmm2
addpd 0x23cfc(%rip), %xmm2    # 0x31fe0
jmp 0xe369
movsd 0x2330f(%rip), %xmm0    # 0x31600
addsd %xmm1, %xmm0
movapd 0x23c23(%rip), %xmm2    # 0x31f20
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movapd %xmm1, %xmm0
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
mulpd %xmm0, %xmm2
addpd 0x23c1b(%rip), %xmm2    # 0x31f30
mulpd %xmm0, %xmm2
addpd 0x23c1f(%rip), %xmm2    # 0x31f40
mulpd %xmm0, %xmm2
addpd 0x23c23(%rip), %xmm2    # 0x31f50
mulpd %xmm0, %xmm2
addpd 0x23c27(%rip), %xmm2    # 0x31f60
mulpd %xmm0, %xmm2
addpd 0x23c2b(%rip), %xmm2    # 0x31f70
mulpd %xmm0, %xmm2
addpd 0x23c2f(%rip), %xmm2    # 0x31f80
mulpd %xmm0, %xmm2
addpd 0x23c33(%rip), %xmm2    # 0x31f90
mulpd %xmm0, %xmm2
addpd 0x23c37(%rip), %xmm2    # 0x31fa0
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
divsd %xmm0, %xmm2
movapd %xmm2, (%rsp)
movapd 0x10(%rsp), %xmm0
movq %rbx, %rdi
callq 0x24569
movapd 0x20(%rsp), %xmm2
mulsd %xmm2, %xmm0
movapd (%rsp), %xmm1
mulsd %xmm2, %xmm1
addsd 0x21e55(%rip), %xmm1    # 0x301f8
mulsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
jmp 0xe0e9