Exact Underpayment Interest Computation?

This is a nitpicking calculate all the decimal digits kind of question.  I'm wondering if anyone out there

can tell me the exact formula for how the IRS calculates interest on underpayments  and provides

some numerical test values to be sure they are right.

What I've gathered is how the interest rate comes out quarterly as 3%+fed short term rate.  (Reference [1])
and that interest is compounded daily (Reference[2])

That's good enough for an approximation but not an exact computation.
For example one can try to use P(1+r/365)^(number of days)
or  P(1+r/366)^(number of days) in a leap year,  as a guess, but I have no way of knowing
if this is correct.  I can imagine slightly different  other formulas as well.

Anyone out there can tell me and prove convincingly that they have it down to the penny?

 

[1]  https://www.irs.gov/payments/quarterly-interest-rates

 

[2]  https://uscode.house.gov/view.xhtml?req=(title:26%20section:6622%20edition:prelim)%20OR%20(granuleid...)