And a multistart version of an efficient minimization algorithm is not what I would call "brute force".
OK, that kind of algorithm sure would be much more sophisticated than the steamroller tactics in my routine, but still it would have something of a brute force approach. There never will be a 100% algorithm as long as we are using a numericial approach. I guess we could find examples which fail even if I would use your fmin on every of my 10^4 intervals.
(imagine the global minimum is in increment 1, but the start of increment 1 happens to be larger than the start of increment 2. Then, unless I misread what you are doing, increment 2 will be passed to the next call in the recursion).
No, if the start of incerement 2 happens to be the minimum of all 10^4 samples, the next search takes place in increment 1 AND increment 2, one step to the left an the right of the current minimum. The min() and max() shall only ensure that we do not fall out of the interval. But of course it would be easy to find examples where this "algorithm" fails to find the gloabal minimum - a thin spike or a very high frequency signal should do. Using your minimization fmin on every interval (we wouldn't need 10^4 and no recursion would be needed) - basically thats what you call multistart, I guess - wouldn't be bullet proof but probably as near as we can come with reasonable costs.
The other arguments can be in any order, but the order must match the order in the function definition that terminates the solve block. It's as though they are being passed by order, rather than by name.
Anyway, its mystic to me. Especially dangereous, as a wrong order of arguments sometimes doesn't let the routine fail but simply return a wrong result.
I guess all those tricks will not work in Prime. At least a standard trick like
f(a,b):=a*sin(b)
g:=f(2)
and that way defining like g(x):=2*sin(x)
doesn't work anymore.
BTW, are you going to post a worksheet with your "nasty" cases in it, or are you hoping I will retype everything ?Image may be NSFW.
Clik here to view.
Idid not thinkit would beof such greatinterest - here it is ;-)