summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/elementaryFunctions/cosh
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/cosh')
-rw-r--r--2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c18
-rw-r--r--2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c18
-rw-r--r--2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c18
-rw-r--r--2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c18
4 files changed, 24 insertions, 48 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c
index 8515bc7d..eb2e9f93 100644
--- a/2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c
+++ b/2.3-1/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]);
+ }
}
diff --git a/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c
index b30c14e2..beed9b30 100644
--- a/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c
+++ b/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.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 i8coshs(int8 x) {
- float y = i8exps(i8abss(x));
- return (0.5f * (y + 1.0f / y));
+void i8cosha(int8* x, int size, int8* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = i8coshs(x[i]);
+ }
}
diff --git a/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c
index 775f710e..e0c41836 100644
--- a/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c
+++ b/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.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 u16coshs(uint16 x) {
- float y = u16exps(u16abss(x));
- return (0.5f * (y + 1.0f / y));
+void u16cosha(uint16* x, int size, uint16* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = u16coshs(x[i]);
+ }
}
diff --git a/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c
index b6d614fa..9584b3e0 100644
--- a/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c
+++ b/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.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 u8coshs(uint8 x) {
- float y = u8exps(u8abss(x));
- return (0.5f * (y + 1.0f / y));
+void u8cosha(uint8* x, int size, uint8* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = u8coshs(x[i]);
+ }
}