Hi,
I looked into the ¯4○ thing a bit more and have identified the
discrepancy between APL2 and GNU APL, which may or not be a
bug depending on whether the ISO spec agrees with APL2 on this
function.
According to the APL2 language reference, if the real part is
greater than or equal to zero, or the real part is between -1
and zero with the imaginary part zero, you return
(¯1+X×X)*0.5. Otherwise you flip the sign and return
-(¯1+X×X)*0.5.
So in APL2....
8 1⍴¯4○1D45*-⎕IO-⍳8
0.000000000E0
4.550898606E¯1J 1.098684113E0
7.146297292E¯16J 1.414213562E0
¯4.550898606E¯1J 1.098684113E0
¯3.814090016E¯8J 3.814090016E¯8
¯4.550898606E¯1J¯1.098684113E0
¯1.342666713E¯15J¯1.414213562E0
4.550898606E¯1J¯1.098684113E0
and in GNU APL
8 1⍴¯4○1D45*-⎕IO-⍳8
0
4.550898606E¯1J1.098684113E0
0J1.414213562E0
4.550898606E¯1J¯1.098684113E0
1.10663761E¯8J¯1.10663761E¯8
4.550898606E¯1J1.098684113E0
0J1.414213562E0
4.550898606E¯1J¯1.098684113E0
As you can see, APL2 flips the signs on half the values, and
GNU APL does not.
So APL2 cancels, and GNU APL adds up to a big value when you
sum them.
So that's why they are different.
Whether this is "wrong" remains to be seen, but it's a case
where APL2 and GNU APL do things differently.