Peak–end rule end. The effects of the duration of an experience upon retrospective evaluation are extremely slight. Fredrickson and Kahneman labeled this phenomenon "duration neglect". The peak–end rule is applicable only when an experience has definite beginning and end periods. A 1993 study titled "When More Pain Is Preferred to Less: Adding a Better End" by Kahneman, Fredrickson, Charles Schreiber, and Donald Redelmeier provided groundbreaking evidence for the peak–end rule. Participants were subjected to two different versions of a single unpleasant experience. The first trial had subjects submerge a hand in 14 °C water for 60 seconds. The second trial had subjects
As-if rule two exceptions concern the copying of objects, and are called copy elision and the return value optimization. The effect of the as-if rule depends on the specific compiler implementation. As an example, in the Microsoft C++ compiler, it causes omission of certain optimizations such as instruction reordering around calls to library functions, since such calls may cause input/output actions or accesses to memory locations marked , and changes in the order of those change observable behavior. The as-if rule is not specific to C++; many other programming languages, including C, Rust , Go, Ocaml, etc... -implementable in compilers- have a