SkillAgentSearch skills...

Coplt.Mathematics

HLSL-style linear algebra math library with full simd support

Install / Use

/learn @coplt/Coplt.Mathematics
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Coplt.Mathematics

Nuget

hlsl-style linear algebra library

  • bool (b16 b32 b64)、half [1]、float、double、short、ushort、int、uint、long、ulong、decimal [2]
  • Vector2~4 (float3 double4 int2 ...)
  • Matrix2x2~4x4 (float3x3 double4x2 int2x3 ...)
  • Hlsl-like cartesian product swizzle (.yzx .abgr ...)
  • Full simd support
  • Simd accelerated [3] log, exp, pow, fmod, trigonometry

[!NOTE] <a name="note-1"></a>

  1. Very slow on CPU <a name="note-2"></a>
  2. Cpu only <a name="note-3"></a>
  3. Lower precision than C# system library

Function ULPs (vs C# system library)

| function | float | double | |----------|-------|--------| | log2 | 1 | 1 | | asin | 2 | 2 | | acos | 2 | 2 | | atan | 2 | 2 | | atan2 | 2 | 2 |

  • The function that needs to be rewritten due to insufficient precision is not in the table

Todo

  • [ ] tests
  • [ ] rewrite the function with too low precision

Related Projects

  • https://github.com/coplt/Coplt.Shader
View on GitHub
GitHub Stars10
CategoryCustomer
Updated3mo ago
Forks5

Languages

C#

Security Score

92/100

Audited on Dec 7, 2025

No findings