Go to main content
Oracle® Developer Studio 12.5: Numerical Computation Guide

Exit Print View

Updated: June 2016
 
 

3.2 Oracle Developer Studio Math Libraries

This section describes the math libraries that are included with the Oracle Developer Studio compilers.

The default base installation directory for Oracle Developer Studio 12.5 is /opt/developerstudio12.5 on Oracle Solaris and /opt/oracle/developerstudio12.5 on Linux. However, you can specify a different base installation directory install-dir during installation.

Oracle Developer Studio static 32-bit libraries are installed by default in the directory install-dir/lib/compilers and its subdirectories. Static 64-bit libraries are installed in install-dir/lib/compilers/sparcv9 on SPARC and install-dir/lib/compilers/amd64 on x86.

This Numerical Computation Guide also describes the shared libm and libmvec libraries, which are available for Oracle Solaris only and are installed in /usr/lib for 32-bit versions and /usr/lib/64 for 64-bit versions.

The math.h and sunmath.h library header files are installed in /usr/include for Oracle Solaris. The math.h library header file is installed in install-dir/lib/compilers/include/cc for Linux.

The subdirectories of your Oracle Developer Studio install-dir for static archives, shared objects, and include files are subject to change from release to release.

3.2.1 Oracle Math Library

The libsunmath math library contains functions that are not specified by any standard but are useful in numerical software. It also contains many of the functions that are in libm.so.2 but not in libm.so.1. libsunmath is provided as both a shared object and a static archive.

Table 16 lists the functions in libsunmath that are not in libm.so.2. For each mathematical function, the table gives only the name of the double precision version of the function as it would be called from a C program.

Table 16  Contents of libsunmath
Type
Function Name
Elementary transcendental functions
exp10
Trigonometric functions in degrees
asind, acosd, atand, atan2d, sind, cosd, sincosd, tand
Trigonometric functions scaled in ??
asinpi, acospi, atanpi, atan2pi, sinpi, cospi, sincospi, tanpi
Trigonometric functions with double precision ?? argument reduction
asinp, acosp, atanp,sinp, cosp, sincosp, tanp
Financial functions
annuity, compound
Integral rounding functions
aint, anint, irint, nint
IEEE standard recommended functions
signbit
IEEE classification functions
fp_class, isinf, isnormal, issubnormal, iszero
Functions that supply useful IEEE values
min_subnormal, max_subnormal, min_normal, max_normal, infinity, signaling_nan, quiet_nan
Additive random number generators
i_addran_, i_addrans_, i_init_addrans_, i_get_addrans_, i_set_addrans_, r_addran_, r_addrans_, r_init_addrans_, r_get_addrans_, r_set_addrans_, d_addran_, d_addrans_, d_init_addrans_, d_get_addrans_, d_set_addrans_, u_addrans_
Linear congruential random number generators
i_lcran_, i_lcrans_, i_init_lcrans_, i_get_lcrans_, i_set_lcrans_, r_lcran_, r_lcrans_, d_lcran_, d_lcrans_, u_lcrans_
Multiply-with-carry random number generators
i_mwcran_, i_mwcrans_, i_init_mwcrans_, i_get_mwcrans_, i_set_mwcrans, i_lmwcran_, i_lmwcrans_, i_llmwcran_, i_llmwcrans_, u_mwcran_, u_mwcrans_, u_lmwcran_, u_lmwcrans, u_llmwcran_, u_llmwcrans_, r_mwcran_, r_mwcrans_, d_mwcran_, d_mwcrans_, smwcran_
Random number shufflers
i_shufrans_, r_shufrans_, d_shufrans_, u_shufrans_
Data conversion
convert_external
Control rounding mode and floating-point exception flags
ieee_flags
Floating-point trap handling
ieee_handler, sigfpe
Show status
ieee_retrospective
Enable/disable nonstandard arithmetic
standard_arithmetic, nonstandard_arithmetic

3.2.2 Optimized Libraries

The libmopt library provides faster versions of some of the functions in libm and libsunmath. libmopt is provided as a static archive only. The routines contained in libmopt replace corresponding routines in libm. Typically, the libmopt versions are noticeably faster. Unlike the libm versions, however, which support any of ANSI/POSIX®, SVID, X/Open, or C99/IEEE-style treatment of exceptional cases, the libmopt routines only support C99/IEEE-style handling of these cases. (See Standards Compliance.) Also, while all mathematical functions in libm deliver results with reasonable accuracy regardless of the floating-point rounding direction mode, the result of calling any function in libmopt with a rounding direction other than round-to-nearest is undefined. A program that uses libmopt must ensure that the default round-to-nearest mode is in effect whenever any standard math function is called. To link a program with libmopt, use the –xlibmopt flag.