// File: /workspace/github_cpp_makefile_star2_O2/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 0x24295
testb %al, %al
je 0xd736
movsd 0x22acf(%rip), %xmm1    # 0x301f8
movsd 0x8(%rsp), %xmm0
callq 0x24259
jmp 0xd738
xorl %eax, %eax
movzbl %al, %edi
leaq 0x2515b(%rip), %rsi     # 0x3289d
movq %rbx, %rdx
callq 0x238ca
movsd 0x22aa6(%rip), %xmm0    # 0x301f8
subsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
callq 0x241f5
testb %al, %al
je 0xd778
movsd 0x22a85(%rip), %xmm0    # 0x301f8
jmp 0xd8a0
movsd 0x23dd0(%rip), %xmm1    # 0x31550
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm1
addsd 0x23dc6(%rip), %xmm1    # 0x31558
mulsd %xmm0, %xmm1
addsd 0x23dc2(%rip), %xmm1    # 0x31560
mulsd %xmm0, %xmm1
addsd 0x23dbe(%rip), %xmm1    # 0x31568
mulsd %xmm0, %xmm1
addsd 0x23dba(%rip), %xmm1    # 0x31570
mulsd %xmm0, %xmm1
addsd 0x23db6(%rip), %xmm1    # 0x31578
mulsd %xmm0, %xmm1
addsd 0x23db2(%rip), %xmm1    # 0x31580
mulsd %xmm0, %xmm1
addsd 0x23dae(%rip), %xmm1    # 0x31588
mulsd %xmm0, %xmm1
addsd 0x23daa(%rip), %xmm1    # 0x31590
mulsd %xmm0, %xmm1
addsd 0x23da6(%rip), %xmm1    # 0x31598
mulsd %xmm0, %xmm1
addsd 0x229fa(%rip), %xmm1    # 0x301f8
movsd %xmm1, 0x18(%rsp)
movsd 0x23d94(%rip), %xmm1    # 0x315a0
mulsd %xmm0, %xmm1
addsd 0x23d90(%rip), %xmm1    # 0x315a8
mulsd %xmm0, %xmm1
addsd 0x23d8c(%rip), %xmm1    # 0x315b0
mulsd %xmm0, %xmm1
addsd 0x23d88(%rip), %xmm1    # 0x315b8
mulsd %xmm0, %xmm1
addsd 0x23d84(%rip), %xmm1    # 0x315c0
mulsd %xmm0, %xmm1
addsd 0x23d80(%rip), %xmm1    # 0x315c8
mulsd %xmm0, %xmm1
addsd 0x23d7c(%rip), %xmm1    # 0x315d0
mulsd %xmm0, %xmm1
addsd 0x23d78(%rip), %xmm1    # 0x315d8
mulsd %xmm0, %xmm1
addsd 0x23d74(%rip), %xmm1    # 0x315e0
mulsd %xmm0, %xmm1
addsd 0x23d70(%rip), %xmm1    # 0x315e8
movsd %xmm1, 0x10(%rsp)
movq %rbx, %rdi
callq 0x2455f
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
subsd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbx
retq