def compute_a_mp(sigma, q, lmbd, verbose=False):
    lmbd_int = int(math.ceil(lmbd))
    if (lmbd_int == 0):
        return 1.0
    (mu0, mu1, mu) = distributions_mp(sigma, q)
    a_lambda_fn = (lambda z: (mu(z) * ((mu(z) / mu0(z)) ** lmbd_int)))
    a_lambda_first_term_fn = (lambda z: (mu0(z) * ((mu(z) / mu0(z)) ** lmbd_int)))
    a_lambda_second_term_fn = (lambda z: (mu1(z) * ((mu(z) / mu0(z)) ** lmbd_int)))
    a_lambda = integral_inf_mp(a_lambda_fn)
    a_lambda_first_term = integral_inf_mp(a_lambda_first_term_fn)
    a_lambda_second_term = integral_inf_mp(a_lambda_second_term_fn)
    if verbose:
        print('A: by numerical integration {} = {} + {}'.format(a_lambda, ((1 - q) * a_lambda_first_term), (q * a_lambda_second_term)))
    return _to_np_float64(a_lambda)
def compute_a_mp(sigma, q, lmbd, verbose=False):
    lmbd_int = int(math.ceil(lmbd))
    if (lmbd_int == 0):
        return 1.0
    (mu0, mu1, mu) = distributions_mp(sigma, q)
    a_lambda_fn = (lambda z: (mu(z) * ((mu(z) / mu0(z)) ** lmbd_int)))
    a_lambda_first_term_fn = (lambda z: (mu0(z) * ((mu(z) / mu0(z)) ** lmbd_int)))
    a_lambda_second_term_fn = (lambda z: (mu1(z) * ((mu(z) / mu0(z)) ** lmbd_int)))
    a_lambda = integral_inf_mp(a_lambda_fn)
    a_lambda_first_term = integral_inf_mp(a_lambda_first_term_fn)
    a_lambda_second_term = integral_inf_mp(a_lambda_second_term_fn)
    if verbose:
        print('A: by numerical integration {} = {} + {}'.format(a_lambda, ((1 - q) * a_lambda_first_term), (q * a_lambda_second_term)))
    return _to_np_float64(a_lambda)