Re: overflow question
Baker Kearfott wrote:
Arnold et al,
On 05/10/2012 05:17 AM, Arnold Neumaier wrote:
.
.
.
But this midpoint is useless. Your bisection algorithm will
spend most time exploring a tiny neighborhood of infinity.
Ah, yes. That is certainly a valid point of view if the
function, say, has a limit or a solution at infinity; in
such cases, the best solution to the user's problem
might be for the person posing
the problem to map the domain into a finite, closed
interval, with one end point corresponding to infinity.
In that context, bisecting a semi-infinite interval at
MAXREAL is like producing an interval whose end points
are consecutive floating point numbers.
Baker
When I run a plain-vanilla midpoint bisecton algorithm on the function
f(x) = sin(1/x)
on the interval domain X = [.1,+omega] it finds all four solutions
(including the solution at infinity)
X mid(X) F(X) wid(F(X))
================= ======= ================= =========
[1.7977e+308, 1.#INF] 1.7977e+308 [ 0,5.5627e-309] 5.5627e-309
[0.31094,0.31875] 0.31484 [-0.074419,0.0043377] 0.078757
[0.15469, 0.1625] 0.15859 [-0.12898,0.18047] 0.30945
[ 0.1,0.10781] 0.10391 [-0.54402,0.14886] 0.69288
Total bisections: 1038
Below are results I get using midpoint in the Interval Newton for the
function
f(x) = x^2*(2*x-3)
on the interval domain X = [1.1,+omega]:
Xn mid(Xn) N(Xn)
================= ======= =================
[ 1.1, 1.#INF] 1.7977e+308 [-1.#INF,1.7977e+308]
[ 1.1,1.7977e+308] 8.9885e+307 [-1.#INF,8.9885e+307]
[ 1.1,8.9885e+307] 4.4942e+307 [-1.#INF,4.4942e+307]
[ 1.1,4.4942e+307] 2.2471e+307 [-1.#INF,2.2471e+307]
...
[ 1.1, 10.096] 5.5981 [-383.58, 5.1319]
[ 1.1, 5.1319] 3.116 [-44.429, 2.8693]
[ 1.1, 2.8693] 1.9847 [-3.8003, 1.866]
[ 1.1, 1.866] 1.483 [ 1.4907, 1.5962]
[ 1.4907, 1.5962] 1.5435 [ 1.4963, 1.5072]
[ 1.4963, 1.5072] 1.5017 [ 1.5, 1.5]
Solution: [1.49998,1.50003]
Total iterations: 990
There may be more complicated ways to improve efficiency, but these
algorithms with midpoint are very simple and the performance is pretty good.
Nate
P.S. Sorry if this turns into a double-post, it appears the server did not
accept my first try.