An accurately fast algorithm of calculating reflection/transmission coefficients