// File: mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::errorfunction(double, alglib_impl::ae_state*)
double errorfunction(double x, ae_state *_state)
{
    double xsq;
    double s;
    double p;
    double q;
    double result;


    s = ae_sign(x, _state);
    x = ae_fabs(x, _state);
    if( ae_fp_less(x,0.5) )
    {
        xsq = x*x;
        p = 0.007547728033418631287834;
        p = 0.288805137207594084924010+xsq*p;
        p = 14.3383842191748205576712+xsq*p;
        p = 38.0140318123903008244444+xsq*p;
        p = 3017.82788536507577809226+xsq*p;
        p = 7404.07142710151470082064+xsq*p;
        p = 80437.3630960840172832162+xsq*p;
        q = 0.0;
        q = 1.00000000000000000000000+xsq*q;
        q = 38.0190713951939403753468+xsq*q;
        q = 658.070155459240506326937+xsq*q;
        q = 6379.60017324428279487120+xsq*q;
        q = 34216.5257924628539769006+xsq*q;
        q = 80437.3630960840172826266+xsq*q;
        result = s*1.1283791670955125738961589031*x*p/q;
        return result;
    }
    if( ae_fp_greater_eq(x,10) )
    {
        result = s;
        return result;
    }
    result = s*(1-errorfunctionc(x, _state));
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c8c0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c820
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x4f6c7(%rip), %xmm1    # 0x55450
callq 0x3c440
testb $0x1, %al
jne 0x5d97
jmp 0x5f5c
movsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x4f7da(%rip), %xmm0    # 0x55588
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f7b7(%rip), %xmm1    # 0x55580
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f790(%rip), %xmm1    # 0x55578
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f769(%rip), %xmm1    # 0x55570
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f742(%rip), %xmm1    # 0x55568
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f71b(%rip), %xmm1    # 0x55560
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f6d4(%rip), %xmm1    # 0x55538
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f17d(%rip), %xmm1    # 0x55008
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f6ae(%rip), %xmm1    # 0x55558
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f687(%rip), %xmm1    # 0x55550
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f660(%rip), %xmm1    # 0x55548
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f639(%rip), %xmm1    # 0x55540
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4f612(%rip), %xmm1    # 0x55538
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x4f5f9(%rip), %xmm0    # 0x55530
mulsd -0x28(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
divsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x5fc9
movsd -0x10(%rbp), %xmm0
movsd 0x4f5bf(%rip), %xmm1    # 0x55528
callq 0x3c500
testb $0x1, %al
jne 0x5f74
jmp 0x5f8a
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x5fc9
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x6100
movaps %xmm0, %xmm2
movsd -0x48(%rbp), %xmm0
movsd 0x4f056(%rip), %xmm1    # 0x55008
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)