complex and hypercomplex NaN coefficients

If we don't know about 'em, we can't fix 'em.

complex and hypercomplex NaN coefficients

PostPosted by drab » Thu Mar 16, 2017 6:35 am

Two complex or hypercomplex values are equal only if all their corresponding coefficients are equal.

This should be so even if any of the coefficients are Nan, because complex and hypercomplex numbers can legitimately be only partially NaN.

Currently, this works right

1J2 = 1J∅

but some similar comparisons do not work right.

This is what should happen

1 ←→ 1J∅ = 1J∅

0 ←→ 1J∅ = 2J∅ (currently wrong)
0 ←→ 1J∅ = 1J2
0 ←→ 1J∅ = 2J∅ (currently wrong)
0 ←→ ∅J1 = ∅J2 (currently wrong)
0 ←→ ∅J1 = ∅J∅ (currently wrong)

1 ←→ ∅J∅ = ∅J∅

Similarly, the usual rules of arithmetic should be followed even if any of the coefficients are ∅.

So, because ∅←→r×∅ for all real values

1J∅ ←→ 0 + 1J∅

∅J∅ ←→ 1 × 1J∅ (currently wrong)

Currently the second one gives the incorrect result because of an arithmetic shortcut.
Such shortcuts should not be taken when either argument has any ∅ coefficient(s).

In general any complex or hypercomplex number should be unchanged when adding 0 to it, whether or not it has any ∅ coefficients.

Also, any complex or hypercomplex number with any ∅coefficients should retain those same ∅ coefficients when any real number is added to it.

Also, any complex or hypercomplex number with ANY ∅coefficients should be changed to have ALL ∅coefficients by multiplying it by 1 (or actually, by multiplying it by anything at all).
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Re: complex and hypercomplex NaN coefficients

PostPosted by forummaster » Thu Mar 16, 2017 9:45 am

I can't duplicate any of your incorrect results in the current Alpha version. You didn't display ⎕SYSVER so I can't be sure which version you are using.
forummaster
 
Posts: 534
Joined: Wed Jan 23, 2013 1:00 pm

Re: complex and hypercomplex NaN coefficients

PostPosted by drab » Thu Mar 16, 2017 10:37 am

⎕sysver
0.5.1.47 Wed Mar 15 00:13:48 2017 Win/64
⎕feature[4]←1 ⍝ ∅

1J∅ = 2J∅
1
wrong

∅J1 = ∅J2
1
wrong

∅J1 = ∅J∅
1
wrong

2 + 1J∅
1J∅
wrong

2 × 1J∅
1J∅
wrong
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Re: complex and hypercomplex NaN coefficients

PostPosted by forummaster » Fri Mar 17, 2017 12:08 am

OK, please try the latest Alpha version:

http://www.nars2000.org/download/binaries/alpha/
forummaster
 
Posts: 534
Joined: Wed Jan 23, 2013 1:00 pm

Re: complex and hypercomplex NaN coefficients

PostPosted by drab » Fri Mar 17, 2017 6:01 am

In version 0.5.1.48, everything is fine now except
2 × 1J∅
2J∅
The answer should be ∅J∅.

The reason is most easily explained using the new primitive monadic functions dilate > and condense < ...

Multiplication of 2 hyper numbers is generally a complicated process where each old coefficient contributes to each new coefficient.

But a real number is a hyper number with all of its non-real coefficients 0.
So multiplication of a hyper number by a real number can be easily and quickly done with this simple shortcut

r×h ←→ <r×>h

This shortcut works fine most of the time, but it is incorrect if the hyper number h has any ∅ coefficients, because r+∅ and r×∅ are both ∅ for all real r. And, in the formal general case, each old coefficient contributes to each new coefficient. So all the new coefficients of the product are ∅.

Thus

han ←→ r × hpn

where hyper han has all ∅ coefficients, and hyper hpn has any ∅ coefficients (partially ∅).

You can't use the shortcut on a hyper with any ∅ coefficients.
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Re: complex and hypercomplex NaN coefficients

PostPosted by drab » Fri Mar 17, 2017 6:07 am

One more thing ...

The monadic circle function pi times is usually defined as

○r ←→ pi × r

This is fine most of the time, but it becomes pretty useless if r is a hyper with any ∅ coefficients, because the formal result will always be a hyper with all ∅ coefficients.

So to keep it useful with partially NaN hypers, we only have to redefine the circle function as

○r ←→ < pi × >r

This is a really only a documentation change, since that is always the way it is implemented anyway.
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Re: complex and hypercomplex NaN coefficients

PostPosted by forummaster » Fri Mar 17, 2017 6:44 pm

drab wrote:In version 0.5.1.48, everything is fine now except
2 × 1J∅
2J∅
The answer should be ∅J∅.

drab wrote:One more thing ...

The monadic circle function pi times is usually defined as

○r ←→ pi × r

This is fine most of the time, but it becomes pretty useless if r is a hyper with any ∅ coefficients, because the formal result will always be a hyper with all ∅ coefficients.

So to keep it useful with partially NaN hypers, we only have to redefine the circle function as

○r ←→ < pi × >r

This is a really only a documentation change, since that is always the way it is implemented anyway.

I agree. The rules for using multiplication shortcuts are applied inconsistently and need to be codified.

BTW, there are two sets of such rules, one for infinity and one for NaN. The one for infinity uses 0×∞ ←→ 0 which is really an indeterminate. The one for NaN is determinate as in 0×∅ ←→ ∅. Both rules are for Real numbers -- and because multiplication and division of Hypercomplex numbers are defined recursively down to the Real number level, those operations on HC numbers can also be well-defined.

I would very much like to avoid things like ○R ←/→ (○1)×R. That is, the rules for monadic PSFs are the same as for dyadic PSFs, so that (for example) +∅J1 is either ∅J∅ or ∅J¯1.

You are the NaN guy -- what do you think?
forummaster
 
Posts: 534
Joined: Wed Jan 23, 2013 1:00 pm

Re: complex and hypercomplex NaN coefficients

PostPosted by drab » Fri Mar 31, 2017 3:15 pm

It's pretty clear to me that the best answer should be

+∅J1 ←→ ∅J¯1

but it's not in
⎕sysver
0.5.2.0 Sun Mar 19 01:50:22 2017 Win/64
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Re: complex and hypercomplex NaN coefficients

PostPosted by drab » Fri Mar 31, 2017 3:29 pm

It seems to me that ...

⊤ ∅

should be 0 (actually 0.0)

⊤ ∅J1
∅J0
⊤ 1J∅
0J∅
both should be 0J0 (actually 0.0J0.0)
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Re: complex and hypercomplex NaN coefficients

PostPosted by drab » Fri Mar 31, 2017 3:31 pm

Also ...

2+3J∅
5J∅
ok

2×3J∅
6J∅
should be ∅J∅
drab
 
Posts: 282
Joined: Thu Oct 09, 2014 6:23 am

Next

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 3 guests

cron