<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/math, branch v1.0.2</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>math: fix aliasing violation in long double wrappers</title>
<updated>2014-04-16T06:46:05+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2014-04-11T15:57:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=67dc1f311646c50f3f1c281b7c345bb45401f17d'/>
<id>67dc1f311646c50f3f1c281b7c345bb45401f17d</id>
<content type='text'>
modfl and sincosl were passing long double* instead of double*
to the wrapped double precision functions (on archs where long
double and double have the same size).
This is fixed now by using temporaries (this is not optimized
to a single branch so the generated code is a bit bigger).
Found by Morten Welinder.

(cherry picked from commit 73c870ed3209b68b5c8c350534508cc9d95a6bcb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
modfl and sincosl were passing long double* instead of double*
to the wrapped double precision functions (on archs where long
double and double have the same size).
This is fixed now by using temporaries (this is not optimized
to a single branch so the generated code is a bit bigger).
Found by Morten Welinder.

(cherry picked from commit 73c870ed3209b68b5c8c350534508cc9d95a6bcb)
</pre>
</div>
</content>
</entry>
<entry>
<title>x32 port (diff against vanilla x86_64)</title>
<updated>2014-02-23T10:09:16+00:00</updated>
<author>
<name>rofl0r</name>
<email>retnyg@gmx.net</email>
</author>
<published>2014-01-07T21:53:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=664cd341921007cea52c8891f27ce35927dca378'/>
<id>664cd341921007cea52c8891f27ce35927dca378</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>import vanilla x86_64 code as x32</title>
<updated>2014-02-23T10:07:18+00:00</updated>
<author>
<name>rofl0r</name>
<email>retnyg@gmx.net</email>
</author>
<published>2014-01-07T21:43:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=323272db175204b951f119dae4bd99ef05e20f13'/>
<id>323272db175204b951f119dae4bd99ef05e20f13</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>math: add drem and dremf weak aliases to i386 remainder asm</title>
<updated>2014-01-08T21:51:46+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2014-01-08T21:51:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=bcff807dc3c1f07db61dae804086b8183bf5df7b'/>
<id>bcff807dc3c1f07db61dae804086b8183bf5df7b</id>
<content type='text'>
weak_alias was only in the c code, so drem was missing on platforms
where remainder is implemented in asm.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
weak_alias was only in the c code, so drem was missing on platforms
where remainder is implemented in asm.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: define _GNU_SOURCE when implementing non-standard math functions</title>
<updated>2013-12-12T03:42:11+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-12-12T03:42:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=ec411999a0262c8e3e6be53ae11ad761776a2fc1'/>
<id>ec411999a0262c8e3e6be53ae11ad761776a2fc1</id>
<content type='text'>
this makes the prototypes in math.h are visible so they are checked agaist
the function definitions
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this makes the prototypes in math.h are visible so they are checked agaist
the function definitions
</pre>
</div>
</content>
</entry>
<entry>
<title>math: clean up __rem_pio2</title>
<updated>2013-11-24T01:06:38+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-11-24T01:06:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=3fdf94ec5101fab63d0e8196d3e557641a0e19e2'/>
<id>3fdf94ec5101fab63d0e8196d3e557641a0e19e2</id>
<content type='text'>
- remove the HAVE_EFFICIENT_IRINT case: fn is an exact integer, so
  it can be converted to int32_t a bit more efficiently than with a
  cast (the rounding mode change can be avoided), but musl does not
  support this case on any arch.
- __rem_pio2: use double_t where possible
- __rem_pio2f: use less assignments to avoid stores on i386
- use unsigned int bit manipulation (and union instead of macros)
- use hexfloat literals instead of named constants
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- remove the HAVE_EFFICIENT_IRINT case: fn is an exact integer, so
  it can be converted to int32_t a bit more efficiently than with a
  cast (the rounding mode change can be avoided), but musl does not
  support this case on any arch.
- __rem_pio2: use double_t where possible
- __rem_pio2f: use less assignments to avoid stores on i386
- use unsigned int bit manipulation (and union instead of macros)
- use hexfloat literals instead of named constants
</pre>
</div>
</content>
</entry>
<entry>
<title>math: add (obsolete) bsd drem and finite functions</title>
<updated>2013-11-21T01:16:49+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-11-21T01:16:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=5d01ab4ac64b913c537e91f7c01d5c8e910151da'/>
<id>5d01ab4ac64b913c537e91f7c01d5c8e910151da</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>math: lgamma cleanup (simpler sin(pi*x) for the negative case)</title>
<updated>2013-11-21T01:01:57+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-11-21T01:01:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=ebbaf2180e6e32043837f570982c2ee86cf19eae'/>
<id>ebbaf2180e6e32043837f570982c2ee86cf19eae</id>
<content type='text'>
* simplify sin_pi(x) (don't care about inexact here, the result is
  inexact anyway, and x is not so small to underflow)
* in lgammal add the previously removed special case for x==1 and
  x==2 (to fix the sign of zero in downward rounding mode)
* only define lgammal on supported long double platforms
* change tgamma so the generated code is a bit smaller
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* simplify sin_pi(x) (don't care about inexact here, the result is
  inexact anyway, and x is not so small to underflow)
* in lgammal add the previously removed special case for x==1 and
  x==2 (to fix the sign of zero in downward rounding mode)
* only define lgammal on supported long double platforms
* change tgamma so the generated code is a bit smaller
</pre>
</div>
</content>
</entry>
<entry>
<title>math: extensive log*.c cleanup</title>
<updated>2013-10-28T01:16:14+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-10-28T01:16:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=71d23b310383699a3101ea8bf088398796529ddd'/>
<id>71d23b310383699a3101ea8bf088398796529ddd</id>
<content type='text'>
The log, log2 and log10 functions share a lot of code and to a lesser
extent log1p too. A small part of the code was kept separately in
__log1p.h, but since it did not capture much of the common code and
it was inlined anyway, it did not solve the issue properly. Now the
log functions have significant code duplication, which may be resolved
later, until then they need to be modified together.

logl, log10l, log2l, log1pl:
* Fix the sign when the return value should be -inf.
* Remove the volatile hack from log10l (seems unnecessary)

log1p, log1pf:
* Change the handling of small inputs: only |x|&lt;2^-53 is special
  (then it is enough to return x with the usual subnormal handling)
  this fixes the sign of log1p(0) in downward rounding.
* Do not handle the k==0 case specially (other than skipping the
  elaborate argument reduction)
* Do not handle 1+x close to power-of-two specially (this code was
  used rarely, did not give much speed up and the precision wasn't
  better than the general)
* Fix the correction term formula (c=1-(u-x) was used incorrectly
  when x&lt;1 but (double)(x+1)==2, this was not a critical issue)
* Use the exact same method for calculating log(1+f) as in log
  (except in log1p the c correction term is added to the result).

log, logf, log10, log10f, log2, log2f:
* Use double_t and float_t consistently.
* Now the first part of log10 and log2 is identical to log (until the
  return statement, hopefully this makes maintainence easier).
* Most special case formulas were removed (close to power-of-two and
  k==0 cases), they increase the code size without providing precision
  or performance benefits (and obfuscate the code).
  Only x==1 is handled specially so in downward rounding mode the
  sign of zero is correct (the general formula happens to give -0).
* For x==0 instead of -1/0.0 or -two54/0.0, return -1/(x*x) to force
  raising the exception at runtime.
* Arg reduction code is changed (slightly simplified)
* The thresholds for arg reduction to [sqrt(2)/2,sqrt(2)] are now
  consistently the [0x3fe6a09e00000000,0x3ff6a09dffffffff] and the
  [0x3f3504f3,0x3fb504f2] intervals for double and float reductions
  respectively (the exact threshold values are not critical)
* Remove the obsolete comment for the FLT_EVAL_METHOD!=0 case in log2f
  (The same code is used for all eval methods now, on i386 slightly
  simpler code could be used, but we have asm there anyway)

all:
* Fix signed int arithmetics (using unsigned for bitmanipulation)
* Fix various comments
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The log, log2 and log10 functions share a lot of code and to a lesser
extent log1p too. A small part of the code was kept separately in
__log1p.h, but since it did not capture much of the common code and
it was inlined anyway, it did not solve the issue properly. Now the
log functions have significant code duplication, which may be resolved
later, until then they need to be modified together.

logl, log10l, log2l, log1pl:
* Fix the sign when the return value should be -inf.
* Remove the volatile hack from log10l (seems unnecessary)

log1p, log1pf:
* Change the handling of small inputs: only |x|&lt;2^-53 is special
  (then it is enough to return x with the usual subnormal handling)
  this fixes the sign of log1p(0) in downward rounding.
* Do not handle the k==0 case specially (other than skipping the
  elaborate argument reduction)
* Do not handle 1+x close to power-of-two specially (this code was
  used rarely, did not give much speed up and the precision wasn't
  better than the general)
* Fix the correction term formula (c=1-(u-x) was used incorrectly
  when x&lt;1 but (double)(x+1)==2, this was not a critical issue)
* Use the exact same method for calculating log(1+f) as in log
  (except in log1p the c correction term is added to the result).

log, logf, log10, log10f, log2, log2f:
* Use double_t and float_t consistently.
* Now the first part of log10 and log2 is identical to log (until the
  return statement, hopefully this makes maintainence easier).
* Most special case formulas were removed (close to power-of-two and
  k==0 cases), they increase the code size without providing precision
  or performance benefits (and obfuscate the code).
  Only x==1 is handled specially so in downward rounding mode the
  sign of zero is correct (the general formula happens to give -0).
* For x==0 instead of -1/0.0 or -two54/0.0, return -1/(x*x) to force
  raising the exception at runtime.
* Arg reduction code is changed (slightly simplified)
* The thresholds for arg reduction to [sqrt(2)/2,sqrt(2)] are now
  consistently the [0x3fe6a09e00000000,0x3ff6a09dffffffff] and the
  [0x3f3504f3,0x3fb504f2] intervals for double and float reductions
  respectively (the exact threshold values are not critical)
* Remove the obsolete comment for the FLT_EVAL_METHOD!=0 case in log2f
  (The same code is used for all eval methods now, on i386 slightly
  simpler code could be used, but we have asm there anyway)

all:
* Fix signed int arithmetics (using unsigned for bitmanipulation)
* Fix various comments
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix rare underflow issue in fma</title>
<updated>2013-10-07T18:46:43+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-10-07T18:46:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=8f438115f2c12b40fa7b1884f87db72857af67f6'/>
<id>8f438115f2c12b40fa7b1884f87db72857af67f6</id>
<content type='text'>
the issue is described in commits 1e5eb73545ca6cfe8b918798835aaf6e07af5beb
and ffd8ac2dd50f99c3c83d7d9d845df9874ec3e7d5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the issue is described in commits 1e5eb73545ca6cfe8b918798835aaf6e07af5beb
and ffd8ac2dd50f99c3c83d7d9d845df9874ec3e7d5
</pre>
</div>
</content>
</entry>
</feed>
