#include <pal.h>

/*
 * sinh z = (exp z - exp(-z)) / 2
 */
static inline float _p_sinh(const float z)
{
    float exp_z;
    p_exp_f32(&z, &exp_z, 1);
    return 0.5f * (exp_z - 1.f / exp_z);
}

/**
 *
 * Calculates the hyperbolic sine of the vector 'a'. Angles are specified
 * in radians.
 *
 * @param a     Pointer to input vector
 *
 * @param c     Pointer to output vector
 *
 * @param n     Size of 'a' and 'c' vector.
 *
 * @return      None
 *
 */
void p_sinh_f32(const float *a, float *c, int n)
{
    int i;
    for (i = 0; i < n; i++) {
        c[i] = _p_sinh(a[i]);
    }
}

#include <pal.h>

/**
 *
 * Calculates the hyperbolic sine of the vector 'a'. Angles are specified
 * in radians.
 *
 * @param a     Pointer to input vector
 *
 * @param c     Pointer to output vector
 *
 * @param n     Size of 'a' and 'c' vector.
 *
 * @return      None
 *
 */
#include <math.h>
void p_sinh_f32(const float *a, float *c, int n)
{
    int i;
    for (i = 0; i < n; i++) {
        *(c + i) = sinhf(*(a + i));
    }
}

--- 
+++ 
@@ -1,4 +1,14 @@
 #include <pal.h>
+
+/*
+ * sinh z = (exp z - exp(-z)) / 2
+ */
+static inline float _p_sinh(const float z)
+{
+    float exp_z;
+    p_exp_f32(&z, &exp_z, 1);
+    return 0.5f * (exp_z - 1.f / exp_z);
+}
 
 /**
  *
@@ -14,11 +24,10 @@
  * @return      None
  *
  */
-#include <math.h>
 void p_sinh_f32(const float *a, float *c, int n)
 {
     int i;
     for (i = 0; i < n; i++) {
-        *(c + i) = sinhf(*(a + i));
+        c[i] = _p_sinh(a[i]);
     }
 }
math:sinh: Implement the hyperbolic sine function.

Signed-off-by: Mansour Moufid <ac5f6b12fab5e0d4efa7215e6c2dac9d55ab77dc@gmail.com>
