Type 1
#define random()	((rand () & 0x7fff) / ((float)0x7fff))
#define crandom()	(2.0 * (random() - 0.5))

Type 2

#define random()	((rand () & 0x7fff) / ((float)0x7fff))
#define brandom(a,b)	((a)+random()*((b)-(a)))
#define crandom()	brandom(-1,1)