在 2019/4/15 20:52, Martin Storsjö 写道: > --- > mingw-w64-crt/Makefile.am | 18 ++++++++++++++++++ > mingw-w64-crt/math/arm-common/acosh.c | 16 ++++++++++++++++ > mingw-w64-crt/math/arm-common/acoshf.c | 16 ++++++++++++++++ > mingw-w64-crt/math/arm-common/acoshl.c | 16 ++++++++++++++++ > mingw-w64-crt/math/arm-common/asinh.c | 18 ++++++++++++++++++ > mingw-w64-crt/math/arm-common/asinhf.c | 18 ++++++++++++++++++ > mingw-w64-crt/math/arm-common/asinhl.c | 16 ++++++++++++++++ > mingw-w64-crt/math/arm-common/atanh.c | 17 +++++++++++++++++ > mingw-w64-crt/math/arm-common/atanhf.c | 17 +++++++++++++++++ > mingw-w64-crt/math/arm-common/atanhl.c | 16 ++++++++++++++++ > 10 files changed, 168 insertions(+) > create mode 100644 mingw-w64-crt/math/arm-common/acosh.c > create mode 100644 mingw-w64-crt/math/arm-common/acoshf.c > create mode 100644 mingw-w64-crt/math/arm-common/acoshl.c > create mode 100644 mingw-w64-crt/math/arm-common/asinh.c > create mode 100644 mingw-w64-crt/math/arm-common/asinhf.c > create mode 100644 mingw-w64-crt/math/arm-common/asinhl.c > create mode 100644 mingw-w64-crt/math/arm-common/atanh.c > create mode 100644 mingw-w64-crt/math/arm-common/atanhf.c > create mode 100644 mingw-w64-crt/math/arm-common/atanhl.c >
> diff --git a/mingw-w64-crt/math/arm-common/asinh.c
> b/mingw-w64-crt/math/arm-common/asinh.c
> new file mode 100644
> index 000000000..8db2cc90e
> --- /dev/null
> +++ b/mingw-w64-crt/math/arm-common/asinh.c
> @@ -0,0 +1,18 @@
> +/**
> + * This file has no copyright assigned and is placed in the Public Domain.
> + * This file is part of the mingw-w64 runtime package.
> + * No warranty is given; refer to the file DISCLAIMER.PD within this package.
> + */
> +
> +#include <math.h>
> +
> +double asinh(double x)
> +{
> + if (isinf(x*x + 1)) {
> + if (x > 0)
> + return log(2) + log(x);
> + else
> + return log(2) - log(-x);
This should be `return -log(2) - log(-x)`.
> + }
> + return log(x + sqrt(x*x + 1));
> +}
> diff --git a/mingw-w64-crt/math/arm-common/asinhf.c
> b/mingw-w64-crt/math/arm-common/asinhf.c
> new file mode 100644
> index 000000000..82fd6605e
> --- /dev/null
> +++ b/mingw-w64-crt/math/arm-common/asinhf.c
> @@ -0,0 +1,18 @@
> +/**
> + * This file has no copyright assigned and is placed in the Public Domain.
> + * This file is part of the mingw-w64 runtime package.
> + * No warranty is given; refer to the file DISCLAIMER.PD within this package.
> + */
> +
> +#include <math.h>
> +
> +float asinhf(float x)
> +{
> + if (isinf(x*x + 1)) {
> + if (x > 0)
> + return logf(2) + logf(x);
> + else
> + return logf(2) - logf(-x);
Ditto.
> +}
> diff --git a/mingw-w64-crt/math/arm-common/atanh.c
> b/mingw-w64-crt/math/arm-common/atanh.c
> new file mode 100644
> index 000000000..08302c0e2
> --- /dev/null
> +++ b/mingw-w64-crt/math/arm-common/atanh.c
> @@ -0,0 +1,17 @@
> +/**
> + * This file has no copyright assigned and is placed in the Public Domain.
> + * This file is part of the mingw-w64 runtime package.
> + * No warranty is given; refer to the file DISCLAIMER.PD within this package.
> + */
> +
> +#include <math.h>
> +
> +double atanh(double x)
> +{
> + if (x > 1 || x < -1)
This should be `if (x >= 1 || x <= -1)`.
> + return NAN;
> + if (-1e-6 < x && x < 1e-6)
> + return x + x*x*x/3;
> + else
> + return (log(1 + x) - log(1 - x)) / 2;
> +}
> diff --git a/mingw-w64-crt/math/arm-common/atanhf.c
> b/mingw-w64-crt/math/arm-common/atanhf.c
> new file mode 100644
> index 000000000..a29492305
> --- /dev/null
> +++ b/mingw-w64-crt/math/arm-common/atanhf.c
> @@ -0,0 +1,17 @@
> +/**
> + * This file has no copyright assigned and is placed in the Public Domain.
> + * This file is part of the mingw-w64 runtime package.
> + * No warranty is given; refer to the file DISCLAIMER.PD within this package.
> + */
> +
> +#include <math.h>
> +
> +float atanhf(float x)
> +{
> + if (x > 1 || x < -1)
Ditto.
> + return NAN;
> + if (-1e-6 < x && x < 1e-6)
> + return x + x*x*x/3;
> + else
> + return (logf(1 + x) - logf(1 - x)) / 2;
> +}
--
Best regards,
LH_Mouse
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
