<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def truncated_pareto_expval(alpha, m, b):
 """ Expected value of truncated Pareto distribution. """


    if alpha <= 1:
        return inf
    part1 = (m ** alpha) / (1. - (m / b) ** alpha)
    part2 = 1. * alpha / (alpha - 1)
    part3 = (1. / (m ** (alpha - 1)) - 1. / (b ** (alpha - 1.)))
    return part1 * part2 * part3