xref: /haiku/src/system/libroot/posix/musl/math/log_data.h (revision f504f61099b010fbfa94b1cc63d2e9072c7f7185)
1*f504f610SAugustin Cavalier /*
2*f504f610SAugustin Cavalier  * Copyright (c) 2018, Arm Limited.
3*f504f610SAugustin Cavalier  * SPDX-License-Identifier: MIT
4*f504f610SAugustin Cavalier  */
5*f504f610SAugustin Cavalier #ifndef _LOG_DATA_H
6*f504f610SAugustin Cavalier #define _LOG_DATA_H
7*f504f610SAugustin Cavalier 
8*f504f610SAugustin Cavalier #include <features.h>
9*f504f610SAugustin Cavalier 
10*f504f610SAugustin Cavalier #define LOG_TABLE_BITS 7
11*f504f610SAugustin Cavalier #define LOG_POLY_ORDER 6
12*f504f610SAugustin Cavalier #define LOG_POLY1_ORDER 12
13*f504f610SAugustin Cavalier extern hidden const struct log_data {
14*f504f610SAugustin Cavalier 	double ln2hi;
15*f504f610SAugustin Cavalier 	double ln2lo;
16*f504f610SAugustin Cavalier 	double poly[LOG_POLY_ORDER - 1]; /* First coefficient is 1.  */
17*f504f610SAugustin Cavalier 	double poly1[LOG_POLY1_ORDER - 1];
18*f504f610SAugustin Cavalier 	struct {
19*f504f610SAugustin Cavalier 		double invc, logc;
20*f504f610SAugustin Cavalier 	} tab[1 << LOG_TABLE_BITS];
21*f504f610SAugustin Cavalier #if !__FP_FAST_FMA
22*f504f610SAugustin Cavalier 	struct {
23*f504f610SAugustin Cavalier 		double chi, clo;
24*f504f610SAugustin Cavalier 	} tab2[1 << LOG_TABLE_BITS];
25*f504f610SAugustin Cavalier #endif
26*f504f610SAugustin Cavalier } __log_data;
27*f504f610SAugustin Cavalier 
28*f504f610SAugustin Cavalier #endif
29