[Chapel Merge] Reduce uses of Math by automatically included modu

Branch: refs/heads/main
Revision: 31a6bd6
Author: lydia-duncan
Link: Unavailable
Log Message:

Merge pull request #19885 from lydia-duncan/mathRefactor

Reduce uses of Math by automatically included modules
[reviewed by @bmcdonald3 and approach run past @bradcray]

Brad pointed out that it was unfortunate for AutoMath to rely on Math for any
permanent symbol. So move the main work of logBasePow2 to a chpl_ prefixed
function in AutoMath and call that instead of logBasePow2 in AutoMath. Also
move the main work of log1p similarly, though these functions will only live there until
the deprecated versions of log1p have been removed, and then their contents
will be migrated back to Math.

Brad also pointed out that ChapelRange was using the Math module still. This
module relies on symbols that are in AutoMath now, so it should explicitly use
that module instead. If we discover that symbols we want to move to Math are
used by ChapelRange, we probably should rethink making them not included by

Updates the module initialization order tests for the new output

Passed a full paratest with futures

Modified Files:
M modules/internal/ChapelRange.chpl

M modules/standard/AutoMath.chpl
M modules/standard/Math.chpl
M test/compflags/ferguson/print-module-resolution.good
M test/modules/bradc/printModStuff/foo.good
M test/optimizations/deadCodeElimination/elliot/countDeadModules.good

Compare: https://github.com/chapel-lang/chapel/compare/de731b762ac7...31a6bd6f06e6