// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::ellipticintegrale(double, alglib_impl::ae_state*)
double ellipticintegrale(double m, ae_state *_state)
{
    double p;
    double q;
    double result;


    ae_assert(ae_fp_greater_eq(m,0)&&ae_fp_less_eq(m,1), "Domain error in EllipticIntegralE: m<0 or m>1", _state);
    m = 1-m;
    if( ae_fp_eq(m,0) )
    {
        result = 1;
        return result;
    }
    p = 1.53552577301013293365E-4;
    p = p*m+2.50888492163602060990E-3;
    p = p*m+8.68786816565889628429E-3;
    p = p*m+1.07350949056076193403E-2;
    p = p*m+7.77395492516787092951E-3;
    p = p*m+7.58395289413514708519E-3;
    p = p*m+1.15688436810574127319E-2;
    p = p*m+2.18317996015557253103E-2;
    p = p*m+5.68051945617860553470E-2;
    p = p*m+4.43147180560990850618E-1;
    p = p*m+1.00000000000000000299E0;
    q = 3.27954898576485872656E-5;
    q = q*m+1.00962792679356715133E-3;
    q = q*m+6.50609489976927491433E-3;
    q = q*m+1.68862163993311317300E-2;
    q = q*m+2.61769742454493659583E-2;
    q = q*m+3.34833904888224918614E-2;
    q = q*m+4.27180926518931511717E-2;
    q = q*m+5.85936634471101055642E-2;
    q = q*m+9.37499997197644278445E-2;
    q = q*m+2.49999999999888314361E-1;
    result = p-q*m*ae_log(m, _state);
    return result;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
callq 0x25c15
testb %al, %al
je 0xe04b
movsd 0x251a2(%rip), %xmm1    # 0x331e0
movsd 0x8(%rsp), %xmm0
callq 0x25bd9
jmp 0xe04d
xorl %eax, %eax
movzbl %al, %edi
leaq 0x27856(%rip), %rsi     # 0x358ad
movq %rbx, %rdx
callq 0x2510e
movsd 0x25179(%rip), %xmm0    # 0x331e0
subsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
callq 0x25b75
testb %al, %al
je 0xe08d
movsd 0x25158(%rip), %xmm0    # 0x331e0
jmp 0xe1b5
movsd 0x264bb(%rip), %xmm1    # 0x34550
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm1
addsd 0x264b1(%rip), %xmm1    # 0x34558
mulsd %xmm0, %xmm1
addsd 0x264ad(%rip), %xmm1    # 0x34560
mulsd %xmm0, %xmm1
addsd 0x264a9(%rip), %xmm1    # 0x34568
mulsd %xmm0, %xmm1
addsd 0x264a5(%rip), %xmm1    # 0x34570
mulsd %xmm0, %xmm1
addsd 0x264a1(%rip), %xmm1    # 0x34578
mulsd %xmm0, %xmm1
addsd 0x2649d(%rip), %xmm1    # 0x34580
mulsd %xmm0, %xmm1
addsd 0x26499(%rip), %xmm1    # 0x34588
mulsd %xmm0, %xmm1
addsd 0x26495(%rip), %xmm1    # 0x34590
mulsd %xmm0, %xmm1
addsd 0x26491(%rip), %xmm1    # 0x34598
mulsd %xmm0, %xmm1
addsd 0x250cd(%rip), %xmm1    # 0x331e0
movsd %xmm1, 0x18(%rsp)
movsd 0x2647f(%rip), %xmm1    # 0x345a0
mulsd %xmm0, %xmm1
addsd 0x2647b(%rip), %xmm1    # 0x345a8
mulsd %xmm0, %xmm1
addsd 0x26477(%rip), %xmm1    # 0x345b0
mulsd %xmm0, %xmm1
addsd 0x26473(%rip), %xmm1    # 0x345b8
mulsd %xmm0, %xmm1
addsd 0x2646f(%rip), %xmm1    # 0x345c0
mulsd %xmm0, %xmm1
addsd 0x2646b(%rip), %xmm1    # 0x345c8
mulsd %xmm0, %xmm1
addsd 0x26467(%rip), %xmm1    # 0x345d0
mulsd %xmm0, %xmm1
addsd 0x26463(%rip), %xmm1    # 0x345d8
mulsd %xmm0, %xmm1
addsd 0x2645f(%rip), %xmm1    # 0x345e0
mulsd %xmm0, %xmm1
addsd 0x2645b(%rip), %xmm1    # 0x345e8
movsd %xmm1, 0x10(%rsp)
movq %rbx, %rdi
callq 0x25f91
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
subsd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbx
retq