The compiler will usually emit the same code no matter whether you extract subexpressions to local variables or not. Therefore, the principal goal in such decisions must be to increase readability for human readers of the code.
Now, temp variables with meaningful names can increase readability. It's probably better to use a temp variable called
clip_duration than an expression like
tape_length / read_head_traverse_speed even though both have the same meaning.
But additional lines can also decrease readability. The example above was a somewhat unintuitive calculation; for something like
height * width it might actually be better to use an inline expression rather than extract it into a temp variable called
Therefore, as in many cases, the answer is "it depends". The parameters on which it depends in this case are: How easy is it to understand the ancillary calculation you are making? Is it simple enough that extracting it would just be repeating the obvious? If so, don't be afraid of nested expressions. If it isn't, choosing a good temp variable name goes a long way to making the code readable without having to add explanatory comments (which should generally be a last resort).