Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-16 Thread Elias Mårtenson
It refers to "unit in the last place", essentially the size of smallest change for a floating point number of a given magnitude. The Wikipedia page explains more: https://en.wikipedia.org/wiki/Unit_in_the_last_place Now, there is also this famous paper, which discusses this in great detail: https:

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-15 Thread Juergen Sauermann
Hi, and what is ulps? /// Jürgen On 08/15/2015 01:15 PM, Elias Mårtenson wrote: Arguably ⎕CT should be specified in terms of ulps, since GNU APL uses double precision floating point for all numeric ope

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-15 Thread Juergen Sauermann
Hi Mike, page 58 merely says that ⌈ and ⌊ use comparison tolerance, but not in which way. And page 133 (floor) says: "using comparison" tolerance and not "using RFUZZ". I read page 58 like this: a) ⎕CT is the same as comparison tol

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-15 Thread Elias Mårtenson
Arguably ⎕CT should be specified in terms of ulps, since GNU APL uses double precision floating point for all numeric operations. On 15 August 2015 at 02:54, Mike Duvos wrote: > Hi Jürgen, > > > Z← R For real numbers, yields the largest integer that does not exceed R > (within the comparison tol

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-14 Thread Mike Duvos
Hi Jürgen, > Z← R For real numbers, yields the largest integer that does not exceed R (within the comparison tolerance). > That is essentially what ISO says and what GNU APL has implemented. The observed behavior > of the IBM APL2 implementation seems to be (within R times the comparison toleranc

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-14 Thread Juergen Sauermann
Hi Mike, the problem with relative ⎕CT is that when the N gets large, say > ÷⎕CT then N×⎕CT becomes > 1 so the interval around N where you would round up (for ⌊) contains one integer or even several. The ISO intention seems to be that only num

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-14 Thread Mike Duvos
Hi Juergen, You write... "Summary: For *⌈* and *⌊* GNU APL follows the ISO standard while IBM APL2 does not." While this may be the case, I would argue that the APL2 approach is much more numerically robust than the ISO approach. Within the range of contiguous integers exactly representable as

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-14 Thread Juergen Sauermann
Hi, I have analyzed this issue a little and the following was my conclusion. 1. when looking at the GNU APL code I found that it could be simplified a little and I did that, SVN 2. It is perfectly correct that, as Jay pointed out, ⎕CT

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-12 Thread Mike Duvos
Hi Jay, Thanks. That's an interesting bit of info. IBM APL2 returns 5. According to the APL2 manual, the system uses relative tolerance. With absolute tolerance, as long as they are still using a closed interval around the number, it should still return 5. If I fudge 5 by half the comparison

Re: [Bug-apl] Fuzzy Floor and Ceiling

2015-08-12 Thread Jay Foad
I don't know anything about the GNU APL implementation, but I can tell you that the definition of tolerant-floor changed between standard APL (ISO 8485) and Extended APL (ISO 13751). In ISO 8485 the tolerance is relative, so both your examples should definitely return 5. In Extended APL the toleran

[Bug-apl] Fuzzy Floor and Ceiling

2015-08-11 Thread Mike Duvos
⌊5-⎕CT 4 ⌈5+⎕CT 6 Unless something has drastically changed since I last read the APL spec, both of these should return 5.