Off the top of my head there isn't a short cut here. Let me think after I finish dinner...
To get started.. the formula would look something like
PHP Code:
-1<x<10
-1<y<10 <- (except when x = 0 then 0<y<9))
(10x+y)/(x+y)
but I don't think this will help much.