I have a function $$f(x)=m(\sin^2(\frac{n}{x}\pi)+\sin^2(x \pi))-k$$ where $m,n$ and $k$ are integers. I also have an interval $[a,b]$ where two roots must lie in. These root are simple (aka has a multiplicity of 1 and goes through the x-axis). These roots are close together, so that $|r_1-r_2|<2$. $f(a)$ and $f(b)$ need not to have opposite signs nor does $a$ or $b$ be close to any of the roots. So, my question is are there some root-finding algorithms or variants of the popular algorithms (Newton's, Secant, etc.) that can find one of the roots.
EDIT: I am interested in the algorithms independent of their programming (though if you want to give a coded example, it would be optimal to do it in Python 3)
One method I would use in school, when Newton's method would fail, is to use Newton's method EXCEPT divide f(x) by a sufficiently large number instead of dividing by the derivative. With this method, a program can run through millions of iterations quickly and still get the answer even if you set the denominator = +-1,000,000. It's sorta like setting the derivative equal to +-1,000,000 no matter what. Find one root by setting the lower bound negative and the derivative -1,000,000, Then find the other root by setting the upper bound positive and the derivative as 1,000,000. Use this formula: https://en.wikipedia.org/wiki/Newton%27s_method