Skip to content

Commit b577a6d

Browse files
committed
fix bug in SZ compression
1 parent 308ed00 commit b577a6d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/CompressionReductionMethod.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ double CompressionReductionMethod::derive_compression_ratio(double accuracy, std
5454
double data_smoothness)
5555
{
5656
if (profile == "sz") {
57-
// SZ-like prediction-based compressor: empirical fit from published benchmarks on scientific data.
58-
// Higher smoothness -> better prediction -> higher ratio.
59-
double alpha = 3.0;
60-
double beta = 0.8;
61-
return std::max(1.0, alpha * std::pow(-std::log10(accuracy), beta) * (0.5 + data_smoothness));
57+
// accuracy = absolute/relative error bound; larger = looser = more compression
58+
// Empirical fit: ratio ≈ A × accuracy^B × (0.5 + data_smoothness)
59+
// Calibrated to give ratio ≈ 7 at 1e-3 and ratio ≈ 2 at 1e-6.
60+
double alpha = 24.4;
61+
double beta = 0.181;
62+
return std::max(1.0, alpha * std::pow(accuracy, beta) * (0.5 + data_smoothness));
6263
}
6364
if (profile == "zfp") {
6465
// ZFP-like transform-based compressor: rate = bits-per-value derived from accuracy.

0 commit comments

Comments
 (0)