mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fix for values too small to be represented as Double causing NaN from StabilityDetector
This commit is contained in:
parent
3f6abf12f8
commit
080849ba3d
@ -43,6 +43,9 @@ public final class StatBucket {
|
||||
} else if (Double.isNaN(popped)) {
|
||||
var newMean = mean + ((value - mean) / ringbuf.count());
|
||||
var dSquaredIncrement = ((value - newMean) * (value - mean));
|
||||
// If this value is too small to be interpreted as a double it gets converted to
|
||||
// zero, which is not what we want. So we use the smallest possible double value
|
||||
if (dSquaredIncrement == 0) dSquaredIncrement = Double.MIN_VALUE;
|
||||
dSquared += dSquaredIncrement;
|
||||
mean = newMean;
|
||||
} else {
|
||||
|
@ -41,6 +41,9 @@ public class StatFunctions {
|
||||
*/
|
||||
public static double sigmoidE4LowPass(double input, double highcut) {
|
||||
double v = 1.0d/(1.0d + Math.pow(Math.E, (10000.0d * (input - (highcut + 0.001d)))));
|
||||
// If this value is too small to be interpreted as a double it gets converted to
|
||||
// zero, which is not what we want. So we use the smallest possible double value
|
||||
if (v == 0) v = Double.MIN_VALUE;
|
||||
return v;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user