xpressn.c: asinh, acosh, atanh replacement functions added

This commit is contained in:
h_vogt 2013-10-08 23:54:14 +02:00 committed by rlar
parent 3e721d871a
commit e5e08b6f93
1 changed files with 12 additions and 0 deletions

View File

@ -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);