Kolbe.LitMath
0.3.6
See the version list below for details.
dotnet add package Kolbe.LitMath --version 0.3.6
NuGet\Install-Package Kolbe.LitMath -Version 0.3.6
<PackageReference Include="Kolbe.LitMath" Version="0.3.6" />
<PackageVersion Include="Kolbe.LitMath" Version="0.3.6" />
<PackageReference Include="Kolbe.LitMath" />
paket add Kolbe.LitMath --version 0.3.6
#r "nuget: Kolbe.LitMath, 0.3.6"
#:package Kolbe.LitMath@0.3.6
#addin nuget:?package=Kolbe.LitMath&version=0.3.6
#tool nuget:?package=Kolbe.LitMath&version=0.3.6
LitMath
A collection of AVX-256 accelerated mathematical functions for .NET
I rewrote Exp, Log, Sin and a few other useful functions using pure AVX intrinsics, so instead of doing one calculation per core, you can now do 4 doubles or 8 floats per core. I added the Sqrt, ERF function and a Normal Distribution CDF as well. On doubles, the following accuracies apply:
ExpandSqrtrun at double precision limitsERFat1e-13SinandCosat1e-15Tanin $[0,\pi/4]$ at2e-16ATanat1e-10(working on it)
There are examples in the benchmark and tests. But here is one to get you started anyway.
Calculate n $e^x$'s in chunks of 4 and store the result in y.
int n = 40;
Span<double> x = new Span<double>(Enumerable.Range(0 , n).Select(z => (double)z/n).ToArray());
Span<double> y = new Span<double>(new double[n]);
LitExp.Exp(ref x, ref y);
Parallel Processing
LitMath leverages SIMD for instruction level parallelism, but not compute cores. For array sizes large enough, it would be a really good idea to do multicore processing. There's an example called LitExpDoubleParallel in the ExpBenchmark.cs file to see one way to go about this.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.0 | 984 | 11/16/2023 |
| 0.6.4 | 229 | 10/13/2023 |
| 0.6.3 | 447 | 1/5/2023 |
| 0.6.2 | 430 | 1/3/2023 |
| 0.6.1 | 428 | 1/3/2023 |
| 0.6.0 | 393 | 12/8/2022 |
| 0.5.8 | 449 | 12/4/2022 |
| 0.5.7 | 454 | 11/27/2022 |
| 0.5.6 | 396 | 11/26/2022 |
| 0.5.5 | 466 | 11/26/2022 |
| 0.5.4 | 466 | 11/26/2022 |
| 0.5.3 | 442 | 11/26/2022 |
| 0.5.2 | 464 | 11/22/2022 |
| 0.5.1 | 445 | 11/22/2022 |
| 0.5.0 | 511 | 9/24/2022 |
| 0.4.1 | 546 | 9/21/2022 |
| 0.4.0 | 553 | 9/21/2022 |
| 0.3.8 | 560 | 9/15/2022 |
| 0.3.7 | 589 | 9/14/2022 |
| 0.3.6 | 591 | 9/14/2022 |
| 0.3.5 | 595 | 9/14/2022 |
| 0.3.4 | 570 | 7/22/2022 |
| 0.3.3 | 556 | 7/21/2022 |
| 0.3.2 | 538 | 7/20/2022 |
| 0.3.1 | 557 | 7/20/2022 |
| 0.3.0 | 570 | 7/18/2022 |
| 0.2.1 | 590 | 7/9/2022 |
| 0.2.0 | 601 | 6/5/2022 |
| 0.1.2 | 576 | 6/3/2022 |
| 0.1.1 | 520 | 6/2/2022 |
| 0.1.0 | 562 | 6/2/2022 |