Lines Matching +full:ulp +full:- +full:allow
2 * Single-precision inverse error function (AdvSIMD variant).
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
18 formats to allow for table-based (vector-to-vector) lookup.
25 P_10 and Q_10 are also stored in homogenous vectors to allow better
35 .P29_3 = V4 (0x1.b13626p-2),
36 .tailshift = V4 (-0.87890625),
37 .Plo = { -0x1.a31268p+3, -0x1.fc0252p-4, 0x1.ac9048p+4, 0x1.119d44p+0 },
38 .PQ = { -0x1.293ff6p+3, -0x1.f59ee2p+0, -0x1.8265eep+3, -0x1.69952p-4 },
39 .Qhi = { 0x1.ef5eaep+4, 0x1.c7b7d2p-1, -0x1.12665p+4, -0x1.167d7p+1 },
40 .P_50 = { V4 (0x1.3d8948p-3), V4 (0x1.61f9eap+0), V4 (0x1.61c6bcp-1),
41 V4 (-0x1.20c9f2p+0), V4 (0x1.5c704cp-1), V4 (-0x1.50c6bep-3) },
42 .Q_50 = { V4 (0x1.3d7dacp-3), V4 (0x1.629e5p+0) },
43 .P_10 = { V4 (-0x1.a31268p+3), V4 (0x1.ac9048p+4), V4 (-0x1.293ff6p+3) },
44 .Q_10 = { V4 (-0x1.8265eep+3), V4 (0x1.ef5eaep+4), V4 (-0x1.12665p+4) },
53 these inputs, and values outside [-1, 1]. This is non-compliant, but is an in special()
55 values use the log1pf_inline helper on -abs(x) - note that erfinvf(inf) in special()
59 vsubq_f32 (v_f32 (1), vabsq_f32 (x)), &d->logf_tbl)))); in special()
61 float32x4_t q = vfmaq_f32 (d->Q_50[0], vaddq_f32 (t, d->Q_50[1]), t); in special()
62 return vdivq_f32 (v_horner_5_f32 (t, d->P_50), vmulq_f32 (ts, q)); in special()
68 /* Shortcut when no input is in a tail region - no need to gather shift or in notails()
70 float32x4_t t = vfmaq_f32 (v_f32 (-0.5625), x, x); in notails()
71 float32x4_t q = vaddq_f32 (t, d->Q_10[2]); in notails()
72 q = vfmaq_f32 (d->Q_10[1], t, q); in notails()
73 q = vfmaq_f32 (d->Q_10[0], t, q); in notails()
75 return vdivq_f32 (vmulq_f32 (x, v_horner_2_f32 (t, d->P_10)), q); in notails()
85 error function in single-precision. Worst-case error is 4.98 ULP, in the
87 _ZGVnN4v_erfinvf(0x1.f7dbeep-1) got 0x1.b4793p+0
96 function", Math. Comp. 30, pp. 827--830 (1976). in V_NAME_F1()
97 https://doi.org/10.1090/S0025-5718-1976-0421040-7. in V_NAME_F1()
100 - 'Normal' region [-0.75, 0.75] in V_NAME_F1()
101 - Tail region [0.75, 0.9375] U [-0.9375, -0.75] in V_NAME_F1()
102 - Extreme tail [-1, -0.9375] U [0.9375, 1] in V_NAME_F1()
104 shifted input - these are typically performed in parallel using gather in V_NAME_F1()
110 /* Shortcut for if all lanes are in [-0.75, 0.75] - can avoid having to in V_NAME_F1()
111 gather coefficients. If input is uniform in [-1, 1] then likelihood of in V_NAME_F1()
116 x * x - shift. in V_NAME_F1()
120 = vfmaq_f32 (vbslq_f32 (is_tail, d->tailshift, v_f32 (-0.5625)), x, x); in V_NAME_F1()
122 /* Calculate indexes for tbl: tbl is byte-wise, so: in V_NAME_F1()
124 Add 4 * i to a group of 4 lanes to copy 32-bit lane i. Each vector stores in V_NAME_F1()
125 two pairs of coeffs, so we need two idx vectors - one for each pair. */ in V_NAME_F1()
127 uint8x16_t idx_lo = vaddq_u8 (d->idxlo, off); in V_NAME_F1()
128 uint8x16_t idx_hi = vaddq_u8 (d->idxhi, off); in V_NAME_F1()
131 float32x4_t p_lo = d->Plo; in V_NAME_F1()
132 float32x4_t pq = d->PQ; in V_NAME_F1()
133 float32x4_t qhi = d->Qhi; in V_NAME_F1()
135 /* Do the lookup (and calculate p3 by masking non-tail lanes). */ in V_NAME_F1()
137 vandq_u32 (is_tail, vreinterpretq_u32_f32 (d->P29_3))); in V_NAME_F1()
151 /* At least one lane is in the extreme tail - if input is uniform in in V_NAME_F1()
152 [-1, 1] the likelihood of this is ~0.23. */ in V_NAME_F1()
158 PL_SIG (V, F, 1, erfinv, -0.99, 0.99)
161 PL_TEST_SYM_INTERVAL_C (V_NAME_F1 (erfinv), 0, 0x1.fffffep-1, 40000, 0.5)
162 PL_TEST_SYM_INTERVAL_C (V_NAME_F1 (erfinv), 0, 0x1.fffffep-1, 40000, 0.8)
163 PL_TEST_SYM_INTERVAL_C (V_NAME_F1 (erfinv), 0, 0x1.fffffep-1, 40000, 0.95)