Re: hp 35s not very impressive (WP 34S solutions) Message #55 Posted by Walter B on 30 Aug 2012, 8:15 a.m., in response to message #54 by Valentin Albillo
OK, I plotted the equation y = sin(x + cos(x))  1 and found its root at pi/2 is the maximum of this function. So, in an attempt to cure the problem, I modified the equation slightly:
y = sin(x + cos(x))  1 + d with d << 1.
I solved it for different values of d (stored in R00). These are the results for DBLON, taking 0 and pi as first guesses and setting the display to ALL 00 (edit: I added the results of a second run with 1 and 2 as first guesses):
d x_root(0, pi) x_root(1, 2)
1e3 2,22036201033 2,22036201033
1e6 1,77490289682 1,77490289682
1e7 1,70980074769 1,70980074769
1e8 1,6654825901 1,6654825901
1e9 1,63530016132 29,7806263746
1e10 1,61474064464 1,52685200895
1e11 no root found 1,57079703157 8840433,65927
1e12 no root found 1,57079639727 1,59119295725
1e15 no root found 1,57079632687 4,71883892102
1e18 no root found 1,57079632679 (= pi/2 + 7e14) 10579,2744561
1e21 no root found 1,57079632679 (= pi/2 + 7e17)
1e24 no root found 1,57079632679 (= pi/2 + 7e20)
1e27 no root found 1,57079632679 (= pi/2 + 7e23)
1e30 no root found 1,57079632679 (= pi/2 + 7e26)
1e33 no root found 1,57079632679 (= pi/2 + 7e29)
Just checked the HP15C Owner's Handbook, Appendix D. The function given by Valentin doesn't fulfill the conditions stated on p.221f there. Although that's not explaining why the algorithm seems to fail, it shows at least that other folks may have had problems, too, with such functions.
Let's take a closer look to the last case solved properly and the first case apparently going banana (d = 1e8 and d = 1e9 for the initial estimates 1 and 2):
SLV returns for d = 1e8: x= 1,6654825901, yx= 9,44475624443e14, z= 0
and returns for d = 1e9: x= 29,7806263746, y= 4,22728651914, z= 0.
Despite of the strange result, it's fully correct. The function Valentin gave us is periodic. It has an infinite number of roots. And the neighborhood of each root is extremely illconditioned. Close to the roots, the function runs almost horizontally. So any search algorithm working with the tangent to the curve will become unstable, i.e. the next sample point may be far off and another root will be found (remember: there is an infinite number of them).
OK, and what's to be learned? Do not throw anything you don't know in any automatic device :)
Edited to merge two postings.
Edited: 31 Aug 2012, 6:38 a.m. after one or more responses were posted
