1bbbf1280Sopenharmony_ci/*
2bbbf1280Sopenharmony_ci * Shared data between erf and erfc.
3bbbf1280Sopenharmony_ci *
4bbbf1280Sopenharmony_ci * Copyright (c) 2019-2020, Arm Limited.
5bbbf1280Sopenharmony_ci * SPDX-License-Identifier: MIT
6bbbf1280Sopenharmony_ci */
7bbbf1280Sopenharmony_ci
8bbbf1280Sopenharmony_ci#include "math_config.h"
9bbbf1280Sopenharmony_ci
10bbbf1280Sopenharmony_ci/*
11bbbf1280Sopenharmony_ciMinimax approximation of erf
12bbbf1280Sopenharmony_ci*/
13bbbf1280Sopenharmony_ciconst struct erf_data __erf_data = {
14bbbf1280Sopenharmony_ci.erf_poly_A = {
15bbbf1280Sopenharmony_ci#if ERF_POLY_A_NCOEFFS == 10
16bbbf1280Sopenharmony_ci0x1.06eba8214db68p-3, -0x1.812746b037948p-2, 0x1.ce2f21a03872p-4,
17bbbf1280Sopenharmony_ci-0x1.b82ce30e6548p-6, 0x1.565bcc360a2f2p-8, -0x1.c02d812bc979ap-11,
18bbbf1280Sopenharmony_ci0x1.f99bddfc1ebe9p-14, -0x1.f42c457cee912p-17, 0x1.b0e414ec20ee9p-20,
19bbbf1280Sopenharmony_ci-0x1.18c47fd143c5ep-23
20bbbf1280Sopenharmony_ci#endif
21bbbf1280Sopenharmony_ci},
22bbbf1280Sopenharmony_ci/* Rational approximation on [0x1p-28, 0.84375] */
23bbbf1280Sopenharmony_ci.erf_ratio_N_A = {
24bbbf1280Sopenharmony_ci0x1.06eba8214db68p-3, -0x1.4cd7d691cb913p-2, -0x1.d2a51dbd7194fp-6,
25bbbf1280Sopenharmony_ci-0x1.7a291236668e4p-8, -0x1.8ead6120016acp-16
26bbbf1280Sopenharmony_ci},
27bbbf1280Sopenharmony_ci.erf_ratio_D_A = {
28bbbf1280Sopenharmony_ci0x1.97779cddadc09p-2, 0x1.0a54c5536cebap-4, 0x1.4d022c4d36b0fp-8,
29bbbf1280Sopenharmony_ci0x1.15dc9221c1a1p-13, -0x1.09c4342a2612p-18
30bbbf1280Sopenharmony_ci},
31bbbf1280Sopenharmony_ci/* Rational approximation on [0.84375, 1.25] */
32bbbf1280Sopenharmony_ci.erf_ratio_N_B = {
33bbbf1280Sopenharmony_ci-0x1.359b8bef77538p-9, 0x1.a8d00ad92b34dp-2, -0x1.7d240fbb8c3f1p-2,
34bbbf1280Sopenharmony_ci0x1.45fca805120e4p-2, -0x1.c63983d3e28ecp-4, 0x1.22a36599795ebp-5,
35bbbf1280Sopenharmony_ci-0x1.1bf380a96073fp-9
36bbbf1280Sopenharmony_ci},
37bbbf1280Sopenharmony_ci.erf_ratio_D_B = {
38bbbf1280Sopenharmony_ci0x1.b3e6618eee323p-4, 0x1.14af092eb6f33p-1, 0x1.2635cd99fe9a7p-4,
39bbbf1280Sopenharmony_ci0x1.02660e763351fp-3, 0x1.bedc26b51dd1cp-7, 0x1.88b545735151dp-7
40bbbf1280Sopenharmony_ci},
41bbbf1280Sopenharmony_ci.erfc_poly_C = {
42bbbf1280Sopenharmony_ci#if ERFC_POLY_C_NCOEFFS == 16
43bbbf1280Sopenharmony_ci/* Generated using Sollya::remez(f(c*x+d), deg, [(a-d)/c;(b-d)/c], 1, 1e-16), [|D ...|] with deg=15 a=1.25 b=2 c=1 d=1.25 */
44bbbf1280Sopenharmony_ci0x1.3bcd133aa0ffcp-4, -0x1.e4652fadcb702p-3, 0x1.2ebf3dcca0446p-2,
45bbbf1280Sopenharmony_ci-0x1.571d01c62d66p-3, 0x1.93a9a8f5b3413p-8, 0x1.8281cbcc2cd52p-5,
46bbbf1280Sopenharmony_ci-0x1.5cffd86b4de16p-6, -0x1.db4ccf595053ep-9, 0x1.757cbf8684edap-8,
47bbbf1280Sopenharmony_ci-0x1.ce7dfd2a9e56ap-11, -0x1.99ee3bc5a3263p-11, 0x1.3c57cf9213f5fp-12,
48bbbf1280Sopenharmony_ci0x1.60692996bf254p-14, -0x1.6e44cb7c1fa2ap-14, 0x1.9d4484ac482b2p-16,
49bbbf1280Sopenharmony_ci-0x1.578c9e375d37p-19
50bbbf1280Sopenharmony_ci#endif
51bbbf1280Sopenharmony_ci},
52bbbf1280Sopenharmony_ci.erfc_poly_D = {
53bbbf1280Sopenharmony_ci#if ERFC_POLY_D_NCOEFFS == 18
54bbbf1280Sopenharmony_ci/* Generated using Sollya::remez(f(c*x+d), deg, [(a-d)/c;(b-d)/c], 1, 1e-16), [|D ...|] with deg=17 a=2 b=3.25 c=2 d=2 */
55bbbf1280Sopenharmony_ci0x1.328f5ec350e5p-8, -0x1.529b9e8cf8e99p-5, 0x1.529b9e8cd9e71p-3,
56bbbf1280Sopenharmony_ci-0x1.8b0ae3a023bf2p-2, 0x1.1a2c592599d82p-1, -0x1.ace732477e494p-2,
57bbbf1280Sopenharmony_ci-0x1.e1a06a27920ffp-6, 0x1.bae92a6d27af6p-2, -0x1.a15470fcf5ce7p-2,
58bbbf1280Sopenharmony_ci0x1.bafe45d18e213p-6, 0x1.0d950680d199ap-2, -0x1.8c9481e8f22e3p-3,
59bbbf1280Sopenharmony_ci-0x1.158450ed5c899p-4, 0x1.c01f2973b44p-3, -0x1.73ed2827546a7p-3,
60bbbf1280Sopenharmony_ci0x1.47733687d1ff7p-4, -0x1.2dec70d00b8e1p-6, 0x1.a947ab83cd4fp-10
61bbbf1280Sopenharmony_ci#endif
62bbbf1280Sopenharmony_ci},
63bbbf1280Sopenharmony_ci.erfc_poly_E = {
64bbbf1280Sopenharmony_ci#if ERFC_POLY_E_NCOEFFS == 14
65bbbf1280Sopenharmony_ci/* Generated using Sollya::remez(f(c*x+d), deg, [(a-d)/c;(b-d)/c], 1, 1e-16), [|D ...|] with deg=13 a=3.25 b=4 c=1 d=3.25 */
66bbbf1280Sopenharmony_ci0x1.20c13035539e4p-18, -0x1.e9b5e8d16df7ep-16, 0x1.8de3cd4733bf9p-14,
67bbbf1280Sopenharmony_ci-0x1.9aa48beb8382fp-13, 0x1.2c7d713370a9fp-12, -0x1.490b12110b9e2p-12,
68bbbf1280Sopenharmony_ci0x1.1459c5d989d23p-12, -0x1.64b28e9f1269p-13, 0x1.57c76d9d05cf8p-14,
69bbbf1280Sopenharmony_ci-0x1.bf271d9951cf8p-16, 0x1.db7ea4d4535c9p-19, 0x1.91c2e102d5e49p-20,
70bbbf1280Sopenharmony_ci-0x1.e9f0826c2149ep-21, 0x1.60eebaea236e1p-23
71bbbf1280Sopenharmony_ci#endif
72bbbf1280Sopenharmony_ci},
73bbbf1280Sopenharmony_ci.erfc_poly_F = {
74bbbf1280Sopenharmony_ci#if ERFC_POLY_F_NCOEFFS == 17
75bbbf1280Sopenharmony_ci/* Generated using Sollya::remez(f(c*x+d), deg, [(a-d)/c;(b-d)/c], 1, 1e-16), [|D ...|] with deg=16 a=4 b=5.90625 c=2 d=4 */
76bbbf1280Sopenharmony_ci0x1.08ddd130d1fa6p-26, -0x1.10b146f59ff06p-22, 0x1.10b135328b7b2p-19,
77bbbf1280Sopenharmony_ci-0x1.6039988e7575fp-17, 0x1.497d365e19367p-15, -0x1.da48d9afac83ep-14,
78bbbf1280Sopenharmony_ci0x1.1024c9b1fbb48p-12, -0x1.fc962e7066272p-12, 0x1.87297282d4651p-11,
79bbbf1280Sopenharmony_ci-0x1.f057b255f8c59p-11, 0x1.0228d0eee063p-10, -0x1.b1b21b84ec41cp-11,
80bbbf1280Sopenharmony_ci0x1.1ead8ae9e1253p-11, -0x1.1e708fba37fccp-12, 0x1.9559363991edap-14,
81bbbf1280Sopenharmony_ci-0x1.68c827b783d9cp-16, 0x1.2ec4adeccf4a2p-19
82bbbf1280Sopenharmony_ci#endif
83bbbf1280Sopenharmony_ci}
84bbbf1280Sopenharmony_ci};
85bbbf1280Sopenharmony_ci
86