// File: mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::ellipticintegralkhighprecision(double, alglib_impl::ae_state*)
double ellipticintegralkhighprecision(double m1, ae_state *_state)
{
    double p;
    double q;
    double result;


    if( ae_fp_less_eq(m1,ae_machineepsilon) )
    {
        result = 1.3862943611198906188E0-0.5*ae_log(m1, _state);
    }
    else
    {
        p = 1.37982864606273237150E-4;
        p = p*m1+2.28025724005875567385E-3;
        p = p*m1+7.97404013220415179367E-3;
        p = p*m1+9.85821379021226008714E-3;
        p = p*m1+6.87489687449949877925E-3;
        p = p*m1+6.18901033637687613229E-3;
        p = p*m1+8.79078273952743772254E-3;
        p = p*m1+1.49380448916805252718E-2;
        p = p*m1+3.08851465246711995998E-2;
        p = p*m1+9.65735902811690126535E-2;
        p = p*m1+1.38629436111989062502E0;
        q = 2.94078955048598507511E-5;
        q = q*m1+9.14184723865917226571E-4;
        q = q*m1+5.94058303753167793257E-3;
        q = q*m1+1.54850516649762399335E-2;
        q = q*m1+2.39089602715924892727E-2;
        q = q*m1+3.01204715227604046988E-2;
        q = q*m1+3.73774314173823228969E-2;
        q = q*m1+4.88280347570998239232E-2;
        q = q*m1+7.03124996963957469739E-2;
        q = q*m1+1.24999999999870820058E-1;
        q = q*m1+4.99999999999999999821E-1;
        result = p-q*ae_log(m1, _state);
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movsd %xmm0, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0x42f2a(%rip), %xmm1    # 0x55918
callq 0x3c480
testb $0x1, %al
jne 0x129f9
jmp 0x12a29
movsd -0x8(%rbp), %xmm0
movq -0x10(%rbp), %rdi
callq 0x3cd70
movsd 0x42e91(%rip), %xmm1    # 0x558a0
mulsd %xmm1, %xmm0
movsd 0x43c75(%rip), %xmm1    # 0x56690
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x12d02
movsd 0x43caf(%rip), %xmm0    # 0x566e0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43c8c(%rip), %xmm1    # 0x566d8
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43c65(%rip), %xmm1    # 0x566d0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43c3e(%rip), %xmm1    # 0x566c8
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43c17(%rip), %xmm1    # 0x566c0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43bf0(%rip), %xmm1    # 0x566b8
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43bc9(%rip), %xmm1    # 0x566b0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43ba2(%rip), %xmm1    # 0x566a8
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43b7b(%rip), %xmm1    # 0x566a0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43b54(%rip), %xmm1    # 0x56698
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43b2d(%rip), %xmm1    # 0x56690
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x43b14(%rip), %xmm0    # 0x56688
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43af1(%rip), %xmm1    # 0x56680
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43aca(%rip), %xmm1    # 0x56678
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43aa3(%rip), %xmm1    # 0x56670
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43a7c(%rip), %xmm1    # 0x56668
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43a55(%rip), %xmm1    # 0x56660
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43a2e(%rip), %xmm1    # 0x56658
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x43a07(%rip), %xmm1    # 0x56650
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x439e0(%rip), %xmm1    # 0x56648
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x439b9(%rip), %xmm1    # 0x56640
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x427aa(%rip), %xmm1    # 0x55450
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x8(%rbp), %xmm0
movq -0x10(%rbp), %rdi
callq 0x3cd70
movsd -0x38(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)