In the UK, the HMRC (again, equivalent of IRS) makes worksheets available for computational tax but these are not machine-readable and are not guaranteed to be correct! (Indeed on some points, government websites give incorrect information related to the state pension. [1])
We did something similar to this approach but much simpler - we wrote a little arithmetic language specifying the tax rules, embedded in a spreadsheet for quick verification, and then translated this language into C++ using a Haskell compiler.
[1] https://www.thisismoney.co.uk/money/pensions/article-7100019...