%mathpiper,def="MinimumBound"

10 # MinimumBound(_p)_(IsZero(p Where x==0)) <-- 0;

20 # MinimumBound(_p)_(Degree(p)>0) <--
[
  Local(an,result);
  an:=Coef(p,1 .. (Degree(p)))/Coef(p,0);
  an := N(Eval(Abs(an)^(1/(1 .. Degree(p)))));

  result:=0;
  an:=2*Maximum(an);
  if(Not IsZero(an)) [result := 1/an;];
  Simplify(Rationalize(result));
];
30 # MinimumBound(_p) <-- -Infinity;

%/mathpiper



%mathpiper_docs,name="MinimumBound",categories="User Functions;Solvers (Numeric)
*CMD MinimumBound --- return lower bounds on the absolute values of real roots of a polynomial
*STD
*CALL
	MinimumBound(p)

*PARMS

{p} - a polynomial in $x$

*DESC

Return minimum bounds for the absolute values of the real
roots of a polynomial {p}. The polynomial has to be converted to one with
rational coefficients first, and be made square-free.
The polynomial must use the variable {x}.

*E.G.

In> p:=SquareFree(Rationalize((x-3.1)*(x+6.23)))
Result: (-40000*x^2-125200*x+772520)/870489;
In> MinimumBound(p)
Result: 5000000000/2275491039;
In> N(%)
Result: 2.1973279236;

*SEE MaximumBound, SquareFree, RealRootsCount, FindRealRoots, Factor
%/mathpiper_docs