Master and Commander prequel

I've never read the books it based on. The closet I've come to reading an age of sail period book is Shogun. That book has some naval combat in it, but that's not the primary focus.

The book series is excellent. It's called the Aubrey-Maturin Series by Patrick O'Brien. Very much so a realistic look at the English Navy of the period and naval tactics of the time combined with the interesting relationship between Jacky Aubrey and Stephen Maturin. Really excellent series that follows Aubrey's career starting when he gets his first command and meets Dr. Maturin.

Strangely enough, there is also a book series that uses the same characters and stories, but tells it in a Sci-Fi setting. That series is called the RCN Series or Leary-Mundy Series by David Drake.