Chapter 9. Math
When we looked at trading resources in the last chapter, you had to choose between RAM, code space, and processing cycles. Trading resources goes only so far. Sometimes you need to make your code go faster. Not knowing what you’ll need for your system, I can still guess that you’ll need to implement some math (because that is where processors excel).
The less your system does, the fewer resources it needs to do them. Sometimes we confuse accuracy, which is important, with precision, which can go too far (see ). If you can quantify the range of data you expect and your error budget, there are some useful methods to reduce unnecessary precision for all sorts of algorithms, thereby saving RAM and processing cycles.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access