// File: /workspace/github_cpp_makefile_star2_O1/mouda[P]LTE_random_access-simulate/specialfunctions.cpp
// Function: alglib_impl::invnormaldistribution(double, alglib_impl::ae_state*)
double invnormaldistribution(double y0, ae_state *_state)
{
    double expm2;
    double s2pi;
    double x;
    double y;
    double z;
    double y2;
    double x0;
    double x1;
    ae_int_t code;
    double p0;
    double q0;
    double p1;
    double q1;
    double p2;
    double q2;
    double result;


    expm2 = 0.13533528323661269189;
    s2pi = 2.50662827463100050242;
    if( ae_fp_less_eq(y0,0) )
    {
        result = -ae_maxrealnumber;
        return result;
    }
    if( ae_fp_greater_eq(y0,1) )
    {
        result = ae_maxrealnumber;
        return result;
    }
    code = 1;
    y = y0;
    if( ae_fp_greater(y,1.0-expm2) )
    {
        y = 1.0-y;
        code = 0;
    }
    if( ae_fp_greater(y,expm2) )
    {
        y = y-0.5;
        y2 = y*y;
        p0 = -59.9633501014107895267;
        p0 = 98.0010754185999661536+y2*p0;
        p0 = -56.6762857469070293439+y2*p0;
        p0 = 13.9312609387279679503+y2*p0;
        p0 = -1.23916583867381258016+y2*p0;
        q0 = 1;
        q0 = 1.95448858338141759834+y2*q0;
        q0 = 4.67627912898881538453+y2*q0;
        q0 = 86.3602421390890590575+y2*q0;
        q0 = -225.462687854119370527+y2*q0;
        q0 = 200.260212380060660359+y2*q0;
        q0 = -82.0372256168333339912+y2*q0;
        q0 = 15.9056225126211695515+y2*q0;
        q0 = -1.18331621121330003142+y2*q0;
        x = y+y*y2*p0/q0;
        x = x*s2pi;
        result = x;
        return result;
    }
    x = ae_sqrt(-2.0*ae_log(y, _state), _state);
    x0 = x-ae_log(x, _state)/x;
    z = 1.0/x;
    if( ae_fp_less(x,8.0) )
    {
        p1 = 4.05544892305962419923;
        p1 = 31.5251094599893866154+z*p1;
        p1 = 57.1628192246421288162+z*p1;
        p1 = 44.0805073893200834700+z*p1;
        p1 = 14.6849561928858024014+z*p1;
        p1 = 2.18663306850790267539+z*p1;
        p1 = -1.40256079171354495875*0.1+z*p1;
        p1 = -3.50424626827848203418*0.01+z*p1;
        p1 = -8.57456785154685413611*0.0001+z*p1;
        q1 = 1;
        q1 = 15.7799883256466749731+z*q1;
        q1 = 45.3907635128879210584+z*q1;
        q1 = 41.3172038254672030440+z*q1;
        q1 = 15.0425385692907503408+z*q1;
        q1 = 2.50464946208309415979+z*q1;
        q1 = -1.42182922854787788574*0.1+z*q1;
        q1 = -3.80806407691578277194*0.01+z*q1;
        q1 = -9.33259480895457427372*0.0001+z*q1;
        x1 = z*p1/q1;
    }
    else
    {
        p2 = 3.23774891776946035970;
        p2 = 6.91522889068984211695+z*p2;
        p2 = 3.93881025292474443415+z*p2;
        p2 = 1.33303460815807542389+z*p2;
        p2 = 2.01485389549179081538*0.1+z*p2;
        p2 = 1.23716634817820021358*0.01+z*p2;
        p2 = 3.01581553508235416007*0.0001+z*p2;
        p2 = 2.65806974686737550832*0.000001+z*p2;
        p2 = 6.23974539184983293730*0.000000001+z*p2;
        q2 = 1;
        q2 = 6.02427039364742014255+z*q2;
        q2 = 3.67983563856160859403+z*q2;
        q2 = 1.37702099489081330271+z*q2;
        q2 = 2.16236993594496635890*0.1+z*q2;
        q2 = 1.34204006088543189037*0.01+z*q2;
        q2 = 3.28014464682127739104*0.0001+z*q2;
        q2 = 2.89247864745380683936*0.000001+z*q2;
        q2 = 6.79019408009981274425*0.000000001+z*q2;
        x1 = z*p2/q2;
    }
    x = x0-x1;
    if( code!=0 )
    {
        x = -x;
    }
    result = x;
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
xorpd %xmm1, %xmm1
movsd %xmm0, (%rsp)
callq 0x2631e
testb %al, %al
je 0x5a60
movsd 0x2ebd5(%rip), %xmm0    # 0x34630
jmp 0x5dbe
movsd 0x2e738(%rip), %xmm1    # 0x341a0
movsd (%rsp), %xmm0
callq 0x2635a
testb %al, %al
je 0x5a83
movsd 0x2ebba(%rip), %xmm0    # 0x34638
jmp 0x5dbe
movsd 0x2ebb5(%rip), %xmm1    # 0x34640
movsd (%rsp), %xmm0
callq 0x2633e
movl %eax, %ebx
testb %al, %al
jne 0x5aa2
movsd (%rsp), %xmm0
jmp 0x5aaf
movsd 0x2e6f6(%rip), %xmm0    # 0x341a0
subsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x2eb8c(%rip), %xmm1    # 0x34648
callq 0x2633e
testb %al, %al
je 0x5b93
movsd (%rsp), %xmm3
addsd 0x2e9b2(%rip), %xmm3    # 0x34488
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movsd 0x2ec82(%rip), %xmm2    # 0x34768
mulsd %xmm0, %xmm2
addsd 0x2ec7e(%rip), %xmm2    # 0x34770
mulsd %xmm0, %xmm2
addsd 0x2ec7a(%rip), %xmm2    # 0x34778
mulsd %xmm0, %xmm2
addsd 0x2ec76(%rip), %xmm2    # 0x34780
mulsd %xmm0, %xmm2
addsd 0x2ec72(%rip), %xmm2    # 0x34788
movsd 0x2ec72(%rip), %xmm1    # 0x34790
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd 0x2ec6a(%rip), %xmm1    # 0x34798
mulsd %xmm0, %xmm1
addsd 0x2ec66(%rip), %xmm1    # 0x347a0
mulsd %xmm0, %xmm1
addsd 0x2ec62(%rip), %xmm1    # 0x347a8
mulsd %xmm0, %xmm1
addsd 0x2ec5e(%rip), %xmm1    # 0x347b0
mulsd %xmm0, %xmm1
addsd 0x2ec5a(%rip), %xmm1    # 0x347b8
mulsd %xmm0, %xmm1
addsd 0x2ec56(%rip), %xmm1    # 0x347c0
mulsd %xmm0, %xmm1
addsd 0x2ec52(%rip), %xmm1    # 0x347c8
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm0
divsd %xmm1, %xmm0
addsd %xmm3, %xmm0
mulsd 0x2ec42(%rip), %xmm0    # 0x347d0
jmp 0x5dbe
movsd (%rsp), %xmm0
movq %r14, %rdi
callq 0x266d6
mulsd 0x2e848(%rip), %xmm0    # 0x343f0
movq %r14, %rdi
callq 0x2658d
movsd %xmm0, 0x20(%rsp)
movq %r14, %rdi
callq 0x266d6
movsd 0x20(%rsp), %xmm2
divsd %xmm2, %xmm0
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
movsd 0x2e5c3(%rip), %xmm0    # 0x341a0
divsd %xmm2, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x2ea61(%rip), %xmm1    # 0x34650
movapd %xmm2, %xmm0
callq 0x262fe
testb %al, %al
je 0x5cd3
movsd 0x2ead8(%rip), %xmm0    # 0x346e0
movsd 0x18(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd 0x2eace(%rip), %xmm0    # 0x346e8
mulsd %xmm2, %xmm0
addsd 0x2eaca(%rip), %xmm0    # 0x346f0
mulsd %xmm2, %xmm0
addsd 0x2eac6(%rip), %xmm0    # 0x346f8
mulsd %xmm2, %xmm0
addsd 0x2eac2(%rip), %xmm0    # 0x34700
mulsd %xmm2, %xmm0
addsd 0x2eabe(%rip), %xmm0    # 0x34708
mulsd %xmm2, %xmm0
addsd 0x2eaba(%rip), %xmm0    # 0x34710
mulsd %xmm2, %xmm0
addsd 0x2eab6(%rip), %xmm0    # 0x34718
mulsd %xmm2, %xmm0
addsd 0x2eab2(%rip), %xmm0    # 0x34720
movsd 0x2eab2(%rip), %xmm1    # 0x34728
addsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
addsd 0x2eaaa(%rip), %xmm1    # 0x34730
mulsd %xmm2, %xmm1
addsd 0x2eaa6(%rip), %xmm1    # 0x34738
mulsd %xmm2, %xmm1
addsd 0x2eaa2(%rip), %xmm1    # 0x34740
mulsd %xmm2, %xmm1
addsd 0x2ea9e(%rip), %xmm1    # 0x34748
mulsd %xmm2, %xmm1
addsd 0x2ea9a(%rip), %xmm1    # 0x34750
mulsd %xmm2, %xmm1
addsd 0x2ea96(%rip), %xmm1    # 0x34758
mulsd %xmm2, %xmm1
addsd 0x2ea92(%rip), %xmm1    # 0x34760
jmp 0x5da1
movsd 0x2e97d(%rip), %xmm0    # 0x34658
movsd 0x18(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd 0x2e973(%rip), %xmm0    # 0x34660
mulsd %xmm2, %xmm0
addsd 0x2e96f(%rip), %xmm0    # 0x34668
mulsd %xmm2, %xmm0
addsd 0x2e96b(%rip), %xmm0    # 0x34670
mulsd %xmm2, %xmm0
addsd 0x2e967(%rip), %xmm0    # 0x34678
mulsd %xmm2, %xmm0
addsd 0x2e963(%rip), %xmm0    # 0x34680
mulsd %xmm2, %xmm0
addsd 0x2e95f(%rip), %xmm0    # 0x34688
mulsd %xmm2, %xmm0
addsd 0x2e95b(%rip), %xmm0    # 0x34690
mulsd %xmm2, %xmm0
addsd 0x2e957(%rip), %xmm0    # 0x34698
movsd 0x2e957(%rip), %xmm1    # 0x346a0
addsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
addsd 0x2e94f(%rip), %xmm1    # 0x346a8
mulsd %xmm2, %xmm1
addsd 0x2e94b(%rip), %xmm1    # 0x346b0
mulsd %xmm2, %xmm1
addsd 0x2e947(%rip), %xmm1    # 0x346b8
mulsd %xmm2, %xmm1
addsd 0x2e943(%rip), %xmm1    # 0x346c0
mulsd %xmm2, %xmm1
addsd 0x2e93f(%rip), %xmm1    # 0x346c8
mulsd %xmm2, %xmm1
addsd 0x2e93b(%rip), %xmm1    # 0x346d0
mulsd %xmm2, %xmm1
addsd 0x2e937(%rip), %xmm1    # 0x346d8
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movapd (%rsp), %xmm0
subsd %xmm2, %xmm0
testb %bl, %bl
jne 0x5dbe
xorpd 0x2e422(%rip), %xmm0    # 0x341e0
addq $0x28, %rsp
popq %rbx
popq %r14
retq