From 1883edb12bd94c30caf3eee793facadaa3b0b0b7 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 4 Oct 2013 21:09:04 +0200 Subject: [PATCH] xpressn.c, tan, asin, acos, atan, asinh, acosh, atanh, pwr, tanh add tan() asin() acos() atan() asinh() acosh() atanh() rewrite pwr() and tanh() --- src/frontend/numparam/xpressn.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index b5af73c7e..a99d18c15 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -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;