aboutsummaryrefslogtreecommitdiff
path: root/pl/math/tools/erf.sollya
blob: b2fc559b511ef17cd35342f52abd793dfa955e79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// tables and constants for approximating erf(x).
//
// Copyright (c) 2023, 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));