Monte Carlo testing and verification of numerical algorithm implementations