When loading the GDA Prolog Standard Library, subsequent files loaded from those files require the same relative path (relative to the binary of the program loading the library).
prolog_tool loads the stdlib from ../data/lib/std/main.plg. In main.plg there needs to be this line to properly include math.plg residing in the same directory:
(load "../data/lib/std/math.plg")
Ideally, it would only require this:
This can be done by cutting the original file's relative path from its filename, and appending the now-to-load file to that path.