I just want to get the sign of the expression, 12-yf[i,j]
but if I divide the absolute value like this, (12-yf[i,j])/abs(12-yf[i,j])
when yf[i,j]=12, the denominator will appear to be 0,and ampl may report an error, what should I do？

Rounded to 10 decimal places, it can take only two values:

if yr_{ij} < 12 then -log_{10} (exp(200)+10^{12}) = -86.8588963807
if yr_{ij} = 12 then -log_{10} (exp(0)+10^{12}) = -12
if yr_{ij} > 12 then -log_{10} (exp(-200)+10^{12}) = -12

This would be easy to write using an AMPL if-then-else expression:

(xr[i,j] - large_radius) >=
if yr[i,j] >= 12 then -12 else -86.8588963807