Fix a few places in examples where C reference implementaion had a double-precision

fp constant undesirably causing computation to be done in double precision.

Makes C scalar versions of the options pricing models, rt, and aobench 3-5% faster.
Makes scalar version of noise about 15% faster.
Others are unchanged.
This commit is contained in:
Matt Pharr
2011-09-01 16:31:22 -07:00
parent eb7913f1dd
commit 99221f7d17
6 changed files with 24 additions and 24 deletions

View File

@@ -104,7 +104,7 @@ inline float NoiseWeight(float t) {
inline float Lerp(float t, float low, float high) {
return (1. - t) * low + t * high;
return (1.f - t) * low + t * high;
}
@@ -147,7 +147,7 @@ static float Turbulence(float x, float y, float z, int octaves) {
lambda *= 1.99f;
o *= omega;
}
return sum * 0.5;
return sum * 0.5f;
}
@@ -163,7 +163,7 @@ void noise_serial(float x0, float y0, float x1, float y1,
float y = y0 + j * dy;
int index = (j * width + i);
output[index] = Turbulence(x, y, 0.6, 8);
output[index] = Turbulence(x, y, 0.6f, 8);
}
}
}