After installing 13.3 and testing my code I ran into an issue with Arg
which i guess has to do with something in the handling of the numerical precision of complex numbers. To prevent stuff happing in the background of my data i always mask that out by multiplication with exact 0 values. However in 13.3 doing that Arg[0.+0.I]
gives back 0.
or 3.14159
rather random. However Arg[Re[0.+0.I]+0.I]
or Arg[0.+Im[0.+0.I]I]
both always produce 0 for the same data.
I have found a workaround for my code which is using Chop
before Arg
which for hundreds of iterations is slowing down the code but solves it for now.
Does anybody have any ideas how to prevent this? Any number multiplied by an exact 0 should return 0. right? Or are there any cases where this assumption is not correct.
Here is my example, I can't share the data and have not been able to make a toy example that reproduces the effect. I'm using identical data and code for both Mathematica versions.
this was the difference in output that started my hunt for the changed behavior. 
I isolated the issue to this part of my code. 
The binary mask (which contains rounded 0 and 1) is multiplied with the complex data (for which here the Re and Im are shown) 
Now the weird stuff is happening after taking the Arg
of the complex data i get non zero values in the background of the image which i never encountered before in any version of Mathematica. 
So i selected some of the background datapoints and tested what is happening. Here is my expected output for v13.2 
Here is my unexpected output for v13.3 
The best example i could come up with is below but this behaves exactly as i expect.
n = 200;
m = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
Arg[ {
( -(10.^-n + (10.^-n) I)), (10.^-n + (10.^-n) I), ( -(10.^-n + (0.) \
I)), (10.^-n + (0.) I), ( -(0. + (10.^-n) I)), (0. + (10.^-n) I),
( -(10.^-n - (10.^-n) I)), (10.^-n - (10.^-n) I), ( -(10.^-n - (0.) \
I)), (10.^-n - (0.) I), ( -(0. - (10.^-n) I)), (0. - (10.^-n) I)
}]
Arg[m {
( -(10.^-n + (10.^-n) I)), (10.^-n + (10.^-n) I), ( -(10.^-n + \
(0.) I)), (10.^-n + (0.) I), ( -(0. + (10.^-n) I)), (0. + (10.^-n) \
I),
( -(10.^-n - (10.^-n) I)), (10.^-n - (10.^-n) I), ( -(10.^-n - \
(0.) I)), (10.^-n - (0.) I), ( -(0. - (10.^-n) I)), (0. - (10.^-n) I)
}]
{-2.35619, 0.785398, 3.14159, 0., -1.5708, 1.5708, 2.35619, \
-0.785398, 3.14159, 0., 1.5708, -1.5708}
{0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}
EDIT
did some extra experiments where i can show that multiplying with 0 or 0. does not remove the effect but any other operation does.
{
DeleteDuplicates[
Arg[Round[
B0mask[[16, 81, 40 ;; -40]]] compi[[4, 16, 81,
40 ;; -40]]]](*has Pi*),
DeleteDuplicates[
Arg[N[Round[B0mask[[16, 81, 40 ;; -40]]]] compi[[4, 16, 81,
40 ;; -40]]]](*has Pi*),
DeleteDuplicates[
Arg[B0mask[[16, 81, 40 ;; -40]] Chop[
compi[[4, 16, 81, 40 ;; -40]]]]](*no Pi, Int*),
DeleteDuplicates[
Arg[B0mask[[16, 81, 40 ;; -40]] (Re[compi[[4, 16, 81, 40 ;; -40]]] +
0. I)]](*no Pi, N*),
DeleteDuplicates[
Arg[B0mask[[16, 81, 40 ;; -40]] (0. +
Im[compi[[4, 16, 81, 40 ;; -40]]] I)]](*no Pi, N*),
DeleteDuplicates[
Arg[Round[
B0mask[[16, 81, 40 ;; -40]]] (Re[compi[[4, 16, 81, 40 ;; -40]]] +
0. I)]](*no Pi, N*),
DeleteDuplicates[
Arg[Round[
B0mask[[16, 81, 40 ;; -40]]] (0. +
Im[compi[[4, 16, 81, 40 ;; -40]]] I)]](*no Pi, N*),
DeleteDuplicates[
Arg[N[Round[
B0mask[[16, 81, 40 ;; -40]]]] (Re[
compi[[4, 16, 81, 40 ;; -40]]] + 0. I)]](*no Pi, N*),
DeleteDuplicates[
Arg[N[Round[B0mask[[16, 81, 40 ;; -40]]]] (0. +
Im[compi[[4, 16, 81, 40 ;; -40]]] I)]](*no Pi, N*)
}
Out[]= {{0., 3.14159}, {0.,
3.14159}, {0}, {0.}, {0.}, {0.}, {0.}, {0.}, {0.}}