xref: /freebsd/contrib/arm-optimized-routines/pl/math/tanf_data.c (revision 02e9120893770924227138ba49df1edb3896112a)
1 /*
2  * Data used in single-precision tan(x) function.
3  *
4  * Copyright (c) 2022-2023, Arm Limited.
5  * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
6  */
7 
8 #include "math_config.h"
9 
10 const struct tanf_poly_data __tanf_poly_data = {
11 .poly_tan = {
12 /* Coefficients generated using:
13    poly = fpminimax((tan(sqrt(x))-sqrt(x))/x^(3/2), deg, [|single ...|], [a*a;b*b]);
14    optimize relative error
15    final prec : 23 bits
16    deg : 5
17    a : 0x1p-126 ^ 2
18    b : ((pi) / 0x1p2) ^ 2
19    dirty rel error: 0x1.f7c2e4p-25
20    dirty abs error: 0x1.f7c2ecp-25.  */
21 0x1.55555p-2,
22 0x1.11166p-3,
23 0x1.b88a78p-5,
24 0x1.7b5756p-6,
25 0x1.4ef4cep-8,
26 0x1.0e1e74p-7
27 },
28 .poly_cotan = {
29 /* Coefficients generated using:
30    fpminimax(f(x) = (0x1p0 / tan(sqrt(x)) - 0x1p0 / sqrt(x)) / sqrt(x), deg, [|dtype ...|], [a;b])
31    optimize a single polynomial
32    optimize absolute error
33    final prec : 23 bits
34    working prec : 128 bits
35    deg : 3
36    a : 0x1p-126
37    b : (pi) / 0x1p2
38    dirty rel error : 0x1.81298cp-25
39    dirty abs error : 0x1.a8acf4p-25.  */
40 -0x1.55555p-2, /* -0.33333325.  */
41 -0x1.6c23e4p-6, /* -2.2225354e-2.  */
42 -0x1.12dbap-9, /* -2.0969994e-3.  */
43 -0x1.05a1c2p-12, /* -2.495116e-4.  */
44 }
45 };
46