Alan Turing (1912-1954) was a brilliant English mathematician considered to be one of the fathers of modern computing. During World War II, he helped British intelligence break the infamous Enigma code used by the Nazis, a feat without which the war might have gone in quite a different (not good) direction for the Allies. He was also a deeply closeted homosexual, and since engaging in homosexual acts was then illegal in Great Britain, when he was caught soliciting sex from a man in 1952, he was sentenced to chemical castration, whereby he was required to take drugs to reduce his physical impulses. He committed suicide two years later.

The Norwegian director Morten Tyldum (Headhunters), working off a script by novice feature-film writer Graham Moore, has fashioned a compelling drama from the tragic circumstances of this misunderstood genius’s life. It is a profoundly sad – and effective – portrait of a very lonely individual who gave so much to the world yet received so little in return. For – at least according to the movie – Turing was the ultimate misfit and outsider. He didn’t not fit in solely because he was a gay man in a straight world; rather, he was, from a young age, a social outcast, owing to behavioral patterns that we would now recognize as falling somewhere on the autism spectrum. Since we see Turing as both child and adult in this temporally fluid story, we are given perspective on how the seeds of his oddness (and eventual destruction) were sown early on.

Tyldum is helped in his task of biographical sketch by a monumental performance from one of the great actors of our day, Benedict Cumberbatch (“Sherlock“). With total commitment and great emotional intelligence, Cumberbatch brings Turing alive in all his ornery glory. We alternately love him and hate him; even more importantly, we understand him and, eventually, pity him. We also believe in his brilliance, since Cumberbatch, like Eddie Redmayne as Stephen Hawking in The Theory of Everything, is able to reveal the workings of Turing’s mind through the play of his eyes, alone (and unlike Redmayne, confined to a wheelchair for much of his film, Cumberbatch has the rest of his body to play with, too, though he exercises that freedom with great restraint). Also essential to the film are Keira Knightley (Begin Again) as Joan Clark – the one female math genius of the movie, and the one woman Turing, sort of, romances – and Matthew Goode (Stoker) as Hugh Alexander, a playboy mathematician whose charisma and good looks make him a natural rival to Turing, yet who comes around – as we do – to throw his full support to a man so obviously his intellectual superior. Both Knightley and Goode – extremely appealing performers, both – bring much needed warmth to the story, and thereby help to highlight Turing’s full humanity.

I knew very little about Turing before seeing the film, beyond the fact that the laptop on which I am typing these words might not have come about without his contributions to the then-burgeoning field of computer science. One of my favorite moments in the story comes when Turing is speaking to the police inspector in charge of looking into his indecency case. The detective thinks Turing may be a Soviet Spy (this is the 1950s, don’t forget), and has done his research into Turing’s work. They discuss his 1951 paper, entitled, appropriately enough, “The Imitation Game,” in which Turing examined how to differentiate between artificial and human intelligence. That’s when I realized that we all owed Turing an additional debt of gratitude for unknowingly contributing to one of the great works of cinematic science fiction of the past 40 years: Blade Runner, based on Philip K. Dick’s Do Androids Dream of Electric Sheep?. That film opens with a cyborg hunter (a “blade runner”) administering a “Voight-Kampff test” to a seeming human. That test? Basically a re-working of Turing’s “imitation game.” What a man! What a genius! And what a tragedy . . . and what a fine movie about all three.