xpressn.c: asinh, acosh, atanh replacement functions added
This commit is contained in:
parent
3e721d871a
commit
e5e08b6f93
|
|
@ -184,13 +184,25 @@ mathfunction(int f, double z, double x)
|
||||||
y = atan(x);
|
y = atan(x);
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
|
#ifdef HAVE_ASINH
|
||||||
y = asinh(x);
|
y = asinh(x);
|
||||||
|
#else
|
||||||
|
y = ((x > 0) ? log(x + sqrt(x * x + 1.0)) : -log(-x + sqrt(x * x + 1.0)));
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
|
#ifdef HAVE_ACOSH
|
||||||
y = acosh(x);
|
y = acosh(x);
|
||||||
|
#else
|
||||||
|
y = (log(x + sqrt(x*x-1.0)));
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
|
#ifdef HAVE_ATANH
|
||||||
y = atanh(x);
|
y = atanh(x);
|
||||||
|
#else
|
||||||
|
y = (log((1.0 + x) / (1.0 - x)) / 2.0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 34:
|
case 34:
|
||||||
y = tan(x);
|
y = tan(x);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue