The coding of a simulation often depends on the purpose for the simulation.
For glass (index of refraction =1.5), the intensity of reflected ray is roughly 4% of the incoming ray for normal incident.
The reflected ray become important when total reflection occurs (or at angle near that).
The intensity of the reflected/refracted ray also depends on it's polarization.
Are you working with polarized light?
Does the incoming ray is always horizontally or it need to be adjustable?
Do you need slope value for different rays?
For different problem, the best way to solve might be different.
I can understand if you do not want to tell me the purpose of the project.
However, you can at least tell me what kind of information you need to find out from the simulation (The specification for the simulation)!
It is become difficuit if you keep asking me one more thing at a time (because I might need to change the design of the simulation because of different requirement).
I will try to create another simulation for you. But I can not be sure that it will be what you really need unless I can get more detail information from you! I am waiting for your information/specification for the simulation!-*-