Misunderstood, mistreated geniuses are a cinematic staple, and the life of yet another of them is dramatized in “The Man Who Knew Infinity,” a Masterpiece Theatre-style treatment of the relationship between Srinavasa Ramanujan, the tragically short-lived Indian math prodigy, and Cambridge don G.H. Hardy, who was instrumental in bringing him to England and served as his supportive mentor in the face of World War I-era racism and prejudice in British society. Though the film is hobbled by the necessity—so common in pictures of this sort—to simplify the subject’s rather esoteric accomplishments by simply having bystanders incredulously tell us how “incredible” and “amazing” they are, it works as a simple human story of the bond that builds between two drastically different men who are in a position to appreciate each other’s brilliance.

Certainly the film fails conspicuously to make much of Ramanujan’s background in India, which is sketched in a colorful but frankly bland fashion. He’s introduced as a twenty-something in pre-war Madras, impoverished but a wiz with figures—as well as newly-married to the beautiful Janaki (Devika Bhise). He’s fortunate in landing a job as a low-level clerk to an Englishman (Stephen Fry), whose chief accountant recognizes and encourages his mathematical studies. Eventually his superiors are instrumental in introducing him by letter to Hardy, who recognizes the innovative conclusions in the sample theorems he’s received from out of the blue and arranges for Ramanujan to come to Cambridge as his student, leaving Janaki behind with his bullying mother (Arundhati Nag).

In England the newcomer has trouble fitting in, especially because most of his classmates treat Indians as intellectually inferior. (The fact that the college refectory has no vegetarian options is also a problem, forcing him to cook for himself!) Hardy, an emotionally remote man, is initially no help, insisting that the young man take regular classes and concentrate on formulating proofs for his inspired conclusions. Hardy, an atheist, simply cannot fathom Ramanujan’s insistence that he intuits the mathematical truths he expounds through prayer and meditation and reads them as divine messages. The result is that Ramanujan is hounded by a contemptuous math don (Anthony Calf) and the leaders of the college, even as he falls victim to a nagging cough, the harbinger of the illness that would ultimately kill him while still in his early thirties, after he’d returned to India and Janaki (who’d been erroneously led to believe that he’d forgotten her by her mother-in-law).

Meanwhile Hardy is prodded into giving his pupil the leeway he needs by his academic friends, math colleague John Littlewood (Toby Jones) and mathematician-philosopher Betrand Russell (Jeremy Northam), whose pacifist leanings led to the loss of his Trinity fellowship in 1916. The don decides to take a chance and pit the abilities of his student regarding partitions against the laborious calculations of another doubtful colleague (Richard Johnson). When they prove to coincide, the powers-that-be will be forced to recognize, however belatedly, Ramanujan’s accomplishments in number theory even as his health deteriorates.

Frankly writer-director Matthew Brown isn’t able to make those achievements comprehensible to laymen, which is what most audience members will be. The best he can do is to convey their importance to the mathematical community at Cambridge through their grudging expressions of admiration. But the emphasis of the film is on personal relationships—not just that between Ramanujan and Hardy, but that between Hardy on the one hand and Littlewood and Russell on the other. (Ramanujan’s marriage, on the other hand, gets very short shrift.) In that respect it’s fortunate in its cast. Irons in particular is splendid, painting a sharp but affectionate portrait of a man given over to his ethereal academic pursuits to the exclusion of almost all else (though, it must be said, he’s far too old to be playing Hardy, who wasn’t yet forty at the time). Jones, Northam and Johnson match him in donnish give-and-take. Patel does he can with the part of Ramanujan, who’s presented as basically a suffering saint; he certainly cuts a sympathetic figure, though not always a compelling one.

“The Man Who Knew Infinity” is helped immeasurably by authentic locations, including the grounds of Trinity College, which are beautifully shot in lustrous widescreen by Larry Smith. And the period detail is captured impeccably in Luciana Arrighi’s production design, the art direction supervised by Andrew Munro and effected by Justin Warburton-Brown, Liz Ainley’s set decoration and Ann Maskrey’s costumes. J.C. Bond’s editing gives the material the Georgian tempo it demands, and Coby Brown’s score is appropriately genteel.

Those more accomplished in mathematics than most of us would doubtlessly applaud a treatment with more disciplinary meat to it, but among examples of this popular genre Brown’s film falls precisely at the middlebrow level that makes it accessible and, on that basis, entertaining.