Browse Source

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

add tan() asin() acos() atan() asinh() acosh() atanh()
rewrite pwr() and tanh()
pre-master-46
rlar 13 years ago
parent
commit
1883edb12b
  1. 28
      src/frontend/numparam/xpressn.c

28
src/frontend/numparam/xpressn.c

@ -91,7 +91,8 @@ initkeys(void)
"and or not div mod defined"); "and or not div mod defined");
scopy_up(&fmathS, scopy_up(&fmathS,
"sqr sqrt sin cos exp ln arctan abs pow pwr max min int log sinh cosh" "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); y = pow(z, x);
break; break;
case 10: case 10:
y = exp(x * ln(fabs(z)));
y = pow(fabs(z), x);
break; break;
case 11: case 11:
y = MAX(x, z); y = MAX(x, z);
@ -151,7 +152,7 @@ mathfunction(int f, double z, double x)
y = cosh(x); y = cosh(x);
break; break;
case 17: case 17:
y = sinh(x)/cosh(x);
y = tanh(x);
break; break;
case 21: /* sgn */ case 21: /* sgn */
if (x > 0) if (x > 0)
@ -167,6 +168,27 @@ mathfunction(int f, double z, double x)
case 27: case 27:
y = floor(x); y = floor(x);
break; 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: default:
y = x; y = x;
break; break;

Loading…
Cancel
Save