Stable version with don't care cut function calculation