Skip to content

Commit 191d4d0

Browse files
committed
test nz
1 parent 5cbcd75 commit 191d4d0

5 files changed

Lines changed: 273 additions & 15 deletions

File tree

.gitignore

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,54 @@
1-
/.vs
1+
# User-specific files
2+
*.rsuser
3+
*.suo
4+
*.user
5+
*.userosscache
6+
*.sln.docstates
7+
*.userprefs
8+
9+
# Images
10+
*.png
11+
*.jpg
12+
*.jpeg
13+
*.bmp
14+
*.webp
15+
16+
# WinMarge backups
17+
*.bak
18+
19+
# Cache/Options directory
20+
/.vs
221
/dll
3-
/packages
4-
/**/bin
5-
/**/obj
6-
/**/*.png
7-
/**/*.jpg
8-
/**/*.bak
9-
/**/*.user
10-
/results_disused
11-
/TestResults
22+
23+
# NuGet Packages
24+
*.nupkg
25+
*.snupkg
26+
/**/[Pp]ackages/*
27+
28+
# Build results
29+
/**/[Bb]in/
30+
/**/[Oo]bj/
31+
/**/[Ll]og/
32+
/**/[Ll]ogs/
33+
/**/bld/
34+
35+
# MSTest test Results
36+
[Tt]est[Rr]esult*/
37+
[Bb]uild[Ll]og.*
38+
39+
# Publish
40+
/**/publish/
41+
/**/PublishProfiles
42+
*.[Pp]ublish.xml
43+
*.azurePubxml
44+
*.pubxml
45+
*.publishproj
46+
47+
# Python cache
1248
/**/__pycache__
13-
/**/PublishProfiles
49+
*.pyc
50+
51+
# Other
52+
/results_disused
53+
54+
# Safelist

ErrorFunctionApproximation/Program.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ static void Main(string[] args) {
6363
sw.WriteLine($"{z},{y_true},{y_approx},{mp_err},{double_err}");
6464
}
6565
}
66+
67+
using (StreamWriter sw = new StreamWriter("../../../../results/inverf_approx_nz.csv")) {
68+
sw.WriteLine("z,y_true,y_approx,mp_error,double_error");
69+
70+
for (int i = -100; i <= +100; i++) {
71+
double z = 1.220703125e-4 + i / 1000000.0;
72+
73+
MultiPrecision<Pow2.N4> y_true = MultiPrecision<Pow2.N4>.InverseErf(z);
74+
double y_approx = ErrorFunction.InverseErf(z);
75+
MultiPrecision<Pow2.N4> mp_err = y_true - y_approx;
76+
double double_err = (double)y_true - y_approx;
77+
78+
sw.WriteLine($"{z},{y_true},{y_approx},{mp_err},{double_err}");
79+
}
80+
}
6681
}
6782
}
6883
}

results/inverf_approx.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
z,y_true,y_approx,mp_error,double_error
2-
-1,-inf,-inf,NaN,NaN
2+
-1,-∞,-∞,NaN,NaN
33
-0.9999,-2.7510639057120796917425935925819583,-2.75106390571208,1.2391489564199963139825013762384876e-16,0
44
-0.9998,-2.6297417762102925939779247515988718,-2.6297417762102926,-1.9803387646251539898754354370091143e-18,0
55
-0.9997,-2.5564031509202212422794006041040893,-2.556403150920221,-5.2244946919756407637267832582595266e-17,0
@@ -19999,4 +19999,4 @@ z,y_true,y_approx,mp_error,double_error
1999919999
0.9997,2.5564031509202212422794006041040893,2.556403150920221,5.2244946919756407637267832582595266e-17,0
2000020000
0.9998,2.6297417762102925939779247515988718,2.6297417762102926,1.9803387646251539898754354370091143e-18,0
2000120001
0.9999,2.7510639057120796917425935925819583,2.75106390571208,-1.2391489564199963139825013762384876e-16,0
20002-
1,inf,inf,NaN,NaN
20002+
1,∞,∞,NaN,NaN

0 commit comments

Comments
 (0)