The math to optimize power attack is relatively easy I think with a few simplifying assumptions (like ignoring criticals). I don't know of anyone who'd do it this way over the table as it seems pretty unrealistic, plus you'd need to make a fair guess at the AC of monster you're hitting. But anyway, for what it's worth:
For a one-handed weapon, you want to adjust your attack bonus and damage so that your average damage is the same as the number of faces on the d20 that successfully hit.
E.g. Let's say you're hitting at +12 for 2d4+3 damage vs. AC 19. You do an average of 8 damage if you hit. But you hit with a 7 or above (that's 14 faces on the d20). So, 8 vs. 14. (Expected damage turns out to be 5.6. That's calculated as 8x14/20)
However, optimal is 3 points of power attack. That increases your average damage on a hit to 11, and reduces the number of faces that hit to 11. (Expected damage rises to 6.05.) Anything more than 3, and your expected damage starts to tail off again, as the decrease in accuracy starts to outweigh the additional damage.
(In geometry terms, this is the same as maximizing the area of a rectangle with a fixed perimeter. The maximum is when the sides are equal, i.e. a square.)
For a two-handed weapon, you want to adjust so that your average damage is twice the number of faces on the d20 that successfully hit.
So, in the example above, optimal would be 5 points of power attack. That would increase your average damage on a hit to 18, and reduce the number of faces that hit to 9. (Expected damage is 8.1.)
Like I said, I don't feel this sort of math is necessarily appropriate (or fun) over the table. YMMV.
For a one-handed weapon, you want to adjust your attack bonus and damage so that your average damage is the same as the number of faces on the d20 that successfully hit.
E.g. Let's say you're hitting at +12 for 2d4+3 damage vs. AC 19. You do an average of 8 damage if you hit. But you hit with a 7 or above (that's 14 faces on the d20). So, 8 vs. 14. (Expected damage turns out to be 5.6. That's calculated as 8x14/20)
However, optimal is 3 points of power attack. That increases your average damage on a hit to 11, and reduces the number of faces that hit to 11. (Expected damage rises to 6.05.) Anything more than 3, and your expected damage starts to tail off again, as the decrease in accuracy starts to outweigh the additional damage.
(In geometry terms, this is the same as maximizing the area of a rectangle with a fixed perimeter. The maximum is when the sides are equal, i.e. a square.)
For a two-handed weapon, you want to adjust so that your average damage is twice the number of faces on the d20 that successfully hit.
So, in the example above, optimal would be 5 points of power attack. That would increase your average damage on a hit to 18, and reduce the number of faces that hit to 9. (Expected damage is 8.1.)
Like I said, I don't feel this sort of math is necessarily appropriate (or fun) over the table. YMMV.