[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53583] fzero should accept x0 as a scalar
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #53583] fzero should accept x0 as a scalar |
Date: |
Sun, 8 Apr 2018 11:42:10 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #3, bug #53583 (project octave):
Octave also accepts a scalar. See the last part of the documentation from
comment #1:
If X0 is a single scalar then several nearby and distant values are
probed in an attempt to obtain a valid bracketing. If this is not
successful, the function fails.
The issue is that if you don't give fzero a valid bracketing around the zero
you want it may probe and find a nearby zero instead. Taking not bessel, but
sin(x) which has zeros at 0, pi, 2*pi, 3*pi, etc. What value should be
returned for
fzero (@sin, pi/2)
In this case, the algorithm chooses 0, but it could just as well have chosen
the one at pi, or even one further away because the instructions weren't
explicit enough.
I suppose the auto-bracketing mechanism could be re-written. It's only a few
lines, but because the characteristics of the function are not known we don't
rely on derivatives.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53583>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/