From: user5857@newsgrouper.org.invalid   
      
   Michael S posted:   
      
   > On Sun, 11 Jan 2026 18:18:00 GMT   
   > MitchAlsup wrote:   
   >   
   > > Michael S posted:   
   > >   
   > > > On Thu, 8 Jan 2026 21:35:16 +0100   
   > > > Terje Mathisen wrote:   
   > > >   
   > > > > MitchAlsup wrote:   
   > > > > >   
   > > > > >   
   > > > > > But a single incorrect rounding is 1 ULP all by itself.   
   > > > >   
   > > > > :-)   
   > > > >   
   > > > > Yeah, there are strong forces who want to have, at least as a   
   > > > > suggested/recommended option, a set of transcendental functions   
   > > > > which are exactly rounded.   
   > > > >   
   > > >   
   > > > I wonder who are those forces and what is the set they push for.   
   > >   
   > > The problem, here, is that even when one gets all the rounding   
   > > correct, one has still lost various algebraic identities.   
   > >   
   > > CRSIN(x)^2 + CRCOS(X)^2 ~= 1.0   
   > >   
   > > > I would guess that they are mostly software and hardware   
   > > > verification people rather than people that use transcendental   
   > > > functions in engineering and physical calculations.   
   > >   
   > > Numerical people, almost never engineers, physicists, or chemists.   
   > >   
   > > > The majority of the latter crowd would likely have no objections   
   > > > against 0.75 ULP RMS as long as implementation is both fast and   
   > > > preserving few invariant, of which I can primarily think of two:   
   > > >   
   > > > 1. Evenness/odness   
   > > > If precise function F(x) is even or odd then approximate functions   
   > > > f(x) is also even or odd.   
   > >   
   > > Odd functions need to be monotonic around zero.   
   > >   
   > > > 2. Weak preservation of sign of delta.   
   > > > If F(x) < F(x+ULP) then f(x) <= f(x+ULP)   
   > > > If F(x) > F(x+ULP) then f(x) >= f(x+ULP)   
   > >   
   > > Small scale Monotonicity.   
   > >   
   >   
   > Yes, that's a better name.   
   > I just wanted to express it as simple non-equality conditions and made   
   > it too simple and stronger than necessary.   
   > In fact I would not complain if my conditions do not hold when F(x) has   
   > extremum in between x and x+ULP. That is, it's nice if condition holds   
   > here as well, but it is relatively less important than holding on   
   > monotonous intervals.   
      
   Consider COS(x) near 0.0   
      
   The transition from 1.0 to .99999999 and later to 0.99999998 (in both   
   directions) is small scale monotonic. AND it is exactly at this trans-   
   ition where my rounding takes the biggest number of hits (incorrect   
   roundings).   
      
   Seen in binary, one has a prerounded result of:   
      
   0.1111111111 1111111111 1111111111 1111111111 1111111111 1111 and digits   
      
   behind where rounding transpires. If those digits start with 01111111111   
   or 1000000000 then we are in the situation where we cannot know if we can   
   choose a correct rounding; the next term of the polynomial could sway the   
   balance. J. M. Mueller chapter 11 shows that one might need as many as   
   2×n+13 bits in order to get the rounding "correct". This must include,   
   polynomial error, arithmetic error, and certain boundary conditions.   
      
   If rounding that begins 01 contains a second 0, correct rounding happens.   
   if rounding that begins 10 contains a second 1, correct rounding happens.   
      
   And it is exactly at these points that   
   a) while the result remains monotonic, the point of change can be "off"   
    by a small number of Δs   
   b) when the slope is shallow, one can get several rounding errors in a row   
    without loosing the property of monotonicity or overall RMS.   
      
   >   
   > > >   
   > > > In practice, it's probably unlikely to have these invariant   
   > > > preserved when RMS error is 0.75 ULP, but for RMS error = 0.60-0.65   
   > > > ULP I don't see difficulties.   
   > > > For many transcendental functions there will be only few problematic   
   > > > values of x near edges of implementation-specific ranges where one   
   > > > has to be careful.   
   > > >   
   > > > > It is provably doable for float, in very close to the same cycle   
   > > > > count as the best libraries in current use, double is "somewhat"   
   > > > > harder to totally verify/prove.   
   > > > >   
   > > > > Terje   
   > > > >   
   > > >   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|