aboutsummaryrefslogtreecommitdiff
path: root/math/tools/erf.sollya
diff options
context:
space:
mode:
Diffstat (limited to 'math/tools/erf.sollya')
-rw-r--r--math/tools/erf.sollya25
1 files changed, 25 insertions, 0 deletions
diff --git a/math/tools/erf.sollya b/math/tools/erf.sollya
new file mode 100644
index 000000000000..060e1686c835
--- /dev/null
+++ b/math/tools/erf.sollya
@@ -0,0 +1,25 @@
+// tables and constants for approximating erf(x).
+//
+// Copyright (c) 2023-2024, Arm Limited.
+// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
+
+display = hexadecimal;
+prec=128;
+
+// Tables
+print("{ i, r, erf(r), 2/sqrt(pi) * exp(-r^2)}");
+for i from 0 to 768 do {
+ r = i / 128;
+ t0 = double(erf(r));
+ t1 = double(2/sqrt(pi) * exp(-r * r));
+ print("{ " @ i @ ",\t" @ r @ ",\t" @ t0 @ ",\t" @ t1 @ " },");
+};
+
+// Constants
+double(1/3);
+double(1/10);
+double(2/15);
+double(2/9);
+double(2/45);
+double(2/sqrt(pi));
+