"So, yes, I think it has a bug. If only that the documentation (which of course was written extensively!) will be inconsistent with what the program is doing, "
Sure, but while the program is a faulty implementation of a faulty algorithm to compute X, it's also a correct implementation of a correct algorithm to compute X.
Would we really want to fix that bug ? And if not, is it still a bug ?