-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 57f01ab
Showing
23 changed files
with
88,185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# User-specific files | ||
*.rsuser | ||
*.suo | ||
*.user | ||
*.userosscache | ||
*.sln.docstates | ||
*.userprefs | ||
|
||
# Images | ||
*.png | ||
*.jpg | ||
*.jpeg | ||
*.bmp | ||
*.webp | ||
|
||
# WinMarge backups | ||
*.bak | ||
|
||
# Cache/Options directory | ||
/.vs | ||
/dll | ||
|
||
# NuGet Packages | ||
*.nupkg | ||
*.snupkg | ||
/**/[Pp]ackages/* | ||
|
||
# Build results | ||
/**/[Bb]in/ | ||
/**/[Oo]bj/ | ||
/**/[Ll]og/ | ||
/**/[Ll]ogs/ | ||
/**/bld/ | ||
|
||
# MSTest test Results | ||
[Tt]est[Rr]esult*/ | ||
[Bb]uild[Ll]og.* | ||
|
||
# Publish | ||
/**/publish/ | ||
/**/PublishProfiles | ||
*.[Pp]ublish.xml | ||
*.azurePubxml | ||
*.pubxml | ||
*.publishproj | ||
|
||
# Python cache | ||
/**/__pycache__ | ||
*.pyc | ||
|
||
# Other | ||
nuget.exe | ||
nugetpack.bat | ||
/**/*.nuspec | ||
/**/*.nupkg | ||
|
||
results/* | ||
|
||
# Resource AutoGen | ||
|
||
# Safelist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.9.34902.65 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HoltsmarkDistributionFP64", "HoltsmarkDistributionFP64\HoltsmarkDistributionFP64.csproj", "{779AFDAF-D840-4312-8E14-38F99C6D79A0}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HoltsmarkDistributionFP64Tests", "HoltsmarkDistributionFP64Tests\HoltsmarkDistributionFP64Tests.csproj", "{31B346D8-0C93-4F67-BD3C-A3D5453906B7}" | ||
ProjectSection(ProjectDependencies) = postProject | ||
{779AFDAF-D840-4312-8E14-38F99C6D79A0} = {779AFDAF-D840-4312-8E14-38F99C6D79A0} | ||
EndProjectSection | ||
EndProject | ||
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "HoltsmarkDistributionFP64ErrorVis", "HoltsmarkDistributionFP64ErrorVis\HoltsmarkDistributionFP64ErrorVis.pyproj", "{706E3B32-B70A-4A14-9B26-DC8D696F1DBA}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{779AFDAF-D840-4312-8E14-38F99C6D79A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{779AFDAF-D840-4312-8E14-38F99C6D79A0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{779AFDAF-D840-4312-8E14-38F99C6D79A0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{779AFDAF-D840-4312-8E14-38F99C6D79A0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{31B346D8-0C93-4F67-BD3C-A3D5453906B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{31B346D8-0C93-4F67-BD3C-A3D5453906B7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{31B346D8-0C93-4F67-BD3C-A3D5453906B7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{31B346D8-0C93-4F67-BD3C-A3D5453906B7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{706E3B32-B70A-4A14-9B26-DC8D696F1DBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{706E3B32-B70A-4A14-9B26-DC8D696F1DBA}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {4515B9EB-0868-42AE-8D66-343BDD6FC243} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.ObjectModel; | ||
using System.Diagnostics; | ||
|
||
namespace HoltsmarkDistributionFP64.InternalUtils { | ||
internal static class ApproxUtil { | ||
|
||
public static double Pade(double x, (ReadOnlyCollection<double> numer, ReadOnlyCollection<double> denom) table) { | ||
double sc = Poly(x, table.numer), sd = Poly(x, table.denom); | ||
|
||
Debug.Assert(sd >= 0.5, $"pade denom digits loss! {x}"); | ||
|
||
return sc / sd; | ||
} | ||
|
||
public static double Poly(double x, ReadOnlyCollection<double> table) { | ||
double s = table[^1]; | ||
|
||
for (int i = table.Count - 2; i >= 0; i--) { | ||
s = s * x + table[i]; | ||
} | ||
|
||
return s; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using static System.Double; | ||
|
||
namespace HoltsmarkDistributionFP64 { | ||
internal static class ExMath { | ||
|
||
public static double Square(double x) => x * x; | ||
public static double Cube(double x) => x * x * x; | ||
|
||
public static double Pow3d2(double x) { | ||
if (x == 0d || !IsFinite(x) || int.Abs(double.ILogB((double)x)) < 320) { | ||
return Sqrt(Cube(x)); | ||
} | ||
else { | ||
return Cube(Sqrt(x)); | ||
} | ||
} | ||
|
||
public static double Pow2d3(double x) { | ||
if (x == 0d || !IsFinite(x) || int.Abs(double.ILogB((double)x)) < 480) { | ||
return Cbrt(Square(x)); | ||
} | ||
else { | ||
return Square(Cbrt(x)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.