MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

AllRoots, indented and functionalized .....

  • To: MATHGROUP at, PAUL at
  • Subject: AllRoots, indented and functionalized .....
  • From: "Mathematical Institute, (0865) 2-73525" <AKYILDIZ at>
  • Date: Sat, 10 Oct 92 16:42 BST



The built in function Real Interval is not (yet) bug-free.

For example, in Allan Hayes' code, f and (a-b) must be padded by N.

Programme below will also work with symbolic, i.e. Pi, interval
limits as well.

Thanks go to A.W. Wickstead of Queens Univ., Belfast and
Allan Hayes of Leicester Univ..

Yilmaz Akyildiz


lefthalf[RealInterval[{x_, y_}]]    := RealInterval[{x,(x+y)/2.}];
righthalf[RealInterval[{x_, y_}]]   := RealInterval[{(x+y)/2.,y}];
containszero[RealInterval[{x_,y_}]] :=  (x <= 0 <= y);
bisect[int_RealInterval]            := {lefthalf[int],righthalf[int]};

intbisecF[f_Function, a_, b_, tol_] :=
      {step =	Select[(bisect/@#)//Flatten, containszero[N[f[#]]]&]& },
      Nest[step, {RealInterval[N[{a,b}]]}, Ceiling[Log[2,N[(b-a)]/tol]]]

  • Prev by Date: Re: Memory management by Share[]?
  • Next by Date: RealInterval needing N
  • Previous by thread: Fortran Format
  • Next by thread: RealInterval needing N