1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! 3x3 matrix operations with exact floating-point rounding control.
//!
//! These routines are ported from the C++ inline_rxr, inline_tr, and
//! inline_mxmxm functions which were compiled under `fp-contract=off`
//! to match Python/Skyfield arithmetic. Rust's default arithmetic
//! operators do not fuse multiply-adds, so no special annotation is
//! needed -- just avoid `f64::mul_add`.
/// A row-major 3x3 matrix.
pub type Mat3 = ;
/// Standard matrix multiply: `result = a * b`.
/// Matrix transpose: `result = r^T`.
/// Triple matrix product with Kahan-compensated summation.
///
/// Computes `result = A * B * C` without materialising the intermediate
/// A*B matrix. Each output element accumulates all 9 terms
/// (matching numpy `einsum('ij,jk,kl->il')`) using Kahan summation to
/// reduce floating-point drift.