Since RGB and CMYK spaces are both device-dependent spaces, there is no simple or general conversion formula that converts between them. Conversions are generally done through color management systems, using color profiles that describe the spaces being converted. An ICC profile defines the bidirectional conversion between a neutral "profile connection" color space (CIE XYZ or Lab) and a colorspace we are interested in, in this case both RGB and CMYK. The precision of the conversion depends on the profile itself, the exact methodology, and because the gamuts do not generally match, the rendering intent and constraints such as ink limit.