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