I have a case of costly calculations method like this:
Input -> Output
0 -> 8
8 -> 9
9 -> 9.5
9.5 -> 9.6
9.6 -> 9.65
9.65 -> 9.654
I use the output for the next input so this way im trying to find where the output exactly matches the input or is a tiny fraction smaller. The goal of the algorithm is to find the smallest X=Y or X>Y where (X-Y) > 10^(-10).
However since the method for calculations is costly I'm looking for an efficient way to reduce the amount of time I'm calling the method, but still retain for example the accuracy of 10 fractional digits.
Some additional Caveats: Output is not always increasing by increasing the Input. It might hop around the limit from both sides. Also increasing the Input value more drastically might change the value the Output approaches to which is not the desired outcome.
Since I'm posting here first time i would be glad if someone tagged this question with proper tags, since honestly i don't know which tags to use.