This incorrect version of DieHarder is in the HyperBook. My apologies for being so careless. Thank you for pointing it out. I will correct it when I get a chance--which will not be right away. Meanwhile, finding a correct algorithm is a good exercise.
It is disheartening that the error was not discovered until now. It seems to indicate that there is no point in my doing further work on the HyperBook.
Leslie