We present Topaz, a new task-based language for computations that execute on approximate computing platforms that may occasionally produce arbitrarily inaccurate results. Topaz maps tasks onto approximate hardware and integrates the generated results into the main computation. To prevent unacceptably inaccurate results from corrupting the main computation, Topaz deploys a novel outlier detection mechanism that recognizes and precisely reexecutes outlier tasks. Outlier detection enables Topaz to work effectively with approximate hardware platforms with complex fault characteristics, including platforms with bit pattern dependent fault characteristics (in which the presence of faults may depend on values stored in adjacent memory cells). Our experimental results show that, for our set of benchmark applications, outlier detection enables Topaz to deliver acceptably accurate results (typically less than 1% error) on our target approximate hardware platforms. Depending on the application, the overall energy savings range from 8% to 17%. Without outlier detection, none of the applications produces acceptably accurate results.