xpressn.c, tan, asin, acos, atan, asinh, acosh, atanh, pwr, tanh

add tan() asin() acos() atan() asinh() acosh() atanh()
rewrite pwr() and tanh()
This commit is contained in:
rlar 2013-10-04 21:09:04 +02:00
parent b40f748ccc
commit 1883edb12b
1 changed files with 25 additions and 3 deletions

View File

@ -91,7 +91,8 @@ initkeys(void)
"and or not div mod defined");
scopy_up(&fmathS,
"sqr sqrt sin cos exp ln arctan abs pow pwr max min int log sinh cosh"
" tanh ternary_fcn v agauss sgn gauss unif aunif limit ceil floor");
" tanh ternary_fcn v agauss sgn gauss unif aunif limit ceil floor"
" asin acos atan asinh acosh atanh tan");
}
@ -130,7 +131,7 @@ mathfunction(int f, double z, double x)
y = pow(z, x);
break;
case 10:
y = exp(x * ln(fabs(z)));
y = pow(fabs(z), x);
break;
case 11:
y = MAX(x, z);
@ -151,7 +152,7 @@ mathfunction(int f, double z, double x)
y = cosh(x);
break;
case 17:
y = sinh(x)/cosh(x);
y = tanh(x);
break;
case 21: /* sgn */
if (x > 0)
@ -167,6 +168,27 @@ mathfunction(int f, double z, double x)
case 27:
y = floor(x);
break;
case 28:
y = asin(x);
break;
case 29:
y = acos(x);
break;
case 30:
y = atan(x);
break;
case 31:
y = asinh(x);
break;
case 32:
y = acosh(x);
break;
case 33:
y = atanh(x);
break;
case 34:
y = tan(x);
break;
default:
y = x;
break;