Const-me/AvxMath

C++

4

38 commits

updated Aug 1, 2022

See the code

See what people are saying

SourceMessageScoreDate

Reverse-engineering the Intel 8087's tangent algorithm: more than CORDIC

I remember I once wanted to compute tangent of fp64 vectors. Here’s what I did. https://github.com/Const-me/AvxMath/blob/master/AvxMath/AvxM...

0

Sep 27, 2026

README

AvxMath

The code in this repository implements small yet hopefully useful subset of DirectXMath, ported from FP32 to FP64 precision.

The code requires AVX1, and can optionally use AVX2 and FMA3 instructions when enabled.
Note however I don’t have old enough computers in this house. If you need AVX1 version, make sure to test on a PC from 2011-2014 which doesn’t have AVX2: Intel Sandy Bridge, Ivy Bridge, AMD Jaguar or similar.

The current version was tested with C++/17 language version.
It doesn’t use advanced language features though, should be trivial to downgrade if needed.

I have tested with Visual Studio 2022 on Windows 10, and GCC 7.4 on Microsoft Linux.
Should hopefully work on other OSes and compilers as well.

Motivation

For real-time graphics applications, FP32 precision implemented in that Microsoft’s library is almost always good enough.

However, some other applications, like CAM/CAE, actually need the FP64 precision.
And sometimes FP64 can even be faster than FP32 because iterative algorithms like conjugate gradient need fewer iterations to converge.

The source code in AvxMath folder implements some low-level math routines for 3D vectors in FP64 precision, stored in __m256d hardware registers.

Usage

Copy-paste the content of AvxMath folder into your project, add the *.cpp files from that folder to your build system.

Include the AvxMath.h header, and use the functions from AvxMath namespace.

Contributors

Const-me

38 commits

Const-me/AvxMath

C++

4

38 commits

updated Aug 1, 2022

See the code

See what people are saying

SourceMessageScoreDate

Reverse-engineering the Intel 8087's tangent algorithm: more than CORDIC

I remember I once wanted to compute tangent of fp64 vectors. Here’s what I did. https://github.com/Const-me/AvxMath/blob/master/AvxMath/AvxM...

0

Sep 27, 2026

README

AvxMath

The code in this repository implements small yet hopefully useful subset of DirectXMath, ported from FP32 to FP64 precision.

The code requires AVX1, and can optionally use AVX2 and FMA3 instructions when enabled.
Note however I don’t have old enough computers in this house. If you need AVX1 version, make sure to test on a PC from 2011-2014 which doesn’t have AVX2: Intel Sandy Bridge, Ivy Bridge, AMD Jaguar or similar.

The current version was tested with C++/17 language version.
It doesn’t use advanced language features though, should be trivial to downgrade if needed.

I have tested with Visual Studio 2022 on Windows 10, and GCC 7.4 on Microsoft Linux.
Should hopefully work on other OSes and compilers as well.

Motivation

For real-time graphics applications, FP32 precision implemented in that Microsoft’s library is almost always good enough.

However, some other applications, like CAM/CAE, actually need the FP64 precision.
And sometimes FP64 can even be faster than FP32 because iterative algorithms like conjugate gradient need fewer iterations to converge.

The source code in AvxMath folder implements some low-level math routines for 3D vectors in FP64 precision, stored in __m256d hardware registers.

Usage

Copy-paste the content of AvxMath folder into your project, add the *.cpp files from that folder to your build system.

Include the AvxMath.h header, and use the functions from AvxMath namespace.

Contributors

Const-me

38 commits

Languages

C++

99.3%