Biomarin Pharmaceutical Inc., of San Rafael, Calif., reported a GAAP net loss of $21.5 million, or 16 cents per diluted share, for the second quarter ending June 30 compared to GAAP net loss of $32 million, or 27 cents per diluted share, for the same period in 2012.