Working - Improve if needed
Working - Improve if needed

The theory behind this solution is very tentative. As far as I know it works for all tested cases, but until I understand further I can't say for sure that it will work for all real numbers.
Chuck8521/LunchtimeBoredom,Chuck8521/LunchtimeBoredom,Chuck8521/LunchtimeBoredom