Index: uspace/lib/math/generic/acos.c
===================================================================
--- uspace/lib/math/generic/acos.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/acos.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <acos.h>
+#include <errno.h>
+#include <math.h>
+
+/** Inverse cosine (32-bit floating point)
+ *
+ * Compute inverse cosine value.
+ *
+ * @param arg Inversecosine argument.
+ *
+ * @return Inverse cosine value.
+ *
+ */
+float32_t float32_acos(float32_t arg)
+{
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT32_NAN;
+	}
+
+	return M_PI_2 - asin_f32(arg);
+}
+
+/** Inverse cosine (64-bit floating point)
+ *
+ * Compute inverse cosine value.
+ *
+ * @param arg Inversecosine argument.
+ *
+ * @return Inverse cosine value.
+ *
+ */
+float64_t float64_acos(float64_t arg)
+{
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT64_NAN;
+	}
+
+	return M_PI_2 - asin_f64(arg);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/asin.c
===================================================================
--- uspace/lib/math/generic/asin.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/asin.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <asin.h>
+#include <errno.h>
+#include <math.h>
+
+/** Inverse sine (32-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float32_t float32_asin(float32_t arg)
+{
+	float32_t aval;
+	
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT32_NAN;
+	}
+	
+	aval = 2.0 * atan_f32(arg / (1.0 + sqrt_f32(1.0 - arg*arg)));
+	if (arg > 0.0)
+		return aval;
+	else
+		return -aval;
+}
+
+/** Inverse sine (64-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float64_t float64_asin(float64_t arg)
+{
+	float64_t aval;
+	
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT64_NAN;
+	}
+	
+	aval = 2.0 * atan_f64(arg / (1.0 + sqrt_f64(1.0 - arg*arg)));
+	if (arg > 0.0)
+		return aval;
+	else
+		return -aval;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/atan.c
===================================================================
--- uspace/lib/math/generic/atan.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/atan.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <atan.h>
+#include <errno.h>
+#include <math.h>
+
+#define SERIES_DEGREE_32 13
+#define SERIES_DEGREE_64 33
+
+/** Inverse tangent approximation by Euler's series (32-bit floating point)
+ *
+ * Compute the approximation of inverse tangent by a
+ * series found by Leonhard Euler (using the first SERIES_DEGREE terms).
+ *
+ * @param arg Inverse tangent argument.
+ *
+ * @return Inverse tangent value approximation.
+ *
+ */
+static float32_t series_atan_32(float32_t arg)
+{
+	float32_t sum = 0;
+	float32_t a = arg / (1.0 + arg * arg);
+	
+	/*
+	 * atan(z) = sum(n=0, +inf) [ (2^2n) * (n!)^2 / (2n + 1)! *
+	 *    z^(2n+1) / (1 + z^2)^(n+1) ]
+	 */
+	
+	for (unsigned int n = 0; n < SERIES_DEGREE_32; n++) {
+		if (n > 0) {
+			a = a * n * n;
+			a = a / (2.0 * n + 1.0) / (2.0 * n);
+		}
+		sum += a;
+		a = a * 4.0 * arg * arg / (1.0 + arg * arg);
+	}
+	
+	return sum;
+}
+
+/** Inverse tangent approximation by Euler's series (64-bit floating point)
+ *
+ * Compute the approximation of inverse tangent by a
+ * series found by Leonhard Euler (using the first SERIES_DEGREE terms).
+ *
+ * @param arg Inverse tangent argument.
+ *
+ * @return Inverse tangent value approximation.
+ *
+ */
+static float64_t series_atan_64(float64_t arg)
+{
+	float64_t sum = 0;
+	float64_t a = arg / (1.0 + arg * arg);
+	
+	/*
+	 * atan(z) = sum(n=0, +inf) [ (2^2n) * (n!)^2 / (2n + 1)! *
+	 *    z^(2n+1) / (1 + z^2)^(n+1) ]
+	 */
+	
+	for (unsigned int n = 0; n < SERIES_DEGREE_64; n++) {
+		if (n > 0) {
+			a = a * n * n;
+			a = a / (2.0 * n + 1.0) / (2.0 * n);
+		}
+		sum += a;
+		a = a * 4.0 * arg * arg / (1.0 + arg * arg);
+	}
+	
+	return sum;
+}
+
+/** Inverse tangent (32-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float32_t float32_atan(float32_t arg)
+{
+	if (arg < -1.0 || arg > 1.0)
+		return 2.0 * series_atan_32(arg / (1.0 + sqrt_f32(1.0 + arg*arg)));
+	else
+		return series_atan_32(arg);
+}
+
+/** Inverse tangent (64-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float64_t float64_atan(float64_t arg)
+{
+	if (arg < -1.0 || arg > 1.0)
+		return 2.0 * series_atan_64(arg / (1.0 + sqrt_f64(1.0 + arg*arg)));
+	else
+		return series_atan_64(arg);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/atan2.c
===================================================================
--- uspace/lib/math/generic/atan2.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/atan2.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <atan2.h>
+#include <errno.h>
+#include <math.h>
+
+/** Inverse tangent of two variables (32-bit floating point)
+ *
+ * @param y
+ * @param x
+ *
+ * @return Inverse tangent of @a y / @a x.
+ *
+ */
+float32_t float32_atan2(float32_t y, float32_t x)
+{
+	if (x >= 0)
+		return atan_f32(y / x);
+	else if (y >= 0)
+		return M_PI - atan_f32(y / -x);
+	else
+		return -M_PI + atan_f32(y / -x);
+}
+
+/** Inverse tangent of two variables (64-bit floating point)
+ *
+ * @param y
+ * @param x
+ *
+ * @return Inverse tangent of @a y / @a x.
+ *
+ */
+float64_t float64_atan2(float64_t y, float64_t x)
+{
+	if (x >= 0)
+		return atan_f64(y / x);
+	else if (y >= 0)
+		return M_PI - atan_f64(y / -x);
+	else
+		return -M_PI + atan_f64(y / -x);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/cosh.c
===================================================================
--- uspace/lib/math/generic/cosh.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/cosh.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <cosh.h>
+#include <math.h>
+
+/** Hyperbolic cosine (32-bit floating point)
+ *
+ * Compute hyperbolic cosine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic cosine.
+ *
+ */
+float32_t float32_cosh(float32_t arg)
+{
+	return (exp_f32(arg) + exp_f32(-arg)) / 2.0;
+}
+
+/** Hyperbolic cosine (64-bit floating point)
+ *
+ * Compute hyperbolic cosine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic cosine.
+ *
+ */
+float64_t float64_cosh(float64_t arg)
+{
+	return (exp_f64(arg) + exp_f64(-arg)) / 2.0;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/exp.c
===================================================================
--- uspace/lib/math/generic/exp.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
+++ uspace/lib/math/generic/exp.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -36,5 +36,4 @@
 #include <exp.h>
 #include <math.h>
-#include <trunc.h>
 
 #define TAYLOR_DEGREE_32 13
Index: uspace/lib/math/generic/fabs.c
===================================================================
--- uspace/lib/math/generic/fabs.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/fabs.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <fabs.h>
+
+/** Absolute value (32-bit floating point)
+ *
+ * Compute absolute value.
+ *
+ * @param arg Argument.
+ *
+ * @return Absolute value.
+ *
+ */
+float32_t float32_fabs(float32_t arg)
+{
+	if (arg < 0.0)
+		return -arg;
+	else
+		return arg;
+}
+
+/** Absolute value (64-bit floating point)
+ *
+ * Compute absolute value.
+ *
+ * @param arg Argument.
+ *
+ * @return Absolute value.
+ *
+ */
+float64_t float64_fabs(float64_t arg)
+{
+	if (arg < 0.0)
+		return -arg;
+	else
+		return arg;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/fmod.c
===================================================================
--- uspace/lib/math/generic/fmod.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/fmod.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <fmod.h>
+#include <math.h>
+
+/** Remainder function (32-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float32_t float32_fmod(float32_t dividend, float32_t divisor)
+{
+	// FIXME: replace with exact arithmetics
+	
+	float32_t quotient = trunc_f32(dividend / divisor);
+	
+	return (dividend - quotient * divisor);
+}
+
+/** Remainder function (64-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float64_t float64_fmod(float64_t dividend, float64_t divisor)
+{
+	// FIXME: replace with exact arithmetics
+	
+	float64_t quotient = trunc_f64(dividend / divisor);
+	
+	return (dividend - quotient * divisor);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/frexp.c
===================================================================
--- uspace/lib/math/generic/frexp.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/frexp.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <frexp.h>
+#include <math.h>
+
+/** Break single precision number into fraction and exponent
+ *
+ * Return f and *exp such that x = f * 2^(*exp) and f is in [0.5,1)
+ *
+ * @param x Number
+ * @param exp Place to store exponent
+ *
+ * @return f
+ *
+ */
+float32_t float32_frexp(float32_t x, int *exp)
+{
+	float32_u u;
+
+	u.val = x;
+	*exp = u.data.parts.exp - FLOAT32_BIAS;
+	u.data.parts.exp = FLOAT32_BIAS;
+
+	return u.val;
+}
+
+/** Break double precision number into fraction and exponent
+ *
+ * Return f and *exp such that x = f * 2^(*exp) and f is in [0.5,1)
+ *
+ * @param x Number
+ * @param exp Place to store exponent
+ *
+ * @return f
+ *
+ */
+float64_t float64_frexp(float64_t x, int *exp)
+{
+	float64_u u;
+
+	u.val = x;
+	*exp = u.data.parts.exp - FLOAT64_BIAS;
+	u.data.parts.exp = FLOAT64_BIAS;
+
+	return u.val;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/ldexp.c
===================================================================
--- uspace/lib/math/generic/ldexp.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/ldexp.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <errno.h>
+#include <ldexp.h>
+#include <math.h>
+
+/** Single precision multiply by power of two
+ *
+ * Compute x * 2^exp.
+ *
+ * @param x Number
+ * @param exp Exponent
+ *
+ * @return x * 2^exp
+ *
+ */
+float32_t float32_ldexp(float32_t x, int exp)
+{
+	float32_u u;
+	int e;
+
+	u.val = x;
+	e = u.data.parts.exp + exp;
+
+	if (e < 0) {
+		/* XXX Can we return denormalized numbers? */
+		return 0.0;
+	} else if (e > FLOAT32_MAX_EXPONENT) {
+		errno = ERANGE;
+		if (e < 0)
+			return -FLOAT32_INF;
+		else
+			return FLOAT32_INF;
+	} else {
+		/* Adjust exponent */
+		u.data.parts.exp = e;
+		return u.val;
+	}
+}
+
+/** Double precision multiply by power of two
+ *
+ * Compute x * 2^exp.
+ *
+ * @param x Number
+ * @param y Exponent
+ *
+ * @return x * 2^exp
+ *
+ */
+float64_t float64_ldexp(float64_t x, int exp)
+{
+	float64_u u;
+	int e;
+
+	u.val = x;
+	e = u.data.parts.exp + exp;
+
+	if (e < 0) {
+		/* XXX Can we return denormalized numbers? */
+		return 0.0;
+	} else if (e > FLOAT64_MAX_EXPONENT) {
+		errno = ERANGE;
+		if (e < 0)
+			return -FLOAT64_INF;
+		else
+			return FLOAT64_INF;
+	} else {
+		/* Adjust exponent */
+		u.data.parts.exp = e;
+		return u.val;
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/log10.c
===================================================================
--- uspace/lib/math/generic/log10.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/log10.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <log10.h>
+#include <math.h>
+
+/** Decimal logarithm (32-bit floating point)
+ *
+ * Compute logarithm value.
+ *
+ * @param arg Logarithm argument.
+ *
+ * @return Logarithm value.
+ *
+ */
+float32_t float32_log10(float32_t arg)
+{
+	return log_f32(arg) / M_LN10;
+}
+
+/** Decimal logarithm (64-bit floating point)
+ *
+ * Compute logarithm value.
+ *
+ * @param arg Logarithm argument.
+ *
+ * @return Logarithm value.
+ *
+ */
+float64_t float64_log10(float64_t arg)
+{
+	return log_f64(arg) / M_LN10;
+}
+
+
+/** @}
+ */
Index: uspace/lib/math/generic/mod.c
===================================================================
--- uspace/lib/math/generic/mod.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/*
- * Copyright (c) 2014 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libmath
- * @{
- */
-/** @file
- */
-
-#include <math.h>
-#include <mod.h>
-
-/** Remainder function (32-bit floating point)
- *
- * Calculate the modulo of dividend by divisor.
- *
- * This is a very basic implementation that uses
- * division and multiplication (instead of exact
- * arithmetics). Thus the result might be very
- * imprecise (depending on the magnitude of the
- * arguments).
- *
- * @param dividend Dividend.
- * @param divisor  Divisor.
- *
- * @return Modulo.
- *
- */
-float32_t float32_mod(float32_t dividend, float32_t divisor)
-{
-	// FIXME: replace with exact arithmetics
-	
-	float32_t quotient = trunc_f32(dividend / divisor);
-	
-	return (dividend - quotient * divisor);
-}
-
-/** Remainder function (64-bit floating point)
- *
- * Calculate the modulo of dividend by divisor.
- *
- * This is a very basic implementation that uses
- * division and multiplication (instead of exact
- * arithmetics). Thus the result might be very
- * imprecise (depending on the magnitude of the
- * arguments).
- *
- * @param dividend Dividend.
- * @param divisor  Divisor.
- *
- * @return Modulo.
- *
- */
-float64_t float64_mod(float64_t dividend, float64_t divisor)
-{
-	// FIXME: replace with exact arithmetics
-	
-	float64_t quotient = trunc_f64(dividend / divisor);
-	
-	return (dividend - quotient * divisor);
-}
-
-/** @}
- */
Index: uspace/lib/math/generic/modf.c
===================================================================
--- uspace/lib/math/generic/modf.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/modf.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <modf.h>
+
+/** Remainder function (32-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float32_t float32_modf(float32_t value, float32_t *iptr)
+{
+	*iptr = trunc_f32(value);
+	return value - *iptr;
+}
+
+/** Remainder function (64-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float64_t float64_modf(float64_t value, float64_t *iptr)
+{
+	*iptr = trunc_f64(value);
+	return value - *iptr;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/pow.c
===================================================================
--- uspace/lib/math/generic/pow.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
+++ uspace/lib/math/generic/pow.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -34,6 +34,4 @@
  */
 
-#include <exp.h>
-#include <log.h>
 #include <math.h>
 #include <pow.h>
Index: uspace/lib/math/generic/sinh.c
===================================================================
--- uspace/lib/math/generic/sinh.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/sinh.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <sinh.h>
+
+/** Hyperbolic sine (32-bit floating point)
+ *
+ * Compute hyperbolic sine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic sine.
+ *
+ */
+float32_t float32_sinh(float32_t arg)
+{
+	return (exp_f32(arg) - exp_f32(-arg)) / 2.0;
+}
+
+/** Hyperbolic sine (64-bit floating point)
+ *
+ * Compute hyperbolic sine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic sine.
+ *
+ */
+float64_t float64_sinh(float64_t arg)
+{
+	return (exp_f64(arg) - exp_f64(-arg)) / 2.0;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/sqrt.c
===================================================================
--- uspace/lib/math/generic/sqrt.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/sqrt.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <sqrt.h>
+
+/** Single precision square root
+ *
+ * Compute square root.
+ *
+ * @param val Value
+ *
+ * @return Square root.
+ *
+ */
+float32_t float32_sqrt(float32_t val)
+{
+	return pow_f32(val, 0.5);
+}
+
+/** Double precision square root
+ *
+ * Compute squre root.
+ *
+ * @param val Value
+ *
+ * @return Square root.
+ *
+ */
+float64_t float64_sqrt(float64_t val)
+{
+	return pow_f64(val, 0.5);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/tan.c
===================================================================
--- uspace/lib/math/generic/tan.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/tan.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <tan.h>
+
+/** Tangent (32-bit floating point)
+ *
+ * Compute tangent value.
+ *
+ * @param arg Tangent argument.
+ *
+ * @return Tangent value.
+ *
+ */
+float32_t float32_tan(float32_t arg)
+{
+	return sin_f32(arg) / cos_f32(arg);
+}
+
+/** Sine (64-bit floating point)
+ *
+ * Compute sine value.
+ *
+ * @param arg Sine argument.
+ *
+ * @return Sine value.
+ *
+ */
+float64_t float64_tan(float64_t arg)
+{
+	return sin_f64(arg) / cos_f64(arg);
+}
+
+
+/** @}
+ */
Index: uspace/lib/math/generic/tanh.c
===================================================================
--- uspace/lib/math/generic/tanh.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
+++ uspace/lib/math/generic/tanh.c	(revision 9308dbadbc0cbb2bac23b198dd31abc15ef9c2d1)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <tanh.h>
+
+/** Hyperbolic tangent (32-bit floating point)
+ *
+ * Compute hyperbolic tangent value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic tangent.
+ *
+ */
+float32_t float32_tanh(float32_t arg)
+{
+	float32_t em2x;
+
+	if (arg > 9.0)
+		return 1.0;
+	if (arg < -9.0)
+		return -1.0;
+
+	em2x = exp_f32(-2.0 * arg);
+	return (1.0 - em2x) / (1.0 + em2x);
+}
+
+/** Hyperbolic tangent (64-bit floating point)
+ *
+ * Compute hyperbolic tangent value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic tangent.
+ *
+ */
+float64_t float64_tanh(float64_t arg)
+{
+	float64_t em2x;
+
+	if (arg > 19.0)
+		return 1.0;
+	if (arg < -19.0)
+		return -1.0;
+
+	em2x = exp_f64(-2.0 * arg);
+	return (1.0 - em2x) / (1.0 + em2x);
+}
+
+/** @}
+ */
