private double nextRadicalInverse ( ) { counter ++ ; // Do at most MAXFAST appromate steps if ( counter >= MAXFAST ) { counter = 0 ; inverse += MAXFAST ; current = radicalInverse ( inverse ) ; return current ; } // Fast approximation: double nextInverse = current + invbase ; if ( nextInverse < ALMOST_ONE ) { current = nextInverse ; return current ; } else { double digit1 = invbase , digit2 = invbase * invbase ; while ( current + digit2 >= ALMOST_ONE ) { digit1 = digit2 ; digit2 *= invbase ; } current += ( digit1 - 1.0 ) + digit2 ; return current ; } }
Compute the next radical inverse .