Method on @infsup: [A, B] = bisect (X)

Bisect an interval into two intervals, which contain half the amount of binary64 numbers each.

Instead of bisecting the values of numbers in the interval at mid (X), this function bisects a function that counts them. In a bisect method this eliminates exactly half of the solutions and avoids slow convergence speeds in extreme cases.

If all numbers in interval X are of equal sign, the pivot element used for bisection is pow2 (mid (log2 (abs (X)))). If X is no empty interval, the intervals A and B are non-empty and satisfy A.sup == B.inf.

[a, b] = bisect (infsup (2, 32))
  ⇒
    a = [2, 8]
    b = [8, 32]

See also: @infsup/mince, @infsup/nextout.

Package: interval