Tea Time Numerical Analysis · Problem 1.1.11

Preliminaries — Leon Brin

Mathematics — Numerical Analysis · floating-point-error

Problem

All of these equations are mathematically true. Nonetheless, floating point error causes some of them to be false according to Octave. Which ones? HINT: Use the boolean operator == to check. For example, to check if sin⁡(0)=0\sin(0) = 0, type sin(0)==0 into Octave. ans=1 means true (the two sides are equal according to Octave---no round-off error) and ans=0 means false (the two sides are not equal according to Octave---round-off error). ((a)) (2)(12)=92−4(9)−21(2)(12) = 9^2 - 4(9) - 21 ((b)) e3ln⁡(2)=8e^{3\ln(2)} = 8 ((c)) ln⁡(10)=ln⁡(5)+ln⁡(2)\ln(10) = \ln(5) + \ln(2) ((d)) g ⁣(1+52)=1+52g\!\left(\frac{1+\sqrt{5}}{2}\right) = \frac{1+\sqrt{5}}{2} where g(x)=x2+x3g(x) = \sqrt[3]{x^2 + x} ((e)) ⌊153465/3⌋=153465/3\lfloor 153465/3 \rfloor = 153465/3 ((f)) 3π3+7π2−2π+8=((3π+7)π−2)π+83\pi^3 + 7\pi^2 - 2\pi + 8 = ((3\pi + 7)\pi - 2)\pi + 8

Related theory

Browse the problem library