diff --git a/src/math/p_root.c b/src/math/p_root.c new file mode 100644 index 0000000..ff3aafa --- /dev/null +++ b/src/math/p_root.c @@ -0,0 +1,30 @@ +#include + +/** + * + * Calculate 'a' radicand to the index 'b' + * + * @param a Pointer to input vector + * + * @param b Pointer to input vector + * + * @param c Pointer to output vector + * + * @param n Size of 'a' and 'c' vector. + * + * @param p Number of processor to use (task parallelism) + * + * @param team Team to work with + * + * @return None + * + */ +#include +void p_root_f32(float *a, float *b, float *c, int n, int p, p_team_t team) +{ + + int i; + for (i = 0; i < n; i++) { + *(c + i) = powf(*(a + i), 1/(*(b + i))); + } +} \ No newline at end of file