From e5e08b6f93f09799c7e76dba54a29be311eee6a9 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Tue, 8 Oct 2013 23:54:14 +0200 Subject: [PATCH] xpressn.c: asinh, acosh, atanh replacement functions added --- src/frontend/numparam/xpressn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 9709343fd..fb2283656 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -184,13 +184,25 @@ mathfunction(int f, double z, double x) y = atan(x); break; case 31: +#ifdef HAVE_ASINH y = asinh(x); +#else + y = ((x > 0) ? log(x + sqrt(x * x + 1.0)) : -log(-x + sqrt(x * x + 1.0))); +#endif break; case 32: +#ifdef HAVE_ACOSH y = acosh(x); +#else + y = (log(x + sqrt(x*x-1.0))); +#endif break; case 33: +#ifdef HAVE_ATANH y = atanh(x); +#else + y = (log((1.0 + x) / (1.0 - x)) / 2.0); +#endif break; case 34: y = tan(x);