diff --git a/esterr.c b/esterr.c index 733c762..7a509da 100644 --- a/esterr.c +++ b/esterr.c @@ -59,6 +59,6 @@ void mm_est_err(const mm_idx_t *mi, int qlen, int n_regs, mm_reg1_t *regs, const n_tot = en - st + 1; if (r->qs > avg_k && r->rs > avg_k) ++n_tot; if (qlen - r->qs > avg_k && l_ref - r->re > avg_k) ++n_tot; - r->div = logf((float)n_tot / n_match) / avg_k; + r->div = n_match >= n_tot? 0.0f : (float)(1.0 - pow((double)n_match / n_tot, 1.0 / avg_k)); } } diff --git a/main.c b/main.c index c727d70..7c9255c 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #include "mmpriv.h" #include "ketopt.h" -#define MM_VERSION "2.17-r1012-dirty" +#define MM_VERSION "2.17-r1013-dirty" #ifdef __linux__ #include