For me the ideal distance between the ends of the underwire and tacking is 0,5 cm, no less and no more.
Firstly, the ends of the wire shall not press against the tacking, otherwise the ends will pirce through it. Secondly, the wire ends shall not be far away either because the bra line wont look good.