HP Forums
HP PPL and Statistical distributions - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: HP PPL and Statistical distributions (/thread-16635.html)

Pages: 1 2


RE: HP PPL and Statistical distributions - robmio - 05-23-2021 01:43 PM

Undoubtedly your program is well done: fast and flexible. I use it for Tukey's post hoc analysis in randomized block-design ANOVA and for post hoc analysis in Fridman's ANOVA.
Thanks, you helped me a lot.
Best regards, Roberto.


RE: HP PPL and Statistical distributions - C.Ret - 05-23-2021 02:00 PM

(05-23-2021 01:32 PM)Albert Chan Wrote:  CAS> inf > 3+4i        → 1
CAS> -inf > 3+4i       → 0

I am very surprised by reading this. I must have missed a step in the advancement of mathematics.

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 !

What's the new under the sky that have ordered the complex numbers ? That is surely a Vander full invention or an epic monster !


In this CAS software environment , what would be the result of comparing 4 + 7i and 14 + 0.3i ?


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

(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)