I’ve been fascinated by the computer science pioneer Alan Turing ever since I came across the remarkable account of his life written by the British mathematician and gay rights activist Andrew Hodges in 1983. The moment of publication was no accident, for two reasons. First, by the early 1980s the story of Turing’s wartime efforts to break Nazi codes had receded just far enough in time to overcome the draconian security restrictions that had prevented it from being told. Second, gay rights campaigners in Europe and the US were enjoying some of their first big successes in breaking through long-standing discrimination. Suddenly it became possible not only to celebrate Turing’s enormous contribution to Allied victory in the war but also to tell the story of his 1952 conviction and subsequent punishment on charges of homosexuality (still a criminal offense in Great Britain at the time), followed by his death, at the age of forty-one, two years later. (For Hodges, this death was clearly a suicide; intriguingly, Jack Copeland, his more recent biographer, isn’t so sure. More on that later.)

To anyone trying to turn this story into a movie, the choice seems clear: either you embrace the richness of Turing as a character and trust the audience to follow you there, or you simply capitulate, by reducing him to a caricature of the tortured genius. The latter, I’m afraid, is the path chosen by director Morten Tyldum and screenwriter Graham Moore in The Imitation Game, their new, multiplex-friendly rendering of the story. In their version, Turing (played by Benedict Cumberbatch) conforms to the familiar stereotype of the otherworldly nerd: he’s the kind of guy who doesn’t even understand an invitation to lunch. This places him at odds not only with the other codebreakers in his unit, but also, equally predictably, positions him as a natural rebel.

Just to make sure we get the point, his recruitment to the British wartime codebreaking organization at Bletchley Park is rendered as a ridiculous confrontation with Alastair Denniston (Charles Dance, of Game of Thrones fame), the Royal Navy officer then in charge of British signals intelligence: “How the bloody hell are you supposed to decrypt German communications if you don’t, oh, I don’t know, speak German?” thunders Denniston. “I’m quite excellent at crossword puzzles,” responds Turing.

On various occasions throughout the film, Denniston tries to fire Turing or have him arrested for espionage, which is resisted by those who have belatedly recognized his redemptive brilliance. “If you fire Alan, you’ll have to fire me, too,” says one of his (formerly hostile) coworkers. There’s no question that the real-life Turing was decidedly eccentric, and that he didn’t suffer fools gladly. As his biographers vividly relate, though, he could also be a wonderfully engaging character when he felt like it, notably popular with children and thoroughly charming to anyone for whom he developed a fondness.

All of this stands sharply at odds with his characterization in the film, which depicts him as a dour Mr. Spock who is disliked by all of his coworkers—with the possible exception of Joan Clarke (Keira Knightley). The film spares no opportunity to drive home his robotic oddness. He uses the word “logical” a lot and can’t grasp even the most modest of jokes. This despite the fact that he had a sprightly sense of humor, something that comes through vividly in the accounts of his friends, many of whom shared their stories with both Hodges and Copeland. (For the record, the real Turing was also a bit of a slob, with a chronic disregard for personal hygiene. The glamorous Cumberbatch, by contrast, looks like he’s just stepped out of a Burberry catalog.)

Now, one might easily dismiss such distortions as trivial. But actually they point to a much broader and deeply regrettable pattern. Tyldum and Moore are determined to suggest maximum dramatic tension between their tragic outsider and a blinkered society. (“You will never understand the importance of what I am creating here,” he wails when Denniston’s minions try to destroy his machine.) But this not only fatally miscasts Turing as a character—it also completely destroys any coherent telling of what he and his colleagues were trying to do.

In reality, Turing was an entirely willing participant in a collective enterprise that featured a host of other outstanding intellects who happily coexisted to extraordinary effect. The actual Denniston, for example, was an experienced cryptanalyst and was among those who, in 1939, debriefed the three Polish experts who had already spent years figuring out how to attack the Enigma, the state-of-the-art cipher machine the German military used for virtually all of their communications. It was their work that provided the template for the machines Turing would later create to revolutionize the British signals intelligence effort. So Turing and his colleagues were encouraged in their work by a military leadership that actually had a pretty sound understanding of cryptological principles and operational security. As Copeland notes, the Nazis would have never allowed a bunch of frivolous eggheads to engage in such highly sensitive work, and they suffered the consequences. The film misses this entirely.

In Tyldum and Moore’s version of events, Turing and his small group of fellow codebreakers spend the first two years of the war in fruitless isolation; only in 1941 does Turing’s crazy machine finally show any results. This is a highly stylized version of Turing’s epic struggle to crack the hardest German cipher, the one used by the German navy, whose ravaging submarines nearly brought Britain to its knees during the early years of the war. What this account neglects to mention is that Turing’s “bombes”—electromechanical calculating devices designed to reconstruct the settings of the Enigma—were already helping to decipher German army and air force codes from early on.

The movie version, in short, represents a bizarre departure from the historical record. In fact, Bletchley Park—and not only Turing’s legendary Hut 8—was doing productive work from the very beginning of the war. Within a few years its motley assortment of codebreakers, linguists, stenographers, and communications experts were operating on a near-industrial scale. By the end of the war there were some 9,000 people working on the project, processing thousands of intercepts per day.

A bit like one of those smartphones that bristles with unneeded features, the film does its best to ladle in extra doses of intrigue where none existed. Tyldum and Moore conjure up an entirely superfluous subplot involving John Cairncross, who was spying for the Soviet Union during his service at Bletchley Park. There’s no evidence that he ever crossed paths with Turing—Bletchley, contrary to the film, was much bigger than a single hut—but The Imitation Game includes him among Turing’s coworkers. When Turing discovers his true allegiance, Cairncross turns the tables on him, saying that he’ll reveal Turing’s homosexuality if his secret is divulged. Turing backs off, leaving the spy in place.

Not many of the critics seem to have paid attention to this detail—except for historian Alex von Tunzelmann, who pointed out that the filmmakers have thus managed, almost as an afterthought, to turn their hero into a traitor. The movie tries to soften this by revealing that Stewart Menzies, the head of the Special Intelligence Service, has known about Cairncross’s treachery from the start—a jury-rigged solution to a gratuitous plot problem. (In fact, Cairncross, “the fifth man,” was never prosecuted.)

These errors are not random; there is a method to the muddle. The filmmakers see their hero above all as a martyr of a homophobic Establishment, and they are determined to lay emphasis on his victimhood. The Imitation Game ends with the following title: “After a year of government-mandated hormonal therapy, Alan Turing committed suicide in 1954.” This is in itself something of a distortion. Turing was convicted on homosexuality charges in 1952, and chose the “therapy” involving female hormones—aimed, in the twisted thinking of the times, at suppressing his “unnatural” desires—as an alternative to jail time. It was barbarous treatment, and Turing complained that the pills gave him breasts. But the whole miserable episode ended in 1953—a full year before his death, something not made clear to the filmgoer.

Copeland, who has taken a fresh look at the record and spoken with many members of Turing’s circle, disputes that the experience sent Turing into a downward spiral of depression. By the accounts of those who knew him, he bore the injustice with fortitude, then spent the next year enthusiastically pursuing projects. Copeland cites a number of close friends (and Turing’s mother) who saw no evidence that he was depressed in the days before his death, and notes that the coroner who concluded that Turing had died by biting a cyanide-laced apple never examined the fruit. Copeland offers sound evidence that the death might have actually been accidental, the result of a self-rigged laboratory where Turing was conducting experiments with cyanide. He left no suicide letter.

Copeland also leaves open the possibility of foul play, which can’t be dismissed out of hand, when you consider that all of this happened during the period of McCarthyite hysteria, an era when homosexuality was regarded as an inherent “security risk.” Turing’s government work meant that he knew a lot of secrets, in the postwar period as well. It’s likely we’ll never know the whole story.

One thing is certain: Turing could be remarkably naive about his own homosexuality. It was Turing himself who reported the fateful 1952 burglary, probably involving a working-class boyfriend, that brought his gay lifestyle to the attention to the police, thus setting off the legal proceedings against him. In The Imitation Game he holds this information back from the cops, who then cleverly wheedle it out. It’s another indication of the filmmakers’ determination to show Turing as an essentially passive figure. He’s never the master of his own destiny.

But even if you believe that Turing was driven to his death, The Imitation Game’s treatment of his fate borders on the ridiculous. In one of the film’s most egregious scenes, his wartime friend Joan pays him a visit in 1952 or so, while he’s still taking his hormones. She finds him shuffling around the house in his bathrobe, barely capable of putting together a coherent sentence. He tells her that he’s terrified that the powers that be will take away “Christopher”—his latest computer, which he’s named after the dead friend of his childhood (just as he did with his machine at Bletchley Park).

As near as I can tell, there is no basis for any of this in the historical record; it’s monstrous hogwash, a conceit entirely cooked up by Moore. The real Turing certainly paid periodic and dignified respects to the memory of his first love, Christopher Morcom, but I doubt very much that he ever confused his computers with people. In perhaps the most bitter irony of all, the filmmakers have managed to transform the real Turing, vivacious and forceful, into just the sort of mythological gay man, whiney and weak, that homophobes love to hate.

This is indicative of the bad faith underlying the whole enterprise, which is desperate to put Turing in the role of a gay liberation totem but can’t bring itself to show him kissing another man—something he did frequently, and with gusto. And it most definitely doesn’t show him cruising New York’s gay bars, or popping off on a saucy vacation to one of the less reputable of the Greek islands. The Imitation Game is a film that prefers its gay men decorously disembodied.

To be honest, I’m a bit surprised that there hasn’t been more pushback against The Imitation Game by intelligence professionals, historians, and survivors of Turing’s circle. But I think I understand why. After so many years in which Turing failed to get his due, no one wants to be seen as spoiling the party. I strongly doubt, though, that many of those in the know are recommending this film to their friends. (For his part, Andrew Hodges is apparently opting to avoid talking about the movie during his current book tour—it’s easy to imagine why he might choose to do so, and I don’t fault him for it.)

If you want to see a richly imagined British movie about a fascinating historical character, go see Mike Leigh’s new film about the painter J.M.W. Turner. But if you want to see the real Alan Turing, you’re better off reading the books.

Morten Tyldum’s The Imitation Game is now in wide release. This post is drawn from a longer essay that will appear in a coming issue of The New York Review of Books.