Many modern applications (such as multimedia processing, machine learning, and big-data analytics) exhibit a natural tradeoff between the accuracy of the results they produce and the application's execution time or energy consumption. These applications allow us to investigate new, more aggressive optimization approaches.This dissertation presents a foundation of program optimization systems that expose and profitably exploit tradeoffs between the accuracy of the results that the program produces and the time and energy required to produce those results. These systems apply accuracy-aware program transformations that intentionally change the semantics of optimized programs.A key challenge to applying accuracy-aware transformations is understanding the uncertainty that the transformations introduce into the program's execution. To address this challenge, this dissertation presents program analysis techniques that quantify the uncertainty introduced by program transformations. First, this dissertation identifies the properties of subcomputations that are amenable to loop perforation (an accuracy-aware transformation that skips loop iterations). Second, it presents how static analysis can derive expressions that characterize the frequency and magnitude of errors. Third, it presents a system that automatically applies accuracy-aware transformations by formulating accuracy-