summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/cosh/i16cosha.c
diff options
context:
space:
mode:
authorsiddhu89902015-09-03 02:06:47 +0530
committersiddhu89902015-09-03 02:06:47 +0530
commit17892e4b25aa0488eb51a5896c58094d63b7c55c (patch)
tree9a10bc8924203a4cc219d5f4d4ecf77439889bcf /src/c/elementaryFunctions/cosh/i16cosha.c
parent222a3e39441ad408dacdc39d46d687dee5a6bf3c (diff)
downloadscilab2c-17892e4b25aa0488eb51a5896c58094d63b7c55c.tar.gz
scilab2c-17892e4b25aa0488eb51a5896c58094d63b7c55c.tar.bz2
scilab2c-17892e4b25aa0488eb51a5896c58094d63b7c55c.zip
Intermediate commit. Not to be used
Diffstat (limited to 'src/c/elementaryFunctions/cosh/i16cosha.c')
-rw-r--r--src/c/elementaryFunctions/cosh/i16cosha.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/c/elementaryFunctions/cosh/i16cosha.c b/src/c/elementaryFunctions/cosh/i16cosha.c
index 8515bc7d..eb2e9f93 100644
--- a/src/c/elementaryFunctions/cosh/i16cosha.c
+++ b/src/c/elementaryFunctions/cosh/i16cosha.c
@@ -1,6 +1,6 @@
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
@@ -10,17 +10,11 @@
*
*/
-/*
-// cosh(z) = 0.5 (exp(|z|) + exp(-|z|))
-// = 0.5 ( y + 1/y ) with y = exp(|z|)
-*/
-
-#include <math.h>
#include "cosh.h"
-#include "exp.h"
-#include "abs.h"
-float i16coshs(int16 x) {
- float y = i16exps(i16abss(x));
- return (0.5f * (y + 1.0f / y));
+void i16cosha(int16* x, int size, int16* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = i16coshs(x[i]);
+ }
}