Generalised Bisection Method for Optimum Ultrasonic Ray Tracing and Focusing in Multi-Layered Structures