jboyton:
Do you know of a better way to do the calculation?
The algorithm is correct, but many implementations of it are wrong, as you pointed out in reply #13, above. And some of the coding errors "don't matter" with some specific values of calibration constants, and do matter with others.
And then there is the issue of using 64-bit numbers for the calculation, or 32 bit numbers, or floating point numbers.
If you compare the datasheets for the different iterations of this device, and the amount of detail in the latest one, it's obviously an "issue" for Bosch's industrial customers as well as "hobbyists".
I do actually know of a better way.
On the arduinos, the 8 bit ones anyway, doing calculations with 64-bit longs is very slow and generates a huge amount of code. I wrote some custom functions to implement those multiply and shift operations in that algorithm using the actual relevant parts of the number and not doing a huge number of multiplies of 0 x 0 and the throwing the result away anyway. Works much faster.