Numerical calculation of special function by means of the trapezoidal rule with high accuracy