@SuppressWarnings("WeakerAccess")
public FloatHistogram(double min, double max, double binsPerDecade) {
super(min, max);
if (max <= 2 * min) {
throw new IllegalArgumentException(String.format("Illegal/nonsensical min, max (%.2f, %.2g)", min, max));
}
if (min <= 0 || max <= 0) {
throw new IllegalArgumentException("Min and max must be positive");
}
if (binsPerDecade < 5 || binsPerDecade > 10000) {
throw new IllegalArgumentException(
String.format("Unreasonable number of bins per decade %.2g. Expected value in range [5,10000]",
binsPerDecade));
}
bitsOfPrecision = (int) Math.ceil(Math.log(binsPerDecade * Math.log10(2)) / Math.log(2));
shift = 52 - bitsOfPrecision;
offset = 0x3ff << bitsOfPrecision;
setupBins(min, max);
}