RIO DE JANEIRO — Women’s gymnastics is chock-full of obligatory elements — on vault, uneven bars and balance beam. But floor exercise is the closest thing to a blank page on which athletes can express their personalities.

Simone Biles wrote the final entry to her Rio Olympics diary Tuesday, pouring out her heart on a floor exercise that thrilled an adoring audience, and earned her a fourth gold to go with the bronze she’d claimed on balance beam the day before.

With it, Biles took her place alongside only four female gymnasts to win four golds in a single Olympics. She stepped onto the medal podium for a final time at these Rio Games — and perhaps the last time at an Olympics — wearing the broad smile that has become her trademark. At 19, there is so much of life she wants to experience, having made the heart-rending decision at 14 to leave the public school she loved to make training her primary pursuit.

Biles, a three-time world champion on floor exercise, was joined on the podium by U.S. captain Aly Raisman, 22, who took silver.

In the difficulty of the floor-exercise routines staged Tuesday, Biles had no peer. Her “start value,” reflecting the rigor, was 6.8. Raisman’s was 6.6. No other competitor was close — in athleticism or artistry.

Biles had the gold wrapped up on her second tumbling pass, which included the fully extended double flip that bears her name. But nothing in her routine conveyed effort.

Raisman went seventh and has rarely been better. She was in full command of her acrobatics, soaring nearly as high as the gravity-defying Biles, and sticking every landing. Her score: 15.5.

Britain’s Amy Tinkler took bronze (14.933).

Biles isn’t expected to make her decision about whether to return for the 2020 Olympics in Tokyo for some time. Even if she decides against, she could change her mind and return to form, no doubt, with a year or two notice. But Biles took her final Rio Olympic bow with nothing left to prove, having established herself as the greatest gymnast of her generation — most believe, the greatest in history, given the warp speed at which gymnasts’ skills advance.

Just 4 feet 9, Biles bows out a giant, with golds in the individual all-around, individual vault, individual floor exercise and team competitions.

Earlier Tuesday, Danell Leyva, the only U.S. male gymnast to qualify for the parallel bars final, earned silver on the apparatus.

Leyva, the 2011 world champion on the event, was initially named an alternate for the 2016 U.S. Olympic gymnastics team but was tapped to fill in for injured teammate John Orozco.

With U.S. teammates shouting approval from their seats at the opposite end of the arena, Leyva was a study in body control and stuck his landing with authority.

Oleg Verniaiev of Ukraine, the 2014 world champion and top qualifier on the event, won gold. Russia’s David Belyavskiy (15.783) took bronze.

It was the first silver and only the second medal by the U.S. men’s gymnastics team at the Rio Games.

Tuesday’s gymnastics competition concludes with the high bar, which gives Leyva another chance at a medal.