MethodicalAcceleratorDesign / MAD-NG

MAD Next-Generation official repository
GNU General Public License v3.0
32 stars 11 forks source link

`mad_ctpsa_rect` calculation #418

Closed mattsignorelli closed 9 months ago

mattsignorelli commented 9 months ago

For a tpsa t, I expected mad_ctpsa_rect to calculate r = CPX( real(t)*cos(imag(t)) , real(t)*sin(imag(t)) ), however this does not appear to be the case. For scalars as tpsas, mad_ctpsa_rect gives:

rect(1+1i) = 5.4030230586813977E-01 +4.5464871341284091E-01   # Should be 0.5403023058681398 + 0.8414709848078965i ?
ldeniau commented 9 months ago

I do not confirm the problem for scalars, I do for TPSA. It could be either an aliasing problem in rect or in sincos.

I will check soon.

ldeniau commented 9 months ago

fixed in 245cd6a0