ReactOS 0.4.16-dev-1948-gd260c1d
asin.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Tests for asin
5 * COPYRIGHT: Copyright 2021 Timo Kreuzer <timo.kreuzer@reactos.org>
6 */
7
8#if !defined(_CRTBLD) && !defined(_M_IX86)
9#define _CRTBLD // we don't want inline asin!
10#endif
11#include "math_helpers.h"
12
13#ifdef _MSC_VER
14#pragma function(asin)
15#endif
16
17#if !defined(_M_IX86)
18#define HAS_ASINF
19#elif (defined(TEST_UCRTBASE) || defined(TEST_STATIC_CRT))
20#define HAS_LIBM_SSE2
21#endif
22
23
24// These are expected to match exactly
26{
27 { 0x0000000000000000 /* 0.000000 */, 0x0000000000000000 /* 0.000000 */ },
28 { 0x8000000000000000 /* -0.000000 */, 0x8000000000000000 /* -0.000000 */ },
29 { 0x7ff0000000000000 /* 1.#INF00 */, 0xfff8000000000000 /* -1.#IND00 */ },
30 { 0x7ff0000000000001 /* 1.#SNAN0 */, 0x7ff8000000000001 /* 1.#QNAN0 */ },
31 { 0x7ff7ffffffffffff /* 1.#SNAN0 */, 0x7fffffffffffffff /* 1.#QNAN0 */ },
32 { 0x7ff8000000000000 /* 1.#QNAN0 */, 0x7ff8000000000000 /* 1.#QNAN0 */ },
33 { 0x7ff8000000000001 /* 1.#QNAN0 */, 0x7ff8000000000001 /* 1.#QNAN0 */ },
34 { 0x7fffffffffffffff /* 1.#QNAN0 */, 0x7fffffffffffffff /* 1.#QNAN0 */ },
35 { 0xfff0000000000000 /* -1.#INF00 */, 0xfff8000000000000 /* -1.#IND00 */ },
36 { 0xfff0000000000001 /* -1.#SNAN0 */, 0xfff8000000000001 /* -1.#QNAN0 */ },
37 { 0xfff7ffffffffffff /* -1.#SNAN0 */, 0xffffffffffffffff /* -1.#QNAN0 */ },
38 { 0xfff8000000000000 /* -1.#IND00 */, 0xfff8000000000000 /* -1.#IND00 */ },
39 { 0xfff8000000000001 /* -1.#QNAN0 */, 0xfff8000000000001 /* -1.#QNAN0 */ },
40 { 0xffffffffffffffff /* -1.#QNAN0 */, 0xffffffffffffffff /* -1.#QNAN0 */ },
41};
42
44{
45 for (int i = 0; i < _countof(s_asin_exact_tests); i++)
46 {
48 double z = asin(x);
50 }
51}
52
53// This table is autogenerated by `python gen_math_tests.py asin`
55{
56// { x, { y_rounded, y_difference } }
57 { -0x1.0000000000000p+0, { -0x1.921fb54442d18p+0, -0x1.1a62633145c07p-54 }, 1 }, // asin(-1.0) == -1.5707963267948966192
58 { -0x1.f5c28f5c28f5cp-1, { -0x1.5ed690583be07p+0, -0x1.9e9b66a311d8ap-54 }, 1 }, // asin(-0.98) == -1.3704614844717769373
59 { -0x1.eb851eb851eb8p-1, { -0x1.4978fa3269ee1p+0, 0x1.b717be098f6f6p-54 }, 1 }, // asin(-0.96) == -1.2870022175865686467
60 { -0x1.e147ae147ae14p-1, { -0x1.38fe4cb950b11p+0, 0x1.e2dfb3eb2069ap-55 }, 1 }, // asin(-0.94) == -1.2226303055219355818
61 { -0x1.d70a3d70a3d71p-1, { -0x1.2b07529b1748ap+0, 0x1.dfd9f2253db3bp-54 }, 1 }, // asin(-0.92) == -1.1680804852142351383
62 { -0x1.ccccccccccccdp-1, { -0x1.1ea93705fa172p+0, -0x1.797aca4b76b6ep-55 }, 1 }, // asin(-0.9) == -1.1197695149986342376
63 { -0x1.c28f5c28f5c29p-1, { -0x1.136bb485f3d91p+0, -0x1.0250f63168287p-54 }, 1 }, // asin(-0.88) == -1.0758622004540011057
64 { -0x1.b851eb851eb85p-1, { -0x1.09076ee9d82bbp+0, 0x1.0b30a15ad18cfp-54 }, 1 }, // asin(-0.86) == -1.0352696724805087711
65 { -0x1.ae147ae147ae1p-1, { -0x1.fe9be811df6cap-1, -0x1.e691a34db4e07p-56 }, 1 }, // asin(-0.84) == -0.99728322237179980876
66 { -0x1.a3d70a3d70a3ep-1, { -0x1.ec3e10a736333p-1, 0x1.7a9fc5e44482fp-56 }, 1 }, // asin(-0.8200000000000001) == -0.96141101876410171191
67 { -0x1.999999999999ap-1, { -0x1.dac670561bb50p-1, -0x1.358a733684234p-57 }, 1 }, // asin(-0.8) == -0.92729521800161230644
68 { -0x1.8f5c28f5c28f6p-1, { -0x1.ca11a353bd84cp-1, -0x1.467d94280ae43p-55 }, 1 }, // asin(-0.78) == -0.89466581723423525206
69 { -0x1.851eb851eb852p-1, { -0x1.ba042d36663dbp-1, -0x1.fbcf504ab6298p-56 }, 1 }, // asin(-0.76) == -0.86331311501555366127
70 { -0x1.7ae147ae147aep-1, { -0x1.aa8832b0b0525p-1, -0x1.933b3e58bf069p-56 }, 1 }, // asin(-0.74) == -0.83307035834164779829
71 { -0x1.70a3d70a3d70ap-1, { -0x1.9b8bfa40885bdp-1, 0x1.369448f6ec2a5p-57 }, 1 }, // asin(-0.72) == -0.80380231893302999382
72 { -0x1.6666666666666p-1, { -0x1.8d00e692afd95p-1, -0x1.3922d1ae3b05ep-55 }, 1 }, // asin(-0.7) == -0.77539749661075300156
73 { -0x1.5c28f5c28f5c2p-1, { -0x1.7edabe7a11ffdp-1, 0x1.c00bede5ce97cp-55 }, 1 }, // asin(-0.6799999999999999) == -0.74776263465992049567
74 { -0x1.51eb851eb851ep-1, { -0x1.710f28188f80cp-1, 0x1.4430a41946ef3p-55 }, 1 }, // asin(-0.6599999999999999) == -0.72081876087008952363
75 { -0x1.47ae147ae147bp-1, { -0x1.639546d3fd53bp-1, 0x1.fd67514c34733p-56 }, 1 }, // asin(-0.64) == -0.69449826562655600518
76 { -0x1.3d70a3d70a3d7p-1, { -0x1.5665718f62b97p-1, -0x1.bc991358a1325p-56 }, 1 }, // asin(-0.62) == -0.66874270320237174848
77 { -0x1.3333333333333p-1, { -0x1.4978fa3269ee1p-1, 0x1.b7ccaf01ab750p-57 }, 1 }, // asin(-0.6) == -0.64350110879328435905
78 { -0x1.28f5c28f5c290p-1, { -0x1.3cca01c711853p-1, 0x1.b19be0a95461fp-55 }, 1 }, // asin(-0.5800000000000001) == -0.61872869067225117773
79 { -0x1.1eb851eb851ecp-1, { -0x1.305355e86c374p-1, -0x1.894989dc9af71p-55 }, 1 }, // asin(-0.56) == -0.5943858000010622682
80 { -0x1.147ae147ae148p-1, { -0x1.241055329849fp-1, 0x1.2cb854d604c5cp-55 }, 1 }, // asin(-0.54) == -0.57043710939992194956
81 { -0x1.0a3d70a3d70a4p-1, { -0x1.17fcd90a0d19fp-1, 0x1.353c5cb21db8ap-57 }, 1 }, // asin(-0.52) == -0.54685095069594412959
82 { -0x1.0000000000000p-1, { -0x1.0c152382d7366p-1, 0x1.ee6913347c2a6p-55 }, 1 }, // asin(-0.5) == -0.52359877559829887308
83 { -0x1.eb851eb851eb8p-2, { -0x1.0055d080bb634p-1, 0x1.7c637ca7bf40ap-61 }, 1 }, // asin(-0.48) == -0.50065471240458814186
84 { -0x1.d70a3d70a3d70p-2, { -0x1.e97792c522be0p-2, -0x1.0b96a30694468p-58 }, 1 }, // asin(-0.45999999999999996) == -0.4779951985189523392
85 { -0x1.c28f5c28f5c28p-2, { -0x1.d2887569581c9p-2, 0x1.c3c3b237e51eep-56 }, 1 }, // asin(-0.43999999999999995) == -0.45559867339582330363
86 { -0x1.ae147ae147ae2p-2, { -0x1.bbd9170937b80p-2, -0x1.b19e844144ec9p-57 }, 1 }, // asin(-0.42000000000000004) == -0.43344532006988602045
87 { -0x1.999999999999ap-2, { -0x1.a564ac0e73a34p-2, 0x1.5a5e0fcb713a0p-56 }, 1 }, // asin(-0.4) == -0.41151684606748804361
88 { -0x1.851eb851eb852p-2, { -0x1.8f26c2a5d5e1dp-2, -0x1.e49b12ccbe190p-58 }, 1 }, // asin(-0.38) == -0.38979629647426056839
89 { -0x1.70a3d70a3d70ap-2, { -0x1.791b37f9e8a25p-2, -0x1.1191d69fe4a0dp-57 }, 1 }, // asin(-0.36) == -0.36826789343663996665
90 { -0x1.5c28f5c28f5c2p-2, { -0x1.633e2ee53c5b7p-2, -0x1.eb922ae27b8cap-56 }, 1 }, // asin(-0.33999999999999997) == -0.34691689752716167617
91 { -0x1.47ae147ae147ap-2, { -0x1.4d8c07dd17d7bp-2, -0x1.d4f0c7410eb0ep-56 }, 1 }, // asin(-0.31999999999999995) == -0.32572948729463010775
92 { -0x1.3333333333332p-2, { -0x1.380159e14f6fdp-2, -0x1.d3d43d740646fp-56 }, 1 }, // asin(-0.29999999999999993) == -0.30469265401539743814
93 { -0x1.1eb851eb851ecp-2, { -0x1.229aec47638ddp-2, -0x1.0ab1de3613b5fp-59 }, 1 }, // asin(-0.28) == -0.28379410920832787338
94 { -0x1.0a3d70a3d70a4p-2, { -0x1.0d55b13e747aep-2, -0x1.98a6d76cfa277p-57 }, 1 }, // asin(-0.26) == -0.26302220290846890502
95 { -0x1.eb851eb851eb8p-3, { -0x1.f05d81df0953fp-3, -0x1.456769fc2eb58p-57 }, 1 }, // asin(-0.24) == -0.24236585103896322362
96 { -0x1.c28f5c28f5c28p-3, { -0x1.c646aa44819d9p-3, 0x1.ecd5d282692a1p-57 }, 1 }, // asin(-0.21999999999999997) == -0.22181447049679438362
97 { -0x1.9999999999998p-3, { -0x1.9c618aa4ae23bp-3, -0x1.73ee81b4de653p-58 }, 1 }, // asin(-0.19999999999999996) == -0.20135792079033074613
98 { -0x1.70a3d70a3d708p-3, { -0x1.72a90648fbf23p-3, -0x1.2715d03bb242dp-57 }, 1 }, // asin(-0.17999999999999994) == -0.18098645124654764405
99 { -0x1.47ae147ae147cp-3, { -0x1.49182e599c593p-3, -0x1.451467c777603p-57 }, 1 }, // asin(-0.16000000000000003) == -0.16069065295191063185
100 { -0x1.1eb851eb851ecp-3, { -0x1.1faa3bf43ad3bp-3, 0x1.b6fe6b35dad63p-58 }, 1 }, // asin(-0.14) == -0.14046141470985581372
101 { -0x1.eb851eb851eb8p-4, { -0x1.ecb5156ece085p-4, -0x1.9529387ef2efep-59 }, 1 }, // asin(-0.12) == -0.12028988239478806685
102 { -0x1.9999999999998p-4, { -0x1.9a49276037882p-4, -0x1.24834eb86e331p-59 }, 1 }, // asin(-0.09999999999999998) == -0.10016742116155977403
103 { -0x1.47ae147ae1478p-4, { -0x1.4807d13203189p-4, -0x1.a5ba073be0654p-58 }, 1 }, // asin(-0.07999999999999996) == -0.080085580033658973651
104 { -0x1.eb851eb851eb0p-5, { -0x1.ebd0bd734d89fp-5, 0x1.9830da45e3bb2p-60 }, 1 }, // asin(-0.05999999999999994) == -0.060036058445278364664
105 { -0x1.47ae147ae1480p-5, { -0x1.47c4773aebd5ep-5, -0x1.799551e7e64edp-59 }, 1 }, // asin(-0.040000000000000036) == -0.040010674353988961776
106 { -0x1.47ae147ae1480p-6, { -0x1.47b3ac64be09fp-6, -0x1.68519a15711bbp-60 }, 1 }, // asin(-0.020000000000000018) == -0.020001333573390509518
107 { 0x0.0p+0, { 0x0.0p+0, 0x0.0p+0 }, 1 }, // asin(0.0) == 0.0
108 { 0x1.47ae147ae1480p-6, { 0x1.47b3ac64be09fp-6, 0x1.68519a15711bbp-60 }, 1 }, // asin(0.020000000000000018) == 0.020001333573390509518
109 { 0x1.47ae147ae1480p-5, { 0x1.47c4773aebd5ep-5, 0x1.799551e7e64edp-59 }, 1 }, // asin(0.040000000000000036) == 0.040010674353988961776
110 { 0x1.eb851eb851ec0p-5, { 0x1.ebd0bd734d8afp-5, -0x1.5d0c7786dd7dcp-60 }, 1 }, // asin(0.06000000000000005) == 0.060036058445278475887
111 { 0x1.47ae147ae1480p-4, { 0x1.4807d13203191p-4, 0x1.c0114cb7ba201p-58 }, 1 }, // asin(0.08000000000000007) == 0.08008558003365908503
112 { 0x1.99999999999a0p-4, { 0x1.9a4927603788ap-4, 0x1.770d6faa7406cp-59 }, 1 }, // asin(0.10000000000000009) == 0.10016742116155988561
113 { 0x1.eb851eb851ec0p-4, { 0x1.ecb5156ece08dp-4, 0x1.06352941aa8c4p-58 }, 1 }, // asin(0.1200000000000001) == 0.12028988239478817868
114 { 0x1.1eb851eb851f0p-3, { 0x1.1faa3bf43ad3fp-3, -0x1.658331594d1dbp-58 }, 1 }, // asin(0.14000000000000012) == 0.14046141470985592585
115 { 0x1.47ae147ae1478p-3, { 0x1.49182e599c58fp-3, 0x1.0f9f4f99cf298p-57 }, 1 }, // asin(0.15999999999999992) == 0.16069065295191051938
116 { 0x1.70a3d70a3d708p-3, { 0x1.72a90648fbf23p-3, 0x1.2715d03bb242dp-57 }, 1 }, // asin(0.17999999999999994) == 0.18098645124654764405
117 { 0x1.9999999999998p-3, { 0x1.9c618aa4ae23bp-3, 0x1.73ee81b4de653p-58 }, 1 }, // asin(0.19999999999999996) == 0.20135792079033074613
118 { 0x1.c28f5c28f5c28p-3, { 0x1.c646aa44819d9p-3, -0x1.ecd5d282692a1p-57 }, 1 }, // asin(0.21999999999999997) == 0.22181447049679438362
119 { 0x1.eb851eb851eb8p-3, { 0x1.f05d81df0953fp-3, 0x1.456769fc2eb58p-57 }, 1 }, // asin(0.24) == 0.24236585103896322362
120 { 0x1.0a3d70a3d70a4p-2, { 0x1.0d55b13e747aep-2, 0x1.98a6d76cfa277p-57 }, 1 }, // asin(0.26) == 0.26302220290846890502
121 { 0x1.1eb851eb851ecp-2, { 0x1.229aec47638ddp-2, 0x1.0ab1de3613b5fp-59 }, 1 }, // asin(0.28) == 0.28379410920832787338
122 { 0x1.3333333333334p-2, { 0x1.380159e14f700p-2, -0x1.c9489977119aep-56 }, 1 }, // asin(0.30000000000000004) == 0.30469265401539755453
123 { 0x1.47ae147ae147cp-2, { 0x1.4d8c07dd17d7ep-2, -0x1.b964cdcda4892p-56 }, 1 }, // asin(0.32000000000000006) == 0.32572948729463022493
124 { 0x1.5c28f5c28f5c4p-2, { 0x1.633e2ee53c5bap-2, -0x1.92b0f5ff70dd1p-56 }, 1 }, // asin(0.3400000000000001) == 0.34691689752716179422
125 { 0x1.70a3d70a3d70cp-2, { 0x1.791b37f9e8a27p-2, 0x1.1bf77ba4d05afp-56 }, 1 }, // asin(0.3600000000000001) == 0.36826789343664008565
126 { 0x1.851eb851eb854p-2, { 0x1.8f26c2a5d5e1fp-2, 0x1.1f3ce3082e4d7p-56 }, 1 }, // asin(0.3800000000000001) == 0.38979629647426068842
127 { 0x1.999999999999cp-2, { 0x1.a564ac0e73a36p-2, -0x1.3fa1e939a0d07p-57 }, 1 }, // asin(0.40000000000000013) == 0.41151684606748816475
128 { 0x1.ae147ae147ae0p-2, { 0x1.bbd9170937b7ep-2, 0x1.03d8f0de418a8p-61 }, 1 }, // asin(0.41999999999999993) == 0.43344532006988589811
129 { 0x1.c28f5c28f5c28p-2, { 0x1.d2887569581c9p-2, -0x1.c3c3b237e51eep-56 }, 1 }, // asin(0.43999999999999995) == 0.45559867339582330363
130 { 0x1.d70a3d70a3d70p-2, { 0x1.e97792c522be0p-2, 0x1.0b96a30694468p-58 }, 1 }, // asin(0.45999999999999996) == 0.4779951985189523392
131 { 0x1.eb851eb851eb8p-2, { 0x1.0055d080bb634p-1, -0x1.7c637ca7bf40ap-61 }, 1 }, // asin(0.48) == 0.50065471240458814186
132 { 0x1.0000000000000p-1, { 0x1.0c152382d7366p-1, -0x1.ee6913347c2a6p-55 }, 1 }, // asin(0.5) == 0.52359877559829887308
133 { 0x1.0a3d70a3d70a4p-1, { 0x1.17fcd90a0d19fp-1, -0x1.353c5cb21db8ap-57 }, 1 }, // asin(0.52) == 0.54685095069594412959
134 { 0x1.147ae147ae148p-1, { 0x1.241055329849fp-1, -0x1.2cb854d604c5cp-55 }, 1 }, // asin(0.54) == 0.57043710939992194956
135 { 0x1.1eb851eb851ecp-1, { 0x1.305355e86c374p-1, 0x1.894989dc9af71p-55 }, 1 }, // asin(0.56) == 0.5943858000010622682
136 { 0x1.28f5c28f5c290p-1, { 0x1.3cca01c711853p-1, -0x1.b19be0a95461fp-55 }, 1 }, // asin(0.5800000000000001) == 0.61872869067225117773
137 { 0x1.3333333333334p-1, { 0x1.4978fa3269ee2p-1, 0x1.2419a87f2a459p-56 }, 1 }, // asin(0.6000000000000001) == 0.64350110879328449783
138 { 0x1.3d70a3d70a3d8p-1, { 0x1.5665718f62b98p-1, 0x1.f76b6a953ef9ep-55 }, 1 }, // asin(0.6200000000000001) == 0.66874270320237188998
139 { 0x1.47ae147ae147cp-1, { 0x1.639546d3fd53cp-1, 0x1.afd909f079963p-58 }, 1 }, // asin(0.6400000000000001) == 0.69449826562655614967
140 { 0x1.51eb851eb8520p-1, { 0x1.710f28188f80ep-1, 0x1.61e063a682122p-55 }, 1 }, // asin(0.6600000000000001) == 0.72081876087008981919
141 { 0x1.5c28f5c28f5c2p-1, { 0x1.7edabe7a11ffdp-1, -0x1.c00bede5ce97cp-55 }, 1 }, // asin(0.6799999999999999) == 0.74776263465992049567
142 { 0x1.6666666666666p-1, { 0x1.8d00e692afd95p-1, 0x1.3922d1ae3b05ep-55 }, 1 }, // asin(0.7) == 0.77539749661075300156
143 { 0x1.70a3d70a3d70ap-1, { 0x1.9b8bfa40885bdp-1, -0x1.369448f6ec2a5p-57 }, 1 }, // asin(0.72) == 0.80380231893302999382
144 { 0x1.7ae147ae147aep-1, { 0x1.aa8832b0b0525p-1, 0x1.933b3e58bf069p-56 }, 1 }, // asin(0.74) == 0.83307035834164779829
145 { 0x1.851eb851eb852p-1, { 0x1.ba042d36663dbp-1, 0x1.fbcf504ab6298p-56 }, 1 }, // asin(0.76) == 0.86331311501555366127
146 { 0x1.8f5c28f5c28f6p-1, { 0x1.ca11a353bd84cp-1, 0x1.467d94280ae43p-55 }, 1 }, // asin(0.78) == 0.89466581723423525206
147 { 0x1.999999999999ap-1, { 0x1.dac670561bb50p-1, 0x1.358a733684234p-57 }, 1 }, // asin(0.8) == 0.92729521800161230644
148 { 0x1.a3d70a3d70a3ep-1, { 0x1.ec3e10a736333p-1, -0x1.7a9fc5e44482fp-56 }, 1 }, // asin(0.8200000000000001) == 0.96141101876410171191
149 { 0x1.ae147ae147ae2p-1, { 0x1.fe9be811df6ccp-1, 0x1.4a2a7bc81f783p-57 }, 1 }, // asin(0.8400000000000001) == 0.99728322237180001337
150 { 0x1.b851eb851eb86p-1, { 0x1.09076ee9d82bcp+0, -0x1.1fd8cb8d0b966p-54 }, 1 }, // asin(0.8600000000000001) == 1.0352696724805089887
151 { 0x1.c28f5c28f5c2ap-1, { 0x1.136bb485f3d92p+0, 0x1.38454d9da0d3ep-54 }, 1 }, // asin(0.8800000000000001) == 1.0758622004540013395
152 { 0x1.ccccccccccccep-1, { 0x1.1ea93705fa173p+0, 0x1.53592f90f84c7p-54 }, 1 }, // asin(0.9000000000000001) == 1.1197695149986344923
153 { 0x1.d70a3d70a3d70p-1, { 0x1.2b07529b17488p+0, 0x1.05c10df861a86p-54 }, 1 }, // asin(0.9199999999999999) == 1.168080485214234855
154 { 0x1.e147ae147ae14p-1, { 0x1.38fe4cb950b11p+0, -0x1.e2dfb3eb2069ap-55 }, 1 }, // asin(0.94) == 1.2226303055219355818
155 { 0x1.eb851eb851eb8p-1, { 0x1.4978fa3269ee1p+0, -0x1.b717be098f6f6p-54 }, 1 }, // asin(0.96) == 1.2870022175865686467
156 { 0x1.f5c28f5c28f5cp-1, { 0x1.5ed690583be07p+0, 0x1.9e9b66a311d8ap-54 }, 1 }, // asin(0.98) == 1.3704614844717769373
157 { 0x1.0000000000000p+0, { 0x1.921fb54442d18p+0, 0x1.1a62633145c07p-54 }, 1 }, // asin(1.0) == 1.5707963267948966192
158};
159
161{
162 for (int i = 0; i < _countof(s_asin_approx_tests); i++)
163 {
164 double x = s_asin_approx_tests[i].x;
166 double z = asin(x);
168 ok(error <= s_asin_approx_tests[i].max_error,
169 "asin(%.17e) = %.17e, expected %.17e, error %I64d ULPs, max %u ULPs\n",
170 x, z, expected, error, s_asin_approx_tests[i].max_error);
171 }
172}
173
174#if defined(HAS_ASINF)
175
176// These are expected to match exactly
178{
179 { 0x00000000 /* 0.000000 */, 0x00000000 /* 0.000000 */ },
180 { 0x80000000 /* -0.000000 */, 0x00000000 /* 0.000000 */ },
181 { 0x7f800000 /* 1.#INF00 */, 0x00000000 /* 0.000000 */ },
182 { 0x7f800001 /* 1.#SNAN0 */, 0x00000000 /* 0.000000 */ },
183 { 0x7fBFffff /* 1.#SNAN0 */, 0x00000000 /* 0.000000 */ },
184 { 0x7fC00000 /* 1.#QNAN0 */, 0x00000000 /* 0.000000 */ },
185 { 0x7fC80001 /* 1.#QNAN0 */, 0x00000000 /* 0.000000 */ },
186 { 0x7fFfffff /* 1.#QNAN0 */, 0x00000000 /* 0.000000 */ },
187 { 0xff800000 /* -1.#INF00 */, 0x00000000 /* 0.000000 */ },
188 { 0xff800001 /* -1.#SNAN0 */, 0x00000000 /* 0.000000 */ },
189 { 0xffBfffff /* -1.#SNAN0 */, 0x00000000 /* 0.000000 */ },
190 { 0xffC00000 /* -1.#IND00 */, 0x00000000 /* 0.000000 */ },
191 { 0xfff80001 /* -1.#QNAN0 */, 0x00000000 /* 0.000000 */ },
192 { 0xffffffff /* -1.#QNAN0 */, 0x00000000 /* 0.000000 */ },
193};
194
196{
197 for (int i = 0; i < _countof(s_asinf_exact_tests); i++)
198 {
200 float z = asinf(x);
202 }
203}
204
205#endif // defined(HAS_ASINF)
206
207#if defined(HAS_ASINF) || defined(HAS_LIBM_SSE2)
208
210{
211// { x, { y_rounded, y_difference } }
212 { -0x1.0000000000000p+0, { -0x1.921fb54442d18p+0, -0x1.1a62633145c07p-54 }, 1 }, // asinf(-1.0) == -1.5707963267948966192
213 { -0x1.f5c2900000000p-1, { -0x1.5ed691f3e5c14p+0, -0x1.d881aa877f15dp-54 }, 1 }, // asinf(-0.9800000190734863) == -1.3704615803196747906
214 { -0x1.eb851e0000000p-1, { -0x1.4978f8e9455eap+0, 0x1.673e49ad1c217p-56 }, 1 }, // asinf(-0.9599999785423279) == -1.2870021409520355587
215 { -0x1.e147ae0000000p-1, { -0x1.38fe4c9b4d1d8p+0, 0x1.d44a6a565c0e7p-54 }, 1 }, // asinf(-0.9399999976158142) == -1.2226302985337634916
216 { -0x1.d70a3e0000000p-1, { -0x1.2b075351fc774p+0, 0x1.4978eb44e6960p-54 }, 1 }, // asinf(-0.9200000166893005) == -1.1680805277978522479
217 { -0x1.cccccc0000000p-1, { -0x1.1ea9361b0e22bp+0, -0x1.4c0b2f53c508dp-54 }, 1 }, // asinf(-0.8999999761581421) == -1.1197694603016639823
218 { -0x1.c28f5c0000000p-1, { -0x1.136bb45ad5983p+0, 0x1.708ef5d01cb48p-54 }, 1 }, // asinf(-0.8799999952316284) == -1.0758621904147679693
219 { -0x1.b851ec0000000p-1, { -0x1.09076f623edf2p+0, 0x1.d92e9623a9090p-57 }, 1 }, // asinf(-0.8600000143051147) == -1.0352697005135920044
220 { -0x1.ae147a0000000p-1, { -0x1.fe9be672ad1cbp-1, 0x1.fac6c7e78bf36p-59 }, 1 }, // asinf(-0.8399999737739563) == -0.9972831740365618557
221 { -0x1.a3d70a0000000p-1, { -0x1.ec3e103bde0acp-1, 0x1.af2150ecb8644p-55 }, 1 }, // asinf(-0.8199999928474426) == -0.9614110062675726519
222 { -0x1.99999a0000000p-1, { -0x1.dac67100c65fcp-1, -0x1.c8a5009f46722p-55 }, 1 }, // asinf(-0.800000011920929) == -0.92729523786982742072
223 { -0x1.8f5c280000000p-1, { -0x1.ca11a1cb039e5p-1, -0x1.aa440698aa7e4p-55 }, 1 }, // asinf(-0.7799999713897705) == -0.89466577151489150757
224 { -0x1.851eb80000000p-1, { -0x1.ba042cb85a8bap-1, -0x1.b9e48d231a978p-56 }, 1 }, // asinf(-0.7599999904632568) == -0.86331310034190458411
225 { -0x1.7ae1480000000p-1, { -0x1.aa88332a7bc89p-1, 0x1.ada6176a6a192p-56 }, 1 }, // asinf(-0.7400000095367432) == -0.83307037252042546063
226 { -0x1.70a3d80000000p-1, { -0x1.9b8bfba2aabc0p-1, -0x1.1b51cfd714dffp-55 }, 1 }, // asinf(-0.7200000286102295) == -0.80380236015968623294
227 { -0x1.6666660000000p-1, { -0x1.8d00e6034c58ep-1, 0x1.d7774bcc37269p-58 }, 1 }, // asinf(-0.699999988079071) == -0.77539747991811380139
228 { -0x1.5c28f60000000p-1, { -0x1.7edabecdddb0ep-1, -0x1.0e17a478e5dfbp-58 }, 1 }, // asinf(-0.6800000071525574) == -0.74776264441502049795
229 { -0x1.51eb860000000p-1, { -0x1.710f29446d89ap-1, 0x1.28c1958bbf49bp-59 }, 1 }, // asinf(-0.6600000262260437) == -0.72081879577924046009
230 { -0x1.47ae140000000p-1, { -0x1.6395463411500p-1, 0x1.ca455446fd3ccp-58 }, 1 }, // asinf(-0.6399999856948853) == -0.69449824700919293097
231 { -0x1.3d70a40000000p-1, { -0x1.566571c39728ep-1, 0x1.085a5461935a4p-55 }, 1 }, // asinf(-0.6200000047683716) == -0.66874270927981324573
232 { -0x1.3333340000000p-1, { -0x1.4978fb3269ee4p-1, -0x1.2419b6d47fa39p-56 }, 1 }, // asinf(-0.6000000238418579) == -0.64350113859560710757
233 { -0x1.28f5c20000000p-1, { -0x1.3cca01171572cp-1, -0x1.d8221aa8f537ap-55 }, 1 }, // asinf(-0.5799999833106995) == -0.61872867018494087222
234 { -0x1.1eb8520000000p-1, { -0x1.30535601246e8p-1, 0x1.238f8e7474374p-55 }, 1 }, // asinf(-0.5600000023841858) == -0.59438580287880157408
235 { -0x1.147ae20000000p-1, { -0x1.2410560d96e0dp-1, -0x1.05c5ef10111b0p-55 }, 1 }, // asinf(-0.5400000214576721) == -0.57043713489423600378
236 { -0x1.0a3d700000000p-1, { -0x1.17fcd84a3d081p-1, 0x1.b60b3c8dc5fe4p-55 }, 1 }, // asinf(-0.5199999809265137) == -0.54685092836599842017
237 { -0x1.0000000000000p-1, { -0x1.0c152382d7366p-1, 0x1.ee6913347c2a6p-55 }, 1 }, // asinf(-0.5) == -0.52359877559829887308
238 { -0x1.eb851e0000000p-2, { -0x1.0055d017adba7p-1, -0x1.0a557943a6e37p-55 }, 1 }, // asinf(-0.47999998927116394) == -0.50065470017476779275
239 { -0x1.d70a3e0000000p-2, { -0x1.e977936697869p-2, -0x1.5af3749a35404p-58 }, 1 }, // asinf(-0.46000000834465027) == -0.47799520791693922898
240 { -0x1.c28f5c0000000p-2, { -0x1.d288753bbb4a3p-2, -0x1.b8087e333343bp-56 }, 1 }, // asinf(-0.4399999976158142) == -0.45559867074082146697
241 { -0x1.ae147a0000000p-2, { -0x1.bbd91610fb58ap-2, 0x1.a9e1804c82556p-57 }, 1 }, // asinf(-0.41999998688697815) == -0.43344530562065896007
242 { -0x1.99999a0000000p-2, { -0x1.a564ac7e2de49p-2, -0x1.192b0e45db774p-57 }, 1 }, // asinf(-0.4000000059604645) == -0.41151685257088794419
243 { -0x1.851eb80000000p-2, { -0x1.8f26c24d45a33p-2, 0x1.4a109f0821705p-56 }, 1 }, // asinf(-0.3799999952316284) == -0.38979629131918895211
244 { -0x1.70a3d80000000p-2, { -0x1.791b3901549f4p-2, 0x1.6c0f7667aaf5fp-56 }, 1 }, // asinf(-0.36000001430511475) == -0.36826790876980839664
245 { -0x1.5c28f60000000p-2, { -0x1.633e2f2691623p-2, -0x1.c08929b44d213p-57 }, 1 }, // asinf(-0.3400000035762787) == -0.34691690132999237867
246 { -0x1.47ae140000000p-2, { -0x1.4d8c075b64a87p-2, 0x1.dbd74ce1333fbp-56 }, 1 }, // asinf(-0.3199999928474426) == -0.32572947974509994436
247 { -0x1.3333340000000p-2, { -0x1.38015ab7ffc0ep-2, 0x1.3faa7a7a211ffp-56 }, 1 }, // asinf(-0.30000001192092896) == -0.30469266651192659578
248 { -0x1.1eb8520000000p-2, { -0x1.229aec5cb8e32p-2, 0x1.0a5d03b49a69fp-57 }, 1 }, // asinf(-0.2800000011920929) == -0.28379411045009127867
249 { -0x1.0a3d700000000p-2, { -0x1.0d55b094c795dp-2, 0x1.3ce8513aac81ep-56 }, 1 }, // asinf(-0.25999999046325684) == -0.26302219303206246184
250 { -0x1.eb851e0000000p-3, { -0x1.f05d81212ac77p-3, 0x1.2b4b519e59224p-58 }, 1 }, // asinf(-0.23999999463558197) == -0.24236584551303838192
251 { -0x1.c28f5c0000000p-3, { -0x1.c646aa1a84804p-3, 0x1.ffefc87db4fcap-58 }, 1 }, // asinf(-0.2199999988079071) == -0.22181446927476155401
252 { -0x1.99999a0000000p-3, { -0x1.9c618b0d31199p-3, 0x1.1dada6710527bp-58 }, 1 }, // asinf(-0.20000000298023224) == -0.20135792383201758406
253 { -0x1.70a3d80000000p-3, { -0x1.72a90742d32d8p-3, -0x1.0e59d53b862d9p-58 }, 1 }, // asinf(-0.18000000715255737) == -0.18098645851787043359
254 { -0x1.47ae140000000p-3, { -0x1.49182ddd2083fp-3, 0x1.07ef7aff76714p-59 }, 1 }, // asinf(-0.1599999964237213) == -0.16069064932895746155
255 { -0x1.1eb8520000000p-3, { -0x1.1faa3c08e9dadp-3, -0x1.06686e958bed9p-57 }, 1 }, // asinf(-0.14000000059604645) == -0.14046141531183079666
256 { -0x1.eb851e0000000p-4, { -0x1.ecb514b524a90p-4, -0x1.d4b89eb468eacp-59 }, 1 }, // asinf(-0.11999999731779099) == -0.12028987969305604862
257 { -0x1.99999a0000000p-4, { -0x1.9a4927c721fedp-4, -0x1.d06f9aba30f2cp-58 }, 1 }, // asinf(-0.10000000149011612) == -0.10016742265918284557
258 { -0x1.47ae140000000p-4, { -0x1.4807d0b6bcaafp-4, 0x1.535b6e72f1b1cp-59 }, 1 }, // asinf(-0.07999999821186066) == -0.080085578239770011587
259 { -0x1.eb851e0000000p-5, { -0x1.ebd0bcbaa674cp-5, -0x1.587046d494473p-59 }, 1 }, // asinf(-0.05999999865889549) == -0.060036057101753389611
260 { -0x1.47ae140000000p-5, { -0x1.47c476bff15bbp-5, -0x1.2a9f020c83094p-59 }, 1 }, // asinf(-0.03999999910593033) == -0.040010673459203139416
261 { -0x1.47ae140000000p-6, { -0x1.47b3abe9d676ep-6, 0x1.7ca8fc735baffp-61 }, 1 }, // asinf(-0.019999999552965164) == -0.020001333126266222139
262 { 0x0.0p+0, { 0x0.0p+0, 0x0.0p+0 }, 1 }, // asinf(0.0) == 0.0
263 { 0x1.47ae140000000p-6, { 0x1.47b3abe9d676ep-6, -0x1.7ca8fc735baffp-61 }, 1 }, // asinf(0.019999999552965164) == 0.020001333126266222139
264 { 0x1.47ae140000000p-5, { 0x1.47c476bff15bbp-5, 0x1.2a9f020c83094p-59 }, 1 }, // asinf(0.03999999910593033) == 0.040010673459203139416
265 { 0x1.eb851e0000000p-5, { 0x1.ebd0bcbaa674cp-5, 0x1.587046d494473p-59 }, 1 }, // asinf(0.05999999865889549) == 0.060036057101753389611
266 { 0x1.47ae140000000p-4, { 0x1.4807d0b6bcaafp-4, -0x1.535b6e72f1b1cp-59 }, 1 }, // asinf(0.07999999821186066) == 0.080085578239770011587
267 { 0x1.99999a0000000p-4, { 0x1.9a4927c721fedp-4, 0x1.d06f9aba30f2cp-58 }, 1 }, // asinf(0.10000000149011612) == 0.10016742265918284557
268 { 0x1.eb851e0000000p-4, { 0x1.ecb514b524a90p-4, 0x1.d4b89eb468eacp-59 }, 1 }, // asinf(0.11999999731779099) == 0.12028987969305604862
269 { 0x1.1eb8520000000p-3, { 0x1.1faa3c08e9dadp-3, 0x1.06686e958bed9p-57 }, 1 }, // asinf(0.14000000059604645) == 0.14046141531183079666
270 { 0x1.47ae140000000p-3, { 0x1.49182ddd2083fp-3, -0x1.07ef7aff76714p-59 }, 1 }, // asinf(0.1599999964237213) == 0.16069064932895746155
271 { 0x1.70a3d80000000p-3, { 0x1.72a90742d32d8p-3, 0x1.0e59d53b862d9p-58 }, 1 }, // asinf(0.18000000715255737) == 0.18098645851787043359
272 { 0x1.99999a0000000p-3, { 0x1.9c618b0d31199p-3, -0x1.1dada6710527bp-58 }, 1 }, // asinf(0.20000000298023224) == 0.20135792383201758406
273 { 0x1.c28f5c0000000p-3, { 0x1.c646aa1a84804p-3, -0x1.ffefc87db4fcap-58 }, 1 }, // asinf(0.2199999988079071) == 0.22181446927476155401
274 { 0x1.eb851e0000000p-3, { 0x1.f05d81212ac77p-3, -0x1.2b4b519e59224p-58 }, 1 }, // asinf(0.23999999463558197) == 0.24236584551303838192
275 { 0x1.0a3d700000000p-2, { 0x1.0d55b094c795dp-2, -0x1.3ce8513aac81ep-56 }, 1 }, // asinf(0.25999999046325684) == 0.26302219303206246184
276 { 0x1.1eb8520000000p-2, { 0x1.229aec5cb8e32p-2, -0x1.0a5d03b49a69fp-57 }, 1 }, // asinf(0.2800000011920929) == 0.28379411045009127867
277 { 0x1.3333340000000p-2, { 0x1.38015ab7ffc0ep-2, -0x1.3faa7a7a211ffp-56 }, 1 }, // asinf(0.30000001192092896) == 0.30469266651192659578
278 { 0x1.47ae140000000p-2, { 0x1.4d8c075b64a87p-2, -0x1.dbd74ce1333fbp-56 }, 1 }, // asinf(0.3199999928474426) == 0.32572947974509994436
279 { 0x1.5c28f60000000p-2, { 0x1.633e2f2691623p-2, 0x1.c08929b44d213p-57 }, 1 }, // asinf(0.3400000035762787) == 0.34691690132999237867
280 { 0x1.70a3d80000000p-2, { 0x1.791b3901549f4p-2, -0x1.6c0f7667aaf5fp-56 }, 1 }, // asinf(0.36000001430511475) == 0.36826790876980839664
281 { 0x1.851eb80000000p-2, { 0x1.8f26c24d45a33p-2, -0x1.4a109f0821705p-56 }, 1 }, // asinf(0.3799999952316284) == 0.38979629131918895211
282 { 0x1.99999a0000000p-2, { 0x1.a564ac7e2de49p-2, 0x1.192b0e45db774p-57 }, 1 }, // asinf(0.4000000059604645) == 0.41151685257088794419
283 { 0x1.ae147a0000000p-2, { 0x1.bbd91610fb58ap-2, -0x1.a9e1804c82556p-57 }, 1 }, // asinf(0.41999998688697815) == 0.43344530562065896007
284 { 0x1.c28f5c0000000p-2, { 0x1.d288753bbb4a3p-2, 0x1.b8087e333343bp-56 }, 1 }, // asinf(0.4399999976158142) == 0.45559867074082146697
285 { 0x1.d70a3e0000000p-2, { 0x1.e977936697869p-2, 0x1.5af3749a35404p-58 }, 1 }, // asinf(0.46000000834465027) == 0.47799520791693922898
286 { 0x1.eb851e0000000p-2, { 0x1.0055d017adba7p-1, 0x1.0a557943a6e37p-55 }, 1 }, // asinf(0.47999998927116394) == 0.50065470017476779275
287 { 0x1.0000000000000p-1, { 0x1.0c152382d7366p-1, -0x1.ee6913347c2a6p-55 }, 1 }, // asinf(0.5) == 0.52359877559829887308
288 { 0x1.0a3d700000000p-1, { 0x1.17fcd84a3d081p-1, -0x1.b60b3c8dc5fe4p-55 }, 1 }, // asinf(0.5199999809265137) == 0.54685092836599842017
289 { 0x1.147ae20000000p-1, { 0x1.2410560d96e0dp-1, 0x1.05c5ef10111b0p-55 }, 1 }, // asinf(0.5400000214576721) == 0.57043713489423600378
290 { 0x1.1eb8520000000p-1, { 0x1.30535601246e8p-1, -0x1.238f8e7474374p-55 }, 1 }, // asinf(0.5600000023841858) == 0.59438580287880157408
291 { 0x1.28f5c20000000p-1, { 0x1.3cca01171572cp-1, 0x1.d8221aa8f537ap-55 }, 1 }, // asinf(0.5799999833106995) == 0.61872867018494087222
292 { 0x1.3333340000000p-1, { 0x1.4978fb3269ee4p-1, 0x1.2419b6d47fa39p-56 }, 1 }, // asinf(0.6000000238418579) == 0.64350113859560710757
293 { 0x1.3d70a40000000p-1, { 0x1.566571c39728ep-1, -0x1.085a5461935a4p-55 }, 1 }, // asinf(0.6200000047683716) == 0.66874270927981324573
294 { 0x1.47ae140000000p-1, { 0x1.6395463411500p-1, -0x1.ca455446fd3ccp-58 }, 1 }, // asinf(0.6399999856948853) == 0.69449824700919293097
295 { 0x1.51eb860000000p-1, { 0x1.710f29446d89ap-1, -0x1.28c1958bbf49bp-59 }, 1 }, // asinf(0.6600000262260437) == 0.72081879577924046009
296 { 0x1.5c28f60000000p-1, { 0x1.7edabecdddb0ep-1, 0x1.0e17a478e5dfbp-58 }, 1 }, // asinf(0.6800000071525574) == 0.74776264441502049795
297 { 0x1.6666660000000p-1, { 0x1.8d00e6034c58ep-1, -0x1.d7774bcc37269p-58 }, 1 }, // asinf(0.699999988079071) == 0.77539747991811380139
298 { 0x1.70a3d80000000p-1, { 0x1.9b8bfba2aabc0p-1, 0x1.1b51cfd714dffp-55 }, 1 }, // asinf(0.7200000286102295) == 0.80380236015968623294
299 { 0x1.7ae1480000000p-1, { 0x1.aa88332a7bc89p-1, -0x1.ada6176a6a192p-56 }, 1 }, // asinf(0.7400000095367432) == 0.83307037252042546063
300 { 0x1.851eb80000000p-1, { 0x1.ba042cb85a8bap-1, 0x1.b9e48d231a978p-56 }, 1 }, // asinf(0.7599999904632568) == 0.86331310034190458411
301 { 0x1.8f5c280000000p-1, { 0x1.ca11a1cb039e5p-1, 0x1.aa440698aa7e4p-55 }, 1 }, // asinf(0.7799999713897705) == 0.89466577151489150757
302 { 0x1.99999a0000000p-1, { 0x1.dac67100c65fcp-1, 0x1.c8a5009f46722p-55 }, 1 }, // asinf(0.800000011920929) == 0.92729523786982742072
303 { 0x1.a3d70a0000000p-1, { 0x1.ec3e103bde0acp-1, -0x1.af2150ecb8644p-55 }, 1 }, // asinf(0.8199999928474426) == 0.9614110062675726519
304 { 0x1.ae147a0000000p-1, { 0x1.fe9be672ad1cbp-1, -0x1.fac6c7e78bf36p-59 }, 1 }, // asinf(0.8399999737739563) == 0.9972831740365618557
305 { 0x1.b851ec0000000p-1, { 0x1.09076f623edf2p+0, -0x1.d92e9623a9090p-57 }, 1 }, // asinf(0.8600000143051147) == 1.0352697005135920044
306 { 0x1.c28f5c0000000p-1, { 0x1.136bb45ad5983p+0, -0x1.708ef5d01cb48p-54 }, 1 }, // asinf(0.8799999952316284) == 1.0758621904147679693
307 { 0x1.cccccc0000000p-1, { 0x1.1ea9361b0e22bp+0, 0x1.4c0b2f53c508dp-54 }, 1 }, // asinf(0.8999999761581421) == 1.1197694603016639823
308 { 0x1.d70a3e0000000p-1, { 0x1.2b075351fc774p+0, -0x1.4978eb44e6960p-54 }, 1 }, // asinf(0.9200000166893005) == 1.1680805277978522479
309 { 0x1.e147ae0000000p-1, { 0x1.38fe4c9b4d1d8p+0, -0x1.d44a6a565c0e7p-54 }, 1 }, // asinf(0.9399999976158142) == 1.2226302985337634916
310 { 0x1.eb851e0000000p-1, { 0x1.4978f8e9455eap+0, -0x1.673e49ad1c217p-56 }, 1 }, // asinf(0.9599999785423279) == 1.2870021409520355587
311 { 0x1.f5c2900000000p-1, { 0x1.5ed691f3e5c14p+0, 0x1.d881aa877f15dp-54 }, 1 }, // asinf(0.9800000190734863) == 1.3704615803196747906
312 { 0x1.0000000000000p+0, { 0x1.921fb54442d18p+0, 0x1.1a62633145c07p-54 }, 1 }, // asinf(1.0) == 1.5707963267948966192
313};
314
315#endif // defined(HAS_ASINF) || defined(HAS_LIBM_SSE2)
316
317#if defined(HAS_ASINF)
318
320{
321 for (int i = 0; i < _countof(s_asinf_approx_tests); i++)
322 {
323 float x = s_asinf_approx_tests[i].x;
325 float z = asinf(x);
327 ok(error <= s_asin_approx_tests[i].max_error,
328 "asin(%.6e) = %.7e, expected %.7e, error %I64d ULPs, max %u ULPs\n",
329 x, z, expected, error, s_asin_approx_tests[i].max_error);
330 }
331}
332
333#endif // defined(HAS_ASINF)
334
335#if defined(HAS_LIBM_SSE2)
336
337__ATTRIBUTE_SSE2__ __m128d __libm_sse2_asin(__m128d Xmm0);
338
340void Test_libm_sse2_asin(void)
341{
342 int i;
343 for (i = 0; i < _countof(s_asin_approx_tests); i++)
344 {
345 double x = s_asin_approx_tests[i].x;
347 __m128d xmm0 = _mm_set_sd(x);
348 __m128d xmm1 = __libm_sse2_asin(xmm0);
349 double z = _mm_cvtsd_f64(xmm1);
351 ok(error <= s_asin_approx_tests[i].max_error,
352 "__libm_sse2_asin(%.17e) = %.17e, expected %.17e, error %I64d ULPs, max %u ULPs\n",
353 x, z, expected, error, s_asin_approx_tests[i].max_error);
354 }
355}
356
357__ATTRIBUTE_SSE2__ __m128 __libm_sse2_asinf(__m128 Xmm0);
358
360void Test_libm_sse2_asinf(void)
361{
362 int i;
363 for (i = 0; i < _countof(s_asinf_approx_tests); i++)
364 {
365 float x = s_asinf_approx_tests[i].x;
367 __m128 xmm0 = _mm_set_ps1(x);
368 __m128 xmm1 = __libm_sse2_asinf(xmm0);
369 float z = _mm_cvtss_f32(xmm1);
371 ok(error <= s_asinf_approx_tests[i].max_error,
372 "__libm_sse2_asinf(%.6e) = %.7e, expected %.7e, error %I64d ULPs, max %u ULPs\n",
373 x, z, expected, error, s_asinf_approx_tests[i].max_error);
374 }
375}
376
377#endif // defined(HAS_LIBM_SSE2)
378
380{
383#if defined(HAS_ASINF)
386#endif
387#if defined(HAS_LIBM_SSE2)
388 Test_libm_sse2_asin();
389 Test_libm_sse2_asinf();
390#endif
391}
valarray< _Tp > asin(const valarray< _Tp > &__x)
Definition: _valarray.h:910
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
INT64 int64_t
Definition: types.h:72
__m128d _mm_set_sd(double w)
Definition: emmintrin.h:1037
double _mm_cvtsd_f64(__m128d a)
Definition: emmintrin.h:931
#define abs(i)
Definition: fconv.c:206
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint64EXT * result
Definition: glext.h:11304
GLdouble GLdouble z
Definition: glext.h:5874
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_ float __cdecl asinf(_In_ float x)
Definition: math.h:234
__ATTRIBUTE_SSE2__ __m128d __libm_sse2_asin(__m128d Xmm0)
Definition: libm_sse2.c:39
__ATTRIBUTE_SSE2__ __m128 __libm_sse2_asinf(__m128 Xmm0)
Definition: libm_sse2.c:46
#define ok_eq_dbl_exact(func, ullx, z, ullexp)
Definition: math_helpers.h:184
static __inline double u64_to_dbl(UINT64 x)
Definition: math_helpers.h:25
#define __ATTRIBUTE_SSE2__
Definition: math_helpers.h:19
static __inline int64_t ulp_error_precise(PRECISE_VALUE *expected, double result)
Definition: math_helpers.h:154
static __inline int ulp_error_flt(float expected, float result)
Definition: math_helpers.h:138
#define ok_eq_flt_exact(func, ux, z, uexp)
Definition: math_helpers.h:194
#define error(str)
Definition: mkdosfs.c:1605
static TESTENTRY_DBL_APPROX s_asin_approx_tests[]
Definition: asin.c:54
void Test_asinf_exact(void)
Definition: asin.c:195
static TESTENTRY_DBL s_asin_exact_tests[]
Definition: asin.c:25
void Test_asin_exact(void)
Definition: asin.c:43
static TESTENTRY_DBL_APPROX s_asinf_approx_tests[]
Definition: asin.c:209
void Test_asin_approx(void)
Definition: asin.c:160
static TESTENTRY_DBL s_asinf_exact_tests[]
Definition: asin.c:177
void Test_asinf_approx(void)
Definition: asin.c:319
BOOL expected
Definition: store.c:2000
#define _countof(array)
Definition: sndvol32.h:70
PRECISE_VALUE expected
Definition: math_helpers.h:87
float _mm_cvtss_f32(__m128 a)
Definition: xmmintrin.h:921
__m128 _mm_set_ps1(float a)