intervals 0.3.56
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.txt +1 -0
- data/ext/crlibm/AUTHORS +2 -0
- data/ext/crlibm/COPYING +504 -0
- data/ext/crlibm/ChangeLog +80 -0
- data/ext/crlibm/INSTALL +182 -0
- data/ext/crlibm/Makefile.am +84 -0
- data/ext/crlibm/Makefile.in +530 -0
- data/ext/crlibm/NEWS +0 -0
- data/ext/crlibm/README +31 -0
- data/ext/crlibm/TODO +47 -0
- data/ext/crlibm/VERSION +1 -0
- data/ext/crlibm/aclocal.m4 +989 -0
- data/ext/crlibm/atan-itanium.c +846 -0
- data/ext/crlibm/atan-pentium.c +261 -0
- data/ext/crlibm/atan_accurate.c +244 -0
- data/ext/crlibm/atan_accurate.h +191 -0
- data/ext/crlibm/atan_fast.c +324 -0
- data/ext/crlibm/atan_fast.h +678 -0
- data/ext/crlibm/config.guess +1461 -0
- data/ext/crlibm/config.sub +1566 -0
- data/ext/crlibm/configure +7517 -0
- data/ext/crlibm/configure.ac +364 -0
- data/ext/crlibm/crlibm.h +125 -0
- data/ext/crlibm/crlibm_config.h +149 -0
- data/ext/crlibm/crlibm_config.h.in +148 -0
- data/ext/crlibm/crlibm_private.c +293 -0
- data/ext/crlibm/crlibm_private.h +658 -0
- data/ext/crlibm/csh_fast.c +631 -0
- data/ext/crlibm/csh_fast.h +771 -0
- data/ext/crlibm/double-extended.h +496 -0
- data/ext/crlibm/exp-td.c +962 -0
- data/ext/crlibm/exp-td.h +685 -0
- data/ext/crlibm/exp_accurate.c +197 -0
- data/ext/crlibm/exp_accurate.h +85 -0
- data/ext/crlibm/gappa/log-de-E0-logir0.gappa +106 -0
- data/ext/crlibm/gappa/log-de-E0.gappa +79 -0
- data/ext/crlibm/gappa/log-de.gappa +81 -0
- data/ext/crlibm/gappa/log-td-E0-logir0.gappa +126 -0
- data/ext/crlibm/gappa/log-td-E0.gappa +143 -0
- data/ext/crlibm/gappa/log-td-accurate-E0-logir0.gappa +230 -0
- data/ext/crlibm/gappa/log-td-accurate-E0.gappa +213 -0
- data/ext/crlibm/gappa/log-td-accurate.gappa +217 -0
- data/ext/crlibm/gappa/log-td.gappa +156 -0
- data/ext/crlibm/gappa/trigoSinCosCase3.gappa +204 -0
- data/ext/crlibm/gappa/trigoTanCase2.gappa +73 -0
- data/ext/crlibm/install-sh +269 -0
- data/ext/crlibm/log-de.c +431 -0
- data/ext/crlibm/log-de.h +732 -0
- data/ext/crlibm/log-td.c +852 -0
- data/ext/crlibm/log-td.h +819 -0
- data/ext/crlibm/log10-td.c +906 -0
- data/ext/crlibm/log10-td.h +823 -0
- data/ext/crlibm/log2-td.c +935 -0
- data/ext/crlibm/log2-td.h +821 -0
- data/ext/crlibm/maple/atan.mpl +359 -0
- data/ext/crlibm/maple/common-procedures.mpl +997 -0
- data/ext/crlibm/maple/csh.mpl +446 -0
- data/ext/crlibm/maple/double-extended.mpl +151 -0
- data/ext/crlibm/maple/exp-td.mpl +195 -0
- data/ext/crlibm/maple/log-de.mpl +243 -0
- data/ext/crlibm/maple/log-td.mpl +316 -0
- data/ext/crlibm/maple/log10-td.mpl +345 -0
- data/ext/crlibm/maple/log2-td.mpl +334 -0
- data/ext/crlibm/maple/trigo.mpl +728 -0
- data/ext/crlibm/maple/triple-double.mpl +58 -0
- data/ext/crlibm/missing +198 -0
- data/ext/crlibm/mkinstalldirs +40 -0
- data/ext/crlibm/rem_pio2_accurate.c +219 -0
- data/ext/crlibm/rem_pio2_accurate.h +53 -0
- data/ext/crlibm/scs_lib/AUTHORS +3 -0
- data/ext/crlibm/scs_lib/COPYING +504 -0
- data/ext/crlibm/scs_lib/ChangeLog +16 -0
- data/ext/crlibm/scs_lib/INSTALL +215 -0
- data/ext/crlibm/scs_lib/Makefile.am +18 -0
- data/ext/crlibm/scs_lib/Makefile.in +328 -0
- data/ext/crlibm/scs_lib/NEWS +0 -0
- data/ext/crlibm/scs_lib/README +9 -0
- data/ext/crlibm/scs_lib/TODO +4 -0
- data/ext/crlibm/scs_lib/addition_scs.c +623 -0
- data/ext/crlibm/scs_lib/config.guess +1461 -0
- data/ext/crlibm/scs_lib/config.sub +1566 -0
- data/ext/crlibm/scs_lib/configure +6226 -0
- data/ext/crlibm/scs_lib/division_scs.c +110 -0
- data/ext/crlibm/scs_lib/double2scs.c +174 -0
- data/ext/crlibm/scs_lib/install-sh +269 -0
- data/ext/crlibm/scs_lib/missing +198 -0
- data/ext/crlibm/scs_lib/mkinstalldirs +40 -0
- data/ext/crlibm/scs_lib/multiplication_scs.c +456 -0
- data/ext/crlibm/scs_lib/poly_fct.c +112 -0
- data/ext/crlibm/scs_lib/print_scs.c +73 -0
- data/ext/crlibm/scs_lib/rand_scs.c +63 -0
- data/ext/crlibm/scs_lib/scs.h +353 -0
- data/ext/crlibm/scs_lib/scs2double.c +391 -0
- data/ext/crlibm/scs_lib/scs2mpf.c +58 -0
- data/ext/crlibm/scs_lib/scs2mpfr.c +61 -0
- data/ext/crlibm/scs_lib/scs_private.c +23 -0
- data/ext/crlibm/scs_lib/scs_private.h +133 -0
- data/ext/crlibm/scs_lib/tests/tbx_timing.h +102 -0
- data/ext/crlibm/scs_lib/wrapper_scs.h +486 -0
- data/ext/crlibm/scs_lib/zero_scs.c +52 -0
- data/ext/crlibm/stamp-h.in +1 -0
- data/ext/crlibm/tests/Makefile.am +43 -0
- data/ext/crlibm/tests/Makefile.in +396 -0
- data/ext/crlibm/tests/blind_test.c +148 -0
- data/ext/crlibm/tests/generate_test_vectors.c +258 -0
- data/ext/crlibm/tests/soak_test.c +334 -0
- data/ext/crlibm/tests/test_common.c +627 -0
- data/ext/crlibm/tests/test_common.h +28 -0
- data/ext/crlibm/tests/test_perf.c +570 -0
- data/ext/crlibm/tests/test_val.c +249 -0
- data/ext/crlibm/trigo_accurate.c +500 -0
- data/ext/crlibm/trigo_accurate.h +331 -0
- data/ext/crlibm/trigo_fast.c +1219 -0
- data/ext/crlibm/trigo_fast.h +639 -0
- data/ext/crlibm/triple-double.h +878 -0
- data/ext/extconf.rb +31 -0
- data/ext/fpu.c +107 -0
- data/ext/jamis-mod.rb +591 -0
- data/lib/fpu.rb +287 -0
- data/lib/interval.rb +1170 -0
- data/lib/intervals.rb +212 -0
- data/lib/struct_float.rb +133 -0
- data/test/data_atan.txt +360 -0
- data/test/data_cos.txt +346 -0
- data/test/data_cosh.txt +3322 -0
- data/test/data_exp.txt +3322 -0
- data/test/data_log.txt +141 -0
- data/test/data_sin.txt +140 -0
- data/test/data_sinh.txt +3322 -0
- data/test/data_tan.txt +342 -0
- metadata +186 -0
@@ -0,0 +1,364 @@
|
|
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
|
+
AM_CONFIG_HEADER(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*)
|
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([exp_accurate.c])
|
48
|
+
AC_PROG_MAKE_SET
|
49
|
+
|
50
|
+
dnl Check for compiler
|
51
|
+
|
52
|
+
AC_PROG_CC(gcc-3.3 gcc-3.2 gcc icc cc)
|
53
|
+
|
54
|
+
# Try to set compiler flags to get floating point arithmetics
|
55
|
+
# to work
|
56
|
+
#
|
57
|
+
if test "${GCC}" != "yes" ; then
|
58
|
+
case "${build}" in
|
59
|
+
*-*-hpux* )
|
60
|
+
CFLAGS="${CFLAGS} -Wp,-H30000"
|
61
|
+
;;
|
62
|
+
*-dec-osf* )
|
63
|
+
CFLAGS="${CFLAGS} -ieee"
|
64
|
+
;;
|
65
|
+
*-apple-darwin* )
|
66
|
+
CFLAGS="${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
|
+
CFLAGS="${CFLAGS} -wd269"
|
76
|
+
;;
|
77
|
+
* )
|
78
|
+
case "${build}" in
|
79
|
+
*-dec-osf* )
|
80
|
+
CFLAGS="${CFLAGS} -mieee -Wall"
|
81
|
+
;;
|
82
|
+
*alpha*-*-linux* )
|
83
|
+
CFLAGS="${CFLAGS} -mieee -Wall"
|
84
|
+
;;
|
85
|
+
*alpha*-*-freebsd* )
|
86
|
+
CFLAGS="${CFLAGS} -mieee -Wall"
|
87
|
+
;;
|
88
|
+
*-apple-darwin* )
|
89
|
+
CFLAGS="${CFLAGS} -fno-common -Wall"
|
90
|
+
;;
|
91
|
+
* )
|
92
|
+
CFLAGS="${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_AWK
|
112
|
+
AC_PROG_LN_S
|
113
|
+
|
114
|
+
dnl Checks for standard C stuff.
|
115
|
+
AC_HEADER_STDC
|
116
|
+
AC_FUNC_MALLOC
|
117
|
+
AC_C_CONST
|
118
|
+
AC_C_INLINE
|
119
|
+
|
120
|
+
|
121
|
+
AC_CHECK_FUNCS([sqrt])
|
122
|
+
AC_CHECK_HEADERS([fenv.h])
|
123
|
+
AC_CHECK_HEADERS([float.h])
|
124
|
+
|
125
|
+
dnl adds -lm
|
126
|
+
AC_CHECK_LIB([m], [log])
|
127
|
+
|
128
|
+
dnl Other checks
|
129
|
+
AC_C_BIGENDIAN(,,)
|
130
|
+
dnl defines WORDS_BIGENDIAN, or not
|
131
|
+
|
132
|
+
AC_C_LONG_DOUBLE
|
133
|
+
dnl defines HAVE_LONG_DOUBLE, or not
|
134
|
+
|
135
|
+
|
136
|
+
AC_CHECK_SIZEOF(int)
|
137
|
+
dnl defines SIZEOF_INT to be the size in bytes of int
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
dnl All the rest is related to MPFR and to Ziv's lib, useful for testing.
|
144
|
+
|
145
|
+
dnl Sometimes the following function is provided by aclocal, sometimes not.
|
146
|
+
dnl Copying it here is probably a bad way of managing this problem
|
147
|
+
AC_DEFUN(AC_ADD_PATH_LIBS,
|
148
|
+
[
|
149
|
+
if ` test "$1" `
|
150
|
+
then
|
151
|
+
AC_MSG_CHECKING($2 library)
|
152
|
+
if test -r "$1/lib$2.a" -o -r "$1/lib$2.so"
|
153
|
+
then
|
154
|
+
LDFLAGS="$LDFLAGS -L$1"
|
155
|
+
LIBS ="$LIBS -l$2"
|
156
|
+
else
|
157
|
+
AC_MSG_ERROR($2 not found)
|
158
|
+
fi
|
159
|
+
AC_MSG_RESULT(yes)
|
160
|
+
else
|
161
|
+
AC_CHECK_LIB($2, main, , AC_MSG_ERROR($2 not found))
|
162
|
+
fi
|
163
|
+
]
|
164
|
+
)
|
165
|
+
|
166
|
+
dnl Command-line arguments to ./configure:
|
167
|
+
|
168
|
+
|
169
|
+
dnl A switch to disable use of double-extended optimised version
|
170
|
+
AC_ARG_ENABLE(double-extended,
|
171
|
+
[ --enable-double-extended enable double-extended optimised versions of functions if hardware supports it [[default=yes]]],
|
172
|
+
[case $enableval in
|
173
|
+
yes|no) ;;
|
174
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-double-extended, need yes or no]) ;;
|
175
|
+
esac],
|
176
|
+
[enable_double_extended=yes])
|
177
|
+
|
178
|
+
dnl following line needs a little bit more work on log-de.c and double-extended.h
|
179
|
+
dnl AM_CONDITIONAL(USE_HARDWARE_DE, test x$has_ia32_de = xtrue -a x$enable_double_extended = xyes -o x$has_ia64_de = xtrue -a x$CC = xicc -a x$enable_double_extended = xyes )
|
180
|
+
AM_CONDITIONAL(USE_HARDWARE_DE, test x$has_ia32_de = xtrue -a x$enable_double_extended = xyes )
|
181
|
+
|
182
|
+
dnl If at some point we wish to include SPARC optimization back,
|
183
|
+
dnl the default should take the value 10 and 25 in this case
|
184
|
+
dnl for around 200 bits of precision
|
185
|
+
|
186
|
+
AC_ARG_ENABLE(nbdigits,
|
187
|
+
[ --enable-nbdigits=N set the number of digits in the SCS structure to N [[default=8]] ],
|
188
|
+
[case $enableval in
|
189
|
+
*[[0-9]]) AC_DEFINE_UNQUOTED(SCS_NB_WORDS, $enableval, [Number of digits in the SCS structure]);;
|
190
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-nbdigits, number expected]) ;;
|
191
|
+
esac],
|
192
|
+
[AC_DEFINE_UNQUOTED(SCS_NB_WORDS, 8, [Number of digits in the SCS structure])]
|
193
|
+
)
|
194
|
+
|
195
|
+
AC_ARG_ENABLE(digitsize,
|
196
|
+
[ --enable-digitsize=N set the size of a digit to N bits [[default=30]] ],
|
197
|
+
[case $enableval in
|
198
|
+
*[[0-9]]) AC_DEFINE_UNQUOTED(SCS_NB_BITS, $enableval, [Size of an SCS digit]);;
|
199
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-digitsize, number expected]) ;;
|
200
|
+
esac],
|
201
|
+
[AC_DEFINE_UNQUOTED(SCS_NB_BITS, 30, [Size of an SCS digit])]
|
202
|
+
)
|
203
|
+
|
204
|
+
|
205
|
+
dnl ... for MPFR
|
206
|
+
AC_ARG_ENABLE(mpfr, [ --enable-mpfr enable MPFR function [[default=no]]],
|
207
|
+
[case $enableval in
|
208
|
+
yes|no) ;;
|
209
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-mpfr, need yes or no]) ;;
|
210
|
+
esac],
|
211
|
+
[enable_mpfr=no])
|
212
|
+
|
213
|
+
|
214
|
+
dnl ... for GMP
|
215
|
+
AC_ARG_ENABLE(gmp, [ --enable-gmp enable GMP function [[default=no]]],
|
216
|
+
[case $enableval in
|
217
|
+
yes|no) ;;
|
218
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-gmp, need yes or no]) ;;
|
219
|
+
esac],
|
220
|
+
[enable_gmp=no])
|
221
|
+
|
222
|
+
|
223
|
+
dnl ... for IBM Accurate Portable Library
|
224
|
+
AC_ARG_ENABLE(ultim, [ --enable-ultim enable libultim, IBM's Accurate Portable Math Library [[default=no]]],
|
225
|
+
[case $enableval in
|
226
|
+
yes|no) ;;
|
227
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-ultim, need yes or no]) ;;
|
228
|
+
esac],
|
229
|
+
[enable_ultim=no])
|
230
|
+
|
231
|
+
|
232
|
+
dnl ... for Sun's libmcr
|
233
|
+
AC_ARG_ENABLE(mcr, [ --enable-mcr enable Sun's LIBMCR [[default=no]]],
|
234
|
+
[case $enableval in
|
235
|
+
yes|no) ;;
|
236
|
+
*) AC_MSG_ERROR([bad value $enableval for --enable-mcr, need yes or no]) ;;
|
237
|
+
esac],
|
238
|
+
[enable_mcr=no])
|
239
|
+
|
240
|
+
|
241
|
+
dnl Now consider the result of the previous to set directories:
|
242
|
+
|
243
|
+
|
244
|
+
dnl ... for GMP
|
245
|
+
if test "$enable_gmp" = "yes" -o "$enable_mpfr" = "yes"; then
|
246
|
+
|
247
|
+
AC_ARG_WITH(gmp_include, [ --with-gmp-include=DIR GMP include directory ],
|
248
|
+
with_gmp_include=$withval)
|
249
|
+
AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=DIR GMP lib directory ],
|
250
|
+
with_gmp_lib=$withval)
|
251
|
+
AC_ARG_WITH(gmp, [ --with-gmp=DIR GMP directory ],
|
252
|
+
with_gmp_include=$withval/include with_gmp_lib=$withval/lib)
|
253
|
+
|
254
|
+
if test -d "$with_gmp_include"; then
|
255
|
+
CPPFLAGS="$CPPFLAGS -I$with_gmp_include"
|
256
|
+
else
|
257
|
+
with_gmp_include=
|
258
|
+
fi
|
259
|
+
AC_ADD_PATH_LIBS($with_gmp_lib, gmp)
|
260
|
+
|
261
|
+
dnl If gmp.h is found, #defines HAVE_GMP_H
|
262
|
+
AC_CHECK_HEADERS([gmp.h])
|
263
|
+
|
264
|
+
dnl If libgmp is found, adds -lgmp to LIBS
|
265
|
+
dnl correct in theory: AC_CHECK_LIB([gmp], [__gmp_fprintf])
|
266
|
+
AC_CHECK_LIB([gmp], [main])
|
267
|
+
|
268
|
+
dnl end of test for gmp
|
269
|
+
fi
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
dnl and for MPFR
|
274
|
+
|
275
|
+
if test "$enable_mpfr" = "yes"; then
|
276
|
+
AC_ARG_WITH(mpfr_include, [ --with-mpfr-include=DIR MPFR include directory ],
|
277
|
+
with_mpfr_include=$withval)
|
278
|
+
AC_ARG_WITH(mpfr_lib, [ --with-mpfr-lib=DIR MPFR lib directory ],
|
279
|
+
with_mpfr_lib=$withval)
|
280
|
+
AC_ARG_WITH(mpfr, [ --with-mpfr=DIR MPFR directory ],
|
281
|
+
with_mpfr_include=$withval/include with_mpfr_lib=$withval/lib)
|
282
|
+
|
283
|
+
if test -d "$with_mpfr_include"; then
|
284
|
+
CPPFLAGS="$CPPFLAGS -I$with_mpfr_include"
|
285
|
+
else
|
286
|
+
with_mpfr_include=
|
287
|
+
fi
|
288
|
+
AC_ADD_PATH_LIBS($with_mpfr_lib, mpfr)
|
289
|
+
|
290
|
+
|
291
|
+
dnl If mpfr.h is found, #defines HAVE_MPFR_H
|
292
|
+
dnl this line should be
|
293
|
+
dnl AC_CHECK_HEADERS([mpfr.h], [], [], [#if HAVE_GMP_H #include<gmp.h> #endif])
|
294
|
+
dnl but it doesn't work properly so we assume that gmp is installed on the system
|
295
|
+
dnl is mpfr is !!!
|
296
|
+
AC_CHECK_HEADERS([mpfr.h], [], [], [#include<gmp.h>])
|
297
|
+
|
298
|
+
dnl If MPFR is found, adds -lmpfr to LIBS
|
299
|
+
dnl correct in theory: AC_CHECK_LIB([mpfr], [mpfr_init2])
|
300
|
+
AC_CHECK_LIB([mpfr], [main])
|
301
|
+
|
302
|
+
dnl end of test for mpfr
|
303
|
+
fi
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
dnl ... for IBM
|
308
|
+
if test "$enable_ultim" = "yes"; then
|
309
|
+
|
310
|
+
AC_ARG_WITH(ultim_include, [ --with-ultim-include=DIR ULTIM include directory ],
|
311
|
+
with_ultim_include=$withval)
|
312
|
+
AC_ARG_WITH(ultim_lib, [ --with-ultim-lib=DIR ULTIM lib directory ],
|
313
|
+
with_ultim_lib=$withval)
|
314
|
+
AC_ARG_WITH(ultim, [ --with-ultim=DIR ULTIM directory ],
|
315
|
+
with_ultim_include=$withval/include with_ultim_lib=$withval/lib)
|
316
|
+
|
317
|
+
if test -d "$with_ultim_include"; then
|
318
|
+
CPPFLAGS="$CPPFLAGS -I$with_ultim_include"
|
319
|
+
else
|
320
|
+
with_ultim_include=
|
321
|
+
fi
|
322
|
+
AC_ADD_PATH_LIBS($with_ultim_lib, ultim)
|
323
|
+
|
324
|
+
AC_CHECK_HEADERS([MathLib.h])
|
325
|
+
|
326
|
+
AC_CHECK_LIB([ultim], [main])
|
327
|
+
|
328
|
+
dnl end of test for IBM libultim
|
329
|
+
fi
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
dnl ... for SUN
|
334
|
+
if test "$enable_mcr" = "yes"; then
|
335
|
+
|
336
|
+
AC_ARG_WITH(mcr_include, [ --with-mcr-include=DIR LIBMCR include directory ],
|
337
|
+
with_mcr_include=$withval)
|
338
|
+
AC_ARG_WITH(mcr_lib, [ --with-mcr-lib=DIR LIBMCR lib directory ],
|
339
|
+
with_mcr_lib=$withval)
|
340
|
+
AC_ARG_WITH(mcr, [ --with-mcr=DIR LIBMCR directory ],
|
341
|
+
with_mcr_include=$withval/include with_mcr_lib=$withval/lib)
|
342
|
+
|
343
|
+
if test -d "$with_mcr_include"; then
|
344
|
+
CPPFLAGS="$CPPFLAGS -I$with_mcr_include"
|
345
|
+
else
|
346
|
+
with_mcr_include=
|
347
|
+
fi
|
348
|
+
AC_ADD_PATH_LIBS($with_mcr_lib, mcr)
|
349
|
+
|
350
|
+
AC_CHECK_HEADERS([libmcr.h])
|
351
|
+
|
352
|
+
AC_CHECK_LIB([mcr], [main])
|
353
|
+
|
354
|
+
dnl end of test for IBM libultim
|
355
|
+
fi
|
356
|
+
|
357
|
+
|
358
|
+
#AC_CONFIG_SUBDIRS([scs_lib])
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
AC_OUTPUT(Makefile tests/Makefile scs_lib/Makefile)
|
363
|
+
|
364
|
+
|
data/ext/crlibm/crlibm.h
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
/*
|
2
|
+
* Author : David Defour, Catherine Daramy, Florent de Dinechin
|
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
|
+
|
73
|
+
/* cotangent */
|
74
|
+
extern double cotan_rn(double); /* to nearest */
|
75
|
+
extern double cotan_rd(double); /* toward -inf */
|
76
|
+
extern double cotan_ru(double); /* toward +inf */
|
77
|
+
extern double cotan_rz(double); /* toward zero */
|
78
|
+
|
79
|
+
/* arctangent */
|
80
|
+
extern double atan_rn(double); /* to nearest */
|
81
|
+
extern double atan_rd(double); /* toward -inf */
|
82
|
+
extern double atan_ru(double); /* toward +inf */
|
83
|
+
extern double atan_rz(double); /* toward zero */
|
84
|
+
|
85
|
+
/* hyperbolic cosine*/
|
86
|
+
extern double cosh_rn(double); /* to nearest */
|
87
|
+
extern double cosh_rd(double); /* toward -inf */
|
88
|
+
extern double cosh_ru(double); /* toward +inf */
|
89
|
+
extern double cosh_rz(double); /* toward zero */
|
90
|
+
|
91
|
+
/* hyperbolic sine */
|
92
|
+
extern double sinh_rn(double); /* to nearest */
|
93
|
+
extern double sinh_rd(double); /* toward -inf */
|
94
|
+
extern double sinh_ru(double); /* toward +inf */
|
95
|
+
extern double sinh_rz(double); /* toward zero */
|
96
|
+
|
97
|
+
/* pow */
|
98
|
+
extern double pow_rn(double, double); /* to nearest */
|
99
|
+
|
100
|
+
|
101
|
+
/* Unfinished functions */
|
102
|
+
/* These functions provide correct rounding but are very slow
|
103
|
+
(typically 100 times slower that the standard libm) */
|
104
|
+
|
105
|
+
|
106
|
+
extern double exp2_rn(double); /* to nearest */
|
107
|
+
extern double exp2_rd(double); /* toward -inf */
|
108
|
+
extern double exp2_ru(double); /* toward +inf */
|
109
|
+
|
110
|
+
|
111
|
+
extern double log2_rn(double); /* to nearest */
|
112
|
+
extern double log2_rd(double); /* toward -inf */
|
113
|
+
extern double log2_ru(double); /* toward +inf */
|
114
|
+
extern double log2_rz(double); /* towards zero */
|
115
|
+
|
116
|
+
extern double log10_rn(double); /* to nearest */
|
117
|
+
extern double log10_rd(double); /* toward -inf */
|
118
|
+
extern double log10_ru(double); /* toward +inf */
|
119
|
+
extern double log10_rz(double); /* towards zero */
|
120
|
+
|
121
|
+
#if defined (__cplusplus)
|
122
|
+
}
|
123
|
+
#endif
|
124
|
+
|
125
|
+
#endif /* ifdef CRLIBM_H*/
|
@@ -0,0 +1,149 @@
|
|
1
|
+
/* crlibm_config.h. Generated by configure. */
|
2
|
+
/* crlibm_config.h.in. Generated from configure.ac by autoheader. */
|
3
|
+
|
4
|
+
/* Processor type */
|
5
|
+
/* #undef CRLIBM_TYPECPU_ALPHA */
|
6
|
+
|
7
|
+
/* Processor type */
|
8
|
+
/* #undef CRLIBM_TYPECPU_AMD64 */
|
9
|
+
|
10
|
+
/* Processor type */
|
11
|
+
/* #undef CRLIBM_TYPECPU_ITANIUM */
|
12
|
+
|
13
|
+
/* Processor type */
|
14
|
+
#define CRLIBM_TYPECPU_POWERPC 1
|
15
|
+
|
16
|
+
/* Processor type */
|
17
|
+
/* #undef CRLIBM_TYPECPU_SPARC */
|
18
|
+
|
19
|
+
/* Processor type */
|
20
|
+
/* #undef CRLIBM_TYPECPU_X86 */
|
21
|
+
|
22
|
+
/* OS type */
|
23
|
+
/* #undef CRLIBM_TYPEOS_BSD */
|
24
|
+
|
25
|
+
/* OS type */
|
26
|
+
/* #undef CRLIBM_TYPEOS_CYGWIN */
|
27
|
+
|
28
|
+
/* OS type */
|
29
|
+
/* #undef CRLIBM_TYPEOS_HPUX */
|
30
|
+
|
31
|
+
/* Define to 1 if you have the <fenv.h> header file. */
|
32
|
+
#define HAVE_FENV_H 1
|
33
|
+
|
34
|
+
/* Define to 1 if you have the <float.h> header file. */
|
35
|
+
#define HAVE_FLOAT_H 1
|
36
|
+
|
37
|
+
/* Define to 1 if you have the <gmp.h> header file. */
|
38
|
+
/* #undef HAVE_GMP_H */
|
39
|
+
|
40
|
+
/* Define to 1 if you have the <inttypes.h> header file. */
|
41
|
+
#define HAVE_INTTYPES_H 1
|
42
|
+
|
43
|
+
/* Define to 1 if you have the `gmp' library (-lgmp). */
|
44
|
+
/* #undef HAVE_LIBGMP */
|
45
|
+
|
46
|
+
/* Define to 1 if you have the `m' library (-lm). */
|
47
|
+
#define HAVE_LIBM 1
|
48
|
+
|
49
|
+
/* Define to 1 if you have the `mcr' library (-lmcr). */
|
50
|
+
/* #undef HAVE_LIBMCR */
|
51
|
+
|
52
|
+
/* Define to 1 if you have the <libmcr.h> header file. */
|
53
|
+
/* #undef HAVE_LIBMCR_H */
|
54
|
+
|
55
|
+
/* Define to 1 if you have the `mpfr' library (-lmpfr). */
|
56
|
+
/* #undef HAVE_LIBMPFR */
|
57
|
+
|
58
|
+
/* Define to 1 if you have the `ultim' library (-lultim). */
|
59
|
+
/* #undef HAVE_LIBULTIM */
|
60
|
+
|
61
|
+
/* Define to 1 if long double works and has more range or precision than
|
62
|
+
double. */
|
63
|
+
/* #undef HAVE_LONG_DOUBLE */
|
64
|
+
|
65
|
+
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
66
|
+
to 0 otherwise. */
|
67
|
+
#define HAVE_MALLOC 1
|
68
|
+
|
69
|
+
/* Define to 1 if you have the <MathLib.h> header file. */
|
70
|
+
/* #undef HAVE_MATHLIB_H */
|
71
|
+
|
72
|
+
/* Define to 1 if you have the <memory.h> header file. */
|
73
|
+
#define HAVE_MEMORY_H 1
|
74
|
+
|
75
|
+
/* Define to 1 if you have the <mpfr.h> header file. */
|
76
|
+
/* #undef HAVE_MPFR_H */
|
77
|
+
|
78
|
+
/* Define to 1 if you have the `sqrt' function. */
|
79
|
+
#define HAVE_SQRT 1
|
80
|
+
|
81
|
+
/* Define to 1 if you have the <stdint.h> header file. */
|
82
|
+
#define HAVE_STDINT_H 1
|
83
|
+
|
84
|
+
/* Define to 1 if you have the <stdlib.h> header file. */
|
85
|
+
#define HAVE_STDLIB_H 1
|
86
|
+
|
87
|
+
/* Define to 1 if you have the <strings.h> header file. */
|
88
|
+
#define HAVE_STRINGS_H 1
|
89
|
+
|
90
|
+
/* Define to 1 if you have the <string.h> header file. */
|
91
|
+
#define HAVE_STRING_H 1
|
92
|
+
|
93
|
+
/* Define to 1 if you have the <sys/stat.h> header file. */
|
94
|
+
#define HAVE_SYS_STAT_H 1
|
95
|
+
|
96
|
+
/* Define to 1 if you have the <sys/types.h> header file. */
|
97
|
+
#define HAVE_SYS_TYPES_H 1
|
98
|
+
|
99
|
+
/* Define to 1 if you have the <unistd.h> header file. */
|
100
|
+
#define HAVE_UNISTD_H 1
|
101
|
+
|
102
|
+
/* Name of package */
|
103
|
+
#define PACKAGE "crlibm"
|
104
|
+
|
105
|
+
/* Define to the address where bug reports for this package should be sent. */
|
106
|
+
#define PACKAGE_BUGREPORT ""
|
107
|
+
|
108
|
+
/* Define to the full name of this package. */
|
109
|
+
#define PACKAGE_NAME ""
|
110
|
+
|
111
|
+
/* Define to the full name and version of this package. */
|
112
|
+
#define PACKAGE_STRING ""
|
113
|
+
|
114
|
+
/* Define to the one symbol short name of this package. */
|
115
|
+
#define PACKAGE_TARNAME ""
|
116
|
+
|
117
|
+
/* Define to the version of this package. */
|
118
|
+
#define PACKAGE_VERSION ""
|
119
|
+
|
120
|
+
/* Size of an SCS digit */
|
121
|
+
#define SCS_NB_BITS 30
|
122
|
+
|
123
|
+
/* Number of digits in the SCS structure */
|
124
|
+
#define SCS_NB_WORDS 8
|
125
|
+
|
126
|
+
/* The size of a `int', as computed by sizeof. */
|
127
|
+
#define SIZEOF_INT 4
|
128
|
+
|
129
|
+
/* Define to 1 if you have the ANSI C header files. */
|
130
|
+
#define STDC_HEADERS 1
|
131
|
+
|
132
|
+
/* Version number of package */
|
133
|
+
#define VERSION "0.10beta"
|
134
|
+
|
135
|
+
/* Define to 1 if your processor stores words with the most significant byte
|
136
|
+
first (like Motorola and SPARC, unlike Intel and VAX). */
|
137
|
+
#define WORDS_BIGENDIAN 1
|
138
|
+
|
139
|
+
/* Define to empty if `const' does not conform to ANSI C. */
|
140
|
+
/* #undef const */
|
141
|
+
|
142
|
+
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
143
|
+
calls it, or to nothing if 'inline' is not supported under any name. */
|
144
|
+
#ifndef __cplusplus
|
145
|
+
/* #undef inline */
|
146
|
+
#endif
|
147
|
+
|
148
|
+
/* Define to rpl_malloc if the replacement function should be used. */
|
149
|
+
/* #undef malloc */
|