Post Reply 
HP PPL and Statistical distributions
05-23-2021, 03:36 PM (This post was last modified: 05-25-2021 12:35 PM by Albert Chan.)
Post: #23
RE: HP PPL and Statistical distributions
(05-23-2021 02:00 PM)C.Ret Wrote:  The last time I was told about the properties of complex numbers field, there were no order relation available for it.

Therefore, no one may attempt a comparison between any complex number nor between a complex number and a real !

It was not about comparing 2 complex numbers, but against a "symbolic" infinity.
My guess symbolic infinity is defined bigger than any finite values, independent of type.

The issue is this line in quad:

< IF bool(a>b) == bool(mode==2) THEN d:=-d END

My patch to extend to complex numbers (which turned out not needed in PPL)
// If integration limits are [a, -inf] or [-inf, b], switch direction of integration.

> IF (mode==2 AND b<0) OR (mode==1 AND a<0) THEN d:=-d END

But, you do have a point.
Patch is more readable, and less reliance on PPL "feature" (which might changed in the future).

I am patching this to quad. Thanks, C.Ret

Update1: replace indirect (mode!=2) as (mode==1)
Update2: replace complicated test with simpler equivalent code

< IF mode == 2 THEN c:=a ELSE c:=b END
< IF (mode==2 AND b<0) OR (mode==1 AND a<0) THEN d:=-d END
< s := f(c+d)

> c, s := a, b; // c = finite edge
> IF mode == 1 THEN c, s := b, a END
> IF s < 0 THEN d:=-d END
> s := f(c+d)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP PPL and Statistical distributions - Albert Chan - 05-23-2021 03:36 PM



User(s) browsing this thread: 1 Guest(s)