<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/math, branch master</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>remove incorrect comment regarding powl exceptional cases</title>
<updated>2024-08-15T00:43:27+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-08-15T00:43:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=ca4e632df42a41aaaf9445a0cfaa939d50a565b8'/>
<id>ca4e632df42a41aaaf9445a0cfaa939d50a565b8</id>
<content type='text'>
the comment does not match the required or actual behavior when x&lt;0
and y is not an integer. while it could be corrected, the role of
comments here is to tell about characteristics unique to the
implementation, not to restate the requirements of the standard, so
just removing it seems best.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the comment does not match the required or actual behavior when x&lt;0
and y is not an integer. while it could be corrected, the role of
comments here is to tell about characteristics unique to the
implementation, not to restate the requirements of the standard, so
just removing it seems best.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix fma(x,y,0) when x*y rounds to -0</title>
<updated>2024-03-14T14:04:42+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2024-03-13T23:57:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=9683bd62414604d3bd56cf6bd7be8f54aa31e7d3'/>
<id>9683bd62414604d3bd56cf6bd7be8f54aa31e7d3</id>
<content type='text'>
if x!=0, y!=0, z==0 then

  fma(x,y,z) == x*y

in all rounding modes, while adding z can ruin the sign of 0 if x*y
rounds to -0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if x!=0, y!=0, z==0 then

  fma(x,y,z) == x*y

in all rounding modes, while adding z can ruin the sign of 0 if x*y
rounds to -0.
</pre>
</div>
</content>
</entry>
<entry>
<title>riscv32: add fenv and math</title>
<updated>2024-02-29T21:36:55+00:00</updated>
<author>
<name>Stefan O'Rear</name>
<email>sorear@fastmail.com</email>
</author>
<published>2020-09-03T09:45:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=b4f7b2ca350ccaa6f58ecec72ac46b7aef22d1c3'/>
<id>b4f7b2ca350ccaa6f58ecec72ac46b7aef22d1c3</id>
<content type='text'>
These are identical to riscv64.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are identical to riscv64.
</pre>
</div>
</content>
</entry>
<entry>
<title>sqrtl: fix invalid use of a non-constant-expression as static initializer</title>
<updated>2024-02-04T00:50:58+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2024-01-29T14:05:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=0e330722c353e71ec9d1518d77278c09f39a1c55'/>
<id>0e330722c353e71ec9d1518d77278c09f39a1c55</id>
<content type='text'>
having these constants be static was unnecessary, so just remove the
static.

this error should have been caught by compilers, but recent versions
of both gcc and clang accept these as "other forms of constant
expressions" which the C standard allows.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
having these constants be static was unnecessary, so just remove the
static.

this error should have been caught by compilers, but recent versions
of both gcc and clang accept these as "other forms of constant
expressions" which the C standard allows.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix ld80 powl(x,huge) and powl(LDBL_MAX,small)</title>
<updated>2023-08-19T18:09:00+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2023-08-18T21:17:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=39e43f0881b12d602ddcb8a9e9295456354b765b'/>
<id>39e43f0881b12d602ddcb8a9e9295456354b765b</id>
<content type='text'>
powl used &gt;= LDBL_MAX as infinity check, but LDBL_MAX is finite, so
this can cause wrong results e.g. powl(LDBL_MAX, 0.5) returned inf
or powl(2, LDBL_MAX) returned inf without raising overflow.

huge y values (close to LDBL_MAX) could cause intermediate results to
overflow (computing y * log2(x) with more than long double precision)
and e.g. powl(0.5, 0x1p16380L) or powl(10, 0x1p16380L) returned nan.
this is fixed by handling huge y early since that always overflows or
underflows.

reported by Paul Zimmermann against expl10 (which uses powl).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
powl used &gt;= LDBL_MAX as infinity check, but LDBL_MAX is finite, so
this can cause wrong results e.g. powl(LDBL_MAX, 0.5) returned inf
or powl(2, LDBL_MAX) returned inf without raising overflow.

huge y values (close to LDBL_MAX) could cause intermediate results to
overflow (computing y * log2(x) with more than long double precision)
and e.g. powl(0.5, 0x1p16380L) or powl(10, 0x1p16380L) returned nan.
this is fixed by handling huge y early since that always overflows or
underflows.

reported by Paul Zimmermann against expl10 (which uses powl).
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix ld80 acoshl(x) for x &lt; 0</title>
<updated>2023-08-19T18:07:44+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2023-08-18T21:16:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=6d10102709df4bc966d2846c1c45cd667e5048e5'/>
<id>6d10102709df4bc966d2846c1c45cd667e5048e5</id>
<content type='text'>
acosh(x) is nan for x &lt; 1, but x &lt; 0 cases were not handled specially
and acoshl gave wrong result for some -0x1p32 &lt; x &lt; -2 values, e.g.:

acoshl(-0x1p20) returned -inf,
acoshl(-0x1.4p20) returned -0x1.db365758403aa9acp+0L,

fixed by checking the sign bit and handling it specially.

reported by Paul Zimmermann.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
acosh(x) is nan for x &lt; 1, but x &lt; 0 cases were not handled specially
and acoshl gave wrong result for some -0x1p32 &lt; x &lt; -2 values, e.g.:

acoshl(-0x1p20) returned -inf,
acoshl(-0x1.4p20) returned -0x1.db365758403aa9acp+0L,

fixed by checking the sign bit and handling it specially.

reported by Paul Zimmermann.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix undefined shift in logf</title>
<updated>2023-02-12T22:46:50+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2023-01-20T10:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=35fdfe62a4ff471074ca53b7626ec80e83d244bd'/>
<id>35fdfe62a4ff471074ca53b7626ec80e83d244bd</id>
<content type='text'>
A signed int shift overflowed when computing a constant mask, use hex
literal instead.  This is unlikely to cause actual issues unless the
code was compiled with ubsan or similar instrumentation specifically
to catch this. The stripped libc.so is unchanged on x86_64.
Reported by q66 on irc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A signed int shift overflowed when computing a constant mask, use hex
literal instead.  This is unlikely to cause actual issues unless the
code was compiled with ubsan or similar instrumentation specifically
to catch this. The stripped libc.so is unchanged on x86_64.
Reported by q66 on irc.
</pre>
</div>
</content>
</entry>
<entry>
<title>add SPE FPU support to powerpc-sf</title>
<updated>2021-09-23T23:11:46+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2021-09-23T23:11:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=7be59733d71ada3a32a98622507399253f1d5e48'/>
<id>7be59733d71ada3a32a98622507399253f1d5e48</id>
<content type='text'>
When the soft-float ABI for PowerPC was added in commit
5a92dd95c77cee81755f1a441ae0b71e3ae2bcdb, with Freescale cpus using
the alternative SPE FPU as the main use case, it was noted that we
could probably support hard float on them, but that it would involve
determining some difficult ABI constraints. This commit is the
completion of that work.

The Power-Arch-32 ABI supplement defines the ABI profiles, and indeed
ATR-SPE is built on ATR-SOFT-FLOAT. But setjmp/longjmp compatibility
are problematic for the same reason they're problematic on ARM, where
optional float-related parts of the register file are "call-saved if
present". This requires testing __hwcap, which is now done.

In keeping with the existing powerpc-sf subarch definition, which did
not have fenv, the fenv macros are not defined for SPE and the SPEFSCR
control register is left (and assumed to start in) the default mode.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the soft-float ABI for PowerPC was added in commit
5a92dd95c77cee81755f1a441ae0b71e3ae2bcdb, with Freescale cpus using
the alternative SPE FPU as the main use case, it was noted that we
could probably support hard float on them, but that it would involve
determining some difficult ABI constraints. This commit is the
completion of that work.

The Power-Arch-32 ABI supplement defines the ABI profiles, and indeed
ATR-SPE is built on ATR-SOFT-FLOAT. But setjmp/longjmp compatibility
are problematic for the same reason they're problematic on ARM, where
optional float-related parts of the register file are "call-saved if
present". This requires testing __hwcap, which is now done.

In keeping with the existing powerpc-sf subarch definition, which did
not have fenv, the fenv macros are not defined for SPE and the SPEFSCR
control register is left (and assumed to start in) the default mode.
</pre>
</div>
</content>
</entry>
<entry>
<title>math: fix fmaf not to depend on FE_TOWARDZERO</title>
<updated>2021-07-06T04:29:57+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2021-07-05T22:37:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=4f3d346bffdf9ed2b1803653643dc31242490944'/>
<id>4f3d346bffdf9ed2b1803653643dc31242490944</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 expm1f overflow threshold</title>
<updated>2021-02-10T19:06:50+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2021-02-05T19:51:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=964104f9f0e056cf58d9defa0b716d7756f040f6'/>
<id>964104f9f0e056cf58d9defa0b716d7756f040f6</id>
<content type='text'>
the threshold was wrong so expm1f overflowed to inf a bit too early
and on most targets uint32_t compare is faster than float compare so
use that.

this also fixes sinhf incorrectly returning nan for some values where
the internal expm1f overflowed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the threshold was wrong so expm1f overflowed to inf a bit too early
and on most targets uint32_t compare is faster than float compare so
use that.

this also fixes sinhf incorrectly returning nan for some values where
the internal expm1f overflowed.
</pre>
</div>
</content>
</entry>
</feed>
