Writers-directors Peter and Bobby Farrelly don’t miss much in their first gross-out comedy since “There’s Something About Mary.”

“Me, Myself & Irene” doesn’t quite reach the heights — though it does plumb the depths — of its hugely popular predecessor. But it will have an enormous, appreciative audience doubled over with belly-busting laughs.

Carrey has never been funnier than as Charlie Bailygates, a veteran Rhode Island state trooper with a dual-personality disorder.

A meek fellow, Charlie has long suppressed his rage over his wife’s running off with a black dwarf chauffeur who fathered the couple’s three now-grown sons.

One day, Charlie, whose extreme avoidance of confrontation has turned him into the Rodney Dangerfield of law enforcement, snaps. He turns into the hyper-aggressive Hank, whose first act is to shove a little girl who refuses to stop skipping rope into the nearest outdoor fountain.

Shrinks give Charlie medication to suppress his Hank attacks, but things start to go wackily wrong when Charlie is assigned to accompany a suspect named Irene Waters (Renée Zellweger) back to her home in Messina, N.Y.

After Irene is attacked by bad guys (following a bizarre encounter with a cow), Charlie loses his medicine — and hilariously zigzags back and forth between his two personalities.

Even when the Farrellys’ script starts degenerating into a generic chase movie at the midway point, Carrey, triumphantly returning to flat-out comedy after flirting with drama in “The Truman Show” and “Man on the Moon,” gives an outrageous physical and verbal performance worthy of Buster Keaton — complete with a Clint Eastwoodish snarl as Hank.

Zellweger, who’s Carrey’s real-life squeeze, has real on-screen chemistry — attracted to Charlie, repelled by Hank — though she never quite keeps up with his frenetic comic pacing.

She fares better than Chris Cooper (the dad next door in “American Beauty”), who’s criminally wasted as a rogue FBI agent trying to frame Irene in an incomprehensible plot, as is Robert Forster (“Jackie Brown”) as Charlie’s sympathetic superior.

In fact, the real standouts are three young black actors who play Charlie’s sons — the ubiquitous Anthony Anderson (“Big Momma’s House,” “Romeo Must Die”), Mongo Brownlee and Jerod Mixon — massive, trash-talking geniuses who for no logical reason accompany the FBI in pursuit of Charlie and Irene.

Also guaranteed to double over audiences are Tony Cox as the dwarf who cuckolds Charlie in the prologue and Michael Bowman as an albino waiter named, well, Whitey.

Grossly insensitive to the mentally ill as well as other groups too numerous to catalog, “Me, Myself & Irene” delivers laughs by the gross for Carrey and Farrelly brothers fans, including several scenes deploying an industrial-size dildo — not to mention a novel use of a live chicken.

Though it’s too long and rambling, it’s hard not to love a movie that quotes Woody Allen’s notorious “60 Minutes” interview, the newsreel of the Hindenberg disaster and the tarantula scene in “Dr. No.”

And it’s all wrapped up in folksy narration by Rex Allen Jr. — whose mellifluous western tones will instantly strike a chord with boomers who heard his sound-alike father narrate countless Disney nature films in the 1950s.

——

ME, MYSELF & IRENE (Three stars)

Jim Carrey is terrific as a Rhode Island state trooper with a split personality — meek and wild — in the Farrelly brothers’ latest, which delivers laughs by the gross, but doesn’t quite reach the delirious heights of “There’s Something About Mary.”