regula-falsi algorithm implementation