Index: uspace/app/tester/float/float2.c
===================================================================
--- uspace/app/tester/float/float2.c	(revision bae1e1f6864fcff51386ca7dda92f703816ffeef)
+++ uspace/app/tester/float/float2.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2014 Martin Decky
+ * Copyright (c) 2015 Jiri Svoboda
  * All rights reserved.
  *
@@ -27,4 +28,5 @@
  */
 
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -32,10 +34,21 @@
 #include "../tester.h"
 
-#define OPERANDS   10
-#define PRECISION  100000000
+#define OPERANDS         10
+#define PRECISIONF    10000
+#define PRECISION 100000000
 
 static double arguments[OPERANDS] = {
 	3.5, -2.1, 100.0, 50.0, -1024.0, 0.0, 768.3156, 1080.499999, -600.0, 1.0
 };
+
+static double arguments_exp[OPERANDS] = {
+	3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.1, -66.0
+};
+
+static double arguments_log[OPERANDS] = {
+	3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
+	2.718281828459045, 9.9, 0.001
+};
+
 
 static double results_ceil[OPERANDS] = {
@@ -63,8 +76,54 @@
 };
 
+static double results_log[OPERANDS] = {
+	1.252762968495, 4.605170185988, 3.912023005428, 6.644200586236,
+	6.985179175021, 0.000000000000, 4.189654742026, 1.000000000000,
+	2.292534757141, -6.907755278982
+};
+
+static double results_exp[OPERANDS] = {
+	33.115451958692, 0.122456428253, 5184705528587072045056.0,
+	1.000000000000, 2.718281828459, 540364.937246691552, 0.332871083698,
+	0.004086771438, 1.105170918076, 0.000000000000
+};
+
+static bool cmp_float(float a, float b)
+{
+	float r;
+
+	/* XXX Need fabsf() */
+	if (b < 1.0 / PRECISIONF && b > -1.0 / PRECISIONF)
+		r = a;
+	else
+		r = a / b - 1.0;
+
+	/* XXX Need fabsf() */
+	if (r < 0.0)
+		r = -r;
+
+	return r < 1.0 / PRECISIONF;
+}
+
+static bool cmp_double(double a, double b)
+{
+	double r;
+
+	/* XXX Need fabs() */
+	if (b < 1.0 / PRECISION && b > -1.0 / PRECISION)
+		r = a;
+	else
+		r = a / b - 1.0;
+
+	/* XXX Need fabs() */
+	if (r < 0.0)
+		r = -r;
+
+	return r < 1.0 / PRECISION;
+}
+
 const char *test_float2(void)
 {
 	bool fail = false;
-	
+
 	for (unsigned int i = 0; i < OPERANDS; i++) {
 		double res = floor(arguments[i]);
@@ -73,6 +132,6 @@
 		
 		if (res_int != corr_int) {
-			TPRINTF("Double floor failed (%" PRId64 " != %" PRId64
-			    ", arg %u)\n", res_int, corr_int, i);
+			TPRINTF("Double precision floor failed (%" PRId64
+			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
 			fail = true;
 		}
@@ -85,6 +144,6 @@
 		
 		if (res_int != corr_int) {
-			TPRINTF("Double ceil failed (%" PRId64 " != %" PRId64
-			    ", arg %u)\n", res_int, corr_int, i);
+			TPRINTF("Double precision ceil failed (%" PRId64
+			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
 			fail = true;
 		}
@@ -97,6 +156,6 @@
 		
 		if (res_int != corr_int) {
-			TPRINTF("Double truncation failed (%" PRId64 " != %" PRId64
-			    ", arg %u)\n", res_int, corr_int, i);
+			TPRINTF("Double precisiontruncation failed (%" PRId64
+			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
 			fail = true;
 		}
@@ -109,6 +168,6 @@
 		
 		if (res_int != corr_int) {
-			TPRINTF("Double sine failed (%" PRId64 " != %" PRId64
-			    ", arg %u)\n", res_int, corr_int, i);
+			TPRINTF("Double precision sine failed (%" PRId64
+			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
 			fail = true;
 		}
@@ -121,6 +180,46 @@
 		
 		if (res_int != corr_int) {
-			TPRINTF("Double cosine failed (%" PRId64 " != %" PRId64
-			    ", arg %u)\n", res_int, corr_int, i);
+			TPRINTF("Double precision cosine failed (%" PRId64
+			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
+			fail = true;
+		}
+	}
+	
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = logf(arguments_log[i]);
+		
+		if (!cmp_float(res, results_log[i])) {
+			TPRINTF("Single precision logarithm failed "
+			    "(%lf != %lf, arg %u)\n", res, results_log[i], i);
+			fail = true;
+		}
+	}
+	
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = log(arguments_log[i]);
+		
+		if (!cmp_double(res, results_log[i])) {
+			TPRINTF("Double precision logarithm failed "
+			    "(%lf != %lf, arg %u)\n", res, results_log[i], i);
+			fail = true;
+		}
+	}
+	
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = exp(arguments_exp[i]);
+		
+		if (!cmp_float(res, results_exp[i])) {
+			TPRINTF("Single precision exponential failed "
+			    "(%lf != %lf, arg %u)\n", res, results_exp[i], i);
+			fail = true;
+		}
+	}
+	
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = exp(arguments_exp[i]);
+		
+		if (!cmp_double(res, results_exp[i])) {
+			TPRINTF("Double precision exponential failed "
+			    "(%lf != %lf, arg %u)\n", res, results_exp[i], i);
 			fail = true;
 		}
