The rounding error was an unintentional result of me taking the form input and running it through parseInt, which truncates all decimal precision. I've changed that to parseFloat - the discrepancy is now resolved.
It worked after your fixing.
I did not expect to see it is quickly fixed like this. I did not know you are J.Lopp on the forum.