When compiling code that uses the libraries, link the
libraries in like this:
The order of the links is important. Placing the link
to the free fast math library first forces the linker to link libfm and
libm after libffm, allowing any references not taken care of by libffm
to be resolved. This is necessary because some functions that libfm supports
are not yet supported by libffm. Similarily, some functions that libm supports
are not handled by libfm.
Code that uses the function "pow(x)" requires special handling. The function "powr(x)", located in the free fast math library, is a fast replacement for "pow(x)". "powr(x)", though faster, is not quite as reliable as "pow(x)", and the makers of the fast math libraries wanted to allow users to decide which version they preferred. If the creators of the fast math libraries had named their version of the function "pow(x)", the only way to use the standard version of "pow(x)" would have been to change the order of the links in the compile statement. Thus, the free fast math version of the function was named "powr(x)" and a special "helper function" was written to convert "pow(x)" to "powr(x)". The function name "pow(x)" should still be used in all code, with a special modification of the standard compile statement if the free fast math version is to be used.
To use the function "powr(x)" in code that currently
uses the "pow(x)", do not hardcode a change. Instead, simply include the
converting "helper function" as follows:
Math library: 15.021 s |
Fast Math library: 5.642 s |
Free Fast Math library: 3.91 s |