mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Make further progress on non-x86 support
This commit is contained in:
parent
aef9a69a60
commit
036b9a0002
155 changed files with 2307 additions and 653 deletions
|
@ -32,17 +32,16 @@ asm(".ident\t\"\\n\\n\
|
|||
Musl libc (MIT License)\\n\
|
||||
Copyright 2005-2014 Rich Felker, et. al.\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
/* clang-format off */
|
||||
// clang-format off
|
||||
|
||||
/**
|
||||
* Returns inverse hyperbolic cosine of 𝑥.
|
||||
* @define acosh(x) = log(x + sqrt(x*x-1))
|
||||
*/
|
||||
long double acoshl(long double x) {
|
||||
#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
|
||||
long double acoshl(long double x)
|
||||
{
|
||||
return acosh(x);
|
||||
}
|
||||
#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
|
||||
/* acosh(x) = log(x + sqrt(x*x-1)) */
|
||||
long double acoshl(long double x)
|
||||
{
|
||||
union ldshape u = {x};
|
||||
int e = u.i.se & 0x7fff;
|
||||
|
||||
|
@ -53,11 +52,10 @@ long double acoshl(long double x)
|
|||
/* |x| < 0x1p32 */
|
||||
return logl(2*x - 1/(x+sqrtl(x*x-1)));
|
||||
return logl(x) + 0.693147180559945309417232121458176568L;
|
||||
}
|
||||
#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384
|
||||
// TODO: broken implementation to make things compile
|
||||
long double acoshl(long double x)
|
||||
{
|
||||
return acosh(x);
|
||||
}
|
||||
#else
|
||||
#error "architecture unsupported"
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue