They are NOT equal.
x: 1, y: 0.333333, y*3: 0.999999
Topics in Digital Heritage:
Numerical Methods for Digital Reconstruction
Fall 2026


A vector space \(V\) over \(\mathbb{R}\) is a set closed under addition and scalar multiplication, satisfying the following axioms:
Vector Space Axioms
![]()
\(\mathbb{R}^2\) is a vector space
\(x\in\mathbb{R}\equiv\mathbb{R}^1\)
\((x,y)\in\mathbb{R}^2\)
\((x,y,z)\in\mathbb{R}^3\)
\((a_1, ..., a_n) \equiv \begin{bmatrix} a_1 \\ \vdots \\ a_n \end{bmatrix} \in \mathbb{R}^n\)
Definition
A function \(f: \mathbb{R}^n \to \mathbb{R}^m\) is linear if it satisfies the following two properties for all \(\mathbf{u}, \mathbf{v} \in \mathbb{R}^n\) and all scalars \(c \in \mathbb{R}\):
\[\begin{split} 3x + 2y + 5z &= 0 \\ -4x + 9y - 3z &= -7 \\ 2x -3y -3z &= 1 \end{split}\]
\[ \begin{bmatrix} 3 & 2 & 5 \\ -4 & 9 & -3 \\ 2 & -3 & -3 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 0 \\ -7 \\ 1 \end{bmatrix} \]
\[ \mathbf{A}\mathbf{x} = \mathbf{b} \]
If \(\exists \mathbf{A}^{-1}\), s.t. \(\mathbf{A}^{-1}\mathbf{A} = \mathbf{I}\), then \[\mathbf{x} = \mathbf{A}^{-1}\mathbf{b}.\]
\[f'(x_0) = \lim_{\Delta x\to 0}\frac{f(x_0 + \Delta x)-f(x_0)}{\Delta x}\]
\[ f'(x_0) = \frac{f(x_0 + \Delta x)-f(x_0)}{\Delta x} + \mathcal{O}(\Delta x^2) \]
\[ f(x_0 + \Delta x) = f(x_0) + f'(x_0){\Delta x} + \mathcal{O}(\Delta x^2) \]
\[ f(x_0 + \Delta x) = f(x_0) + f'(x_0){\Delta x} + f''(x_0)\frac{\Delta x^2}{2!} + \cdots + f^{(k)}(x_0)\frac{\Delta x^k}{k!} + \mathcal{O}(\Delta x^{k+1}) \]
A function \(f: \mathbb{R}^n \to \mathbb{R}\) is convex if for all \(x_1, x_2 \in \mathbb{R}^n\) and \(\theta \in [0, 1]\): \[f(\theta x_1 + (1-\theta) x_2) \leq \theta f(x_1) + (1-\theta) f(x_2)\]
A function \(f: \mathbb{R}^n \to \mathbb{R}\) is non-convex if there exist \(x_1, y_2 \in \mathbb{R}^n\) and \(\theta \in [0, 1]\) such that: \[f(\theta x_1 + (1-\theta) x_2) > \theta f(x_1) + (1-\theta) f(x_2)\]

\[\begin{aligned} \text{minimize } & f(\mathbf{x}) \\ \text{subject to } & g(\mathbf{x}) = 0 \end{aligned}\]


They are NOT equal.
x: 1, y: 0.333333, y*3: 0.999999
Modern C++ compilers pre-compute constant expressions at compile time, applying “Round to Nearest” by default. So, the comparison x == y * 3.0 may yield true even if y is not exactly equal to 1/3, because the compiler optimizes the expression to if (1.0 == 1.0) at compile time.
They are equal!
== and its equivalents be used on fractional values.
Class 2: Numerics and Error Analysis