Currently, buffer.rs lines 92-102 decrease the probability that a number is prime once it passes the slprp or eslprp test. I suspect you intended to decrease the probability that the number wasn't prime. Assuming the probability of accepting a pseudoprime, conditioned on having passed the Miller-Rabin tests, was meant to be 4/15, this would be done with
probability = 1. - ((1. - probability) * 11f32 / 15f32);
I'm also concerned that the probability estimate may be incompatible with Bayes' Theorem, because it doesn't take into account that by the Prime Number Theorem, the prior probability of a number's primality decreases as the number grows larger. I may be slightly biased in the same direction as the Yudkowsky crowd, but it seems to me that applying Bayesian statistics is obligatory when formally-proven priors are available.
Currently, buffer.rs lines 92-102 decrease the probability that a number is prime once it passes the
slprporeslprptest. I suspect you intended to decrease the probability that the number wasn't prime. Assuming the probability of accepting a pseudoprime, conditioned on having passed the Miller-Rabin tests, was meant to be 4/15, this would be done withI'm also concerned that the probability estimate may be incompatible with Bayes' Theorem, because it doesn't take into account that by the Prime Number Theorem, the prior probability of a number's primality decreases as the number grows larger. I may be slightly biased in the same direction as the Yudkowsky crowd, but it seems to me that applying Bayesian statistics is obligatory when formally-proven priors are available.