| … | … | @@ -157,7 +157,8 @@ static void record_choice( |
| 157 | 157 | static int estimate_log2_table_size(Sentence sent) |
| 158 | 158 | { |
| 159 | 159 | /* Size estimate based on measurements (see #1402) */ |
| 160 | | double lscale = log2(sent->num_disjuncts + 1.0) - 0.5 * log2(sent->length); |
| 160 | double lscale = log2((double)sent->num_disjuncts + 1.0) - |
| 161 | 0.5 * log2((double)sent->length); |
| 161 | 162 | double lo_est = lscale + 4.0; |
| 162 | 163 | double hi_est = 1.5 * lscale; |
| 163 | 164 | double dj_est = fmax(lo_est, hi_est); |
| … | … | @@ -166,10 +167,10 @@ static int estimate_log2_table_size(Sentence sent) |
| 166 | 167 | * pex->Pset_bucket_pool is almost exactly equal to the num elts |
| 167 | 168 | * issued for sent->Table_tracon_pool. This provides a better |
| 168 | 169 | * estimate when parsing with MST, when the above is too low. */ |
| 169 | | double ntracon = pool_num_elements_issued(sent->Table_tracon_pool); |
| 170 | double ntracon = (double)pool_num_elements_issued(sent->Table_tracon_pool); |
| 170 | 171 | double ltra = log2(ntracon) + 1.0; // + 1.0 because floor() |
| 171 | 172 | |
| 172 | | int log2_table_size = floor(fmax(dj_est, ltra)); |
| 173 | int log2_table_size = (int)floor(fmax(dj_est, ltra)); |
| 173 | 174 | |
| 174 | 175 | // Enforce min and max sizes. |
| 175 | 176 | if (log2_table_size < 4) log2_table_size = 4; |