That crossed my eyes as well - if I feel unproductive, I take a break. If I feel drained mentally for the day, I leave, even if it means leaving 2 hours early.
I learned from graduate school that you get the most productivity when your mind is sharp. It makes no sense to work an 80 hour work week programming if your mind can't handle it, and especially if your employer isn't compensating you appropriately - the most I've done is 56 hours, and that was due to having to quickly turnaround a broken project upon starting work at my current job (the most I've worked in a week since then was 48 hours I think).
That said, when I leave work, I often am coding at home on side projects and other self-learning/experimentation initiatives, but at my own pace. I have the freedom to do a lot of extra coding, or none at all, and that in itself can be invigorating when it comes to programming.