Calculate IRS underpayment penalty

How to calculate the underpayment penalty? Is there a formula available?

 

Is it preferred to pay the estimated penalty when I file the return or wait until the IRS send the actual penalty bill?

 

Will there be additional penalty if the estimated penalty that was paid is lower than the actual penalty?