In the headers and documentation for ippiRGBToHLS (both for ipp v9 and v2017) the following pseudo-code is given
if R = M2 then H = Cb - Cg
if G = M2 then H = 2 + Cr - Cb
if B = M2 then H = 4 + Cg - Cr
referring to
David F.Rogers
Procedural Elements for Computer Graphics
1985.pp.(403-406)
However, in that book (2nd ed. 1998) on page 629 I read
if R = M1 then H = Cb - Cg
if G = M1 then H = 2 + Cr - Cb
if B = M1 then H = 4 + Cg - Cr
and this does give different results. I haven't checked what ipp actually does, but at least there is a discrepancy in the documentation and headers.
Regards,
Adriaan van Os