Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Yet another midpoint formula, was: Re: Sorry, mistake in my last message Re: roundToZero_F(+inf) = +inf



> Date: Thu, 01 Mar 2012 10:58:29 -0600
> From: Ralph Baker Kearfott <rbk@xxxxxxxxxxxxx>
> To: stds-1788 <stds-1788@xxxxxxxxxxxxxxxxx>
> Subject: Sorry, mistake in my last message Re: roundToZero_F(+inf) = +inf
> 
> Oh, of course RoundToZero(+inf) = +inf, since
> +inf is a representable number, and
> RoundUp(HUGE) = HUGE for the same reason.  I guess
> I was thinking about numbers strictly between
> HUGE and +inf.  (Please don't let me distract
> you in this case.)
> 
> Baker
> -----------------------------------------------------
> 
> Please educate me here.  Without actually looking
> up what 754 specifies, my intuition would tell
> me that roundToZero(+inf) would be HUGE (i.e.
> the largest representable number)
> and roundUp(HUGE) would be +inf.
> 
> (That is, for what it's worth in this context.)
> 
> Baker
> 

	Your intuition is correct but there are some details
	that are at the heart of Michel & Vincent's discussion.

	The rule is that if a value larger than the largest
	finite number is arrived at inexactly or if some loss
	of precision is incurred in representing the result,
	then a rounding is done.  For these values & depending
	on the rounding rule, either Fmax_F or infinity is
	returned & both inexact & overflow are indicated.

	(There is a notion of an exact infinity which is only
	arrived at by a divide by zero.  In that case, no
	rounding is done & divide-by-zero is indicated.)

	There is also a notion of an exact (or infinitely
	precise) result that lives at 754's level 1.  And one
	MIGHT interpret the entire formula (lo+inf)/2 as an
	inexact infinity at level 1 which may be rounded
	either way as desired.  This is Michel's generous
	interpretation of what I wrote.

	There is also the interpretation that the inexactitude
	happened during the (lo+inf) & that the subsequent
	divide by 2 is exact BEFORE you round.  This is Vincent's
	frankly more reasonable interpretation of things.

	(There are also limits to consider under ordinary
	analysis but I digress even further than we already
	have if I discuss them. :-)

	Still, the distraction is not in your question.  The
	distraction is in my poor formulation which admits
	both interpretations.

	Michel is correct that my intent was to formulate a
	midpoint which always returns a finite number on the
	grounds that infinity is of no use as a split point.

	I once had such a formula but it made reference to
	Fmax_F & someone asked me to remove that reference.
	I presume on the grounds that coercing a level 1
	concept to level 2 without such a reference was a
	more robust way to describe it.

	I obviously failed in that description.

	Let me try again.  The only new thing is the coercion:


	Level 1: mid(X) = for non-empty X only: if (X==Entire) then 0
						else (inf(X) + sup(X))/2

	Property: X \subset Y ==> if (inf(X)==inf(Y)) then mid(X) <= mid(Y) &
				  if (sup(X)==sup(Y)) then mid(X) >= mid(Y)

	Coercion: mid_F(X) = if (round2Nearest_F(mid(X)) = +inf)
				then nextDown_F(+inf)
			     else if (round2Nearest_F(mid(X)) = -inf)
				then nextUp_F(-inf)
			     else round2Nearest_F(mid(X))


	Is that clear enough to everyone?

	Oh, also please note the "for non-empty X only" bit.

	And, just to move things along a bit, if you have a
	problem with some formula in future, please offer
	up a fix.  Just saying "this is wrong" or "this has
	another interpretation", while it may be correct,
	gets us no closer to an answer.


				Dan