The screenplay for the Steve Carell comedy, Crazy, Stupid, Love, isn’t so much written as manufactured according to precepts found in manuals and teachings by the current breed of Hollywood screenwriting gurus. It starts with a high concept, manages its coincidences, misunderstandings and character arcs to maximize comic potential and, in twists that would undoubtedly tickle those script coaches, pulls off not one but two genuine surprises. Its cleverness, however, masks a lack of real heart.

When a movie plays an opening sequence — where a wife surprises her husband by asking for a divorce — strictly for laughs with perky music in the background, you know the film cares only about audience reactions, not its characters. Nevertheless, Crazy is clever, give it that. The script sets up rote situations, then turns them on their head or takes them in unexpected directions. Given the dearth of inventive adult comedies in the marketplace, Warner Bros. may experience crazy, good box office with this romantic comedy.

Crazy, Stupid, Love is that rara avis that has more directors than writers. Dan Fogelman has the sole credit on the screenplay directed by Glenn Ficarra and John Requa. His basic idea is to display three generations of romantic attraction to demonstrate that when it comes to love, experience counts for little. Indeed the 13-year-old son of Carell’s forty something Cal Weaver is more focused and adroit than his dad when it comes to pursuing a “soul mate.”

The fiendishly plotted comedy starts to uncoil when Cal’s wife and former high-school sweetheart, Emily (Julianne Moore), abruptly requests a divorce. Thrust unprepared into the singles scene, Cal, who wears sneakers, coats a size too big and a wounded heart on his sleeve, is clueless.

Taking pity for no apparent reason other than the script needs him to, a supremely successful lady’s man, Jacob (Ryan Gosling who is nicely maturing into leading man status in studio movies), takes Cal under his wing to teach him all the right moves. Jacob also drastically overhauls that woeful wardrobe.

Jacob’s own polished pick-up routines work on a dazzling array of dazzling women until it hits a wall: The player can’t elicit anything but laughter and sarcasm from law student Hannah (Emma Stone, who seems to be in every movie this summer that doesn’t require digital effects). Hannah somehow sees through every line. Again, the script pretty much requires this for later developments.

Meanwhile, two more romances stumble along at the Weaver household: Son Robbie (Jonah Bobo) pines for his sister’s 17-year-old babysitter, Jessica (Analeigh Tipton), while his mom tries to make sense of the adulterous relationship she foolishly began with an office co-worker (Kevin Bacon, playing it too smarmy for the relationship to be credible).

Jacob’s instructions finally pays off as Cal scores first with a pretty barfly (Marisa Tomei, in possibly the best performance in the movie only it seems to belong to a different movie), then continues on with a somewhat implausible succession of lovelies.

In the script’s most poorly engineered subplot, Hannah suffers a crushing disappointment in her passive pursuit of a lawyer played by recording artist Josh Groban. This all too blatantly causes her to rebound into Jacob’s startled arms to instigate a genuine relationship that takes both parties by surprise.

The script then quite adroitly throws in two startling revelation about cunningly hidden relationships among the characters, which leads to a climatic free-for-all that brings nearly everyone to an unplanned showdown in the Weaver backyard.

In its headlong pursuit of laughs, the screenplay runs by several opportunities to explore its characters in greater depth. It would have been nice to see Jacob’s advice to Cal actually have a beneficial impact on how he now treats his estranged, taken-for-granted wife. And it would have been equally nice to see Cal’s clear adoration of his family have an impact on his determined-to-remain-single advisor. The movie suggests these things happen but you witness neither.

The movie borrows so heavily from other movies —but always putting an inventive twist on these borrowings, mind you — that it even has fun with its movie references. This includes a sequence between Gosling and Stone where her character demands he bed her in an athletic “R rated” scene as opposed to a “PG-13 rated” one. But the two actually start to talk about their lives, one thing leads to another and the sequence winds up PG-13 after all. Yet this is one of the more amusing riffs in any recent film on the MPAA’s rating system.

The movie suffers perhaps from too many characters and subplots but all the actors appear to have fun with their characters. Carell, who has the market cornered for playing schnooks — his best movie performance remains Dan in Real Life, however — finds something new here by suggesting that there can be worse things than being a schnook. Gosling keeps it real yet amusingly satirizes his screen lothario character.

Moore conveys the angst-ridden internal push-pull of a midlife crisis while Stone gets a little lost in her inconsistent character but is never less than winning.

Tomei plays the comedy very broadly but gets more than her share of laughs. The younger actors, Bobo and Tipton, shine in roles that have greater depth than some of the adult ones.

All tech credits are pro in a film shot in Los Angeles but aiming to look like Anywhere USA. However, the frequently used bar set with wall-to-wall, ready and willing beautiful single women is located in Nowhere USA.