Fixed log-space calculation.