Won't write it for you. Might try to help you work it out mostly on your own though. Since you are using an inserted drill, have you considered just using 2 or more drilling cycles. First one on X0. Next one on say X0.1 (0.050 DOC). And then so on until you get the size you want. If you are asking for a self-calculating macro type program, that is something entirely different.