This procedure is designed for Northern / Central Europe and uses the equation for saturation pressure over ice.
tc500mb = temperature at 500hPa [°C]
rh500mb = relative humidity at 500hPa [%]

'define dewp500mb = tc500mb-((14.55+0.114*tc500mb)*(1-0.01*rh500mb)+pow((2.5+0.007*tc500mb)
                    *(1-0.01*rh500mb),3)+(15.9+0.117*tc500mb)*pow((1-0.01*rh500mb),14))'
'define vapr500mb = 6.1115*exp((23.036-dewp500mb/333.7)*dewp500mb/(279.82+dewp500mb))'
'define e500mb    = vapr500mb*1.001+(500-100)/900*0.0034'
'define w500mb    = 0.62197*(e500mb/(500-e500mb))'
'define te500mb   = tmp500mb+(2260000*w500mb/1004)'
'define ept500mb  = (te500mb*pow((1000/500),(287/1004)))-273.16'