aboutsummaryrefslogtreecommitdiff
path: root/math/tools/erff.sollya
diff options
context:
space:
mode:
Diffstat (limited to 'math/tools/erff.sollya')
-rw-r--r--math/tools/erff.sollya20
1 files changed, 20 insertions, 0 deletions
diff --git a/math/tools/erff.sollya b/math/tools/erff.sollya
new file mode 100644
index 000000000000..c0178a2b24ad
--- /dev/null
+++ b/math/tools/erff.sollya
@@ -0,0 +1,20 @@
+// tables and constants for approximating erff(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 512 do {
+ r = i / 128;
+ t0 = single(erf(r));
+ t1 = single(2/sqrt(pi) * exp(-r * r));
+ print("{ " @ i @ ",\t" @ r @ ",\t" @ t0 @ ",\t" @ t1 @ " },");
+};
+
+// Constants
+single(1/3);
+single(2/sqrt(pi));