I'm doing a bit 'o matrix algebra in ruby. When testing the results, I'm seeing what I can only assume is a rounding error.

All I'm doing is multiplying 3 matrices, but the values are fairly small:

```
c_xy:
[0.9702957262759965, 0.012661213742314235, -0.24159035004964077]
[0, 0.9986295347545738, 0.05233595624294383]
[0.24192189559966773, -0.050781354673095955, 0.9689659697053497]

i2k = Matrix[[8.1144E-06, 0.0, 0.0],
                [0.0, 8.1144E-06, 0.0],
                [0.0, 0.0, 8.1144E-06]]

c_yx:
[0.9702957262759965, 0, 0.24192189559966773]
[0.012661213742314235, 0.9986295347545738, -0.050781354673095955]
[-0.24159035004964077, 0.05233595624294383, 0.9689659697053497]

```

What I'm trying to do is `c_xy * i2k * c_yx`. Here's what I expect (this was done in Excel):

```
8.1144E-06  0   2.11758E-22
0   8.1144E-06  0
2.11758E-22 -5.29396E-23    8.1144E-06

```

And what I get:

```
[8.1144e-06, 1.3234889800848443e-23, 6.352747104407253e-22]
[0.0, 8.114399999999998e-06, -5.293955920339377e-23]
[2.117582368135751e-22, 0.0, 8.1144e-06]

```

As you can see, the first column matches, as does the diagonal. But then (in r,c indexing) (0,1) is wrong (though approaching 0), (0,2) is very wrong, and (1,2) and (2,1) seem to be transposed. I thought it had something to do with the`8.1144e-6` value, and tried wrapping it in a `BigDecimal` to no avail.

Any ideas on places I can look? I'm using the standard Ruby Matrix library

*edit*

here's the code.

```
phi1 = 0.24434609527920614
phi2 = 0.05235987755982988

i2k = Matrix[[8.1144E-06, 0.0, 0.0],
                [0.0, 8.1144E-06, 0.0],
                [0.0, 0.0, 8.1144E-06]]

c_x = Matrix[[1, 0, 0],
             [0, Math.cos(phi2), Math.sin(phi2)],
             [0, -Math.sin(phi2), Math.cos(phi2)]]

c_y = Matrix[[Math.cos(phi1), 0, -Math.sin(phi1)],
             [0, 1, 0],
             [Math.sin(phi1), 0, Math.cos(phi1)]]

c_xy = c_y * c_x
c_yx = c_xy.transpose

c_xy * i2k * c_yx

```