How is quantization applied/simulated in software?
In general there are three approaches:

Analysis
Simulation
Testing

To analyze you must, of course, understand the calculation, and be a skilled mathematician.
To simulate you must still understand the calculation since you need to re-write it in the simulation language, but you don't need to be so good at math ;-)
Testing is the easiest since you need neither understand of the calculation nor deep math skills. In your case this should be pretty trivial: since there are only 16-bit parameters, you can test all combinations of 2 arguments with 2^16 x 2^16 = 2^32 iterations of your test... a blink of an eye on a modern processor. Compare the result using 16-bit floats with 6-bit ints and keep some simple stats (mean error, max error, etc.). If you have more than two arguments you can save time over an exhaustive test by trying a large number of random inputs, but otherwise the same approach.
How is quantization applied/simulated in software in practice? Suppose for example that I'd like to compute how much error in an output of some function I will get if instead of using 16 bit floating point values I were to use 6 bit integer values in the parameters of the function. If it matters for this question, I am interested in applying quantization to neural networks and the like.
My naive thoughts about this: either somehow force the machine to use reduced bit precision (doesn't seem feasible or easy to do on general purpose OS like Linux, but I'd be interested to know if it is done in practice), or artificially simulate the quantization by mapping ranges of floats to a single integer value, where the integer value represents one quantized value.
I put C and python as a tags because I can only understand those languages if you'd like to answer with code.