// File: /workspace/github_cpp_makefile_star2_O1/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 0x2635a
testb %al, %al
je 0xe107
movsd 0x260a6(%rip), %xmm1    # 0x341a0
movsd 0x8(%rsp), %xmm0
callq 0x2631e
jmp 0xe109
xorl %eax, %eax
movzbl %al, %edi
leaq 0x285fa(%rip), %rsi     # 0x3670d
movq %rbx, %rdx
callq 0x2581c
movsd 0x2607d(%rip), %xmm0    # 0x341a0
subsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
callq 0x262ba
testb %al, %al
je 0xe149
movsd 0x2605c(%rip), %xmm0    # 0x341a0
jmp 0xe271
movsd 0x27607(%rip), %xmm1    # 0x35758
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm1
addsd 0x275fd(%rip), %xmm1    # 0x35760
mulsd %xmm0, %xmm1
addsd 0x275f9(%rip), %xmm1    # 0x35768
mulsd %xmm0, %xmm1
addsd 0x275f5(%rip), %xmm1    # 0x35770
mulsd %xmm0, %xmm1
addsd 0x275f1(%rip), %xmm1    # 0x35778
mulsd %xmm0, %xmm1
addsd 0x275ed(%rip), %xmm1    # 0x35780
mulsd %xmm0, %xmm1
addsd 0x275e9(%rip), %xmm1    # 0x35788
mulsd %xmm0, %xmm1
addsd 0x275e5(%rip), %xmm1    # 0x35790
mulsd %xmm0, %xmm1
addsd 0x275e1(%rip), %xmm1    # 0x35798
mulsd %xmm0, %xmm1
addsd 0x275dd(%rip), %xmm1    # 0x357a0
mulsd %xmm0, %xmm1
addsd 0x25fd1(%rip), %xmm1    # 0x341a0
movsd %xmm1, 0x18(%rsp)
movsd 0x275cb(%rip), %xmm1    # 0x357a8
mulsd %xmm0, %xmm1
addsd 0x275c7(%rip), %xmm1    # 0x357b0
mulsd %xmm0, %xmm1
addsd 0x275c3(%rip), %xmm1    # 0x357b8
mulsd %xmm0, %xmm1
addsd 0x275bf(%rip), %xmm1    # 0x357c0
mulsd %xmm0, %xmm1
addsd 0x275bb(%rip), %xmm1    # 0x357c8
mulsd %xmm0, %xmm1
addsd 0x275b7(%rip), %xmm1    # 0x357d0
mulsd %xmm0, %xmm1
addsd 0x275b3(%rip), %xmm1    # 0x357d8
mulsd %xmm0, %xmm1
addsd 0x275af(%rip), %xmm1    # 0x357e0
mulsd %xmm0, %xmm1
addsd 0x275ab(%rip), %xmm1    # 0x357e8
mulsd %xmm0, %xmm1
addsd 0x275a7(%rip), %xmm1    # 0x357f0
movsd %xmm1, 0x10(%rsp)
movq %rbx, %rdi
callq 0x266d6
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
subsd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbx
retq