Thread Links | Date Links | ||||
---|---|---|---|---|---|
Thread Prev | Thread Next | Thread Index | Date Prev | Date Next | Date Index |
P1788 On 8 Mar 2013, at 20:08, Ian McIntosh wrote: > If they are the same base, is a number written as 0.5 the same as another written as 0.5? In C, C++ and Java, 0.5 is double precision. In Fortran it is generally single precision. It sometimes means one half (infinite precision). It's been used in these discussions with all three meanings. The same numbers but not the same numbers. I just quote this as a representative context, but what I write applies to most of Ian's posting. I strongly feel that this is all important and relevant in the floating point world, but totally misses the point (excuse pun) in the interval world, where things are a lot simpler. A "floating literal" has the value a mathematician assigns it, independent of any computer representation. It is a Level 1 notion, and originally I had its specification in the Level 1 part of the text. I repent now that I moved it to §11.11.1 of Draft 7.0, which is part of Level 2, and will move it back. I have two points: A. It is essential to the P1788 conceptual model that every interval operation at Level 2 splits neatly into three steps, as follows. Take e.g. a binary operation zz = xx op yy, where xx, yy are Level 2 datums of some interval type T. So xx, yy are finite-precision things represented in a machine. (For simplicity take the case where xx, yy, zz all have the same type, which isn't always so.) The steps are (1) Map xx, yy to the exact mathematical intervals XX, YY they represent. In fact the model says that apart from their type-tag they *are* those intervals, so the map is the identity map. (2) Do the exact mathematical operation ZZ = XX op YY. (3) Map the mathematical ZZ to its the Level 2 datum zz which is the T-hull of ZZ. That is, in most cases (always, for an inf-sup type), it is the unique tightest T-interval containing ZZ. This is the point of the Level 2 -> Level 1, and Level 1 -> Level 2, maps in Table 1 of §4.1 "Structure of the standard in levels". text2interval(s) follows the same principle, except that *only* the Level 1 -> Level 2 map is involved. So step 1 is missing and we have: (2') There is a syntax, mostly but not entirely finalised, by which the strings s in some set S denote *mathematical* intervals ZZ. (3) (As before) Map the mathematical ZZ to its the Level 2 datum zz which is the T-hull of ZZ, denoted hull_T(ZZ). Step (2') is what's currently in §11.11.1 and it defines a new map: the "strings -> Level 1" map. Forget error handling, NaI etc., for now as they are irrelevant to my argument. The destination type T is of the essence, so one should refer to T-text2interval(s). However the mathematical interval ZZ denoted by s is always the same, independent of T. Using text2interval(s), without a type, to denote step (2'), we have, for any string s and any type T, T-text2interval(s) = hull_T(text2interval(s)). B. Now, the various possibilities Ian describes, such as 0.5 differing from 0.50 in some contexts, are nothing to do with step (3). They are purely about the choice of syntax for step (2'). Personally I don't think this syntax should *ever* allow things like 0.5 being different from 0.50 -- floating literals should keep the mathematical meaning I've specified (or tried to) in §11.11.1. Oh, and exponent symbols d and e, should we allow both, mean the same thing. 0.1, 0.1e0, 1d-1, as floating literals, all mean the exact number 1/10. Though personally I think only e should be allowed. For most of the extra features Ian mentions, I commend the string syntax offered by Arnold Neumaier in §6.4 "Uncertain numbers" of the Vienna proposal, where (instead of trailing zeros having a special meaning), suffixing a floating literal s with the characters _ or ?, together with "uncertainty type" characters u,d,a,r, specifies an uncertainty interval containing the mathematical real value denoted by s. It seems to me that after some work tightening up the syntax (a volunteer please?), it can be added to the syntax in §11.11.1 of Draft 7.0. I also commend Vienna §6.5 "Exact numbers" and ask Richard to comment on it. These two Vienna clauses are reproduced below. Vienna's term "text" is the same as my "string". In the examples, I think the character # starts an end-of-line comment. FYI I also attach the version of Draft 7.0 I sent to a few people on 24 January, since I don't think I circulated it generally yet. Note it requires MANY changes in the light of discussions on Motion 42 and other issues. My flu and subsequent bronchitis has put me three weeks or more behindhand. John ----------------------------- > 6.4. Uncertain numbers > > A text t taking one of the forms > ’<fixpart>?<expart>’, ’<fixpart>_<expart>’, > ’<fixpart>?<unctype><fixpart><expart>’, > where <fixpart> is a decimal <literal_float> without exponent part, > <expart> is the possibly empty exponent part of a decimal > <literal_float> with decimal exponent indicator ’e’, > and <unctype> is one of the characters in ’udar’ > (standing for ’’up’’, ’’down’’, ’’absolute’’, and ’’relative’’) > is considered to be an uncertain number, and is required to be > converted by text2interval(t) into the tightest interval containing > all real numbers represented by this uncertain number. > > (The precise semantics must be described here.) > > The use of ’d’ as decimal exponent indicator (as is customary for > Fortran double precision numbers) would conflict with the use of ’d’ > for representing downward uncertainty. > > Examples. > (ulp is one unit in the last place of the decimal number displayed) > 12.3_ # represents 12.3 +- 1 ulp, i.e., [12.2,12.4] > 1.23?e3 # represents 1.23e3 +- 1/2 ulp, i.e., [12250,12350] > Note: An earlier version had here erroneously 1 ulp > 1.23?5e-1 # represents 1.23e-1 +- 5 ulp, i.e., [0.118,0.128] > .23?u2 # represents .23 + <=2 ulp, i.e., [.23,.25] > .23?d2 # represents .23 - <=2 ulp, i.e., [.21,.23] > .234?a0.01 # represents .234 +- 0.01, i.e., [.224,.244] > .23?r0.1e2 # represents .23e2 * (1+-0.1), i.e., [20.7,25.3] > > > 6.5. Exact numbers > > A text t taking one of the forms > ’<sign><natural>/<natural>’ or ’<literal_float>’, > where <sign> is empty or one of the characters + or -, <natural> > is a natural number in decimal notation without exponent, > and <literal_float> is as in Section 6.2, is considered to be an exact > number, and is required to be converted into the tightest interval > containing this number. > > Remark. > Very long rationals frequently arise in problems generated > from computer algebra packages using rational arithmetic. > For example, I have seen rationals with 800 digits in a particular > constraint satisfaction problem posed to me, generated for a > computer-assisted proof in the geometry of numbers.
Attachment:
20130124P1788_MAIN.pdf
Description: Adobe PDF document