[J3] [EXTERNAL] [BULK] SCALE(x,i) with complex x
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Mon Nov 6 12:55:20 UTC 2023
Hi Steve,
Extending to complex would not seem to pose any challenge. As to why (well before my time), my guess would be that someone was attempting to emulate a specific bit of functionality in another layer (IEEE?) that did not address the complex case.
Of course back in the day, SCALE() could provide some significant performance advantage via bit-twiddling vs full multiply. These days, though, unless an arg and result are known to be very small and cache resident, the memory access will dominate. Given that I think a variant of your 3rd version is actually preferable in most implementations:
PROGRAM FOO
COMPLEX A, B
A = (1,1)
B = (2**2) * A ! parens added for clarity for reader
PRINT *, B
END PROGRAM FOO
I find this implementation much more obvious than SCALE() as one needs to 1st remember which argument is which. Of course, if I used SCALE() frequently, I might feel differently.
Not opposed to the extension – just explaining why I there may be mixed views on priority.
Cheers,
* Tom
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of j3 <j3 at mailman.j3-fortran.org>
Reply-To: "kargl at uw.edu" <kargl at uw.edu>, j3 <j3 at mailman.j3-fortran.org>
Date: Saturday, November 4, 2023 at 11:29 PM
To: j3 <j3 at mailman.j3-fortran.org>
Cc: "Steven G. Kargl" <kargl at uw.edu>
Subject: [EXTERNAL] [BULK] [J3] SCALE(x,i) with complex x
CAUTION: This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20231106/0b4f6c2f/attachment.htm>
More information about the J3
mailing list