added fast approximate rcp(double) accurate to 15 digits
This commit is contained in:
@@ -3,12 +3,12 @@ export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double x = aFOO[programIndex&0x3];
|
||||
double x = aFOO[programIndex&0x3]*1d100;
|
||||
double d, ix;
|
||||
ix = rcp(x);
|
||||
d = (ix - 1.0d0 / x);
|
||||
d = (d < 0.0d0) ? -d : d;
|
||||
RET[programIndex] = (d < 1d-7) ? 1.0d0 : 0.0d0;
|
||||
RET[programIndex] = (d < 1d-15 && !isnan(d)) ? 1.0d0 : 0.0d0;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
|
||||
Reference in New Issue
Block a user