Abstraction: binratintvl Version: 1 Date: 29 November 2003; revised 29 November 2003 Author: Mike O'Donnell Derived from ratintvl-4 Values in the binratintvl abstraction are closed intervals [(m-1)*2^n, (m+1)*2^n], where m and n are integers. They are intended to represent approximate information about real numbers, but all procedures are defined in terms of their effects on the intervals. Constructors ------------ (make_binratintvl r1 r2) takes integers m and n, and returns a representation of the closed interval [(m-1)*2^n, (m+1)*2^n]. (rational->ratintvl r) returns the smallest closed binary rational interval containing the given rational r. Predicates ---------- (binratintvl? expr) returns #t if expr is a ratintvl, #f otherwise. (member_binratintvl? r bri) returns #t if the rational r is a member of the ratintvl bri, #f otherwise. (contained_binratintvl? bri1 bri2) returns #t if bri1 is a subinterval (possibly equal) of bri2, #f otherwise. (equal_binratintvl? bri1 bri2) returns #t if bri1=bri2, #f otherwise. (precedes_binratintvl? bri1 bri2) returns #t if all reals in ri1 strictly precede all reals in bri2. (overlaps_binratintvl? bri1 bri2) returns #t if there is at least one real number that is a member of both bri1 and bri2 (equivalently, if the intersection of bri1 and bri2 is not empty), #f otherwise. (lbounds_binratintvl? bri1, bri2) returns #t if bri1 contains at least one real less than all reals in bri2, #f otherwise. (ubounded_binratintvl? bri1, bri2) returns #t if bri2 contains at least one real greater than all reals in bri1, #f otherwise. Operations ---------- (union_binratintvl bri1 bri2) returns the smallest binratintvl containing all reals in bri1 and all reals in bri2. (intersect_binratintvl bri1 bri2) returns the smallest binratintvl containing all reals that are in both of bri1 and bri2. (add_binratintvl bri1 bri2) returns the smallest binratintvl containing all sums of one real in bri1 plus one real in bri2. (sub_binratintvl bri1 bri2) returns the smallest binratintvl containing all differences of one real in bri1 minus one real in bri2. (mult_binratintvl bri1 bri2) returns the binratintvl containing all products of one real in bri1 times one real in bri2. (div_binratintvl bri1 bri2) returns the binratintvl containing all ratios of one real in bri1 divided by one real in bri2. (power_binratintvl bri int) returns the binratintvl containing all values of one real in bri to the integer power int. Selectors --------- (min_binratintvl->rational bri) returns the left rational endpoint of bri. (max_binratintvl->rational bri) returns the right rational endpoint of bri. (abs_tolerance_binratintvl bri) returns the width r2-r1 of bri=[r1,r2]. (rel_tolerance_binratintvl bri) returns the relative width (r2-r1)/max(|r1|,|r2|) of bri=[r1,r2]. (mantissa_binratintvl bri) returns m, where bri=[(m-1)*2^n, (m+1)*2^n]. (exponent_binratintvl bri) returns n, where bri=[(m-1)*2^n, (m+1)*2^n]. Type conversions ---------------- (mid_binratintvl->rational bri) returns the rational midpoint of bri. (binratintvl->ratintvl bri) returns the interval bri represented as a ratintvl instead of a binratintvl. (ratintvl->binratintvl ri) returns the smallest binratintvl containing the ratintvl ri. String representations ---------------------- (std_binratintvl->string bri) returns a character string representing the binratintvl bri. Use the following format: [,] and are rationals, in the standard Scheme notation. (mid_err_binratintvl->string bri) returns a character string representing the binratintvl bri. Use the following format: +- and are exact decimal representations of the midpoint and half width of bri. (decimal_sn_ratintvl->string bri) returns a character string displaying the most accurate decimal representation of bri in scientific notation. Use the following format: .E Each of and is either "-" or "". is one decimal digit from 0-9. is a sequence of 0 or more decimal digits. is a sequence of 1 or more decimal digits. The first , and every digit in , must be significant (i.e., correct for every real in bri). must have no leading 0s, except for a single 0 if the exponent value is 0. (decimal_ratintvl->string bri) returns a character string displaying the most accurate representation of bri in normal decimal notation. Use the following format: . is either "-" or "". is a sequence of 1 or more decimal digits. is a sequence of 0 or more decimal digits. Every digit in and must be significant (i.e., correct for every real in bri). must have no leading 0s, except for a single 0 if the integer part is 0. must have trailing 0s if they are significant.