The error in a cross product calculation with (3,) tuples
from sympy import Symbol, symarray, Matrix, matrices
u = Matrix(symarray('u', (3, 1)))
v = Matrix(symarray('v', (3, 1)))
c = u.cross(v)
c
[u_1_0*v_2_0 - u_2_0*v_1_0, -u_0_0*v_2_0 + u_2_0*v_0_0, u_0_0*v_1_0 - u_1_0*v_0_0]
Assuming same error $\delta$ for both vectors:
d = Symbol('d')
e = matrices.ones((3,1)) * d
Same calculation as above, with error
ue = u + e
ve = v + e
ce = ue.cross(ve)
Calculate absolute error by subtracting true result from result with error
cce = ce - c
cce.simplify()
cce
[d*(u_1_0 - u_2_0 - v_1_0 + v_2_0), d*(-u_0_0 + u_2_0 + v_0_0 - v_2_0), d*(u_0_0 - u_1_0 - v_0_0 + v_1_0)]
Floating point calculation error given by operations on elements:
c
[u_1_0*v_2_0 - u_2_0*v_1_0, -u_0_0*v_2_0 + u_2_0*v_0_0, u_0_0*v_1_0 - u_1_0*v_0_0]
Each element has two products and one subtraction; The input values are $\le 1$. Calculation error per element then $3 \epsilon / 2$