Algorithm for the Computation of the Generalized Fresnel Integral