<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/math, branch v0.9.14</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>fix x86_64 lrintl asm, again</title>
<updated>2013-09-13T05:22:13+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2013-09-13T05:22:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=2f1de8051b4b33445ca233868e573ec838c81f65'/>
<id>2f1de8051b4b33445ca233868e573ec838c81f65</id>
<content type='text'>
the underlying problem was not incorrect sign extension (fixed in the
previous commit to this file by nsz) but that code that treats "long"
as 32-bit was copied blindly from i386 to x86_64.

now lrintl is identical to llrintl on x86_64, as it should be.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the underlying problem was not incorrect sign extension (fixed in the
previous commit to this file by nsz) but that code that treats "long"
as 32-bit was copied blindly from i386 to x86_64.

now lrintl is identical to llrintl on x86_64, as it should be.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: remove STRICT_ASSIGN from exp2f (see previous commit)</title>
<updated>2013-09-06T20:05:25+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-06T20:05:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=067aea7c9b688e61f69aed62b9b52e536948b273'/>
<id>067aea7c9b688e61f69aed62b9b52e536948b273</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>math: remove STRICT_ASSIGN macro</title>
<updated>2013-09-06T18:35:55+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-06T18:35:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=9b0fcb441a44456c7b071c7cdaf90403f81ec05a'/>
<id>9b0fcb441a44456c7b071c7cdaf90403f81ec05a</id>
<content type='text'>
gcc did not always drop excess precision according to c99 at assignments
before version 4.5 even if -std=c99 was requested which caused badly
broken mathematical functions on i386 when FLT_EVAL_METHOD!=0

but STRICT_ASSIGN was not used consistently and it is worked around for
old compilers with -ffloat-store so it is no longer needed

the new convention is to get the compiler respect c99 semantics and when
excess precision is not harmful use float_t or double_t or to specialize
code using FLT_EVAL_METHOD
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcc did not always drop excess precision according to c99 at assignments
before version 4.5 even if -std=c99 was requested which caused badly
broken mathematical functions on i386 when FLT_EVAL_METHOD!=0

but STRICT_ASSIGN was not used consistently and it is worked around for
old compilers with -ffloat-store so it is no longer needed

the new convention is to get the compiler respect c99 semantics and when
excess precision is not harmful use float_t or double_t or to specialize
code using FLT_EVAL_METHOD
</pre>
</div>
</content>
</entry>
<entry>
<title>math: support invalid ld80 representations in fpclassify</title>
<updated>2013-09-05T18:05:07+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T18:05:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f657fe4b9f734d7fdea515af8dffbf7c28ce4fbc'/>
<id>f657fe4b9f734d7fdea515af8dffbf7c28ce4fbc</id>
<content type='text'>
apparently gnulib requires invalid long double representations
to be handled correctly in printf so we classify them according
to how the fpu treats them: bad inf is nan, bad nan is nan,
bad normal is nan and bad subnormal/zero is minimal normal
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
apparently gnulib requires invalid long double representations
to be handled correctly in printf so we classify them according
to how the fpu treats them: bad inf is nan, bad nan is nan,
bad normal is nan and bad subnormal/zero is minimal normal
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix atanh (overflow and underflow issues)</title>
<updated>2013-09-05T16:57:46+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T16:57:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f4d9bfb3a986f2c25ec023426b4fb222130af75f'/>
<id>f4d9bfb3a986f2c25ec023426b4fb222130af75f</id>
<content type='text'>
in atanh exception handling was left to the called log functions,
but the argument to those functions could underflow or overflow.

use double_t and float_t to avoid some useless stores on x86
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in atanh exception handling was left to the called log functions,
but the argument to those functions could underflow or overflow.

use double_t and float_t to avoid some useless stores on x86
</pre>
</div>
</content>
</entry>
<entry>
<title>math: remove libc.h include from libm.h</title>
<updated>2013-09-05T14:03:10+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T14:03:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=afa2aaccea6e9f8c55809abb6471dc9aaa402711'/>
<id>afa2aaccea6e9f8c55809abb6471dc9aaa402711</id>
<content type='text'>
libc.h is only for weak_alias so include it directly where it is used
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libc.h is only for weak_alias so include it directly where it is used
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix acoshf on negative values</title>
<updated>2013-09-05T12:26:26+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T12:26:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=101e6012856918440b5d7474739c3fc22a8d3b85'/>
<id>101e6012856918440b5d7474739c3fc22a8d3b85</id>
<content type='text'>
acosh(x) is invalid for x&lt;1, acoshf tried to be clever using
signed comparisions to handle all x&lt;2 the same way, but the
formula was wrong on large negative values.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
acosh(x) is invalid for x&lt;1, acoshf tried to be clever using
signed comparisions to handle all x&lt;2 the same way, but the
formula was wrong on large negative values.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix expm1l on x86_64 (avoid underflow for large negative x)</title>
<updated>2013-09-05T12:23:44+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T12:23:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=02343946215a7ae03634c6490abcc69da68df589'/>
<id>02343946215a7ae03634c6490abcc69da68df589</id>
<content type='text'>
copy the fix from i386: return -1 instead of exp2l(x)-1 when x &lt;= -65
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
copy the fix from i386: return -1 instead of exp2l(x)-1 when x &lt;= -65
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix lrintl.s on x86_64 (use movslq to signextend the result)</title>
<updated>2013-09-05T12:04:58+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T12:04:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=e5937885de3c8d493a9d2978aa46a771740c7458'/>
<id>e5937885de3c8d493a9d2978aa46a771740c7458</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix exp2l asm on x86 (raise underflow correctly)</title>
<updated>2013-09-05T11:30:09+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-09-05T10:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=07039ed8563b850624146c938ae201a1099d2f75'/>
<id>07039ed8563b850624146c938ae201a1099d2f75</id>
<content type='text'>
there were two problems:
* omitted underflow on subnormal results: exp2l(-16383.5) was calculated
as sqrt(2)*2^-16384, the last bits of sqrt(2) are zero so the down scaling
does not underflow eventhough the result is in subnormal range
* spurious underflow for subnormal inputs: exp2l(0x1p-16400) was evaluated
as f2xm1(x)+1 and f2xm1 raised underflow (because inexact subnormal result)

the first issue is fixed by raising underflow manually if x is in
(-32768,-16382] and not integer (x-0x1p63+0x1p63 != x)

the second issue is fixed by treating x in (-0x1p64,0x1p64) specially

for these fixes the special case handling was completely rewritten
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
there were two problems:
* omitted underflow on subnormal results: exp2l(-16383.5) was calculated
as sqrt(2)*2^-16384, the last bits of sqrt(2) are zero so the down scaling
does not underflow eventhough the result is in subnormal range
* spurious underflow for subnormal inputs: exp2l(0x1p-16400) was evaluated
as f2xm1(x)+1 and f2xm1 raised underflow (because inexact subnormal result)

the first issue is fixed by raising underflow manually if x is in
(-32768,-16382] and not integer (x-0x1p63+0x1p63 != x)

the second issue is fixed by treating x in (-0x1p64,0x1p64) specially

for these fixes the special case handling was completely rewritten
</pre>
</div>
</content>
</entry>
</feed>
