crmf 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/crmf.gemspec +105 -3
- data/ext/crlibm-1.0beta5/AUTHORS +2 -0
- data/ext/crlibm-1.0beta5/CMakeLists.txt +154 -0
- data/ext/crlibm-1.0beta5/COPYING +340 -0
- data/ext/crlibm-1.0beta5/COPYING.LIB +504 -0
- data/ext/crlibm-1.0beta5/ChangeLog +125 -0
- data/ext/crlibm-1.0beta5/Makefile.am +134 -0
- data/ext/crlibm-1.0beta5/NEWS +0 -0
- data/ext/crlibm-1.0beta5/README +31 -0
- data/ext/crlibm-1.0beta5/README.DEV +23 -0
- data/ext/crlibm-1.0beta5/README.md +5 -0
- data/ext/crlibm-1.0beta5/TODO +66 -0
- data/ext/crlibm-1.0beta5/VERSION +1 -0
- data/ext/crlibm-1.0beta5/acos-td.c +1195 -0
- data/ext/crlibm-1.0beta5/acos-td.h +629 -0
- data/ext/crlibm-1.0beta5/asin-td.c +1297 -0
- data/ext/crlibm-1.0beta5/asin-td.h +620 -0
- data/ext/crlibm-1.0beta5/asincos.c +4488 -0
- data/ext/crlibm-1.0beta5/asincos.h +575 -0
- data/ext/crlibm-1.0beta5/atan-itanium.c +846 -0
- data/ext/crlibm-1.0beta5/atan-pentium.c +280 -0
- data/ext/crlibm-1.0beta5/atan-pentium.h +343 -0
- data/ext/crlibm-1.0beta5/atan_accurate.c +341 -0
- data/ext/crlibm-1.0beta5/atan_accurate.h +198 -0
- data/ext/crlibm-1.0beta5/atan_fast.c +506 -0
- data/ext/crlibm-1.0beta5/atan_fast.h +680 -0
- data/ext/crlibm-1.0beta5/configure.ac +419 -0
- data/ext/crlibm-1.0beta5/crlibm.h +204 -0
- data/ext/crlibm-1.0beta5/crlibm.spec +42 -0
- data/ext/crlibm-1.0beta5/crlibm_private.c +397 -0
- data/ext/crlibm-1.0beta5/crlibm_private.h +1048 -0
- data/ext/crlibm-1.0beta5/csh_fast.c +721 -0
- data/ext/crlibm-1.0beta5/csh_fast.h +771 -0
- data/ext/crlibm-1.0beta5/double-extended.h +496 -0
- data/ext/crlibm-1.0beta5/exp-itanium.c +723 -0
- data/ext/crlibm-1.0beta5/exp-td-standalone.c +87 -0
- data/ext/crlibm-1.0beta5/exp-td.c +1363 -0
- data/ext/crlibm-1.0beta5/exp-td.h +685 -0
- data/ext/crlibm-1.0beta5/exp_build_coeffs/exp_fast_table.c +125 -0
- data/ext/crlibm-1.0beta5/expm1-standalone.c +119 -0
- data/ext/crlibm-1.0beta5/expm1.c +2515 -0
- data/ext/crlibm-1.0beta5/expm1.h +715 -0
- data/ext/crlibm-1.0beta5/interval.h +238 -0
- data/ext/crlibm-1.0beta5/log-de.c +480 -0
- data/ext/crlibm-1.0beta5/log-de.h +747 -0
- data/ext/crlibm-1.0beta5/log-de2.c +280 -0
- data/ext/crlibm-1.0beta5/log-de2.h +2352 -0
- data/ext/crlibm-1.0beta5/log-td.c +1158 -0
- data/ext/crlibm-1.0beta5/log-td.h +819 -0
- data/ext/crlibm-1.0beta5/log.c +2244 -0
- data/ext/crlibm-1.0beta5/log.h +1592 -0
- data/ext/crlibm-1.0beta5/log10-td.c +906 -0
- data/ext/crlibm-1.0beta5/log10-td.h +823 -0
- data/ext/crlibm-1.0beta5/log1p.c +1295 -0
- data/ext/crlibm-1.0beta5/log2-td.c +1521 -0
- data/ext/crlibm-1.0beta5/log2-td.h +821 -0
- data/ext/crlibm-1.0beta5/log2_accurate.c +330 -0
- data/ext/crlibm-1.0beta5/log2_accurate.h +261 -0
- data/ext/crlibm-1.0beta5/log_accurate.c +133 -0
- data/ext/crlibm-1.0beta5/log_accurate.h +261 -0
- data/ext/crlibm-1.0beta5/log_fast.c +360 -0
- data/ext/crlibm-1.0beta5/log_fast.h +440 -0
- data/ext/crlibm-1.0beta5/pow.c +1396 -0
- data/ext/crlibm-1.0beta5/pow.h +3101 -0
- data/ext/crlibm-1.0beta5/prepare +20 -0
- data/ext/crlibm-1.0beta5/rem_pio2_accurate.c +219 -0
- data/ext/crlibm-1.0beta5/rem_pio2_accurate.h +53 -0
- data/ext/crlibm-1.0beta5/scs_lib/AUTHORS +3 -0
- data/ext/crlibm-1.0beta5/scs_lib/COPYING +504 -0
- data/ext/crlibm-1.0beta5/scs_lib/ChangeLog +16 -0
- data/ext/crlibm-1.0beta5/scs_lib/Doxyfile.dev +939 -0
- data/ext/crlibm-1.0beta5/scs_lib/Doxyfile.user +939 -0
- data/ext/crlibm-1.0beta5/scs_lib/INSTALL +215 -0
- data/ext/crlibm-1.0beta5/scs_lib/Makefile.am +17 -0
- data/ext/crlibm-1.0beta5/scs_lib/NEWS +0 -0
- data/ext/crlibm-1.0beta5/scs_lib/README +9 -0
- data/ext/crlibm-1.0beta5/scs_lib/README.DEV +38 -0
- data/ext/crlibm-1.0beta5/scs_lib/TODO +4 -0
- data/ext/crlibm-1.0beta5/scs_lib/VERSION +1 -0
- data/ext/crlibm-1.0beta5/scs_lib/addition_scs.c +623 -0
- data/ext/crlibm-1.0beta5/scs_lib/division_scs.c +110 -0
- data/ext/crlibm-1.0beta5/scs_lib/double2scs.c +174 -0
- data/ext/crlibm-1.0beta5/scs_lib/main.dox +104 -0
- data/ext/crlibm-1.0beta5/scs_lib/multiplication_scs.c +339 -0
- data/ext/crlibm-1.0beta5/scs_lib/poly_fct.c +112 -0
- data/ext/crlibm-1.0beta5/scs_lib/print_scs.c +73 -0
- data/ext/crlibm-1.0beta5/scs_lib/rand_scs.c +63 -0
- data/ext/crlibm-1.0beta5/scs_lib/scs.h +353 -0
- data/ext/crlibm-1.0beta5/scs_lib/scs2double.c +411 -0
- data/ext/crlibm-1.0beta5/scs_lib/scs2mpf.c +58 -0
- data/ext/crlibm-1.0beta5/scs_lib/scs2mpfr.c +61 -0
- data/ext/crlibm-1.0beta5/scs_lib/scs_private.c +23 -0
- data/ext/crlibm-1.0beta5/scs_lib/scs_private.h +133 -0
- data/ext/crlibm-1.0beta5/scs_lib/wrapper_scs.h +486 -0
- data/ext/crlibm-1.0beta5/scs_lib/zero_scs.c +52 -0
- data/ext/crlibm-1.0beta5/trigo_accurate.c +501 -0
- data/ext/crlibm-1.0beta5/trigo_accurate.h +331 -0
- data/ext/crlibm-1.0beta5/trigo_fast.c +1243 -0
- data/ext/crlibm-1.0beta5/trigo_fast.h +639 -0
- data/ext/crlibm-1.0beta5/trigpi.c +1169 -0
- data/ext/crlibm-1.0beta5/trigpi.h +556 -0
- data/ext/crlibm-1.0beta5/triple-double.c +57 -0
- data/ext/crlibm-1.0beta5/triple-double.h +1380 -0
- data/ext/crmf/crmf.c +117 -20
- data/ext/crmf/extconf.rb +12 -8
- data/lib/crmf/version.rb +1 -1
- data/tests/perf.rb +100 -219
- metadata +108 -10
- data/ext/crlibm-1.0beta4.tar.gz +0 -0
@@ -0,0 +1,419 @@
|
|
1
|
+
dnl Process this file with autoconf to produce a configure script.
|
2
|
+
AC_INIT
|
3
|
+
|
4
|
+
crlibm_version=`cat $srcdir/VERSION`
|
5
|
+
dnl For Automake
|
6
|
+
AM_INIT_AUTOMAKE(crlibm, $crlibm_version)
|
7
|
+
|
8
|
+
AC_CONFIG_HEADERS([crlibm_config.h])
|
9
|
+
|
10
|
+
|
11
|
+
AC_SUBST(VERSION)
|
12
|
+
|
13
|
+
ISODATE=`date +%Y-%m-%d`
|
14
|
+
AC_SUBST(ISODATE)
|
15
|
+
|
16
|
+
dnl Check for system information
|
17
|
+
AC_CANONICAL_HOST
|
18
|
+
case $host_os in
|
19
|
+
hpux*)
|
20
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPEOS_HPUX,1,[OS type]);;
|
21
|
+
*cygwin* | *mingw* | *uwin* | *djgpp | *emx*)
|
22
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPEOS_CYGWIN,1,[OS type]);;
|
23
|
+
freebsd*|netbsd*|darwin*)
|
24
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPEOS_BSD,1,[OS type]);;
|
25
|
+
esac;
|
26
|
+
|
27
|
+
|
28
|
+
case $host_cpu in
|
29
|
+
alpha)
|
30
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPECPU_ALPHA,1,[Processor type]) ;;
|
31
|
+
sparc)
|
32
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPECPU_SPARC,1,[Processor type]) ;;
|
33
|
+
powerpc*)
|
34
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPECPU_POWERPC,1,[Processor type]);;
|
35
|
+
i*86|k6|k7|pentium*|athlon*)
|
36
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPECPU_X86,1,[Processor type])
|
37
|
+
has_ia32_de=true;;
|
38
|
+
x86_64|amd64)
|
39
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPECPU_AMD64,1,[Processor type])
|
40
|
+
has_ia32_de=true;;
|
41
|
+
ia64)
|
42
|
+
AC_DEFINE_UNQUOTED(CRLIBM_TYPECPU_ITANIUM,1,[Processor type])
|
43
|
+
has_ia64_de=true;;
|
44
|
+
esac;
|
45
|
+
|
46
|
+
|
47
|
+
AC_CONFIG_SRCDIR([crlibm.h])
|
48
|
+
AC_PROG_MAKE_SET
|
49
|
+
|
50
|
+
dnl Check for compiler
|
51
|
+
|
52
|
+
AC_PROG_CC(gcc icc cc)
|
53
|
+
|
54
|
+
# Try to set compiler flags to get floating point arithmetics
|
55
|
+
# to work. This is an old heritage and should become useless within 30 years
|
56
|
+
#
|
57
|
+
if test "${GCC}" != "yes" ; then
|
58
|
+
case "${build}" in
|
59
|
+
*-*-hpux* )
|
60
|
+
AM_CFLAGS="${AM_CFLAGS} -Wp,-H30000"
|
61
|
+
;;
|
62
|
+
*-dec-osf* )
|
63
|
+
AM_CFLAGS="${AM_CFLAGS} -ieee"
|
64
|
+
;;
|
65
|
+
*-apple-darwin* )
|
66
|
+
AM_CFLAGS="${AM_CFLAGS} -fno-common"
|
67
|
+
;;
|
68
|
+
*-sgi-irix* )
|
69
|
+
;;
|
70
|
+
esac
|
71
|
+
else
|
72
|
+
case "${CC}" in
|
73
|
+
*icc* )
|
74
|
+
# -Wall causes relocation errors with icc.
|
75
|
+
AM_CFLAGS="${AM_CFLAGS} -wd269"
|
76
|
+
;;
|
77
|
+
* )
|
78
|
+
case "${build}" in
|
79
|
+
*-dec-osf* )
|
80
|
+
AM_CFLAGS="${AM_CFLAGS} -mieee -Wall"
|
81
|
+
;;
|
82
|
+
*alpha*-*-linux* )
|
83
|
+
AM_CFLAGS="${AM_CFLAGS} -mieee -Wall"
|
84
|
+
;;
|
85
|
+
*alpha*-*-freebsd* )
|
86
|
+
AM_CFLAGS="${AM_CFLAGS} -mieee -Wall"
|
87
|
+
;;
|
88
|
+
*-apple-darwin* )
|
89
|
+
AM_CFLAGS="${AM_CFLAGS} -fno-common -Wall"
|
90
|
+
;;
|
91
|
+
* )
|
92
|
+
AM_CFLAGS="${AM_CFLAGS} -Wall"
|
93
|
+
;;
|
94
|
+
esac
|
95
|
+
;;
|
96
|
+
esac
|
97
|
+
fi
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
dnl send this information to automake to set up compilation flags
|
105
|
+
dnl (add your compiler here)
|
106
|
+
AM_CONDITIONAL(COMPILER_ICC, test x$CC = xicc)
|
107
|
+
|
108
|
+
dnl Checks for programs.
|
109
|
+
AC_PROG_INSTALL
|
110
|
+
AC_PROG_RANLIB
|
111
|
+
AC_PROG_LN_S
|
112
|
+
|
113
|
+
dnl Checks for standard C stuff.
|
114
|
+
AC_HEADER_STDC
|
115
|
+
AC_C_CONST
|
116
|
+
AC_C_INLINE
|
117
|
+
|
118
|
+
|
119
|
+
AC_CHECK_FUNCS([sqrt])
|
120
|
+
AC_CHECK_HEADERS([fenv.h])
|
121
|
+
AC_CHECK_HEADERS([float.h])
|
122
|
+
AC_CHECK_HEADER(fpu_control.h, has_fpu_control=yes, has_fpu_control=no)
|
123
|
+
|
124
|
+
dnl Send this information to automake
|
125
|
+
AM_CONDITIONAL(HAS_FPU_CONTROL, test x$has_fpu_control = xyes)
|
126
|
+
|
127
|
+
if test x$has_fpu_control = xyes ; then
|
128
|
+
AC_DEFINE_UNQUOTED(CRLIBM_HAS_FPU_CONTROL,1,[architecture- and system-specific FPU control header file])
|
129
|
+
fi
|
130
|
+
|
131
|
+
dnl adds -lm
|
132
|
+
AC_CHECK_LIB([m], [log])
|
133
|
+
|
134
|
+
dnl Other checks
|
135
|
+
AC_C_BIGENDIAN(,,)
|
136
|
+
dnl defines WORDS_BIGENDIAN, or not
|
137
|
+
|
138
|
+
AC_C_LONG_DOUBLE
|
139
|
+
dnl defines HAVE_LONG_DOUBLE, or not
|
140
|
+
|
141
|
+
|
142
|
+
AC_CHECK_SIZEOF(int)
|
143
|
+
dnl defines SIZEOF_INT to be the size in bytes of int
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
dnl All the rest is related to MPFR and to Ziv's lib, useful for testing.
|
150
|
+
|
151
|
+
dnl Sometimes the following function is provided by aclocal, sometimes not.
|
152
|
+
dnl Copying it here is probably a bad way of managing this problem
|
153
|
+
AC_DEFUN([AC_ADD_PATH_LIBS],
|
154
|
+
[
|
155
|
+
if ` test "$1" `
|
156
|
+
then
|
157
|
+
AC_MSG_CHECKING($2 library)
|
158
|
+
if test -r "$1/lib$2.a" -o -r "$1/lib$2.so"
|
159
|
+
then
|
160
|
+
LDFLAGS="$LDFLAGS -L$1"
|
161
|
+
LIBS ="$LIBS -l$2"
|
162
|
+
else
|
163
|
+
AC_MSG_ERROR($2 not found)
|
164
|
+
fi
|
165
|
+
AC_MSG_RESULT(yes)
|
166
|
+
else
|
167
|
+
AC_CHECK_LIB($2, main, , AC_MSG_ERROR($2 not found))
|
168
|
+
fi
|
169
|
+
]
|
170
|
+
)
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
dnl Command-line arguments to ./configure:
|
177
|
+
|
178
|
+
|
179
|
+
dnl switch for SSE2
|
180
|
+
AC_ARG_ENABLE(sse2,
|
181
|
+
[ --enable-sse2 forces the use of sse2 arith [[default=no]]],
|
182
|
+
[case $enableval in
|
183
|
+
yes)
|
184
|
+
AC_DEFINE_UNQUOTED(HAS_SSE2,1,[Use the sse2 operators ]);;
|
185
|
+
no) ;;
|
186
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-sse2, need yes or no]) ;;
|
187
|
+
esac],
|
188
|
+
[enable_sse2=no])
|
189
|
+
dnl Send this information to automake
|
190
|
+
AM_CONDITIONAL(USE_SSE2, test x$enable_sse2 = xyes )
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
dnl switch for compiling the interval functions
|
196
|
+
AC_ARG_ENABLE(interval-functions,
|
197
|
+
[ --enable-interval-functions enables filib-compatible interval functions (DOES NOT WORK YET) [[default=no]]],
|
198
|
+
[case $enableval in
|
199
|
+
yes)
|
200
|
+
AC_DEFINE_UNQUOTED(BUILD_INTERVAL_FUNCTIONS,1,[Compile the filib-compatible interval functions]);;
|
201
|
+
no) ;;
|
202
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-interval-functions, need yes or no]) ;;
|
203
|
+
esac],
|
204
|
+
[enable_interval_functions=no])
|
205
|
+
dnl Send this information to automake
|
206
|
+
AM_CONDITIONAL(USE_INTERVAL_FUNCTIONS, test x$enable_interval_functions = xyes )
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
dnl A switch to disable use of double-extended optimised version
|
211
|
+
AC_ARG_ENABLE(double-extended,
|
212
|
+
[ --enable-double-extended enable double-extended optimised versions of functions if hardware supports it [[default=yes]]],
|
213
|
+
[case $enableval in
|
214
|
+
yes|no) ;;
|
215
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-double-extended, need yes or no]) ;;
|
216
|
+
esac],
|
217
|
+
[enable_double_extended=yes])
|
218
|
+
|
219
|
+
dnl following line needs a little bit more work on log-de.c and double-extended.h
|
220
|
+
dnl AM_CONDITIONAL(USE_HARDWARE_DE, test x$has_ia32_de = xtrue -a x$enable_double_extended = xyes -a x$has_fpu_control=xyes -o x$has_ia64_de = xtrue -a x$CC = xicc -a x$enable_double_extended = xyes )
|
221
|
+
|
222
|
+
AM_CONDITIONAL(USE_HARDWARE_DE, test x$has_ia32_de = xtrue -a x$has_fpu_control = xyes -a x$enable_double_extended = xyes -a x$enable_interval_functions = xno )
|
223
|
+
dnl Note that at the moment, enabling intervals disables double-extended
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
dnl If at some point we wish to include SPARC optimization back,
|
233
|
+
dnl the default should take the value 10 and 25 in this case
|
234
|
+
dnl for around 200 bits of precision
|
235
|
+
|
236
|
+
AC_ARG_ENABLE(nbdigits,
|
237
|
+
[ --enable-nbdigits=N set the number of digits in the SCS structure to N [[default=8]] ],
|
238
|
+
[case $enableval in
|
239
|
+
*[[0-9]]) AC_DEFINE_UNQUOTED(SCS_NB_WORDS, $enableval, [Number of digits in the SCS structure]);;
|
240
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-nbdigits, number expected]) ;;
|
241
|
+
esac],
|
242
|
+
[AC_DEFINE_UNQUOTED(SCS_NB_WORDS, 8, [Number of digits in the SCS structure])]
|
243
|
+
)
|
244
|
+
|
245
|
+
AC_ARG_ENABLE(digitsize,
|
246
|
+
[ --enable-digitsize=N set the size of a digit to N bits [[default=30]] ],
|
247
|
+
[case $enableval in
|
248
|
+
*[[0-9]]) AC_DEFINE_UNQUOTED(SCS_NB_BITS, $enableval, [Size of an SCS digit]);;
|
249
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-digitsize, number expected]) ;;
|
250
|
+
esac],
|
251
|
+
[AC_DEFINE_UNQUOTED(SCS_NB_BITS, 30, [Size of an SCS digit])]
|
252
|
+
)
|
253
|
+
|
254
|
+
|
255
|
+
dnl ... for MPFR
|
256
|
+
AC_ARG_ENABLE(mpfr,
|
257
|
+
[ --enable-mpfr enable MPFR function [[default=no]]],
|
258
|
+
[case $enableval in
|
259
|
+
yes|no) ;;
|
260
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-mpfr, need yes or no]) ;;
|
261
|
+
esac],
|
262
|
+
[enable_mpfr=no])
|
263
|
+
|
264
|
+
|
265
|
+
dnl ... for GMP
|
266
|
+
AC_ARG_ENABLE(gmp,
|
267
|
+
[ --enable-gmp enable GMP function [[default=no]]],
|
268
|
+
[case $enableval in
|
269
|
+
yes|no) ;;
|
270
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-gmp, need yes or no]) ;;
|
271
|
+
esac],
|
272
|
+
[enable_gmp=no])
|
273
|
+
|
274
|
+
|
275
|
+
dnl ... for IBM Accurate Portable Library
|
276
|
+
AC_ARG_ENABLE(ultim,
|
277
|
+
[ --enable-ultim enable comparison with libultim, IBM's Accurate Portable Math Library [[default=no]]],
|
278
|
+
[case $enableval in
|
279
|
+
yes|no) ;;
|
280
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-ultim, need yes or no]) ;;
|
281
|
+
esac],
|
282
|
+
[enable_ultim=no])
|
283
|
+
|
284
|
+
|
285
|
+
dnl ... for Sun's libmcr
|
286
|
+
AC_ARG_ENABLE(mcr,
|
287
|
+
[ --enable-mcr enable comparison with Sun's LIBMCR [[default=no]]],
|
288
|
+
[case $enableval in
|
289
|
+
yes|no) ;;
|
290
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-mcr, need yes or no]) ;;
|
291
|
+
esac],
|
292
|
+
[enable_mcr=no])
|
293
|
+
|
294
|
+
|
295
|
+
dnl Now consider the result of the previous to set directories:
|
296
|
+
|
297
|
+
|
298
|
+
dnl ... for GMP
|
299
|
+
if test "$enable_gmp" = "yes" -o "$enable_mpfr" = "yes"; then
|
300
|
+
|
301
|
+
AC_ARG_WITH(gmp_include, [ --with-gmp-include=DIR GMP include directory ],
|
302
|
+
with_gmp_include=$withval)
|
303
|
+
AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=DIR GMP lib directory ],
|
304
|
+
with_gmp_lib=$withval)
|
305
|
+
AC_ARG_WITH(gmp, [ --with-gmp=DIR GMP directory ],
|
306
|
+
with_gmp_include=$withval/include with_gmp_lib=$withval/lib)
|
307
|
+
|
308
|
+
if test -d "$with_gmp_include"; then
|
309
|
+
CPPFLAGS="$CPPFLAGS -I$with_gmp_include"
|
310
|
+
else
|
311
|
+
with_gmp_include=
|
312
|
+
fi
|
313
|
+
AC_ADD_PATH_LIBS($with_gmp_lib, gmp)
|
314
|
+
|
315
|
+
dnl If gmp.h is found, #defines HAVE_GMP_H
|
316
|
+
AC_CHECK_HEADERS([gmp.h])
|
317
|
+
|
318
|
+
dnl If libgmp is found, adds -lgmp to LIBS
|
319
|
+
dnl correct in theory: AC_CHECK_LIB([gmp], [__gmp_fprintf])
|
320
|
+
AC_CHECK_LIB([gmp], [main])
|
321
|
+
|
322
|
+
dnl end of test for gmp
|
323
|
+
fi
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
dnl and for MPFR
|
328
|
+
|
329
|
+
if test "$enable_mpfr" = "yes"; then
|
330
|
+
AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=DIR MPFR include directory ],
|
331
|
+
with_mpfr_include=$withval)
|
332
|
+
AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=DIR MPFR lib directory ],
|
333
|
+
with_mpfr_lib=$withval)
|
334
|
+
AC_ARG_WITH(mpfr, [ --with-mpfr=DIR MPFR directory ],
|
335
|
+
with_mpfr_include=$withval/include with_mpfr_lib=$withval/lib)
|
336
|
+
|
337
|
+
if test -d "$with_mpfr_include"; then
|
338
|
+
CPPFLAGS="$CPPFLAGS -I$with_mpfr_include"
|
339
|
+
else
|
340
|
+
with_mpfr_include=
|
341
|
+
fi
|
342
|
+
AC_ADD_PATH_LIBS($with_mpfr_lib, mpfr)
|
343
|
+
|
344
|
+
|
345
|
+
dnl If mpfr.h is found, #defines HAVE_MPFR_H
|
346
|
+
dnl this line should be
|
347
|
+
dnl AC_CHECK_HEADERS([mpfr.h], [], [], [#if HAVE_GMP_H #include<gmp.h> #endif])
|
348
|
+
dnl but it doesn't work properly so we assume that gmp is installed on the system
|
349
|
+
dnl is mpfr is !!!
|
350
|
+
AC_CHECK_HEADERS([mpfr.h], [], [], [#include<gmp.h>])
|
351
|
+
|
352
|
+
dnl If MPFR is found, adds -lmpfr to LIBS
|
353
|
+
dnl correct in theory: AC_CHECK_LIB([mpfr], [mpfr_init2])
|
354
|
+
AC_CHECK_LIB([mpfr], [main])
|
355
|
+
|
356
|
+
dnl end of test for mpfr
|
357
|
+
fi
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
dnl ... for IBM
|
362
|
+
if test "$enable_ultim" = "yes"; then
|
363
|
+
|
364
|
+
AC_ARG_WITH(ultim_include, [ --with-ultim-include=DIR ULTIM include directory ],
|
365
|
+
with_ultim_include=$withval)
|
366
|
+
AC_ARG_WITH(ultim_lib, [ --with-ultim-lib=DIR ULTIM lib directory ],
|
367
|
+
with_ultim_lib=$withval)
|
368
|
+
AC_ARG_WITH(ultim, [ --with-ultim=DIR ULTIM directory ],
|
369
|
+
with_ultim_include=$withval/include with_ultim_lib=$withval/lib)
|
370
|
+
|
371
|
+
if test -d "$with_ultim_include"; then
|
372
|
+
CPPFLAGS="$CPPFLAGS -I$with_ultim_include"
|
373
|
+
else
|
374
|
+
with_ultim_include=
|
375
|
+
fi
|
376
|
+
AC_ADD_PATH_LIBS($with_ultim_lib, ultim)
|
377
|
+
|
378
|
+
AC_CHECK_HEADERS([MathLib.h])
|
379
|
+
|
380
|
+
AC_CHECK_LIB([ultim], [main])
|
381
|
+
|
382
|
+
dnl end of test for IBM libultim
|
383
|
+
fi
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
dnl ... for SUN
|
388
|
+
if test "$enable_mcr" = "yes"; then
|
389
|
+
|
390
|
+
AC_ARG_WITH(mcr_include, [ --with-mcr-include=DIR LIBMCR include directory ],
|
391
|
+
with_mcr_include=$withval)
|
392
|
+
AC_ARG_WITH(mcr_lib, [ --with-mcr-lib=DIR LIBMCR lib directory ],
|
393
|
+
with_mcr_lib=$withval)
|
394
|
+
AC_ARG_WITH(mcr, [ --with-mcr=DIR LIBMCR directory ],
|
395
|
+
with_mcr_include=$withval/include with_mcr_lib=$withval/lib)
|
396
|
+
|
397
|
+
if test -d "$with_mcr_include"; then
|
398
|
+
CPPFLAGS="$CPPFLAGS -I$with_mcr_include"
|
399
|
+
else
|
400
|
+
with_mcr_include=
|
401
|
+
fi
|
402
|
+
AC_ADD_PATH_LIBS($with_mcr_lib, mcr)
|
403
|
+
|
404
|
+
AC_CHECK_HEADERS([libmcr.h])
|
405
|
+
|
406
|
+
AC_CHECK_LIB([mcr], [main])
|
407
|
+
|
408
|
+
dnl end of test for IBM libultim
|
409
|
+
fi
|
410
|
+
|
411
|
+
|
412
|
+
#AC_CONFIG_SUBDIRS([scs_lib])
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
AC_CONFIG_FILES([Makefile scs_lib/Makefile])
|
417
|
+
AC_OUTPUT
|
418
|
+
|
419
|
+
|
@@ -0,0 +1,204 @@
|
|
1
|
+
/*
|
2
|
+
* Author : David Defour, Catherine Daramy, Florent de Dinechin, Christoph Lauter
|
3
|
+
* Contact : David.Defour@ens-lyon.fr, catherine_daramy@ens-lyon.fr
|
4
|
+
*
|
5
|
+
* This program is free software; you can redistribute it and/or modify
|
6
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
7
|
+
* the Free Software Foundation; either version 2 of the License, or
|
8
|
+
* (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
* GNU General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Lesser General Public License
|
16
|
+
* along with this program; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
18
|
+
*/
|
19
|
+
|
20
|
+
#ifndef CRLIBM_H
|
21
|
+
#define CRLIBM_H
|
22
|
+
|
23
|
+
#if defined (__cplusplus)
|
24
|
+
extern "C" {
|
25
|
+
#endif
|
26
|
+
|
27
|
+
|
28
|
+
/* An init function which sets FPU flags when needed (mostly on Intel
|
29
|
+
architectures with default double extended) */
|
30
|
+
extern unsigned long long crlibm_init(void);
|
31
|
+
|
32
|
+
/* An exit function which restores FPU flags when needed (mostly on Intel
|
33
|
+
architectures with default double extended) */
|
34
|
+
extern void crlibm_exit(unsigned long long);
|
35
|
+
|
36
|
+
|
37
|
+
/* Finished functions */
|
38
|
+
/* These functions are computed in two steps and have an average
|
39
|
+
execution time comparable to that of a standard libm
|
40
|
+
*/
|
41
|
+
|
42
|
+
/* exponential */
|
43
|
+
extern double exp_rn(double); /* to nearest */
|
44
|
+
extern double exp_rd(double); /* toward -inf */
|
45
|
+
extern double exp_ru(double); /* toward +inf */
|
46
|
+
#define exp_rz exp_rd /* toward zero */
|
47
|
+
|
48
|
+
/* logarithm */
|
49
|
+
extern double log_rn(double); /* to nearest */
|
50
|
+
extern double log_rd(double); /* toward -inf */
|
51
|
+
extern double log_ru(double); /* toward +inf */
|
52
|
+
extern double log_rz(double); /* toward zero */
|
53
|
+
|
54
|
+
/* cosine */
|
55
|
+
extern double cos_rn(double); /* to nearest */
|
56
|
+
extern double cos_rd(double); /* toward -inf */
|
57
|
+
extern double cos_ru(double); /* toward +inf */
|
58
|
+
extern double cos_rz(double); /* toward zero */
|
59
|
+
|
60
|
+
/* sine */
|
61
|
+
extern double sin_rn(double); /* to nearest */
|
62
|
+
extern double sin_rd(double); /* toward -inf */
|
63
|
+
extern double sin_ru(double); /* toward +inf */
|
64
|
+
extern double sin_rz(double); /* toward zero */
|
65
|
+
|
66
|
+
/* tangent */
|
67
|
+
extern double tan_rn(double); /* to nearest */
|
68
|
+
extern double tan_rd(double); /* toward -inf */
|
69
|
+
extern double tan_ru(double); /* toward +inf */
|
70
|
+
extern double tan_rz(double); /* toward zero */
|
71
|
+
|
72
|
+
/* cosine of pi times x */
|
73
|
+
extern double cospi_rn(double); /* to nearest */
|
74
|
+
extern double cospi_rd(double); /* toward -inf */
|
75
|
+
extern double cospi_ru(double); /* toward +inf */
|
76
|
+
extern double cospi_rz(double); /* toward zero */
|
77
|
+
|
78
|
+
/* sine of pi times x */
|
79
|
+
extern double sinpi_rn(double); /* to nearest */
|
80
|
+
extern double sinpi_rd(double); /* toward -inf */
|
81
|
+
extern double sinpi_ru(double); /* toward +inf */
|
82
|
+
extern double sinpi_rz(double); /* toward zero */
|
83
|
+
|
84
|
+
/* tangent of pi times x */
|
85
|
+
extern double tanpi_rn(double); /* to nearest */
|
86
|
+
extern double tanpi_rd(double); /* toward -inf */
|
87
|
+
extern double tanpi_ru(double); /* toward +inf */
|
88
|
+
extern double tanpi_rz(double); /* toward zero */
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
/* /\* cotangent *\/ */
|
94
|
+
/* extern double cotan_rn(double); /\* to nearest *\/ */
|
95
|
+
/* extern double cotan_rd(double); /\* toward -inf *\/ */
|
96
|
+
/* extern double cotan_ru(double); /\* toward +inf *\/ */
|
97
|
+
/* extern double cotan_rz(double); /\* toward zero *\/ */
|
98
|
+
|
99
|
+
/* arctangent */
|
100
|
+
extern double atan_rn(double); /* to nearest */
|
101
|
+
extern double atan_rd(double); /* toward -inf */
|
102
|
+
extern double atan_ru(double); /* toward +inf */
|
103
|
+
extern double atan_rz(double); /* toward zero */
|
104
|
+
|
105
|
+
/* arctangentPi */
|
106
|
+
extern double atanpi_rn(double); /* to nearest */
|
107
|
+
extern double atanpi_rd(double); /* toward -inf */
|
108
|
+
extern double atanpi_ru(double); /* toward +inf */
|
109
|
+
extern double atanpi_rz(double); /* toward zero */
|
110
|
+
|
111
|
+
/* hyperbolic cosine*/
|
112
|
+
extern double cosh_rn(double); /* to nearest */
|
113
|
+
extern double cosh_rd(double); /* toward -inf */
|
114
|
+
extern double cosh_ru(double); /* toward +inf */
|
115
|
+
extern double cosh_rz(double); /* toward zero */
|
116
|
+
|
117
|
+
/* hyperbolic sine */
|
118
|
+
extern double sinh_rn(double); /* to nearest */
|
119
|
+
extern double sinh_rd(double); /* toward -inf */
|
120
|
+
extern double sinh_ru(double); /* toward +inf */
|
121
|
+
extern double sinh_rz(double); /* toward zero */
|
122
|
+
|
123
|
+
|
124
|
+
/* base 2 logarithm */
|
125
|
+
extern double log2_rn(double); /* to nearest */
|
126
|
+
extern double log2_rd(double); /* toward -inf */
|
127
|
+
extern double log2_ru(double); /* toward +inf */
|
128
|
+
extern double log2_rz(double); /* towards zero */
|
129
|
+
|
130
|
+
/* base 10 logarithm */
|
131
|
+
extern double log10_rn(double); /* to nearest */
|
132
|
+
extern double log10_rd(double); /* toward -inf */
|
133
|
+
extern double log10_ru(double); /* toward +inf */
|
134
|
+
extern double log10_rz(double); /* towards zero */
|
135
|
+
|
136
|
+
/* arcsine */
|
137
|
+
extern double asin_rn(double); /* to nearest */
|
138
|
+
extern double asin_rd(double); /* toward -inf */
|
139
|
+
extern double asin_ru(double); /* toward +inf */
|
140
|
+
extern double asin_rz(double); /* toward zero */
|
141
|
+
|
142
|
+
/* arccosine */
|
143
|
+
extern double acos_rn(double); /* to nearest */
|
144
|
+
extern double acos_rd(double); /* toward -inf */
|
145
|
+
extern double acos_ru(double); /* toward +inf */
|
146
|
+
#define acos_rz acos_rd /* toward zero */
|
147
|
+
|
148
|
+
/* arcsine/PI */
|
149
|
+
extern double asinpi_rn(double); /* to nearest */
|
150
|
+
extern double asinpi_rd(double); /* toward -inf */
|
151
|
+
extern double asinpi_ru(double); /* toward +inf */
|
152
|
+
extern double asinpi_rz(double); /* toward zero */
|
153
|
+
|
154
|
+
/* arccosine/PI */
|
155
|
+
extern double acospi_rn(double); /* to nearest */
|
156
|
+
extern double acospi_rd(double); /* toward -inf */
|
157
|
+
extern double acospi_ru(double); /* toward +inf */
|
158
|
+
#define acospi_rz acospi_rd /* toward zero */
|
159
|
+
|
160
|
+
/* expm1 = e^x -1 */
|
161
|
+
extern double expm1_rn(double); /* to nearest */
|
162
|
+
extern double expm1_rd(double); /* toward -inf */
|
163
|
+
extern double expm1_ru(double); /* toward +inf */
|
164
|
+
extern double expm1_rz(double); /* toward zero */
|
165
|
+
|
166
|
+
/* log1p = log(1 + x) */
|
167
|
+
extern double log1p_rn(double); /* to nearest */
|
168
|
+
extern double log1p_rd(double); /* toward -inf */
|
169
|
+
extern double log1p_ru(double); /* toward +inf */
|
170
|
+
extern double log1p_rz(double); /* toward zero */
|
171
|
+
|
172
|
+
|
173
|
+
/* Unfinished functions */
|
174
|
+
/* These functions provide correct rounding but are very slow
|
175
|
+
(typically 100 times slower that the standard libm) */
|
176
|
+
|
177
|
+
extern double exp2_rn(double); /* to nearest */
|
178
|
+
extern double exp2_rd(double); /* toward -inf */
|
179
|
+
extern double exp2_ru(double); /* toward +inf */
|
180
|
+
|
181
|
+
/* pow */
|
182
|
+
/* ATTENTION: THIS FUNCTION IS UNDER DEVELOPMENT
|
183
|
+
AND CURRENTLY NOT PROVEN CORRECTLY ROUNDED FOR ALL CASES
|
184
|
+
|
185
|
+
See the documentation
|
186
|
+
|
187
|
+
*/
|
188
|
+
extern double pow_rn(double, double);
|
189
|
+
|
190
|
+
|
191
|
+
/* fi_lib-compatible interval functions (EXPERIMENTAL) */
|
192
|
+
|
193
|
+
#ifdef BUILD_INTERVAL_FUNCTIONS
|
194
|
+
#include "interval.h"
|
195
|
+
interval j_log(interval x);
|
196
|
+
interval j_exp(interval x);
|
197
|
+
#endif /* BUILD_INTERVAL_FUNCTIONS */
|
198
|
+
|
199
|
+
#if defined (__cplusplus)
|
200
|
+
|
201
|
+
}
|
202
|
+
#endif
|
203
|
+
|
204
|
+
#endif /* ifdef CRLIBM_H*/
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Summary: cr-libm, a portable, efficient, correctly rounded mathematical library.
|
2
|
+
Name: crlibm
|
3
|
+
Version: 0.8
|
4
|
+
Release: 1
|
5
|
+
License: GNU LESSER GENERAL PUBLIC LICENSE
|
6
|
+
Group: System/Mathematics
|
7
|
+
URL: http://lipforge.ens-lyon.fr/projects/crlibm
|
8
|
+
Source0: %{name}-%{version}.tar.gz
|
9
|
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
10
|
+
|
11
|
+
%description The goal of the crlibm project is to design a
|
12
|
+
mathematical library which offers proven correct rounding, with
|
13
|
+
performance and memory usage comparable to current libraries.
|
14
|
+
|
15
|
+
%prep
|
16
|
+
%setup -q
|
17
|
+
|
18
|
+
%build
|
19
|
+
%configure
|
20
|
+
make
|
21
|
+
|
22
|
+
%install
|
23
|
+
rm -rf $RPM_BUILD_ROOT
|
24
|
+
%makeinstall
|
25
|
+
|
26
|
+
%clean
|
27
|
+
rm -rf $RPM_BUILD_ROOT
|
28
|
+
|
29
|
+
%files
|
30
|
+
%defattr(-,root,root,-)
|
31
|
+
%{_bindir}/*
|
32
|
+
%{_libdir}/*
|
33
|
+
%{_includedir}/*
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
%changelog
|
39
|
+
* Thu Oct 28 2004 Philippe Defert <defert@lxcert-i386.cern.ch>
|
40
|
+
- Initial build.
|
41
|
+
|
42
|
+
|