Once again, a purely non-coders point of view, but it looks like it checks each point to make sure it is not too close to any others? So it's roughly 'While Distance is More than or Equal to' and it generates a random average distance for each starfield so they look different? I'm not very up on array generation in anything above Cobol ( a tiny bit) and Pascal.
I suppose my first suggestion would be to remove the checks altogether?
// following code randomly distributes star points within a sphere volume, which
// avoids there being denser areas along the edges and in corners that we had in the
// old rectangular distribution scheme.
for (i=0; i
{
v.xyz.x = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.y = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
v.xyz.z = (float) ((myrand() & RND_MAX_MASK) - HALF_RND_MAX);
dist = v.xyz.x * v.xyz.x + v.xyz.y * v.xyz.y + v.xyz.z * v.xyz.z;
vm_vec_copy_normalize(&Stars
.pos, &v);
Once again, I have applied brute force to this, so chances are it is completely wrong
Computer Randomness is not 'real' as such, so there is a tendency to create clusters etc if you let it create enough stars 
Flipside 