fn scrambled_radical_inverse_specialized(base: u16, perm: &[u16], a: u64) -> Float {
    let inv_base: Float = 1.0 as Float / base as Float;
    let mut reversed_digits: u64 = 0_u64;
    let mut inv_base_n: Float = 1.0 as Float;
    let mut a: u64 = a; // shadowing input parameter
    while a != 0_u64 {
        let next: u64 = a / base as u64;
        let digit: u64 = a - next * base as u64;
        assert!(perm[digit as usize] < base);
        reversed_digits = reversed_digits * base as u64 + perm[digit as usize] as u64;
        inv_base_n *= inv_base;
        a = next;
    }
    assert!(
        (inv_base_n
            * (reversed_digits as Float + inv_base * perm[0] as Float / (1.0 as Float - inv_base)))
            < 1.00001 as Float
    );
    (inv_base_n
        * (reversed_digits as Float + inv_base * perm[0] as Float / (1.0 as Float - inv_base)))
        .min(FLOAT_ONE_MINUS_EPSILON)
}
/// Compute the radical inverse, but put each pixel through the
/// permutation table for the given base. Deal with a special case
/// that can arise.
Compute the radical inverse, but put each pixel through the
permutation table for the given base. Deal with a special case
that can arise.
Compute the radical inverse but put each pixel through the permutation table for the given base . Deal with a special case that can arise .
fn scrambled_radical_inverse_specialized(base: u16, perm: &[u16], a: u64) -> Float {
    let inv_base: Float = 1.0 as Float / base as Float;
    let mut reversed_digits: u64 = 0_u64;
    let mut inv_base_n: Float = 1.0 as Float;
    let mut a: u64 = a; // shadowing input parameter
    while a != 0_u64 {
        let next: u64 = a / base as u64;
        let digit: u64 = a - next * base as u64;
        assert!(perm[digit as usize] < base);
        reversed_digits = reversed_digits * base as u64 + perm[digit as usize] as u64;
        inv_base_n *= inv_base;
        a = next;
    }
    assert!(
        (inv_base_n
            * (reversed_digits as Float + inv_base * perm[0] as Float / (1.0 as Float - inv_base)))
            < 1.00001 as Float
    );
    (inv_base_n
        * (reversed_digits as Float + inv_base * perm[0] as Float / (1.0 as Float - inv_base)))
        .min(FLOAT_ONE_MINUS_EPSILON)
}
fn scrambled_radical_inverse_specialized ( base : u16 , perm : & [ u16 ] , a : u64 ) -> Float { let inv_base : Float = 1.0 as Float / base as Float ; let mut reversed_digits : u64 = 0_u64 ; let mut inv_base_n : Float = 1.0 as Float ; let mut a : u64 = a ; // shadowing input parameter while a != 0_u64 { let next : u64 = a / base as u64 ; let digit : u64 = a - next * base as u64 ; assert ! ( perm [ digit as usize ] base ) ; reversed_digits = reversed_digits * base as u64 + perm [ digit as usize ] as u64 ; inv_base_n *= inv_base ; a = next ; } assert ! ( ( inv_base_n ( reversed_digits as Float inv_base perm [ 0 ] as Float ( 1.0 as Float inv_base ) ) ) 1.00001 as Float ) ; ( inv_base_n * ( reversed_digits as Float + inv_base * perm [ 0 ] as Float / ( 1.0 as Float - inv_base ) ) ) . min ( FLOAT_ONE_MINUS_EPSILON ) }
Compute the radical inverse, but put each pixel through the
permutation table for the given base.
Compute the radical inverse but put each pixel through the permutation table for the given base .
base
u16
perm
&[u16]
a
u64