// File: mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::errorfunctionc(double, alglib_impl::ae_state*)
double errorfunctionc(double x, ae_state *_state)
{
    double p;
    double q;
    double result;


    if( ae_fp_less(x,0) )
    {
        result = 2-errorfunctionc(-x, _state);
        return result;
    }
    if( ae_fp_less(x,0.5) )
    {
        result = 1.0-errorfunction(x, _state);
        return result;
    }
    if( ae_fp_greater_eq(x,10) )
    {
        result = 0;
        return result;
    }
    p = 0.0;
    p = 0.5641877825507397413087057563+x*p;
    p = 9.675807882987265400604202961+x*p;
    p = 77.08161730368428609781633646+x*p;
    p = 368.5196154710010637133875746+x*p;
    p = 1143.262070703886173606073338+x*p;
    p = 2320.439590251635247384768711+x*p;
    p = 2898.0293292167655611275846+x*p;
    p = 1826.3348842295112592168999+x*p;
    q = 1.0;
    q = 17.14980943627607849376131193+x*q;
    q = 137.1255960500622202878443578+x*q;
    q = 661.7361207107653469211984771+x*q;
    q = 2094.384367789539593790281779+x*q;
    q = 4429.612803883682726711528526+x*q;
    q = 6089.5424232724435504633068+x*q;
    q = 4958.82756472114071495438422+x*q;
    q = 1826.3348842295112595576438+x*q;
    result = ae_exp(-ae_sqr(x, _state), _state)*p/q;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c440
testb $0x1, %al
jne 0x6124
jmp 0x616c
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x18(%rbp), %rdi
callq 0x6100
movaps %xmm0, %xmm1
movsd 0x4f274(%rip), %xmm0    # 0x553c8
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x6430
movsd -0x10(%rbp), %xmm0
movsd 0x4f2d7(%rip), %xmm1    # 0x55450
callq 0x3c440
testb $0x1, %al
jne 0x6184
jmp 0x61b5
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x5d40
movaps %xmm0, %xmm1
movsd 0x4ee6b(%rip), %xmm0    # 0x55008
subsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x6430
movsd -0x10(%rbp), %xmm0
movsd 0x4f366(%rip), %xmm1    # 0x55528
callq 0x3c500
testb $0x1, %al
jne 0x61cd
jmp 0x61e4
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x6430
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f3fe(%rip), %xmm1    # 0x55600
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f3d7(%rip), %xmm1    # 0x555f8
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f3b0(%rip), %xmm1    # 0x555f0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f389(%rip), %xmm1    # 0x555e8
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f362(%rip), %xmm1    # 0x555e0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f33b(%rip), %xmm1    # 0x555d8
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f314(%rip), %xmm1    # 0x555d0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f2b5(%rip), %xmm1    # 0x55590
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x4ed1c(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f2c1(%rip), %xmm1    # 0x555c8
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f29a(%rip), %xmm1    # 0x555c0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f273(%rip), %xmm1    # 0x555b8
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f24c(%rip), %xmm1    # 0x555b0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f225(%rip), %xmm1    # 0x555a8
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f1fe(%rip), %xmm1    # 0x555a0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f1d7(%rip), %xmm1    # 0x55598
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f1b0(%rip), %xmm1    # 0x55590
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c870
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cdd0
mulsd -0x20(%rbp), %xmm0
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)