It's an entire pipeline from photomultiplier to recording medium to the inverse process and everything is optimized not for any particular mathematical truth but for the subjective experience.
Granted some CDs are mastered like garbage, and that led to some bad press for awhile. But you can master a CD so that it sounds exactly, as in mathematically exactly, as a vinyl record, if so desired.
It is also possible to make a digital amplifier that sounds exactly identical to vacuum tubes.
Humans have well and mastered the art of shaping sound waveforms however we want.