If the two columns are equal, Y+3=X+5 and Y=X+2.
If X and Y are equal then OUT=IN-2.
If Y=2X+1 (for example), then OUT is 2X+4, and IN=X+5 and OUT=2(IN-5)+4, OUT=2IN-10+4=2IN-6.
In general, if Y=aX+b, then OUT=a(IN-5)+b+3, OUT=aIN-5a+b+3.
Or, if Y=f(X) then OUT=f(X)+3, so OUT=f(IN-5)+3.