uxarray.utils.computing.accucross

Contents

uxarray.utils.computing.accucross#

uxarray.utils.computing.accucross(a0, a1, a2, b0, b1, b2)#

Accurate cross product a x b returning (hi[3], lo[3]) component pairs.

Each component of a cross product is a difference of two products — the exact form that diff_of_products handles. This function computes all three components that way, returning six scalars such that the mathematically exact cross product satisfies result[i] = hi[i] + lo[i] for each component. Callers that need single-precision accuracy can use the hi parts alone; callers that need the full compensated result add hi and lo before further use.

Parameters:
  • a0 (float) – Components of vector a.

  • a1 (float) – Components of vector a.

  • a2 (float) – Components of vector a.

  • b0 (float) – Components of vector b.

  • b1 (float) – Components of vector b.

  • b2 (float) – Components of vector b.

Returns:

x_hi, y_hi, z_hi, x_lo, y_lo, z_lo – High and low parts of each cross-product component.

Return type:

float

References

Chen, H., Ullrich, P. A., Panetta, J., Marsico, D., Hanke, M., Jain, R., Zhang, C., and Jacob, R. L. (2026). Accurate and robust geometric algorithms for regridding on the sphere. Geoscientific Model Development, 19(14), 6545-6570. https://doi.org/10.5194/gmd-19-6545-2026