calculate k with one fewer divide
Updated the tests to print out how close we are to roundtripping 1.0f.
With this change, the computed inverses actually become closer to the
goal than the current hardcoded inverse:
~/skcms (master↑1|✔) $ out/clang/tests
0x1.fff50ap-1 0.999916, -1403 ulps from 1.0f (hardcoded)
0x1.0001p+0 1.00002, 128 ulps from 1.0f (sRGB2)
0x1.fffc0ap-1 0.99997, -507 ulps from 1.0f (inv2)
This a^-g version also beats 1/(a^g).
Since this quality is now better than the hardcoded version, I'm
thinking of removing the hardcoded sRGB inverse and replacing it with a
once'd runtime call to invert. That'd at least make the two obvious
ways of getting at the inverse sRGB curve agree exactly.
Guarded by SKCMS_LEGACY_TF_INVERT.
Reviewed-by: Brian Osman <firstname.lastname@example.org>
Commit-Queue: Mike Klein <email@example.com>
43 files changed