An old school solution like:
double X=((double)rand()/(double)RAND_MAX);
Should meet all your criteria (portable, standard and fast). obviously the random number generated has to be seeded the standard procedure is something like:
srand((unsigned)time(NULL));