La divisione tra interi restituisce un valore intero. Scrivi

r= (double)reject/index;