program Tint, rclass

args h a jmax cutpoint

tempvar seriesL
tempvar seriesH


if (`h'<=8){
		local hL = `h'
		local hH = -99
}
else{
		local hH = `h'
		local hL = -99
}
if (`hL' != -99){
tempvar series
mata: f1(`hL',`jmax',`a')
mat `series'= r(seriesL)
}

if (`hH' != -99){
tempvar series
local seriest = atan(`a')*exp(-0.5*(`hH'^2)*`a'/atan(`a'))*(1+0.00868*(`hH'*`a')^4)/(2*_pi)
mat `series' = `seriest'
}

local value=`series'[1,1]
return scalar m=`value'
end