Re: Motion 31: V04.2 Revision of proposed Level 1 text
So we have the natural interval extension "case(c,g,h)"
and the "simple" interval extension "Case(c,g,h)".
What will be the Level2 conformance requirements for this function ?
Will implementation that returns "hull(case(c,g,h))" conform ?
Or shall it return "hull(Case(c,g,h))" ?
Or implementation may choose any of the above ?
The other question is about reverse-mode elementary functions.
The text says about reverse-mode unary and binary functions.
Now we have two required ternary functions: "fma(x,y,z)" and "case(c,g,h)".
Will standard mention reverse interval extensions of them ?
If yes, will the "case" have the natural reverse interval extension
or some "simple" reverse interval extension ?
-Dima
----- Исходное сообщение -----
От: j.d.pryce@xxxxxxxxxxxx
Кому: stds-1788@xxxxxxxxxxxxxxxxx
Отправленные: Среда, 8 Февраль 2012 г 15:39:07 GMT +03:00 Москва, Санкт-Петербург, Волгоград
Тема: Re: Motion 31: V04.2 Revision of proposed Level 1 text
Dmitry, P1788
Thanks for these comments, sorry for the delay responding.
On 25 Jan 2012, at 19:07, Dmitry Nadezhin wrote:
> Here are some small comments:
>
> 1) case(c,g,h)
> The point function is defined as
> (1) case(c,g,h) = if (c < 0) g else h
> It's natural interval extension is
> (2) case(C,G,H) = Empty, if (C isEmpty) or (G isEmpty) or (H isEmpty)
> G, if (C.sup < 0) and not (H isEmpty)
> H, if (C.inf >= 0) and not (G isEmpty)
> hull(G U H), if (C.inf < 0) and (C.sup >= 0) and not (G isEmpty) and (not H isEmpty)
> The document says that natural interval extension is
> (3) case(C,G,H) = Empty, if (C is Empty)
> G, if (C.sup < 0)
> H, if (C.inf >= 0)
> hull(G U H), if (C.inf < 0) and (C.sup >= 0)
> This is not true. (3) is not natural interval extension, (3) is wider interval extension.
Yes, I see you are correct. Careless of me and others not to notice this.
> Nevertheless, I like more the definition (3).
> If the implementation is forced to compute case according to the tightest definition (2),
> it has to always compute both G and H subexpressions.
> The definition (3) allows to skip computation of G and H in some cases.
>
> My opinion is to keep definition (3) of case(C,G,H),
> but call (3) "recommended interval extension" instead of "natural interval extension".
My first impression is to like this idea. But not "recommended", which has its own meaning in clause 5. Try "simple" or "preferred" or ...?
> Perhaps, we should change classification of case(C,G,H) from "interval arithmetic operation"
> to "interval non-arithmetic operation", but I'm not sure.
I don't see why. If I call the current function Case(), and yours case(), then it seems
Case(C,G,H) = { case(C,G,H) when the latter is nonempty,
{ possibly something else when the latter is empty.
So Case(C,G,H) \supseteq case(C,G,H) in all cases, so if we are correct that case() is an interval extension of the point function, then Case() is one also. So it's wrong to call it a non-arithmetic operation.
P1788, do any of you see a problem with keeping the current definition and calling it "simple" interval extension or a similar name?
> 2) fma(x,y,z)
> The operation fma is mentioned in definitions, but the document don't clarify the status of
> interval version fma. Is it required, recommended or none ?
>
> 3) negate(x) = -x
> The unary minus is an operator in most programming languages.
> Shouldn't we require interval version of negate ?
Now included fma & negate in Required list.
> 4) isBoundedNonempty(x) = not (x isEmpty) and (x.inf > -oo) and (x.sup < +oo).
> Section "Abbreviations" defines IR as a "the set of bounded, nonempty closed real intervals".
> Perhaps, there should be a boolean function to test this.
> Unfortunately, I failed to find a shorter name for it.
P1788: please speak for/against this.
> 5) The section 5.6.5 says that "evaluation all these sums independently costs O(n^2)".
> However, it is possible to compute all these sums in O(n*log(n)) using binary tree of partial sums.
> Perhaps, we can say "evaluation all these sums without inner subtraction costs O(n*log(n)) .
Actually there's a simpler algorithm without subtraction. Let the x_i be indexed x(1) to x(n) and the "sums with a gap" s_i similarly. Then do
s(1) = 0; for (i=1; i<n; i++) s(i+1) = s(i)+x(i);
t = 0; for (i=n; i>1; i--) s(i-1) += (t+=x(i));
This takes about 3n operations.
Regards
John