aboutsummaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/libpoly.c7
-rw-r--r--libs/libsin.c7
-rw-r--r--libs/libsq.c4
3 files changed, 18 insertions, 0 deletions
diff --git a/libs/libpoly.c b/libs/libpoly.c
new file mode 100644
index 0000000..2daa972
--- /dev/null
+++ b/libs/libpoly.c
@@ -0,0 +1,7 @@
+
+#include <math.h>
+
+// calculate polynomial
+double f(double x) {
+ return pow(x, 3) - 2*x*x - 10*x + 69;
+}
diff --git a/libs/libsin.c b/libs/libsin.c
new file mode 100644
index 0000000..34200af
--- /dev/null
+++ b/libs/libsin.c
@@ -0,0 +1,7 @@
+
+#include <math.h>
+
+// calculate sine
+double f(double x) {
+ return sin(x);
+}
diff --git a/libs/libsq.c b/libs/libsq.c
new file mode 100644
index 0000000..2b93fb4
--- /dev/null
+++ b/libs/libsq.c
@@ -0,0 +1,4 @@
+// calculate square
+double f(double x) {
+ return x*x;
+}