Maybe I'm blind, but I don't see any handling of out-of-gamut colors? At the very minimum I'd expect some naive min/max clipping to avoid negative RGB components.
Also no mention of what kind of RGB it is. From the xyzToRgb function it seems to be[1] sRGB but that should be mentioned, and also consistent throughout the library (in case it isn't).
[1]: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix....