// File: 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 %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movsd %xmm0, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movsd 0x4ed8c(%rip), %xmm0    # 0x55618
movsd %xmm0, -0x20(%rbp)
movsd 0x4ed77(%rip), %xmm0    # 0x55610
movsd %xmm0, -0x28(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
callq 0x3c480
testb $0x1, %al
jne 0x68b1
jmp 0x68d3
movsd 0x4eef7(%rip), %xmm0    # 0x557b0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x70fb
movsd -0x10(%rbp), %xmm0
movsd 0x4e728(%rip), %xmm1    # 0x55008
callq 0x3c500
testb $0x1, %al
jne 0x68eb
jmp 0x690d
movsd 0x4eeb5(%rip), %xmm0    # 0x557a8
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x70fb
movq $0x1, -0x60(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x4e6dc(%rip), %xmm1    # 0x55008
subsd -0x20(%rbp), %xmm1
callq 0x3c4c0
testb $0x1, %al
jne 0x693c
jmp 0x6956
movsd 0x4e6c4(%rip), %xmm0    # 0x55008
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq $0x0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
callq 0x3c4c0
testb $0x1, %al
jne 0x696e
jmp 0x6b71
movsd -0x38(%rbp), %xmm0
movsd 0x4ead5(%rip), %xmm1    # 0x55450
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x4ee05(%rip), %xmm0    # 0x557a0
movsd %xmm0, -0x68(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ede2(%rip), %xmm1    # 0x55798
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4edbb(%rip), %xmm1    # 0x55790
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ed94(%rip), %xmm1    # 0x55788
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ed6d(%rip), %xmm1    # 0x55780
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x4e5e4(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ed39(%rip), %xmm1    # 0x55778
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ed12(%rip), %xmm1    # 0x55770
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4eceb(%rip), %xmm1    # 0x55768
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ecc4(%rip), %xmm1    # 0x55760
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ec9d(%rip), %xmm1    # 0x55758
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ec76(%rip), %xmm1    # 0x55750
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ec4f(%rip), %xmm1    # 0x55748
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ec28(%rip), %xmm1    # 0x55740
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
divsd -0x70(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x70fb
movsd -0x38(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cd70
movaps %xmm0, %xmm1
movsd 0x4ea9e(%rip), %xmm0    # 0x55628
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rdi
callq 0x3c890
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x30(%rbp), %xmm0
movq -0x18(%rbp), %rdi
callq 0x3cd70
movaps %xmm0, %xmm1
movsd -0xa0(%rbp), %xmm0
divsd -0x30(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x4e430(%rip), %xmm0    # 0x55008
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x4ea31(%rip), %xmm1    # 0x55620
callq 0x3c440
testb $0x1, %al
jne 0x6bfd
jmp 0x6e20
movsd 0x4eb33(%rip), %xmm0    # 0x55738
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4eb10(%rip), %xmm1    # 0x55730
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4eae9(%rip), %xmm1    # 0x55728
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4eac2(%rip), %xmm1    # 0x55720
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ea9b(%rip), %xmm1    # 0x55718
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ea74(%rip), %xmm1    # 0x55710
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ea4d(%rip), %xmm1    # 0x55708
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4ea26(%rip), %xmm1    # 0x55700
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e9ff(%rip), %xmm1    # 0x556f8
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x4e2fe(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e9cb(%rip), %xmm1    # 0x556f0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e9a4(%rip), %xmm1    # 0x556e8
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e97d(%rip), %xmm1    # 0x556e0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e956(%rip), %xmm1    # 0x556d8
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e92f(%rip), %xmm1    # 0x556d0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e908(%rip), %xmm1    # 0x556c8
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e8e1(%rip), %xmm1    # 0x556c0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e8ba(%rip), %xmm1    # 0x556b8
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x70aa
movsd 0x4e888(%rip), %xmm0    # 0x556b0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e85f(%rip), %xmm1    # 0x556a8
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e832(%rip), %xmm1    # 0x556a0
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e805(%rip), %xmm1    # 0x55698
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e7d8(%rip), %xmm1    # 0x55690
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e7ab(%rip), %xmm1    # 0x55688
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e77e(%rip), %xmm1    # 0x55680
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e751(%rip), %xmm1    # 0x55678
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e724(%rip), %xmm1    # 0x55670
addsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x4e0a8(%rip), %xmm0    # 0x55008
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e6e7(%rip), %xmm1    # 0x55668
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e6ba(%rip), %xmm1    # 0x55660
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e68d(%rip), %xmm1    # 0x55658
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e660(%rip), %xmm1    # 0x55650
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e633(%rip), %xmm1    # 0x55648
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e606(%rip), %xmm1    # 0x55640
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e5d9(%rip), %xmm1    # 0x55638
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x4e5ac(%rip), %xmm1    # 0x55630
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x88(%rbp), %xmm0
divsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x50(%rbp), %xmm0
subsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x70e1
movsd -0x30(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)