For scientific purposes I’m writing some number crunching routines in C++ and benchmarking various ways of running computations for ultra-high-precision floating-point numbers. And when I decide on the best routine for a specific purpose, I’d like to specify a generalized alias to that function.
For example, to compute the natural logarithm of a number, I’ve coded three functions named LnXMacL, LnXHalley, and, LnXagm. They implement the natural logarithm via three different methods: a MacLaurin series, Halley’s method, and arithmetic-geometric mean. They all exhibit the same accuracy of several hundred decimal places, but the MacLaurin series is much faster than the other two. So rather than rename it something like LogX, for historical reference I’d rather keep the original name intact and create an alias to LnXMacL. I’d also like that alias to appear as a visible entry point in the DLL because I frequently use C# to prototype the heavy math functions, then port them to C++. The header for the three functions is as follows:
extern "C" __declspec(dllexport) void __stdcall LnXMacL(UINT64* LnX, UINT64* xM);
extern "C" __declspec(dllexport) void __stdcall LnXHalley(UINT64* LnX, UINT64* xM);
extern "C" __declspec(dllexport) void __stdcall LnXagm(UINT64* LnX, UINT64* xM);
Ideally, the alias would be the equivalent of something like:
extern "C" __declspec(dllexport) void __stdcall LogX(UINT64* LnX, UINT64* xM);
but instead of compiling as a separate function, its entry point would go directly to LnXMacL.
I’m using Visual Studio 2022 on a Windows 11 machine. I have decades of experience writing C code, but only a few years at C++. Any help will be greatly appreciated. I searched this forum extensively and found a lot on aliasing, but haven't found anything on creating an alias to the same entry point in a DLL.
LnXMacLfromLogX? The overhead will be negligible if any. Or#define LogX LnXMacl?