Skip to content
The Lumenary

Practice · First-year graduate

Computational reproducibility

Computational reproducibility

Warm-upHuman

Which of these reports state their evidence honestly? (Choose all that apply.)

Choose all that apply

Computational reproducibility

Warm-upComputational

In IEEE double precision (p=53p = 53), let x = 1e16. What does (x + 1) - x evaluate to?

Computational reproducibility

CoreHuman

In double precision, 1 - math.cos(1e-8) evaluates to 0.0, although 1−cos⁡(10−8)≈5×10−171 - \cos(10^{-8}) \approx 5 \times 10^{-17}. Which explanation is correct?

Choose one

Computational reproducibility

CoreHuman

Theorem 2 bounds the error of recursive summation by γn∑∣xi∣\gamma_n \sum |x_i|, not by γn∣∑xi∣\gamma_n |\sum x_i|. Why can the bound not be improved to a multiple of ∣∑xi∣|\sum x_i|?

Choose one

Computational reproducibility

CoreHuman

Using interval multiplication, compute [−1,2]⋅[−1,2][-1, 2] \cdot [-1, 2]. What is the lower endpoint of the result?

Computational reproducibility

CoreHuman

A program you do not trust outputs: gcd⁡(1071,462)=21\gcd(1071, 462) = 21, with certificate x=−3x = -3, y=7y = 7. What can you conclude?

Choose one

Computational reproducibility

CoreFormal

In the Lean module, fsum x δ n is the floating-point recursive sum of x 0, …, x n with rounding errors δ. Which statement correctly formalises Theorem 2?

Choose one

Computational reproducibility

Warm-upHuman

You want a colleague to be able to regenerate every figure of your paper in five years' time. Which is the best plan?

Choose one

Computational reproducibility

StretchComputational

Implement Kahan's compensated summation kahan_sum(xs). Keep a running sum s and a compensation c for the low-order bits lost so far: for each x, set y = x - c, t = s + y, c = (t - s) - y, s = t. The tests compare your result with the exact rational sum.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.