The code for smallpt, that is a global illumination renderer, has an implementation of the refract function; that implementation seems to me similar to the one in your question. The implementation is explained in a presentation slides by David Cline; I attach here the relevant slide:
According to Wikipedia the formula is explained in the book:
GLASSNER, Andrews (ed.). An introduction to ray tracing. Morgan Kaufmann, 1989.
In Glassner's book the section 5 in chapter 7 (written by Paul Heckbert) is titled "Derivation of Refraction Formulas", that section is available at Heckbert's page; in that section Heckbert derives the formulas used in those two papers:
WHITTED, Turner. An improved illumination model for shaded display. Comm. ACM, 1980, 23.6.
HECKBERT, Paul S.; HANRAHAN, Pat. Beam tracing polygonal objects. In: ACM SIGGRAPH Computer Graphics. ACM, 1984. p. 119-127.