diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-03 21:30:28 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-04 10:18:07 -0800 |
commit | afadb6f05cd0477976a04fad62122523c0c90420 (patch) | |
tree | a1324f368a90c3fd350bf9d612488672ba2af907 /Documentation/mobile-manual.txt | |
parent | a873711cec2ce1d865be12e077ae06a35abce1d7 (diff) | |
download | subsurface-afadb6f05cd0477976a04fad62122523c0c90420.tar.gz |
gas model: use virial cubic polynomial form
The "virial" form of the Z compression factor is of the form
Z = 1.0 + A*p + B*p^2 + C*p^3 + ..
and it's considered the "right" polynomial form to use. It happens to
also make for one constant less per gas (since the 1.0 can be added
later), and can be used to simplify the expression and avoid a few
floating point operations.
However, in order for that kind of expression simplification to make
sense, we need to make sure that we don't calculate the powers of the
pressure multiple times either, and that means we have to inline all the
actual calculations.
Our compiler options still mean that the generated code isn't optimal,
but that's a separate issue. And it is a lot better than it used to be.
Being clever about this does potentially make the code a tiny bit less
legible, but maybe that's not too bad for something that we'd expect to
not ever touch once we get it right.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'Documentation/mobile-manual.txt')
0 files changed, 0 insertions, 0 deletions