IFC Films has calculated a deal for the biopic about an Indian math whiz and his British professor. Writer-director Matthew Brown’s The Man Who Knew Infinity stars Dev Patel in the title role and Oscar winner Jeremy Irons as his mentor in the story of their friendship that altered the course of mathematics in the 20th century. The film premiered at Toronto and later was the opening-night pic at the Zurich Film Festival.

The story follows Srinivasa Ramanujan (Patel), a self-taught mathematician who IFC Filmstravels to Trinity College in Cambridge, where he forges a bond with his mentor, the eccentric professor GH Hardy (Irons) and fights against prejudice to reveal his genius to the world. Devika Bhise, Stephen Fry and Toby Jones co-star in the pic, which was produced by Edward R. Pressman, Jim Young, Joe Thomas, Sofia Sondervan, Jon Katz and Brown. It is based on Robert Kanigel’s 1991 biography The Man Who Knew Infinity: A Life of the Genius Ramanujan.

“Matthew Brown has crafted a crowd-pleasing film, ideal for smart adult audiences, in which both Jeremy Irons and Dev Patel deliver incredible performances,” says Jonathan Sehring, President of Sundance Selects/IFC Films.

The deal was negotiated by Arianna Bocco, SVP Acquisitions at Sundance Selects/IFC Films, with CAA on behalf of the filmmakers. Filmmaker Brown is repped by CAA, Kaplan/Perrone Entertainment and Schreck Rose.