Ivan Ilyich screamed for three days straight because he knows he's dying and nothing he did in his life really mattered, he feels the same anguish as Munch's painting. This is precisely why Tolstoy chose to focus on those last days of his life, they are the most dreadful and full of agony, turning Ivan Ilych from a shallow rather frivolous man into a pathetic pitiful hero. there you go