xref: /haiku/src/system/libroot/posix/musl/math/pow_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 _POW_DATA_H
6*f504f610SAugustin Cavalier #define _POW_DATA_H
7*f504f610SAugustin Cavalier 
8*f504f610SAugustin Cavalier #include <features.h>
9*f504f610SAugustin Cavalier 
10*f504f610SAugustin Cavalier #define POW_LOG_TABLE_BITS 7
11*f504f610SAugustin Cavalier #define POW_LOG_POLY_ORDER 8
12*f504f610SAugustin Cavalier extern hidden const struct pow_log_data {
13*f504f610SAugustin Cavalier 	double ln2hi;
14*f504f610SAugustin Cavalier 	double ln2lo;
15*f504f610SAugustin Cavalier 	double poly[POW_LOG_POLY_ORDER - 1]; /* First coefficient is 1.  */
16*f504f610SAugustin Cavalier 	/* Note: the pad field is unused, but allows slightly faster indexing.  */
17*f504f610SAugustin Cavalier 	struct {
18*f504f610SAugustin Cavalier 		double invc, pad, logc, logctail;
19*f504f610SAugustin Cavalier 	} tab[1 << POW_LOG_TABLE_BITS];
20*f504f610SAugustin Cavalier } __pow_log_data;
21*f504f610SAugustin Cavalier 
22*f504f610SAugustin Cavalier #endif
23