The program in this example demonstrates a stream-based approach to locating a zero of a given continuous function in a given interval via the so-called binary search. Unlike Newton-Raphson's method, binary search does not need the derivative of the given function, though its convergence rate is (much) slower than that of Newton-Raphson's method.
Happy programming in ATS!!!