Jake Gyllenhaal and Denis Villeneuve had such a great time doing Enemy (2013) that Villeneuve cast him for this movie without any audition.
The first time it was submitted to the MPAA, it received an NC-17 rating, due to its tone and subject matter. The film's torture scenes were later cut by a couple of frames, along with scenes suggesting pedophilia, and it then received the R-rating.
Paul Dano admits to being attracted to roles of this nature (learning difficulties, screaming, nonsensical ranting) and says he draws on his own personal and private experiences to perfect these recurring roles.
Ryan Gosling auditioned for the role of Detective Loki which later went to Jake Gyllenhaal, a frequent collaborator of director Denis Villeneuve (and a friendly professional rival of Gosling's, being that they often audition for the same roles). Villeneuve and Gosling would finally get their chance to work together in Blade Runner 2049 (2017).