Worth noting that this is an adaptation of a story and the original author is neither Wilder nor Chandler, but James M Cain.
Apparently Cain was a big fan of the movie, from a quick check of Wikipedia he said about the male lead: "The way you found tragedy in his shallow, commonplace, smart-cracking skull will remain with me for a long time and, indeed, reinforce an aesthetic viewpoint that many quarrel with; for if I have any gift, it is to take such people and show that they can suffer as profoundly as anybody else…" and the page in general suggests that they deepened the story a bit - https://en.wikipedia.org/wiki/Double_Indemnity_(novel)