#lang scribble/manual @(require scribble/eval "is-prime.rkt") @title{Miller-Rabin Primality Tester} @defmodule[(planet djhaskin987/miller-rabin:1:3)]{Provides the function "prime?" which takes a number @racket[x] and the number of times to test it @racket[k] and returns whether the number N is (probably) prime. The probability of its truth is (1 - 1 / (4^K)).} @defproc[(prime? [x integer?] [k integer?] [rng (-> exact-positive-integer? exact-nonnegative-integer?)]) (boolean?)]{ Given an integer @racket[x], The number of tests to perform @racket[k], and a random number generator @racket[rng], which takes a number and returns a number between 0 and the given number. @bold{NOTE:} the default rng is @racket[random], which takes as its maximum value 4294967087.}