The relationship between the three irradiance components can be expressed by the closure equation:
GHI = DHI + DNI * cos(zenith)
Given that you have two of the three irradiance components, the third can be calculated. Thus it is not advisable to use a model such as the DISC!
The function that Saurabh linked to implements the closure equation but implements some clever limits for high solar zenith angles to reduce unfeasible high values near sunrise/sunset. The reason unfeasible values tend to occur is that cos(zenith) approaches zero at sunrise/sunset and small measurement uncertainties in GHI/DHI are magnified as DNI = (GHI-DHI)/cos(zenith).