// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c500
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x31(%rbp)
jne 0x134ac
jmp 0x134c1
movsd -0x10(%rbp), %xmm0
movsd 0x41b4f(%rip), %xmm1    # 0x55008
callq 0x3c480
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
movq -0x18(%rbp), %rdx
movzbl %al, %edi
andl $0x1, %edi
leaq 0x441b8(%rip), %rsi     # 0x5768d
callq 0x3b240
movsd 0x41b26(%rip), %xmm0    # 0x55008
subsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c3d0
testb $0x1, %al
jne 0x134ff
jmp 0x1351b
movsd 0x41b01(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x137e4
movsd 0x43265(%rip), %xmm0    # 0x56788
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43242(%rip), %xmm1    # 0x56780
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4321b(%rip), %xmm1    # 0x56778
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x431f4(%rip), %xmm1    # 0x56770
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x431cd(%rip), %xmm1    # 0x56768
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x431a6(%rip), %xmm1    # 0x56760
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4317f(%rip), %xmm1    # 0x56758
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43158(%rip), %xmm1    # 0x56750
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43131(%rip), %xmm1    # 0x56748
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4310a(%rip), %xmm1    # 0x56740
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x419b3(%rip), %xmm1    # 0x55008
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x430d2(%rip), %xmm0    # 0x56738
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x430af(%rip), %xmm1    # 0x56730
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43088(%rip), %xmm1    # 0x56728
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43061(%rip), %xmm1    # 0x56720
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4303a(%rip), %xmm1    # 0x56718
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43013(%rip), %xmm1    # 0x56710
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x42fec(%rip), %xmm1    # 0x56708
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x42fc5(%rip), %xmm1    # 0x56700
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x42f9e(%rip), %xmm1    # 0x566f8
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x42f77(%rip), %xmm1    # 0x566f0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cd70
movsd -0x48(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x40(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nop