Bug introduced in 9.0.1 or earlier and persisting through 12.3.1 or later
The following has no solution:
FindRoot[x == 1, {x, 0.25, 0, 0.5}]
And Mathematica correctly warns us:
FindRoot::reged: The point {0.5} is at the edge of the search region {0.,0.5} in coordinate 1 and the computed search direction points outside the region.
If we use Quiet
, we correctly suppress the message.
The following is exactly the same system, but here we ask for a specific numerical method
FindRoot[x == 1, {x, 0, 0.5}, Method -> "Brent"]
And we receive a similar warning:
FindRoot::bbrac: Method -> Brent is only applicable to univariate real functions and requires two real starting values that bracket the root.
But this time, if we add Quiet
, we still receive the same warning.
Why isn't Quiet
working (is it a bug)?
Quiet@Check[FindRoot[x == 1, {x, 0.25, 0, 0.5}, Method -> "Brent"], foo]
$\endgroup$Quiet
and;
together stop the message too. Could also useOff[FindRoot::bbrac]
$\endgroup$TracePrint
reveals two calls toMessage[FindRoot::bbrac]
. $\endgroup$Message
, and one suppressed, but only ifQuiet
is used. Here's a way to check:messageHandler = Print[{##}] &; Internal
AddHandler["Message", messageHandler];` It'll show things likeHold[Message[FindRoot::bbrac],True]
whereTrue
means not suppressed usingQuiet
. $\endgroup$