Siddhesh Poyarekar
1cadc85813
Fix sign of input to bsloww1 (BZ #16623 )
...
In 84ba214c
, I removed some redundant sign computations and in the
process, I incorrectly got rid of a temporary variable, thus passing
the absolute value of the input to bsloww1. This caused #16623 .
This fix undoes the incorrect change.
2014-02-27 21:12:09 +05:30
Ondřej Bílka
a1ffb40e32
Use glibc_likely instead __builtin_expect.
2014-02-10 15:07:12 +01:00
Allan McRae
d4697bc93d
Update copyright notices with scripts/update-copyrights
2014-01-01 22:00:23 +10:00
Allan McRae
6c9642eda6
Fix typo in csloww()
...
An incorrect variable name was used during the refactoring done in
commit 4aafb73c
.
2013-12-27 12:29:38 +10:00
Siddhesh Poyarekar
392dd2de03
Consolidate code to compute sin and cos from lookup tables
...
This patch consolidates the multiple copies of code that looks up sin
and cos of a number from the lookup table and computes the final
value, into static functions. This does not have a noticeable
performance impact since the functions are inlined by gcc.
There is further scope for consolidation in the functions but they
cause a more noticable impact on performance (>5%) due to which I have
held back on them.
2013-12-20 16:01:03 +05:30
Siddhesh Poyarekar
84ba214c21
Remove more redundant computations in s_sin.c
...
Removed more redundant computations in the slow paths of the sin and
cos functions. The notable change is the passing of the most
significant bits of X to the slow functions to check if X is positive
so that just the absolute value of x can be passed and the repeated
ABS() operation is avoided.
2013-12-20 15:58:19 +05:30
Siddhesh Poyarekar
975195e466
Remove redundant arguments in reduce_and_compute
...
The A and DA arguments in reduce_and_compute are useless and hence
have been removed.
2013-12-20 15:56:21 +05:30
Siddhesh Poyarekar
5ff8d60ef3
Remove some redundant computations in s_sin.c
...
There are multiple points in the code where the absolute value of a
number is computed multiple times or is computed even though the value
can only be positive. This change removes those redundant
computations. Tested on x86_64 to verify that there were no
regressions in the testsuite.
2013-12-20 15:55:34 +05:30
Marcus Shawcroft
cb756c6d68
Compile e_sqrt.c with -ffp-contract=off.
2013-12-18 12:07:06 +00:00
Joseph Myers
6432a5409c
Fix dbl-64 hypot spurious underflows (bug 16314).
2013-12-17 13:43:40 +00:00
Joseph Myers
c88769dda4
Fix hypot handling of subnormals (bug 16316, bug 16330).
2013-12-17 13:42:13 +00:00
Siddhesh Poyarekar
8d561986c0
Minor code cleanup in s_sin.c
...
- Remove redundant mynumber union definitions
- Clean up a clumsy ternary operator
- Rename TAYLOR_SINCOS to TAYLOR_SIN since we're only expanding the
sin Taylor series in it.
2013-12-16 20:03:04 +05:30
Siddhesh Poyarekar
7a74607ff6
Consolidate definition of constant t22
2013-12-11 12:08:19 +05:30
Siddhesh Poyarekar
196f7f5dbf
Use double constants instead of the struct number
2013-12-11 11:24:25 +05:30
Adhemerval Zanella
ae1a4cd9ff
PowerPC: multiarch finite/finitef for PowerPC32
2013-12-06 05:47:03 -06:00
Joseph Myers
749008ff03
Fix exp missing underflows (bug 15268, bug 15425).
2013-12-03 21:49:56 +00:00
Joseph Myers
34e16df5a1
Fix erfc errno setting on underflow (bug 6786).
2013-12-03 16:25:18 +00:00
Joseph Myers
3c1c46a64a
Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271).
2013-11-28 16:50:38 +00:00
Siddhesh Poyarekar
f3fd2628d8
Add systemtap probe markers for sin, cos, asin and acos
2013-11-20 07:46:48 +05:30
Siddhesh Poyarekar
c79a12040c
Consolidate conditionals in mp sin/cos functions
...
Consolidate conditionals in multiple precision sin and cos functions
to prepare the code for addition of probe points.
2013-10-28 16:21:54 +05:30
Ondřej Bílka
c5d5d574cb
Format floating routines.
2013-10-17 16:03:24 +02:00
Siddhesh Poyarekar
10e1cf6b73
Add systemtap markers to math function slow paths
...
Add systemtap probes to various slow paths in libm so that application
developers may use systemtap to find out if their applications are
hitting these slow paths. We have added probes for pow, exp, log,
tan, atan and atan2.
2013-10-11 22:37:53 +05:30
Siddhesh Poyarekar
885766357d
Format e_pow.c
2013-10-08 16:23:16 +05:30
Siddhesh Poyarekar
e7b2d1dd62
Format e_exp.c
2013-10-08 16:22:28 +05:30
Siddhesh Poyarekar
09544cbcd6
Consolidate multiple precision sin/cos functions
2013-10-08 11:50:17 +05:30
Siddhesh Poyarekar
4aafb73cb2
Consolidate common code into macros
...
Consolidated common Taylor series polynomials into macros in s_sin.c
to make it a bit cleaner.
2013-09-19 20:34:45 +05:30
Siddhesh Poyarekar
b348e1e3a6
Consolidate sin/cos table lookup code
2013-09-19 16:51:02 +05:30
Siddhesh Poyarekar
6cce25f814
Consolidate sin/cos computation for large inputs
2013-09-19 16:45:27 +05:30
Siddhesh Poyarekar
5eea0404a8
Remove redundant goto lines
2013-09-19 16:43:53 +05:30
Siddhesh Poyarekar
97a0650b8a
Format sincos32.c
2013-09-18 13:01:34 +05:30
Ondřej Bílka
c7cabd1355
Remove DO_NOT_USE_THIS conditionals.
2013-09-10 19:15:33 +02:00
Joseph Myers
3711a167f6
Fix spurious "inexact" exceptions from dbl-64 sqrt (bug 15631).
2013-06-15 19:59:41 +00:00
Ondrej Bilka
350635a59a
Fix leading whitespaces.
2013-06-06 20:36:07 +02:00
Joseph Myers
9c84384cc1
Remove trailing whitespace.
2013-06-05 20:44:03 +00:00
Joseph Myers
3e69426875
Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490).
2013-05-19 18:40:25 +00:00
Joseph Myers
bb38759d6d
Fix remainder exceptions and directed-rounding results (bugs 15480, 15485).
2013-05-17 19:04:08 +00:00
Ryan S. Arnold
e054f49430
Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).
2013-05-16 11:32:54 -05:00
Joseph Myers
d8cd06db62
Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426).
2013-05-08 11:58:18 +00:00
Siddhesh Poyarekar
6dbe713d85
Format s_sin.c
2013-04-30 14:18:57 +05:30
Thomas Schwinge
a1cbf437a5
[BZ #14686 , #15336 ] Fix standard compliance. Don't use hard-coded qNaN values.
2013-04-05 22:34:52 +02:00
Thomas Schwinge
8b43a0c9f2
[BZ #15335 , #15342 ] Fix standard compliance. Don't use hard-coded qNaN values.
2013-04-05 22:27:29 +02:00
Thomas Schwinge
d91da4ce87
Remove unreachable code.
...
The case of y == 0 is handled at the beginning of the function.
2013-04-05 21:30:28 +02:00
Thomas Schwinge
bf0f50dfc6
Remove unused hard-coded qNaN definition.
2013-04-05 21:28:03 +02:00
Siddhesh Poyarekar
c871eccd1e
Remove TWO
...
Minor cleanup to remove the macro TWO and use the value directly
instead.
2013-04-03 15:47:01 +05:30
Siddhesh Poyarekar
e7906a4789
Use mantissa_t in mpexp
2013-04-02 17:53:09 +05:30
Thomas Schwinge
572676160d
New <math.h> macro named issignaling to check for a signaling NaN (sNaN).
...
It is based on draft TS 18661 and currently enabled as a GNU extension.
2013-04-02 13:51:02 +02:00
Siddhesh Poyarekar
c2d94018c6
Remove ONE and MONE
2013-03-29 16:40:36 +05:30
Siddhesh Poyarekar
27ec37f185
Format s_tan.c
2013-03-29 16:38:27 +05:30
Siddhesh Poyarekar
a64d7e0efb
Remove ZERO and MZERO macros
2013-03-29 16:37:26 +05:30
Siddhesh Poyarekar
d26dd3eb00
Format s_atan.c
2013-03-29 16:34:28 +05:30
Siddhesh Poyarekar
0f6a8d4b0b
Format e_log.c
2013-03-29 16:34:00 +05:30
Siddhesh Poyarekar
1728ab378e
Format and clean up s_atan2.c
2013-03-28 10:56:06 +05:30
Siddhesh Poyarekar
5739f705ee
Use integral constants
...
The compiler is smart enough to convert those into double for powerpc,
but if we put them as doubles, it adds overhead by performing those
operations in floating point mode.
2013-03-26 20:24:04 +05:30
Siddhesh Poyarekar
e375e83d17
Removed commented code
2013-03-26 20:14:18 +05:30
Siddhesh Poyarekar
6f2e90e78f
Make mantissa type of mp_no configurable
...
The mantissa of mp_no is intended to take only integral values. This
is a relatively good choice for powerpc due to its 4 fpus, but not for
other architectures, which suffer due to this choice. This change
makes the default mantissa a long integer and allows powerpc to
override it. Additionally, some operations have been optimized for
integer manipulation, resulting in a significant improvement in
performance.
2013-03-26 19:28:50 +05:30
Siddhesh Poyarekar
b33d4ce4a2
Replace 8388608.0 with HALFRAD in mp code
...
Minor cleanup
2013-03-21 13:07:44 +05:30
Siddhesh Poyarekar
1e3803454e
Revert configurable mantissa patch
...
Reverts d22ca8cdfb
since it is severely broken on 32-bit.
2013-03-15 23:18:51 +05:30
Siddhesh Poyarekar
d22ca8cdfb
Make mantissa type configurable
...
This allows the default mantissa to be integral, with powerpc
overriding it to take advantage of its FPUs.
2013-03-15 10:44:03 +05:30
Joseph Myers
41c7328e85
Fix spurious underflow exceptions for Bessel functions for double (bug 14155).
2013-03-14 17:47:30 +00:00
Siddhesh Poyarekar
ce544b5bda
Merge powerpc slowexp.c into generic code
2013-03-07 13:25:02 +05:30
Siddhesh Poyarekar
4cc149fd8e
Merge powerpc slowpow.c into generic code
2013-03-07 13:23:07 +05:30
Siddhesh Poyarekar
82a9811d29
Use generic mpa.c code for everything except __mul and __sqr
2013-03-07 12:23:29 +05:30
Siddhesh Poyarekar
09c14ed23e
Format mpsqrt.c
2013-02-27 11:28:20 +05:30
Siddhesh Poyarekar
a688864eed
Format mpatan2.c
2013-02-27 11:27:41 +05:30
Siddhesh Poyarekar
6295157a77
Format mpatan.c
2013-02-27 11:26:22 +05:30
Siddhesh Poyarekar
b8de22026d
Format mptan.c
2013-02-27 11:25:39 +05:30
Siddhesh Poyarekar
11d6e2f237
Format mplog.c
2013-02-27 11:24:45 +05:30
Siddhesh Poyarekar
45f058844c
Another tweak to the multiplication algorithm
...
Reduce the formula to calculate mantissa so that we reduce the net
number of multiplications performed.
2013-02-26 21:28:16 +05:30
Siddhesh Poyarekar
2236d3595a
Don't duplicate mpone and mptwo
2013-02-26 15:15:27 +05:30
Siddhesh Poyarekar
2a983a2e0a
Remove commented declarations
2013-02-25 18:11:14 +05:30
Siddhesh Poyarekar
e69804d14e
Use long wherever possible in mpa.c
...
Using long throughout like powerpc does is beneficial since it reduces
the need to switch to 32-bit instructions. It gives a very minor
performance improvement.
2013-02-25 16:43:03 +05:30
Siddhesh Poyarekar
2f22a1e8dd
Format slowexp.c
2013-02-25 16:13:35 +05:30
Siddhesh Poyarekar
8930ddc705
Reformat slowpow.c
2013-02-25 16:08:38 +05:30
Siddhesh Poyarekar
dc60cb110b
Remove commented code
2013-02-25 14:51:57 +05:30
Siddhesh Poyarekar
bab8a695ee
Fix whitespace differences between generic and powerpc mpa.c
2013-02-21 14:31:42 +05:30
Siddhesh Poyarekar
20cd7fb3ae
Copy comment about inner loop from powerpc mpa.c to the default one
2013-02-20 18:56:20 +05:30
Siddhesh Poyarekar
22af19f9fb
Don't require LIM to determine loop end in __sqr
2013-02-16 00:15:57 +05:30
Siddhesh Poyarekar
4709fe7602
Use intermediate variable to compute exponent in __mul
2013-02-16 00:09:29 +05:30
Siddhesh Poyarekar
2d0e0f29f8
Fix determination of lower precision in __mul
2013-02-15 23:56:20 +05:30
Siddhesh Poyarekar
f414520d3c
Use __sqr instead of __mul wherever possible
2013-02-14 11:39:14 +05:30
Siddhesh Poyarekar
d6752ccd69
New __sqr function as a faster special case of __mul
2013-02-14 10:31:09 +05:30
Siddhesh Poyarekar
c2af38aa76
Remove unnecessary factorial array
...
kf is n! at the end of the loop, so storing the values is unnecessary.
2013-02-13 17:19:07 +05:30
Siddhesh Poyarekar
4e92d59e26
Better exp polynomial
...
The lesser the __mul calls, the better it is for performance.
2013-02-13 14:49:50 +05:30
Siddhesh Poyarekar
909279a5cf
Optimized mp multiplication
...
Don't bother multiplying zeroes since that only wastes cycles.
2013-02-13 14:16:23 +05:30
Siddhesh Poyarekar
bdf028142e
Clean up add_magnitudes and sub_magnitudes
2013-02-13 13:55:29 +05:30
Roland McGrath
f1d70dad53
Remove lots of inline keywords.
2013-02-07 14:44:18 -08:00
Siddhesh Poyarekar
caa99d06e7
Simplify calculation of 2^-m in __mpexp
2013-01-18 11:18:13 +05:30
Siddhesh Poyarekar
d3b9ea6148
Remove unnecessary multiplication with RADIXI
2013-01-18 11:14:34 +05:30
Siddhesh Poyarekar
a897655d7b
Fix header comment
2013-01-17 15:05:22 +05:30
Siddhesh Poyarekar
f93a8d1569
Consolidate constant defines into mpa.h
2013-01-16 16:06:48 +05:30
Siddhesh Poyarekar
dd930cc571
Fix the value of TWO
2013-01-16 14:53:53 +05:30
David S. Miller
438ebba294
Use libc_fe*() in 32-bit nearbyint()
...
* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
libc_feholdexcept and libc_fesetenv.
2013-01-15 20:32:13 -08:00
Siddhesh Poyarekar
2a91b5735a
Minor tweak to mp multiplication
...
Add a local variable to remove extra copies to/from memory in the Z
array.
2013-01-14 21:53:48 +05:30
Siddhesh Poyarekar
1066a53440
Fix code formatting in mpa.c
...
This includes the overridden mpa.c in power4.
2013-01-14 21:53:43 +05:30
Siddhesh Poyarekar
7490eb81ae
Fix formatting in mpexp.c
2013-01-10 14:59:18 +05:30
Siddhesh Poyarekar
751b85f795
Make __mpexp_twomm1 an array of doubles
...
Cleanup to get rid of the `number` muck which is not necessary here.
2013-01-10 14:59:18 +05:30
Siddhesh Poyarekar
950c99ca90
Update comments in mpa.c
...
Fixed comment style and clearer wording in some cases.
2013-01-09 19:07:15 +05:30
Siddhesh Poyarekar
fffb407f46
Remove unused __cr and __cpymn
2013-01-04 22:52:12 +05:30
Siddhesh Poyarekar
6420d207bb
Fix code formatting
2013-01-04 15:57:13 +05:30
Siddhesh Poyarekar
a9e48ab40e
Clean up comment for MP_NO
2013-01-04 15:42:09 +05:30