Real fix for the issue in the math docs

Commit 92b0e86ed1cf0270730c004211387b3fdc4b0469 turns
out to have been the wrong approach, because there was no mysterious
performance problem with TR. Instead, TR's `define` expanded to new
code that interacted poorly with a macro used in the math docs.

I've kept the refactoring from that commit because I think it still
makes the code clearer, but I've removed the now extraneous comment.