changeset 3260:77f9d3253c3e

Add: Complex number header and library (single and double precision floating point), port from Newlib. Add: Single precision floating point library, port from Newlib. [ Bugzilla 1001539 ]
author vae
date Sun, 25 Aug 2013 14:38:57 +0000
parents 8ecac279f33c
children c53b67b63b63
files packages/language/c/libm/current/ChangeLog packages/language/c/libm/current/cdl/compat.cdl packages/language/c/libm/current/cdl/libm.cdl packages/language/c/libm/current/include/complex.h packages/language/c/libm/current/include/math.h packages/language/c/libm/current/src/complex/cabs.c packages/language/c/libm/current/src/complex/cabsf.c packages/language/c/libm/current/src/complex/cacos.c packages/language/c/libm/current/src/complex/cacosf.c packages/language/c/libm/current/src/complex/cacosh.c packages/language/c/libm/current/src/complex/cacoshf.c packages/language/c/libm/current/src/complex/carg.c packages/language/c/libm/current/src/complex/cargf.c packages/language/c/libm/current/src/complex/casin.c packages/language/c/libm/current/src/complex/casinf.c packages/language/c/libm/current/src/complex/casinh.c packages/language/c/libm/current/src/complex/casinhf.c packages/language/c/libm/current/src/complex/catan.c packages/language/c/libm/current/src/complex/catanf.c packages/language/c/libm/current/src/complex/catanh.c packages/language/c/libm/current/src/complex/catanhf.c packages/language/c/libm/current/src/complex/ccos.c packages/language/c/libm/current/src/complex/ccosf.c packages/language/c/libm/current/src/complex/ccosh.c packages/language/c/libm/current/src/complex/ccoshf.c packages/language/c/libm/current/src/complex/cephes_subr.c packages/language/c/libm/current/src/complex/cephes_subr.h packages/language/c/libm/current/src/complex/cephes_subrf.c packages/language/c/libm/current/src/complex/cephes_subrf.h packages/language/c/libm/current/src/complex/cexp.c packages/language/c/libm/current/src/complex/cexpf.c packages/language/c/libm/current/src/complex/cimag.c packages/language/c/libm/current/src/complex/cimagf.c packages/language/c/libm/current/src/complex/clog.c packages/language/c/libm/current/src/complex/clogf.c packages/language/c/libm/current/src/complex/complex.tex packages/language/c/libm/current/src/complex/conj.c packages/language/c/libm/current/src/complex/conjf.c packages/language/c/libm/current/src/complex/cpow.c packages/language/c/libm/current/src/complex/cpowf.c packages/language/c/libm/current/src/complex/cproj.c packages/language/c/libm/current/src/complex/cprojf.c packages/language/c/libm/current/src/complex/creal.c packages/language/c/libm/current/src/complex/crealf.c packages/language/c/libm/current/src/complex/csin.c packages/language/c/libm/current/src/complex/csinf.c packages/language/c/libm/current/src/complex/csinh.c packages/language/c/libm/current/src/complex/csinhf.c packages/language/c/libm/current/src/complex/csqrt.c packages/language/c/libm/current/src/complex/csqrtf.c packages/language/c/libm/current/src/complex/ctan.c packages/language/c/libm/current/src/complex/ctanf.c packages/language/c/libm/current/src/complex/ctanh.c packages/language/c/libm/current/src/complex/ctanhf.c packages/language/c/libm/current/src/float/ieee754-api/wf_acos.c packages/language/c/libm/current/src/float/ieee754-api/wf_acosh.c packages/language/c/libm/current/src/float/ieee754-api/wf_asin.c packages/language/c/libm/current/src/float/ieee754-api/wf_atan2.c packages/language/c/libm/current/src/float/ieee754-api/wf_atanh.c packages/language/c/libm/current/src/float/ieee754-api/wf_cosh.c packages/language/c/libm/current/src/float/ieee754-api/wf_exp.c packages/language/c/libm/current/src/float/ieee754-api/wf_fmod.c packages/language/c/libm/current/src/float/ieee754-api/wf_gamma.c packages/language/c/libm/current/src/float/ieee754-api/wf_gamma_r.c packages/language/c/libm/current/src/float/ieee754-api/wf_hypot.c packages/language/c/libm/current/src/float/ieee754-api/wf_j0.c packages/language/c/libm/current/src/float/ieee754-api/wf_j1.c packages/language/c/libm/current/src/float/ieee754-api/wf_jn.c packages/language/c/libm/current/src/float/ieee754-api/wf_lgamma.c packages/language/c/libm/current/src/float/ieee754-api/wf_lgamma_r.c packages/language/c/libm/current/src/float/ieee754-api/wf_log.c packages/language/c/libm/current/src/float/ieee754-api/wf_log10.c packages/language/c/libm/current/src/float/ieee754-api/wf_pow.c packages/language/c/libm/current/src/float/ieee754-api/wf_remainder.c packages/language/c/libm/current/src/float/ieee754-api/wf_scalb.c packages/language/c/libm/current/src/float/ieee754-api/wf_sinh.c packages/language/c/libm/current/src/float/ieee754-api/wf_sqrt.c packages/language/c/libm/current/src/float/ieee754-core/ef_acos.c packages/language/c/libm/current/src/float/ieee754-core/ef_acosh.c packages/language/c/libm/current/src/float/ieee754-core/ef_asin.c packages/language/c/libm/current/src/float/ieee754-core/ef_atan2.c packages/language/c/libm/current/src/float/ieee754-core/ef_atanh.c packages/language/c/libm/current/src/float/ieee754-core/ef_cosh.c packages/language/c/libm/current/src/float/ieee754-core/ef_exp.c packages/language/c/libm/current/src/float/ieee754-core/ef_fmod.c packages/language/c/libm/current/src/float/ieee754-core/ef_gamma.c packages/language/c/libm/current/src/float/ieee754-core/ef_gamma_r.c packages/language/c/libm/current/src/float/ieee754-core/ef_hypot.c packages/language/c/libm/current/src/float/ieee754-core/ef_j0.c packages/language/c/libm/current/src/float/ieee754-core/ef_j1.c packages/language/c/libm/current/src/float/ieee754-core/ef_jn.c packages/language/c/libm/current/src/float/ieee754-core/ef_lgamma.c packages/language/c/libm/current/src/float/ieee754-core/ef_lgamma_r.c packages/language/c/libm/current/src/float/ieee754-core/ef_log.c packages/language/c/libm/current/src/float/ieee754-core/ef_log10.c packages/language/c/libm/current/src/float/ieee754-core/ef_pow.c packages/language/c/libm/current/src/float/ieee754-core/ef_rem_pio2.c packages/language/c/libm/current/src/float/ieee754-core/ef_remainder.c packages/language/c/libm/current/src/float/ieee754-core/ef_scalb.c packages/language/c/libm/current/src/float/ieee754-core/ef_sinh.c packages/language/c/libm/current/src/float/ieee754-core/ef_sqrt.c packages/language/c/libm/current/src/float/internal/kf_cos.c packages/language/c/libm/current/src/float/internal/kf_rem_pio2.c packages/language/c/libm/current/src/float/internal/kf_sin.c packages/language/c/libm/current/src/float/internal/kf_tan.c packages/language/c/libm/current/src/float/portable-api/sf_asinh.c packages/language/c/libm/current/src/float/portable-api/sf_atan.c packages/language/c/libm/current/src/float/portable-api/sf_cbrt.c packages/language/c/libm/current/src/float/portable-api/sf_ceil.c packages/language/c/libm/current/src/float/portable-api/sf_copysign.c packages/language/c/libm/current/src/float/portable-api/sf_cos.c packages/language/c/libm/current/src/float/portable-api/sf_erf.c packages/language/c/libm/current/src/float/portable-api/sf_expm1.c packages/language/c/libm/current/src/float/portable-api/sf_fabs.c packages/language/c/libm/current/src/float/portable-api/sf_finite.c packages/language/c/libm/current/src/float/portable-api/sf_floor.c packages/language/c/libm/current/src/float/portable-api/sf_frexp.c packages/language/c/libm/current/src/float/portable-api/sf_ilogb.c packages/language/c/libm/current/src/float/portable-api/sf_isnan.c packages/language/c/libm/current/src/float/portable-api/sf_ldexp.c packages/language/c/libm/current/src/float/portable-api/sf_log1p.c packages/language/c/libm/current/src/float/portable-api/sf_logb.c packages/language/c/libm/current/src/float/portable-api/sf_modf.c packages/language/c/libm/current/src/float/portable-api/sf_nextafter.c packages/language/c/libm/current/src/float/portable-api/sf_rint.c packages/language/c/libm/current/src/float/portable-api/sf_scalbn.c packages/language/c/libm/current/src/float/portable-api/sf_significand.c packages/language/c/libm/current/src/float/portable-api/sf_sin.c packages/language/c/libm/current/src/float/portable-api/sf_tan.c packages/language/c/libm/current/src/float/portable-api/sf_tanh.c packages/language/c/libm/current/src/mathincl/fdlibm.h packages/language/c/libm/current/src/misc/matherr.c packages/language/c/libm/current/src/misc/standard.c packages/language/c/libm/current/src/misc/standard.inl packages/language/c/libm/current/src/misc/standard_float.c packages/language/c/libm/current/tests/vectors/acosf.c packages/language/c/libm/current/tests/vectors/acoshf.c packages/language/c/libm/current/tests/vectors/asinf.c packages/language/c/libm/current/tests/vectors/asinhf.c packages/language/c/libm/current/tests/vectors/atan2f.c packages/language/c/libm/current/tests/vectors/atanf.c packages/language/c/libm/current/tests/vectors/atanhf.c packages/language/c/libm/current/tests/vectors/cbrtf.c packages/language/c/libm/current/tests/vectors/ceilf.c packages/language/c/libm/current/tests/vectors/copysignf.c packages/language/c/libm/current/tests/vectors/cosf.c packages/language/c/libm/current/tests/vectors/coshf.c packages/language/c/libm/current/tests/vectors/erfcf.c packages/language/c/libm/current/tests/vectors/erff.c packages/language/c/libm/current/tests/vectors/expf.c packages/language/c/libm/current/tests/vectors/expm1f.c packages/language/c/libm/current/tests/vectors/fabsf.c packages/language/c/libm/current/tests/vectors/finitef.c packages/language/c/libm/current/tests/vectors/floorf.c packages/language/c/libm/current/tests/vectors/fmodf.c packages/language/c/libm/current/tests/vectors/frexpf.c packages/language/c/libm/current/tests/vectors/gammaf.c packages/language/c/libm/current/tests/vectors/hypotf.c packages/language/c/libm/current/tests/vectors/ilogbf.c packages/language/c/libm/current/tests/vectors/isnanf.c packages/language/c/libm/current/tests/vectors/j0f.c packages/language/c/libm/current/tests/vectors/j1f.c packages/language/c/libm/current/tests/vectors/jnf.c packages/language/c/libm/current/tests/vectors/ldexpf.c packages/language/c/libm/current/tests/vectors/log10f.c packages/language/c/libm/current/tests/vectors/log1pf.c packages/language/c/libm/current/tests/vectors/logbf.c packages/language/c/libm/current/tests/vectors/logf.c packages/language/c/libm/current/tests/vectors/modff.c packages/language/c/libm/current/tests/vectors/nextafterf.c packages/language/c/libm/current/tests/vectors/powf.c packages/language/c/libm/current/tests/vectors/remainderf.c packages/language/c/libm/current/tests/vectors/rintf.c packages/language/c/libm/current/tests/vectors/scalbf.c packages/language/c/libm/current/tests/vectors/scalbnf.c packages/language/c/libm/current/tests/vectors/significandf.c packages/language/c/libm/current/tests/vectors/sinf.c packages/language/c/libm/current/tests/vectors/sinhf.c packages/language/c/libm/current/tests/vectors/sqrtf.c packages/language/c/libm/current/tests/vectors/tanf.c packages/language/c/libm/current/tests/vectors/tanhf.c packages/language/c/libm/current/tests/vectors/vector_support_float.h
diffstat 182 files changed, 22351 insertions(+), 905 deletions(-) [+]
line wrap: on
line diff
--- a/packages/language/c/libm/current/ChangeLog
+++ b/packages/language/c/libm/current/ChangeLog
@@ -1,3 +1,118 @@
+2013-08-25  Ilija Kocho <ilijak@siva.com.mk>
+
+	* src/complex/cabs.c, src/complex/casinf.c, src/complex/ccosh.c, src/complex/cimagf.c,
+	* src/complex/cprojf.c, src/complex/ctan.c, src/complex/cabsf.c, src/complex/casinh.c,
+	* src/complex/ccoshf.c, src/complex/clog.c, src/complex/creal.c, src/complex/ctanf.c,
+	* src/complex/cacos.c, src/complex/casinhf.c, src/complex/cephes_subr.c,
+	* src/complex/clogf.c, src/complex/crealf.c, src/complex/ctanh.c, src/complex/cacosf.c,
+	* src/complex/catan.c, src/complex/cephes_subrf.c, src/complex/src/complex.tex,
+	* src/complex/csin.c, src/complex/ctanhf.c, src/complex/cacosh.c, src/complex/catanf.c,
+	* src/complex/cephes_subrf.h src/complex/conj.c, src/complex/csinf.c,
+	* src/complex/cacoshf.c, src/complex/catanh.c, src/complex/cephes_subr.h
+	* src/complex/conjf.c, src/complex/csinh.c, src/complex/carg.c, src/complex/catanhf.c,
+	* src/complex/cexp.c, src/complex/cpow.c, src/complex/csinhf.c, src/complex/cargf.c,
+	* src/complex/ccos.c, src/complex/cexpf.c, src/complex/cpowf.c, src/complex/csqrt.c,
+	* src/complex/casin.c, src/complex/ccosf.c, src/complex/cimag.c, src/complex/cproj.c,
+	* src/complex/csqrtf.c,
+	* include/src/complex.h:
+
+	Add: Complex number header and library (single and double precision floating point),
+	port from Newlib. [ Bugzilla 1001539 ]
+
+2013-08-25  Visar Zejnullahu <visar.siva.mk>
+            Ilija Kocho <ilijak@siva.com.mk>
+
+	* cdl/compat.cdl, cdl/libm.cdl, include/complex.h, include/math.h,
+	* src/float/ieee754-api/wf_acos.c, src/float/ieee754-api/wf_acosh.c,
+	* src/float/ieee754-api/wf_asin.c, src/float/ieee754-api/wf_atan2.c,
+	* src/float/ieee754-api/wf_atanh.c, src/float/ieee754-api/wf_cosh.c,
+	* src/float/ieee754-api/wf_exp.c, src/float/ieee754-api/wf_fmod.c,
+	* src/float/ieee754-api/wf_gamma.c, src/float/ieee754-api/wf_gamma_r.c,
+	* src/float/ieee754-api/wf_hypot.c, src/float/ieee754-api/wf_j0.c,
+	* src/float/ieee754-api/wf_j1.c, src/float/ieee754-api/wf_jn.c,
+	* src/float/ieee754-api/wf_lgamma.c, src/float/ieee754-api/wf_lgamma_r.c,
+	* src/float/ieee754-api/wf_log10.c, src/float/ieee754-api/wf_log.c,
+	* src/float/ieee754-api/wf_pow.c, src/float/ieee754-api/wf_remainder.c,
+	* src/float/ieee754-api/wf_scalb.c, src/float/ieee754-api/wf_sinh.c,
+	* src/float/ieee754-api/wf_sqrt.c, 
+	* src/float/ieee754-core/ef_acos.c, src/float/ieee754-core/ef_acosh.c,
+	* src/float/ieee754-core/ef_asin.c, src/float/ieee754-core/ef_atan2.c,
+	* src/float/ieee754-core/ef_atanh.c, src/float/ieee754-core/ef_cosh.c,
+	* src/float/ieee754-core/ef_exp.c, src/float/ieee754-core/ef_fmod.c,
+	* src/float/ieee754-core/ef_gamma.c, src/float/ieee754-core/ef_gamma_r.c,
+	* src/float/ieee754-core/ef_hypot.c, src/float/ieee754-core/ef_j0.c,
+	* src/float/ieee754-core/ef_j1.c, src/float/ieee754-core/ef_jn.c,
+	* src/float/ieee754-core/ef_lgamma.c, src/float/ieee754-core/ef_lgamma_r.c,
+	* src/float/ieee754-core/ef_log10.c, src/float/ieee754-core/ef_log.c,
+	* src/float/ieee754-core/ef_pow.c, src/float/ieee754-core/ef_remainder.c,
+	* src/float/ieee754-core/ef_rem_pio2.c, src/float/ieee754-core/ef_scalb.c,
+	* src/float/ieee754-core/ef_sinh.c, src/float/ieee754-core/ef_sqrt.c,
+	* src/float/internal/kf_cos.c, src/float/internal/kf_rem_pio2.c,
+	* src/float/internal/kf_sin.c, src/float/internal/kf_tan.c,
+	* src/float/portable-api/sf_asinh.c, src/float/portable-api/sf_atan.c,
+	* src/float/portable-api/sf_cbrt.c, src/float/portable-api/sf_ceil.c,
+	* src/float/portable-api/sf_copysign.c, src/float/portable-api/sf_cos.c,
+	* src/float/portable-api/sf_erf.c, src/float/portable-api/sf_expm1.c,
+	* src/float/portable-api/sf_fabs.c, src/float/portable-api/sf_finite.c,
+	* src/float/portable-api/sf_floor.c, src/float/portable-api/sf_frexp.c,
+	* src/float/portable-api/sf_ilogb.c, src/float/portable-api/sf_isnan.c,
+	* src/float/portable-api/sf_ldexp.c, src/float/portable-api/sf_log1p.c,
+	* src/float/portable-api/sf_logb.c, src/float/portable-api/sf_modf.c,
+	* src/float/portable-api/sf_nextafter.c, src/float/portable-api/sf_rint.c,
+	* src/float/portable-api/sf_scalbn.c, src/float/portable-api/sf_significand.c,
+	* src/float/portable-api/sf_sin.c, src/float/portable-api/sf_tan.c,
+	* src/float/portable-api/sf_tanh.c,
+	* src/mathincl/fdlibm.h,
+	* tests/vector_support.h,
+	* tests/vectors/acosf.c, tests/vectors/atan2.h,
+	* tests/vectors/copysignf.h, tests/vectors/expf.h,
+	* tests/vectors/fmodf.c, tests/vectors/ilogbf.h,
+	* tests/vectors/log10f.c, tests/vectors/modff.h, tests/vectors/scalbf.h,
+	* tests/vectors/sqrtf.h, tests/vectors/acosf.h, tests/vectors/atanf.c,
+	* tests/vectors/cosf.c, tests/vectors/exp.h, tests/vectors/fmodf.h,
+	* tests/vectors/isnanf.c, tests/vectors/log10f.h, tests/vectors/modf.h,
+	* tests/vectors/scalbnf.c, tests/vectors/sqrt.h, tests/vectors/acos.h,
+	* tests/vectors/atanf.h, tests/vectors/cosf.h, tests/vectors/expm1f.c,
+	* tests/vectors/fmod.h, tests/vectors/isnanf.h, tests/vectors/log10.h,
+	* tests/vectors/nextafterf.c, tests/vectors/scalbnf.h, tests/vectors/tanf.c,
+	* tests/vectors/acoshf.c, tests/vectors/atan.h, tests/vectors/cos.h,
+	* tests/vectors/expm1f.h, tests/vectors/frexpf.c, tests/vectors/j0f.c,
+	* tests/vectors/log1pf.c, tests/vectors/nextafterf.h,
+	* tests/vectors/significandf.c, tests/vectors/tanf.h,
+	* tests/vectors/acoshf.h, tests/vectors/atanhf.c, tests/vectors/coshf.c,
+	* tests/vectors/fabsf.c, tests/vectors/frexpf.h, tests/vectors/j0f.h,
+	* tests/vectors/log1pf.h, tests/vectors/powf.c, tests/vectors/significandf.h,
+	* tests/vectors/tan.h, tests/vectors/asinf.c, tests/vectors/atanhf.h,
+	* tests/vectors/coshf.h, tests/vectors/fabsf.h,
+	* tests/vectors/frexpf_visar.h, tests/vectors/j1f.c,
+	* tests/vectors/logbf.c, tests/vectors/powf.h,
+	* tests/vectors/sinf.c, tests/vectors/tanhf.c,
+	* tests/vectors/asinf.h, tests/vectors/cbrtf.c, tests/vectors/cosh.h,
+	* tests/vectors/fabs.h, tests/vectors/frexp.h, tests/vectors/j1f.h,
+	* tests/vectors/logbf.h, tests/vectors/pow.h, tests/vectors/sinf.h,
+	* tests/vectors/tanhf.h, tests/vectors/asin.h, tests/vectors/cbrtf.h,
+	* tests/vectors/erfcf.c, tests/vectors/finitef.c,
+	* tests/vectors/gammaf.c, tests/vectors/jnf.c, tests/vectors/logf.c,
+	* tests/vectors/remainderf.c, tests/vectors/sin.h,
+	* tests/vectors/tanh.h, tests/vectors/asinhf.c, tests/vectors/ceilf.c,
+	* tests/vectors/erfcf.h, tests/vectors/finitef.h,
+	* tests/vectors/gammaf.h, tests/vectors/jnf.h,
+	* tests/vectors/logf.h, tests/vectors/remainderf.h,
+	* tests/vectors/sinhf.c, tests/vectors/vector_support_float.h,
+	* tests/vectors/asinhf.h, tests/vectors/ceilf.h, tests/vectors/erff.c,
+	* tests/vectors/floorf.c, tests/vectors/hypotf.c, tests/vectors/ldexpf.c,
+	* tests/vectors/log.h, tests/vectors/rintf.c, tests/vectors/sinhf.h,
+	* tests/vectors/vector_support.h, tests/vectors/atan2f.c,
+	* tests/vectors/ceil.h, tests/vectors/erff.h, tests/vectors/floorf.h,
+	* tests/vectors/hypotf.h, tests/vectors/ldexpf.h,
+	* tests/vectors/modf.c, tests/vectors/rintf.h, tests/vectors/sinh.h,
+	* tests/vectors/atan2f.h, tests/vectors/copysignf.c, tests/vectors/expf.c,
+	* tests/vectors/floor.h, tests/vectors/ilogbf.c, tests/vectors/ldexp.h,
+	* tests/vectors/modff.c, tests/vectors/scalbf.c, tests/vectors/sqrtf.c:
+
+	Add: Single precision floating point library, port from Newlib.
+	[ Bugzilla 1001539 ]
+
 2010-11-11  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
 
 	* cdl/libm.cdl (CYGPKG_LIBM_CFLAGS_ADD): Add a set of parentheses
@@ -824,7 +939,7 @@ Fri Jun  5 07:07:03 1998  Jonathan Larmo
 // ####GPLCOPYRIGHTBEGIN####                                                
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007, 2008, 2010, 2013 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
--- a/packages/language/c/libm/current/cdl/compat.cdl
+++ b/packages/language/c/libm/current/cdl/compat.cdl
@@ -8,7 +8,7 @@
 ## ####ECOSGPLCOPYRIGHTBEGIN####                                            
 ## -------------------------------------------                              
 ## This file is part of eCos, the Embedded Configurable Operating System.   
-## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2013 Free Software Foundation, Inc.
 ##
 ## eCos is free software; you can redistribute it and/or modify it under    
 ## the terms of the GNU General Public License as published by the Free     
@@ -41,7 +41,7 @@
 #
 # Author(s):      jskov
 # Original data:  jlarmour
-# Contributors:
+# Contributors:   ilijak
 # Date:           1999-07-07
 #
 #####DESCRIPTIONEND####
@@ -52,7 +52,7 @@ cdl_interface CYGINT_LIBM_COMPAT {
     requires 1 == CYGINT_LIBM_COMPAT
 }
 
-cdl_option CYGSEM_LIBM_COMPAT_IEEE_ONLY {
+cdl_component CYGSEM_LIBM_COMPAT_IEEE_ONLY {
     display       "IEEE-only"
     default_value 0
     implements    CYGINT_LIBM_COMPAT
@@ -66,6 +66,19 @@ cdl_option CYGSEM_LIBM_COMPAT_IEEE_ONLY 
         modes. If not defined, the math library can be
         set at run-time to any of the supported
         compatibility modes."
+
+    cdl_option CYGSEM_LIBM_IEEE_API_INLINE {
+        display    "Inline IEEE754 API wrappers"
+        default_value 0
+
+        description "
+            IEEE754 API functions are just wrappers for
+            core functions. This introduces indirection which can can be
+            avoided by inlining. This will also prevent GCC from rendering
+            these functions as builtin. The HAL can override for a set of functions
+            by providing a list of builtin functions."
+    }
+
 }
 
 cdl_component CYGNUM_LIBM_COMPATIBILITY {
@@ -83,7 +96,7 @@ cdl_component CYGNUM_LIBM_COMPATIBILITY 
         you choose which mode should be the default."
 
     cdl_option CYGNUM_LIBM_COMPAT_DEFAULT {
-      	display       "Numeric representation"
+	display       "Numeric representation"
 	flavor        data
 	calculated   { \
             CYGNUM_LIBM_COMPATIBILITY == "POSIX" ? "CYGNUM_LIBM_COMPAT_POSIX" :\
@@ -97,6 +110,16 @@ cdl_component CYGNUM_LIBM_COMPATIBILITY 
 	    mode for numeric representation in terms of the values used
 	    to set that mode at run-time."
     }
+
+    cdl_option CYGOPT_LIBM_COMPAT_POSIX_IEEE {
+        display       "POSIX return NaN for out-of-domain argument."
+        active_if   { CYGNUM_LIBM_COMPATIBILITY == "POSIX" }
+        default_value 0
+        description   "Later POSIX specification states that functions
+            may return either NaN (like IEEE), or implementation defined
+            value when argument is out of domain. For backward compatibility
+            default value is set to 0."
+    }
 }
 
 cdl_option CYGFUN_LIBM_SVID3_scalb {
--- a/packages/language/c/libm/current/cdl/libm.cdl
+++ b/packages/language/c/libm/current/cdl/libm.cdl
@@ -8,7 +8,7 @@
 ## ####ECOSGPLCOPYRIGHTBEGIN####                                            
 ## -------------------------------------------                              
 ## This file is part of eCos, the Embedded Configurable Operating System.   
-## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2010 Free Software Foundation, Inc.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2010, 2012, 2013 Free Software Foundation, Inc.
 ##
 ## eCos is free software; you can redistribute it and/or modify it under    
 ## the terms of the GNU General Public License as published by the Free     
@@ -41,7 +41,7 @@
 #
 # Author(s):      bartv
 # Original data:  jlarmour
-# Contributors:
+# Contributors:   visar, ilijak
 # Date:           1999-06-13
 #
 #####DESCRIPTIONEND####
@@ -56,38 +56,85 @@ cdl_package CYGPKG_LIBM {
         containing many useful functions for mathematical
         calculations."
 
-    compile       misc/matherr.c misc/standard.c misc/compatmode.cxx          \
-                  misc/infconst.c                                             \
-                                                                              \
-                  double/ieee754-core/e_acos.c double/ieee754-core/e_asin.c   \
-                  double/ieee754-core/e_atan2.c double/ieee754-core/e_cosh.c  \
-                  double/ieee754-core/e_exp.c double/ieee754-core/e_fmod.c    \
-                  double/ieee754-core/e_log.c double/ieee754-core/e_log10.c   \
-                  double/ieee754-core/e_pow.c                                 \
-                  double/ieee754-core/e_rem_pio2.c                            \
-                  double/ieee754-core/e_scalb.c double/ieee754-core/e_sinh.c  \
-                  double/ieee754-core/e_sqrt.c                                \
-                                                                              \
-                  double/ieee754-api/w_acos.c double/ieee754-api/w_asin.c     \
-                  double/ieee754-api/w_atan2.c double/ieee754-api/w_cosh.c    \
-                  double/ieee754-api/w_exp.c double/ieee754-api/w_fmod.c      \
-                  double/ieee754-api/w_log.c double/ieee754-api/w_log10.c     \
-                  double/ieee754-api/w_pow.c double/ieee754-api/w_scalb.c     \
-                  double/ieee754-api/w_sinh.c double/ieee754-api/w_sqrt.c     \
-                                                                              \
-                  double/internal/k_cos.c double/internal/k_rem_pio2.c        \
-                  double/internal/k_sin.c double/internal/k_tan.c             \
-                                                                              \
-                  double/portable-api/s_atan.c double/portable-api/s_ceil.c   \
-                  double/portable-api/s_copysign.c                            \
-                  double/portable-api/s_cos.c double/portable-api/s_expm1.c   \
-                  double/portable-api/s_fabs.c double/portable-api/s_finite.c \
-                  double/portable-api/s_floor.c double/portable-api/s_frexp.c \
-                  double/portable-api/s_isnan.c double/portable-api/s_ldexp.c \
-                  double/portable-api/s_rint.c double/portable-api/s_scalbn.c \
-                  double/portable-api/s_sin.c double/portable-api/s_tan.c     \
-                  double/portable-api/s_modf.c double/portable-api/s_tanh.c
-
+        compile   misc/matherr.c misc/standard.c misc/standard_float.c                  \
+                  misc/compatmode.cxx misc/infconst.c                                   \
+                                                                                        \
+                  double/ieee754-core/e_acos.c double/ieee754-core/e_asin.c             \
+                  double/ieee754-core/e_atan2.c double/ieee754-core/e_cosh.c            \
+                  double/ieee754-core/e_exp.c double/ieee754-core/e_fmod.c              \
+                  double/ieee754-core/e_log.c double/ieee754-core/e_log10.c             \
+                  double/ieee754-core/e_pow.c                                           \
+                  double/ieee754-core/e_rem_pio2.c                                      \
+                  double/ieee754-core/e_scalb.c double/ieee754-core/e_sinh.c            \
+                  double/ieee754-core/e_sqrt.c double/ieee754-core/e_hypot.c            \
+                                                                                        \
+                  double/ieee754-api/w_acos.c double/ieee754-api/w_asin.c               \
+                  double/ieee754-api/w_atan2.c double/ieee754-api/w_cosh.c              \
+                  double/ieee754-api/w_exp.c double/ieee754-api/w_fmod.c                \
+                  double/ieee754-api/w_log.c double/ieee754-api/w_log10.c               \
+                  double/ieee754-api/w_pow.c double/ieee754-api/w_scalb.c               \
+                  double/ieee754-api/w_sinh.c double/ieee754-api/w_sqrt.c               \
+                  double/ieee754-api/w_hypot.c                                          \
+                  double/ieee754-core/e_gamma.c double/ieee754-api/w_gamma.c            \
+                  double/ieee754-core/e_gamma_r.c double/ieee754-api/w_gamma_r.c        \
+                  double/ieee754-core/e_lgamma.c double/ieee754-api/w_lgamma.c          \
+                  double/ieee754-core/e_lgamma_r.c double/ieee754-api/w_lgamma_r.c      \
+                                                                                        \
+                  double/internal/k_cos.c double/internal/k_rem_pio2.c                  \
+                  double/internal/k_sin.c double/internal/k_tan.c                       \
+                                                                                        \
+                  float/internal/kf_cos.c float/internal/kf_sin.c                       \
+                  float/internal/kf_rem_pio2.c float/internal/kf_tan.c                  \
+                                                                                        \
+                  double/portable-api/s_atan.c double/portable-api/s_ceil.c             \
+                  double/portable-api/s_copysign.c                                      \
+                  double/portable-api/s_cos.c double/portable-api/s_expm1.c             \
+                  double/portable-api/s_fabs.c double/portable-api/s_finite.c           \
+                  double/portable-api/s_floor.c double/portable-api/s_frexp.c           \
+                  double/portable-api/s_isnan.c double/portable-api/s_ldexp.c           \
+                  double/portable-api/s_rint.c double/portable-api/s_scalbn.c           \
+                  double/portable-api/s_sin.c double/portable-api/s_tan.c               \
+                  double/portable-api/s_modf.c double/portable-api/s_tanh.c             \
+                                                                                        \
+                  float/ieee754-core/ef_rem_pio2.c                                      \
+                  float/ieee754-core/ef_sqrt.c   float/ieee754-api/wf_sqrt.c            \
+                  float/ieee754-core/ef_pow.c    float/ieee754-api/wf_pow.c             \
+                  float/ieee754-core/ef_exp.c    float/ieee754-api/wf_exp.c             \
+                  float/ieee754-core/ef_asin.c   float/ieee754-api/wf_asin.c            \
+                  float/ieee754-core/ef_log.c   float/ieee754-api/wf_log.c              \
+                  float/ieee754-core/ef_log10.c   float/ieee754-api/wf_log10.c          \
+                  float/ieee754-core/ef_hypot.c float/ieee754-api/wf_hypot.c            \
+                  float/ieee754-core/ef_fmod.c   float/ieee754-api/wf_fmod.c            \
+                  float/ieee754-core/ef_remainder.c   float/ieee754-api/wf_remainder.c  \
+                  float/ieee754-core/ef_scalb.c   float/ieee754-api/wf_scalb.c          \
+                  float/ieee754-core/ef_acos.c   float/ieee754-api/wf_acos.c            \
+                  float/ieee754-core/ef_atan2.c  float/ieee754-api/wf_atan2.c           \
+                  float/ieee754-core/ef_acosh.c   float/ieee754-api/wf_acosh.c          \
+                  float/ieee754-core/ef_atanh.c   float/ieee754-api/wf_atanh.c          \
+                  float/ieee754-core/ef_cosh.c   float/ieee754-api/wf_cosh.c            \
+                  float/ieee754-core/ef_j0.c   float/ieee754-api/wf_j0.c                \
+                  float/ieee754-core/ef_j1.c   float/ieee754-api/wf_j1.c                \
+                  float/ieee754-core/ef_jn.c   float/ieee754-api/wf_jn.c                \
+                  float/ieee754-core/ef_sinh.c   float/ieee754-api/wf_sinh.c            \
+                  float/portable-api/sf_asinh.c float/portable-api/sf_ilogb.c           \
+                  float/portable-api/sf_copysign.c                                      \
+                  float/portable-api/sf_sin.c                                           \
+                  float/portable-api/sf_finite.c float/portable-api/sf_erf.c            \
+                  float/portable-api/sf_isnan.c float/portable-api/sf_floor.c           \
+                  float/portable-api/sf_modf.c                                          \
+                  float/portable-api/sf_atan.c                                          \
+                  float/portable-api/sf_ldexp.c                                         \
+                  float/portable-api/sf_nextafter.c                                     \
+                  float/portable-api/sf_tan.c float/portable-api/sf_cbrt.c              \
+                  float/portable-api/sf_expm1.c                                         \
+                  float/portable-api/sf_frexp.c                                         \
+                  float/portable-api/sf_log1p.c  float/portable-api/sf_rint.c           \
+                  float/portable-api/sf_tanh.c float/portable-api/sf_ceil.c             \
+                  float/portable-api/sf_fabs.c                                          \
+                  float/portable-api/sf_logb.c                                          \
+                  float/portable-api/sf_scalbn.c                                        \
+                  float/portable-api/sf_cos.c                                           \
+                  float/portable-api/sf_significand.c
 
     # COMPATIBILITY-MODE RELATED CONFIGURATION OPTIONS
     cdl_component CYGPKG_LIBM_COMPATIBILITY {
@@ -216,6 +263,43 @@ cdl_package CYGPKG_LIBM {
         puts $::cdl_header "/****** proc output end ******/"
     }
 
+    cdl_component CYGPKG_COMPLEX {
+        display       "Complex"
+        flavor        bool
+        default_value 1
+
+        description "
+            Complex library provides support for some basic operations
+            on complex numbers as well as mathematical functions in
+            complex domain."
+
+            compile   complex/cabs.c complex/cabsf.c     \
+            complex/carg.c complex/cargf.c               \
+                                                         \
+            complex/creal.c complex/crealf.c             \
+            complex/cimag.c complex/cimagf.c             \
+            complex/conj.c complex/conjf.c               \
+                                                         \
+            complex/cacos.c complex/cacosf.c             \
+            complex/cacosh.c complex/cacoshf.c           \
+            complex/casin.c complex/casinf.c             \
+            complex/casinh.c complex/casinhf.c           \
+            complex/catan.c complex/catanf.c             \
+            complex/catanh.c complex/catanhf.c           \
+            complex/ccos.c complex/ccosf.c               \
+            complex/ccosh.c complex/ccoshf.c             \
+            complex/cephes_subr.c complex/cephes_subrf.c \
+            complex/cexp.c complex/cexpf.c               \
+            complex/clog.c complex/clogf.c               \
+            complex/cpow.c complex/cpowf.c               \
+            complex/cproj.c complex/cprojf.c             \
+            complex/csin.c complex/csinf.c               \
+            complex/csinh.c complex/csinhf.c             \
+            complex/csqrt.c complex/csqrtf.c             \
+            complex/ctan.c complex/ctanf.c               \
+            complex/ctanh.c complex/ctanhf.c
+    }
+
     cdl_component CYGPKG_LIBM_OPTIONS {
         display "Math library build options"
         flavor  none
@@ -252,9 +336,30 @@ cdl_package CYGPKG_LIBM {
             display "Math library tests"
             flavor  data
             no_define
-            calculated { "tests/vectors/acos tests/vectors/asin tests/vectors/atan tests/vectors/atan2 tests/vectors/ceil tests/vectors/cos tests/vectors/cosh tests/vectors/exp tests/vectors/fabs tests/vectors/floor tests/vectors/fmod tests/vectors/frexp tests/vectors/ldexp tests/vectors/log tests/vectors/log10 tests/vectors/modf tests/vectors/pow tests/vectors/sin tests/vectors/sinh tests/vectors/sqrt tests/vectors/tan tests/vectors/tanh" }
+            calculated { "tests/vectors/acos tests/vectors/asin             \
+                tests/vectors/cos tests/vectors/cosh                        \
+                tests/vectors/sin tests/vectors/sinh                        \
+                tests/vectors/atan tests/vectors/atan2                      \
+                tests/vectors/tan tests/vectors/tanh                        \
+                tests/vectors/sqrt tests/vectors/pow                        \
+                tests/vectors/ceil tests/vectors/floor                      \
+                tests/vectors/fabs tests/vectors/fmod                       \
+                tests/vectors/frexp tests/vectors/ldexp                     \
+                tests/vectors/exp tests/vectors/log tests/vectors/log10     \
+                                                                            \
+                tests/vectors/acosf tests/vectors/asinf                     \
+                tests/vectors/cosf tests/vectors/coshf                      \
+                tests/vectors/sinf tests/vectors/sinhf                      \
+                tests/vectors/atanf tests/vectors/atan2f                    \
+                tests/vectors/tanf tests/vectors/tanhf                      \
+                tests/vectors/hypotf tests/vectors/sqrtf tests/vectors/powf \
+                tests/vectors/floorf tests/vectors/ceilf                    \
+                tests/vectors/fabsf tests/vectors/fmodf                     \
+                tests/vectors/frexpf tests/vectors/ldexpf                   \
+                tests/vectors/expf tests/vectors/logf tests/vectors/log10f "
+            }
             description   "
-                This option specifies the set of tests for the math library."
+               this option specifies the set of tests for the math library."
         }
     }
 }
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/include/complex.h
@@ -0,0 +1,202 @@
+#ifndef	CYGONCE_COMPLEX_H
+#define	CYGONCE_COMPLEX_H
+
+//===========================================================================
+//
+//      complex.h
+//
+//      Standard complex number functions conforming to ANSI and other standards
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####                                            
+// -------------------------------------------                              
+// This file is part of eCos, the Embedded Configurable Operating System.   
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under    
+// the terms of the GNU General Public License as published by the Free     
+// Software Foundation; either version 2 or (at your option) any later      
+// version.                                                                 
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT      
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License    
+// for more details.                                                        
+//
+// You should have received a copy of the GNU General Public License        
+// along with eCos; if not, write to the Free Software Foundation, Inc.,    
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.            
+//
+// As a special exception, if other files instantiate templates or use      
+// macros or inline functions from this file, or you compile this file      
+// and link it with other works to produce a work based on this file,       
+// this file does not by itself cause the resulting work to be covered by   
+// the GNU General Public License. However the source code for this file    
+// must still be made available in accordance with section (3) of the GNU   
+// General Public License v2.                                               
+//
+// This exception does not invalidate any other reasons why a work based    
+// on this file might be covered by the GNU General Public License.         
+// -------------------------------------------                              
+// ####ECOSGPLCOPYRIGHTEND####                                              
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):   ilijak
+// Based on:    see below
+// Contributors:
+// Date:        2013-06-05
+// Purpose:
+// Description: Standard complex number mathematical functions.
+//
+// Usage:       #include <complex.h>
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// This file was derived from a file with following copyright
+
+/* $NetBSD: complex.h,v 1.3 2010/09/15 16:11:30 christos Exp $ */
+
+/*
+ * Written by Matthias Drochner.
+ * Public domain.
+ */
+
+#ifndef _COMPLEX_H
+#define _COMPLEX_H
+#endif
+
+#define complex _Complex
+#define _Complex_I (1.0fi)
+#define I _Complex_I
+
+// 7.3.5 Trigonometric functions
+// 7.3.5.1 The cacos functions
+double complex cacos(double complex);
+float complex cacosf(float complex);
+
+// 7.3.5.2 The casin functions
+double complex casin(double complex);
+float complex casinf(float complex);
+
+// 7.3.5.1 The catan functions
+double complex catan(double complex);
+float complex catanf(float complex);
+
+// 7.3.5.1 The ccos functions
+double complex ccos(double complex);
+float complex ccosf(float complex);
+
+// 7.3.5.1 The csin functions
+double complex csin(double complex);
+float complex csinf(float complex);
+
+// 7.3.5.1 The ctan functions
+double complex ctan(double complex);
+float complex ctanf(float complex);
+
+// 7.3.6 Hyperbolic functions
+// 7.3.6.1 The cacosh functions
+double complex cacosh(double complex);
+float complex cacoshf(float complex);
+
+// 7.3.6.2 The casinh functions
+double complex casinh(double complex);
+float complex casinhf(float complex);
+
+// 7.3.6.3 The catanh functions
+double complex catanh(double complex);
+float complex catanhf(float complex);
+
+// 7.3.6.4 The ccosh functions
+double complex ccosh(double complex);
+float complex ccoshf(float complex);
+
+// 7.3.6.5 The csinh functions
+double complex csinh(double complex);
+float complex csinhf(float complex);
+
+// 7.3.6.6 The ctanh functions
+double complex ctanh(double complex);
+float complex ctanhf(float complex);
+
+// 7.3.7 Exponential and logarithmic functions
+// 7.3.7.1 The cexp functions
+double complex cexp(double complex);
+float complex cexpf(float complex);
+
+// 7.3.7.2 The clog functions
+double complex clog(double complex);
+float complex clogf(float complex);
+
+// 7.3.9 Manipulation functions
+// 7.3.9.2 The cimag functions
+double cimag(double complex);
+float cimagf(float complex);
+//long double cimagl(long double complex);
+
+// 7.3.9.3 The conj functions
+double complex conj(double complex);
+float complex conjf(float complex);
+//long double complex conjl(long double complex);
+
+// 7.3.9.4 The cproj functions
+double complex cproj(double complex);
+float complex cprojf(float complex);
+//long double complex cprojl(long double complex);
+
+// 7.3.9.5 The creal functions
+double creal(double complex);
+float crealf(float complex);
+//long double creall(long double complex);
+
+// 7.3.9.1 The carg functions
+#ifdef CYGSEM_LIBM_IEEE_API_INLINE
+CYGBLD_FORCE_INLINE double
+carg(double complex z)
+{
+	return atan2( cimag(z) , creal(z) );
+}
+
+CYGBLD_FORCE_INLINE float
+cargf(float complex z)
+{
+	return atan2f( cimagf(z) , crealf(z) );
+}
+#else
+double carg(double complex);
+float cargf(float complex);
+#endif
+
+// 7.3.8 Power and absolute-value functions
+// 7.3.8.1 The cabs functions
+#ifdef CYGSEM_LIBM_IEEE_API_INLINE
+CYGBLD_FORCE_INLINE double
+cabs(double complex z)
+{
+	return hypot( creal(z) , cimag(z) );
+}
+
+CYGBLD_FORCE_INLINE float
+cabsf(float complex z)
+{
+	return hypotf( crealf(z) , cimagf(z) );
+}
+#else
+double cabs(double complex) ;
+float cabsf(float complex) ;
+#endif
+
+// 7.3.8.2 The cpow functions
+double complex cpow(double complex, double complex);
+float complex cpowf(float complex, float complex);
+
+// 7.3.8.3 The csqrt functions
+double complex csqrt(double complex);
+float complex csqrtf(float complex);
+
+#endif //CYGONCE_COMPLEX_H
+
+// End of complex.h
--- a/packages/language/c/libm/current/include/math.h
+++ b/packages/language/c/libm/current/include/math.h
@@ -10,7 +10,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2012, 2013 Free Software Foundation, Inc.
 //
 // eCos is free software; you can redistribute it and/or modify it under    
 // the terms of the GNU General Public License as published by the Free     
@@ -42,9 +42,9 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):   jlarmour
-// Contributors:  jlarmour
+// Contributors:  jlarmour, visar, ilijak
 // Date:        1998-02-13
-// Purpose:     
+// Purpose:
 // Description: Standard mathematical functions. These can be
 //              configured to conform to ANSI section 7.5. There are also
 //              a number of extensions conforming to IEEE-754 and behaviours
@@ -57,33 +57,150 @@
 
 // CONFIGURATION
 
+#include <pkgconf/system.h> // System configuration header
 #include <pkgconf/libm.h>   // Configuration header
 
 // Include the Math library?
-#ifdef CYGPKG_LIBM     
+#ifdef CYGPKG_LIBM
+
+#ifdef CYGBLD_HAL_LIBM_H
+# include CYGBLD_HAL_LIBM_H
+#endif
+
+// Inline IEEE754 API macros
+#define CYGBLD_LIBM_INLINE CYGBLD_FORCE_INLINE
+
+#ifdef CYGSEM_LIBM_IEEE_API_INLINE
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_F(_fun)        \
+externC double __ieee754_##_fun(double);           \
+CYGBLD_LIBM_INLINE double _fun(double x)           \
+{                                                  \
+    return __ieee754_##_fun(x);                    \
+}                                                  \
+externC float __ieee754_##_fun##f(float);          \
+CYGBLD_LIBM_INLINE float _fun##f(float x)          \
+{                                                  \
+    return __ieee754_##_fun##f(x);                 \
+}
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_FF(_fun)       \
+externC double __ieee754_##_fun(double, double);   \
+CYGBLD_LIBM_INLINE double _fun(double x, double y) \
+{                                                  \
+    return __ieee754_##_fun(x, y);                 \
+}                                                  \
+externC float __ieee754_##_fun##f(float, float);   \
+CYGBLD_LIBM_INLINE float _fun##f(float x, float y) \
+{                                                  \
+    return __ieee754_##_fun##f(x, y);              \
+}
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_IF(_fun)       \
+externC double __ieee754_##_fun(int, double);      \
+CYGBLD_LIBM_INLINE double _fun(int x, double y)    \
+{                                                  \
+    return __ieee754_##_fun(x, y);                 \
+}                                                  \
+externC float __ieee754_##_fun##f(int, float);     \
+CYGBLD_LIBM_INLINE float _fun##f(int x, float y)   \
+{                                                  \
+    return __ieee754_##_fun##f(x, y);              \
+}
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_FIP(_fun)      \
+externC double __ieee754_##_fun(double, int *);    \
+CYGBLD_LIBM_INLINE double _fun(double x, int *y)   \
+{                                                  \
+    return __ieee754_##_fun(x, y);                 \
+}                                                  \
+externC float __ieee754_##_fun##f(float, int*);    \
+CYGBLD_LIBM_INLINE float _fun##f(float x, int *y)  \
+{                                                  \
+    return __ieee754_##_fun##f(x, y);              \
+}
+
+#else
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_F(_fun) \
+externC inline double _fun(double);         \
+externC float inline _fun##f(float);
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_FF(_fun) \
+externC inline double _fun(double, double);  \
+externC inline float _fun##f(float, float);
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_IF(_fun) \
+externC inline double _fun(int, double);     \
+externC inline float _fun##f(int, float);
+
+#define CYGDCL_LIBM_IEEE_API_INLINE_FIP(_fun) \
+externC inline double _fun(double, int *);    \
+externC inline float _fun##f(float, int *);
+
+#endif
 
 // INCLUDES
 
 #include <cyg/infra/cyg_type.h>    // Common type definitions and support
 #include <float.h>                 // Properties of FP representation on this
                                    // platform
-#include <sys/ieeefp.h>            // Cyg_libm_ieee_double_shape_type
+#include <sys/ieeefp.h>            // Cyg_libm_ieee_[double|float]_shape_type
 
 // CONSTANT DEFINITIONS
 
+// Useful constants.
+
+#define MAXFLOAT    3.40282347e+38F
+
+#define M_E         2.7182818284590452354
+#define M_LOG2E     1.4426950408889634074
+#define M_LOG10E    0.43429448190325182765
+#define M_LN2       _M_LN2
+#define M_LN10      2.30258509299404568402
+#define M_PI        3.14159265358979323846
+#define M_TWOPI     (M_PI * 2.0)
+#define M_PI_2      1.57079632679489661923
+#define M_PI_4      0.78539816339744830962
+#define M_3PI_4     2.3561944901923448370E0
+#define M_SQRTPI    1.77245385090551602792981
+#define M_1_PI      0.31830988618379067154
+#define M_2_PI      0.63661977236758134308
+#define M_2_SQRTPI  1.12837916709551257390
+#define M_SQRT2     1.41421356237309504880
+#define M_SQRT1_2   0.70710678118654752440
+#define M_LN2LO     1.9082149292705877000E-10
+#define M_LN2HI     6.9314718036912381649E-1
+#define M_SQRT3     1.73205080756887719000
+#define M_IVLN10    0.43429448190325182765   /* 1 / log(10) */
+#define M_LOG2_E    _M_LN2
+#define M_INVLN2    1.4426950408889633870E0  /* 1 / log(2) */
 
 // HUGE_VAL is a positive double (not necessarily representable as a float)
 // representing infinity as specified in ANSI 7.5. cyg_libm_infinity is
 // defined further down
+#if 1
 #define HUGE_VAL        (cyg_libm_infinity.value)
+#define HUGE_VALF       (cyg_libm_float_infinity.value)
 
+#else
+ /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values.  */
+
+# ifndef HUGE_VAL
+#  define HUGE_VAL (__builtin_huge_val())
+# endif
+
+# ifndef HUGE_VALF
+#  define HUGE_VALF (__builtin_huge_valf())
+# endif
+
+#endif /* !gcc >= 3.3  */
 
 #ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION
 // HUGE is defined in System V Interface Definition 3 (SVID3) as the largest
 // finite single precision number
 #define HUGE            FLT_MAX    // from float.h
 
-
 // Values used in the type field of struct exception below
 
 #define DOMAIN          1
@@ -93,6 +210,9 @@
 #define TLOSS           5
 #define PLOSS           6
 
+#ifndef FP_ILOGBNAN
+# define FP_ILOGBNAN INT_MAX
+#endif
 
 // TYPE DEFINITIONS
 
@@ -106,12 +226,20 @@ struct exception {
     double retval;  // Value to be returned - can be altered by matherr()
 };
 
+struct exceptionf {
+    int type;       // One of DOMAIN, SING, OVERFLOW, UNDERFLOW, TLOSS, PLOSS
+    char *name;     // Name of the function generating the exception
+    float arg1;     // First argument to the function
+    float arg2;     // Second argument to the function
+    float retval;   // Value to be returned - can be altered by matherr()
+};
+
 #endif // ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION
 
-
 // GLOBALS
 
 externC const Cyg_libm_ieee_double_shape_type cyg_libm_infinity;
+externC const Cyg_libm_ieee_float_shape_type cyg_libm_float_infinity;
 
 //===========================================================================
 // FUNCTION PROTOTYPES
@@ -178,84 +306,108 @@ externC int signgam;
 
 // Trigonometric functions - ANSI 7.5.2
 
-externC double
-acos( double );            // arc cosine i.e. inverse cos
+// arc cosine i.e. inverse cos
+CYGDCL_LIBM_IEEE_API_INLINE_F(acos)
 
-externC double
-asin( double );            // arc sine i.e. inverse sin
+// arc sine i.e. inverse sin
+CYGDCL_LIBM_IEEE_API_INLINE_F(asin)
 
 externC double
 atan( double );            // arc tan i.e. inverse tan
 
-externC double
-atan2( double, double );   // arc tan of (first arg/second arg) using signs
-                           // of args to determine quadrant
+externC float
+atanf ( float );
+
+// arc tan of (first arg/second arg) using signs
+// of args to determine quadrant
+CYGDCL_LIBM_IEEE_API_INLINE_FF(atan2)
 
 externC double
 cos( double );             // cosine
 
+externC float
+cosf( float );
+
 externC double
 sin( double );             // sine
 
+externC float
+sinf( float );
+
 externC double
 tan( double );             // tangent
 
+externC float
+tanf ( float );
+
 // Hyperbolic functions - ANSI 7.5.3
 
-externC double
-cosh( double );            // hyperbolic cosine
+// hyperbolic cosine
+CYGDCL_LIBM_IEEE_API_INLINE_F(cosh)
 
-externC double
-sinh( double );            // hyperbolic sine
+// hyperbolic sine
+CYGDCL_LIBM_IEEE_API_INLINE_F(sinh)
 
 externC double
 tanh( double );            // hyperbolic tangent
 
+externC float
+tanhf ( float );
+
 // Exponential and Logarithmic Functions - ANSI 7.5.4
 
-externC double
-exp( double );             // exponent
+CYGDCL_LIBM_IEEE_API_INLINE_F(exp)
 
 externC double
 frexp( double, int * );    // break number into normalized fraction (returned)
                            // and integral power of 2 (second arg)
-
-externC double
-ldexp( double, int );      // multiples number by integral power of 2 
+externC float
+frexpf( float, int * );
 
 externC double
-log( double );             // natural logarithm
+ldexp( double, int );      // multiples number by integral power of 2
+
+externC float
+ldexpf( float, int );
 
-externC double
-log10( double );           // base ten logarithm
+// natural logarithm
+CYGDCL_LIBM_IEEE_API_INLINE_F(log)
+
+// base ten logarithm
+CYGDCL_LIBM_IEEE_API_INLINE_F(log10)
 
 externC double
 modf( double, double * );  // break number into integral and fractional
                            // parts, each of which has same sign as arg.
-                           // It returns signed fractional part, and
-                           // puts integral part in second arg
+externC float              // It returns signed fractional part, and
+modff ( float, float *);   // puts integral part in second arg
 
 // Power Functions - ANSI 7.5.5
 
-externC double
-pow( double, double );     // (1st arg) to the power of (2nd arg)
+// (1st arg) to the power of (2nd arg)
+CYGDCL_LIBM_IEEE_API_INLINE_FF(pow)
 
-externC double
-sqrt( double );            // square root
+// square root
+CYGDCL_LIBM_IEEE_API_INLINE_F(sqrt)
 
 // Nearest integer, absolute value and remainder functions - ANSI 7.5.6
 
 externC double
 ceil( double );            // smallest integer >= arg
+externC float
+ceilf ( float );
 
 externC double
 fabs( double );            // absolute value
+externC float
+fabsf ( float );
 
 externC double
 floor( double );           // largest integer <= arg
+externC float
+floorf ( float );
 
-externC double
-fmod( double, double );    // remainder of (1st arg)/(2nd arg)
+CYGDCL_LIBM_IEEE_API_INLINE_FF(fmod)
 
 //===========================================================================
 // Other standard functions
@@ -263,93 +415,121 @@ fmod( double, double );    // remainder 
 #ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION
 externC int
 matherr( struct exception * );    // User-overridable error handling - see
-#endif                            // <pkgconf/libm.h> for a discussion
+                                  // <pkgconf/libm.h> for a discussion
+externC int
+matherrf( struct exceptionf * );
+#endif
 
 // FIXME: from here needs to be documented and mentioned as non-ISO
 // Arc Hyperbolic trigonometric functions
 
-externC double
-acosh( double );                  // Arc hyperbolic cos i.e. inverse cosh
+// Arc hyperbolic cos i.e. inverse cosh
+CYGDCL_LIBM_IEEE_API_INLINE_F(acosh)
 
-externC double
-asinh( double );                  // Arc hyperbolic sin i.e. inverse sinh
+// Arc hyperbolic sin i.e. inverse sinh
+CYGDCL_LIBM_IEEE_API_INLINE_F(asinh)
 
-externC double
-atanh( double );                  // Arc hyperbolic tan i.e. inverse tanh
+// Arc hyperbolic tan i.e. inverse tanh
+CYGDCL_LIBM_IEEE_API_INLINE_F(atanh)
 
 // Error functions
 
 externC double                    // Error function, such that
 erf( double );                    // erf(x) = 2/sqrt(pi) * integral from
                                   // 0 to x of e**(-t**2) dt
+externC float
+erff ( float );
 
 externC double                    // Complementary error function - simply
 erfc( double );                   // 1.0 - erf(x)
 
+externC float
+erfcf ( float );
+
 // Gamma functions
 
-externC double                    // Logarithm of the absolute value of the
-lgamma( double );                 // gamma function of the argument. The
-                                  // integer signgam is used to store the
-                                  // sign of the gamma function of the arg
+// Logarithm of the absolute value of the
+// gamma function of the argument. The
+// integer signgam is used to store the
+// sign of the gamma function of the arg
+CYGDCL_LIBM_IEEE_API_INLINE_F(lgamma)
 
-externC double
-lgamma_r( double, int * );        // Re-entrant version of the above, where
-                                  // the user passes the location of signgam
-                                  // as the second argument
+// Re-entrant version of the above, where
+// the user passes the location of signgam
+// as the second argument
+CYGDCL_LIBM_IEEE_API_INLINE_FIP(lgamma_r)
 
-externC double                    // Identical to lgamma()!
-gamma( double );                  // The reasons for this are historical,
-                                  // and may be changed in future standards
-                                  //
-                                  // To get the real gamma function, you should
-                                  // use: l=lgamma(x); g=signgam*exp(l);
-                                  //
-                                  // Do not just do signgam*exp(lgamma(x))
-                                  // as lgamma() modifies signgam
+// Identical to lgamma()!
+// The reasons for this are historical,
+// and may be changed in future standards
+//
+// To get the real gamma function, you should
+// use: l=lgamma(x); g=signgam*exp(l);
+//
+// Do not just do signgam*exp(lgamma(x))
+// as lgamma() modifies signgam
+CYGDCL_LIBM_IEEE_API_INLINE_F(gamma)
 
 externC double
 gamma_r( double, int * );         // Identical to lgamma_r(). See above.
 
+externC float
+gammaf_r( float, int * );
+
 
 // Bessel functions
 
-externC double                    // Zero-th order Bessel function of the
-j0( double );                     // first kind at the ordinate of the argument
+// Zero-th order Bessel function of the
+// first kind at the ordinate of the argument
+CYGDCL_LIBM_IEEE_API_INLINE_F(j0)
 
-externC double                    // First-order Bessel function of the
-j1( double );                     // first kind at the ordinate of the argument
+// First-order Bessel function of the
+// first kind at the ordinate of the argument
+CYGDCL_LIBM_IEEE_API_INLINE_F(j1)
 
-externC double                    // Bessel function of the first kind of the
-jn( int, double );                // order of the first argument at the
-                                  // ordinate of the second argument
+// Bessel function of the first kind of the
+// order of the first argument at the
+// ordinate of the second argument
+CYGDCL_LIBM_IEEE_API_INLINE_IF(jn)
 
 externC double                    // Zero-th order Bessel function of the
 y0( double );                     // second kind at the ordinate of the
-                                  // argument
+
+externC float
+y0f( float );
 
 externC double                    // First-order Bessel function of the
 y1( double );                     // second kind at the ordinate of the
                                   // argument
+externC float
+y1f( float );
 
 externC double                    // Bessel function of the second kind of the
 yn( int, double );                // order of the first argument at the
                                   // ordinate of the second argument
+externC float
+ynf( int, float );
 
 // scalb*()
 
 externC double                    // scalbn(x,n) returns x*(2**n)
 scalbn( double, int );
 
+externC float
+scalbnf ( float, int);
+
 #ifdef CYGFUN_LIBM_SVID3_scalb
 
-externC double
-scalb( double, double );          // as above except n is a floating point arg
+// as above except n is a floating point arg
+CYGDCL_LIBM_IEEE_API_INLINE_FF(scalb)
 
 #else
 externC double
 scalb( double, int );             // as scalbn()
 
+externC float
+scalbf( float, int );
+
 #endif // ifdef CYGFUN_LIBM_SVID3_scalb
 
 // And the rest
@@ -357,58 +537,90 @@ scalb( double, int );             // as 
 externC double
 cbrt( double );                   // Cube Root
 
-externC double                    // hypotenuse function, defined such that:
-hypot( double, double );          // hypot(x,y)==sqrt(x**2 + y**2)
+externC float
+cbrtf( float );
+
+// hypotenuse function, defined such that:
+// hypotf(x,y)==sqrt(x**2 + y**2)
+
+CYGDCL_LIBM_IEEE_API_INLINE_FF(hypot)
 
 externC int                       // whether the argument is NaN
 isnan( double );
 
 externC int
+isnanf ( float );
+
+externC int                       // wheteher the argument is infinite
+isinf(double);
+
+externC int
+isinff(float);
+
+externC int
 finite( double );                 // whether the argument is finite
 
+externC int
+finitef ( float );
+
 externC double                    // logb returns the binary exponent of its
 logb( double );                   // argument as an integral value
                                   // This is not recommended - use ilogb
-                                  // instead
+externC float                     // instead
+logbf ( float );
 
 externC int                       // As for logb, but has the more correct
 ilogb( double );                  // return value type of int
 
+externC int
+ilogbf ( float );
 
 externC double                    // nextafter(x,y) returns the next
 nextafter( double, double );      // representable floating point number
                                   // adjacent to x in the direction of y
-                                  // i.e. the next greater FP if y>x, the next
-                                  // less FP if y<x, or just x if y==x
+externC float                     // i.e. the next greater FP if y>x, the next
+nextafterf ( float, float );      // less FP if y<x, or just x if y==x
 
-externC double                    // remainder(x,y) returns the remainder
-remainder( double, double );      // when x is divided by y
+// when x is divided by y
+CYGDCL_LIBM_IEEE_API_INLINE_FF(remainder)
 
 externC double                    // IEEE Test Vector
 significand( double );            // significand(x) computes:
                                   //   scalb(x, (double) -ilogb(x))
-                                 
+externC float
+significandf( float );
+
 //===========================================================================
 // Non-standard functions
 
 externC double                    // copysign(x,y) returns a number with
 copysign ( double, double );      // the absolute value of x and the sign of y
 
+externC float
+copysignf ( float, float );
+
 externC double                    // rounds to an integer according to the
 rint( double );                   // current rounding mode
 
+externC float
+rintf ( float );
+
 
 // BSD functions
 
 externC double                    // expm1(x) returns the equivalent of
 expm1( double );                  // (exp(x) - 1) but more accurately when
                                   // x tends to zero
+externC float
+expm1f ( float );
 
 externC double                    // log1p(x) returns the equivalent of
 log1p( double );                  // log(1+x) but more accurately when
                                   // x tends to zero
+externC float
+log1pf ( float );
 
-#endif // ifdef CYGPKG_LIBM     
+#endif // ifdef CYGPKG_LIBM
 
 #endif // CYGONCE_LIBM_MATH_H multiple inclusion protection
 
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cabs.c
@@ -0,0 +1,53 @@
+/* $NetBSD: cabs.c,v 1.1 2007/08/20 16:01:30 drochner Exp $ */
+
+/*
+ * Written by Matthias Drochner <drochner@NetBSD.org>.
+ * Public domain.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<cabs>>, <<cabsf>>---complex absolute-value
+
+INDEX
+        cabs
+INDEX
+        cabsf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double cabs(double complex <[z]>);
+       float cabsf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute compute the complex absolute value 
+        (also called norm, modulus, or magnitude) of <[z]>. 
+
+        <<cabsf>> is identical to <<cabs>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        The cabs functions return the complex absolute value.
+
+PORTABILITY
+        <<cabs>> and <<cabsf>> are ISO C99
+
+QUICKREF
+        <<cabs>> and <<cabsf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+double
+cabs(double complex z)
+{
+
+	return hypot( creal(z), cimag(z) );
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cabsf.c
@@ -0,0 +1,19 @@
+/* $NetBSD: cabsf.c,v 1.1 2007/08/20 16:01:30 drochner Exp $ */
+
+/*
+ * Written by Matthias Drochner <drochner@NetBSD.org>.
+ * Public domain.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float
+cabsf(float complex z)
+{
+
+	return hypotf( crealf(z), cimagf(z) );
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cacos.c
@@ -0,0 +1,99 @@
+/* $NetBSD: cacos.c,v 1.1 2007/08/20 16:01:30 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<cacos>>, <<cacosf>>---complex arc cosine
+
+INDEX
+        cacos
+INDEX
+        cacosf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex cacos(double complex <[z]>);
+       float complex cacosf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex arc cosine of <[z]>,
+        with branch cuts outside the interval [-1, +1] along the real axis.
+
+        <<cacosf>> is identical to <<cacos>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        These functions return the complex arc cosine value, in the range
+        of a strip mathematically  unbounded  along the imaginary axis
+        and in the interval [0, pi] along the real axis.
+        @end ifnottex
+        @tex
+        These functions return the complex arc cosine value, in the range
+        of a strip mathematically  unbounded  along the imaginary axis
+        and in the interval [<<0>>, $\pi$] along the real axis.
+        @end tex
+
+PORTABILITY
+        <<cacos>> and <<cacosf>> are ISO C99
+
+QUICKREF
+        <<cacos>> and <<cacosf>> are ISO C99
+
+*/
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+cacos(double complex z)
+{
+	double complex w;
+
+	/* FIXME: The original NetBSD code results in an ICE when trying to
+	   build this function on ARM/Thumb using gcc 4.5.1.  For now we use
+	   a hopefully temporary workaround. */
+#if 0
+	w = casin(z);
+	w = (M_PI_2 - creal(w)) - cimag(w) * I;
+#else
+	double complex tmp0, tmp1;
+
+	tmp0 = casin(z);
+	tmp1 = M_PI_2 - creal(tmp0);
+	w = tmp1 - (cimag(tmp0) * I);
+#endif
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cacosf.c
@@ -0,0 +1,46 @@
+/* $NetBSD: cacosf.c,v 1.1 2007/08/20 16:01:30 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+cacosf(float complex z)
+{
+	float complex w;
+
+	w = casinf(z);
+	w = ((float)M_PI_2 - crealf(w)) - cimagf(w) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cacosh.c
@@ -0,0 +1,93 @@
+/* $NetBSD: cacosh.c,v 1.2 2009/08/03 19:41:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<cacosh>>, <<cacoshf>>---complex arc hyperbolic cosine
+
+INDEX
+        cacosh
+INDEX
+        cacoshf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex cacosh(double complex <[z]>);
+       float complex cacoshf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex arc hyperbolic cosine of <[z]>,
+        with a branch cut at values less than 1 along the real axis.
+
+        <<cacoshf>> is identical to <<cacosh>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        These functions return the complex arc hyperbolic cosine value, 
+        in the range of a half-strip of non-negative values along the 
+        real axis and in the interval [-i * pi, +i * pi] along the 
+        imaginary axis.
+        @end ifnottex
+        @tex
+        These functions return the complex arc hyperbolic cosine value, 
+        in the range of a half-strip of non-negative values along the 
+        real axis and in the interval [$-i\pi$, $+i\pi$] along the 
+        imaginary axis.
+        @end tex
+
+PORTABILITY
+        <<cacosh>> and <<cacoshf>> are ISO C99
+
+QUICKREF
+        <<cacosh>> and <<cacoshf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+
+double complex
+cacosh(double complex z)
+{
+	double complex w;
+
+#if 0 /* does not give the principal value */
+	w = I * cacos(z);
+#else
+	w = clog(z + csqrt(z + 1) * csqrt(z - 1));
+#endif
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cacoshf.c
@@ -0,0 +1,48 @@
+/* $NetBSD: cacoshf.c,v 1.2 2009/08/03 19:41:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+
+float complex
+cacoshf(float complex z)
+{
+	float complex w;
+
+#if 0 /* does not give the principal value */
+	w = I * cacosf(z);
+#else
+	w = clogf(z + csqrtf(z + 1) * csqrtf(z - 1));
+#endif
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/carg.c
@@ -0,0 +1,59 @@
+/* $NetBSD: carg.c,v 1.1 2007/08/20 16:01:31 drochner Exp $ */
+
+/*
+ * Written by Matthias Drochner <drochner@NetBSD.org>.
+ * Public domain.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<carg>>, <<cargf>>---argument (phase angle)
+
+INDEX
+        carg
+INDEX
+        cargf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double carg(double complex <[z]>);
+       float cargf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the argument (also called phase angle) 
+        of <[z]>, with a branch cut along the negative real axis.
+
+        <<cargf>> is identical to <<carg>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        The carg functions return the value of the argument in the 
+        interval [-pi, +pi]
+        @end ifnottex
+        @tex
+        The carg functions return the value of the argument in the 
+        interval [$-\pi$, $+\pi$]
+        @end tex
+
+PORTABILITY
+        <<carg>> and <<cargf>> are ISO C99
+
+QUICKREF
+        <<carg>> and <<cargf>> are ISO C99
+
+*/
+
+#include <complex.h>
+#include <math.h>
+
+double
+carg(double complex z)
+{
+
+	return atan2( cimag(z) , creal(z) );
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cargf.c
@@ -0,0 +1,19 @@
+/* $NetBSD: cargf.c,v 1.1 2007/08/20 16:01:31 drochner Exp $ */
+
+/*
+ * Written by Matthias Drochner <drochner@NetBSD.org>.
+ * Public domain.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float
+cargf(float complex z)
+{
+
+	return atan2f( cimagf(z), crealf(z) );
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/casin.c
@@ -0,0 +1,165 @@
+/* $NetBSD: casin.c,v 1.1 2007/08/20 16:01:31 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<casin>>, <<casinf>>---complex arc sine
+
+INDEX
+        casin
+INDEX
+        casinf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex casin(double complex <[z]>);
+       float complex casinf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex arc sine of <[z]>,
+        with branch cuts outside the interval [-1, +1] along the real axis.
+
+        <<casinf>> is identical to <<casin>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        These functions return the complex arc sine value, in the range
+        of a strip mathematically  unbounded  along the imaginary axis
+        and in the interval [-pi/2, +pi/2] along the real axis.
+        @end ifnottex
+        @tex
+        These functions return the complex arc sine value, in the range
+        of a strip mathematically  unbounded  along the imaginary axis
+        and in the interval [$-\pi/2$, $+\pi/2$] along the real axis.
+        @end tex
+
+PORTABILITY
+        <<casin>> and <<casinf>> are ISO C99
+
+QUICKREF
+        <<casin>> and <<casinf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+#ifdef __weak_alias
+__weak_alias(casin, _casin)
+#endif
+
+double complex
+casin(double complex z)
+{
+	double complex w;
+	double complex ca, ct, zz, z2;
+	double x, y;
+
+	x = creal(z);
+	y = cimag(z);
+
+#if 0 /* MD: test is incorrect, casin(>1) is defined */
+	if (y == 0.0) {
+		if (fabs(x) > 1.0) {
+			w = M_PI_2 + 0.0 * I;
+#if 0
+			mtherr ("casin", DOMAIN);
+#endif
+		} else {
+			w = asin(x) + 0.0 * I;
+		}
+		return w;
+	}
+#endif
+
+/* Power series expansion */
+/*
+b = cabs(z);
+if( b < 0.125 )
+{
+z2.r = (x - y) * (x + y);
+z2.i = 2.0 * x * y;
+
+cn = 1.0;
+n = 1.0;
+ca.r = x;
+ca.i = y;
+sum.r = x;
+sum.i = y;
+do
+	{
+	ct.r = z2.r * ca.r  -  z2.i * ca.i;
+	ct.i = z2.r * ca.i  +  z2.i * ca.r;
+	ca.r = ct.r;
+	ca.i = ct.i;
+
+	cn *= n;
+	n += 1.0;
+	cn /= n;
+	n += 1.0;
+	b = cn/n;
+
+	ct.r *= b;
+	ct.i *= b;
+	sum.r += ct.r;
+	sum.i += ct.i;
+	b = fabs(ct.r) + fabs(ct.i);
+	}
+while( b > MACHEP );
+w->r = sum.r;
+w->i = sum.i;
+return;
+}
+*/
+
+
+	ca = x + y * I;
+	ct = ca * I;
+	/* sqrt( 1 - z*z) */
+	/* cmul( &ca, &ca, &zz ) */
+	/*x * x  -  y * y */
+	zz = (x - y) * (x + y) + (2.0 * x * y) * I;
+
+	zz = 1.0 - creal(zz) - cimag(zz) * I;
+	z2 = csqrt(zz);
+
+	zz = ct + z2;
+	zz = clog(zz);
+	/* multiply by 1/i = -i */
+	w = zz * (-1.0 * I);
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/casinf.c
@@ -0,0 +1,122 @@
+/* $NetBSD: casinf.c,v 1.1 2007/08/20 16:01:31 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+#ifdef __weak_alias
+__weak_alias(casinf, _casinf)
+#endif
+
+float complex
+casinf(float complex z)
+{
+	float complex w;
+	float complex ca, ct, zz, z2;
+	float x, y;
+
+	x = crealf(z);
+	y = cimagf(z);
+
+#if 0 /* MD: test is incorrect, casin(>1) is defined */
+	if (y == 0.0f) {
+		if (fabsf(x) > 1.0) {
+			w = M_PI_2 + 0.0f * I;
+#if 0
+			mtherr ("casin", DOMAIN);
+#endif
+		} else {
+			w = asinf(x) + 0.0f * I;
+		}
+		return w;
+	}
+#endif
+
+/* Power series expansion */
+/*
+b = cabsf(z);
+if( b < 0.125 )
+{
+z2.r = (x - y) * (x + y);
+z2.i = 2.0 * x * y;
+
+cn = 1.0;
+n = 1.0;
+ca.r = x;
+ca.i = y;
+sum.r = x;
+sum.i = y;
+do
+	{
+	ct.r = z2.r * ca.r  -  z2.i * ca.i;
+	ct.i = z2.r * ca.i  +  z2.i * ca.r;
+	ca.r = ct.r;
+	ca.i = ct.i;
+
+	cn *= n;
+	n += 1.0;
+	cn /= n;
+	n += 1.0;
+	b = cn/n;
+
+	ct.r *= b;
+	ct.i *= b;
+	sum.r += ct.r;
+	sum.i += ct.i;
+	b = fabsf(ct.r) + fabsf(ct.i);
+	}
+while( b > MACHEP );
+w->r = sum.r;
+w->i = sum.i;
+return;
+}
+*/
+
+
+	ca = x + y * I;
+	ct = ca * I;
+	/* sqrt( 1 - z*z) */
+	/* cmul( &ca, &ca, &zz ) */
+	/*x * x  -  y * y */
+	zz = (x - y) * (x + y) + (2.0f * x * y) * I;
+
+	zz = 1.0f - crealf(zz) - cimagf(zz) * I;
+	z2 = csqrtf(zz);
+
+	zz = ct + z2;
+	zz = clogf(zz);
+	/* multiply by 1/i = -i */
+	w = zz * (-1.0f * I);
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/casinh.c
@@ -0,0 +1,97 @@
+/* $NetBSD: casinh.c,v 1.1 2007/08/20 16:01:31 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<casinh>>, <<casinhf>>---complex arc hyperbolic sine
+
+INDEX
+        casinh
+INDEX
+        casinhf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex casinh(double complex <[z]>);
+       float complex casinhf(float complex <[z]>);
+
+
+DESCRIPTION
+        @ifnottex
+        These functions compute the complex arc hyperbolic sine of <[z]>,
+        with branch cuts outside the interval [-i, +i] along the 
+        imaginary axis.        
+        @end ifnottex
+        @tex
+        These functions compute the complex arc hyperbolic sine of <[z]>,
+        with branch cuts outside the interval [$-i$, $+i$] along the 
+        imaginary axis.        
+        @end tex
+
+        <<casinhf>> is identical to <<casinh>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        These functions return the complex arc hyperbolic sine value, 
+        in the range of a strip mathematically unbounded along the 
+        real axis and in the interval [-i*p/2, +i*p/2] along the 
+        imaginary axis.
+        @end ifnottex
+        @tex
+        These functions return the complex arc hyperbolic sine value, 
+        in the range of a strip mathematically unbounded along the 
+        real axis and in the interval [$-i\pi/2$, $+i\pi/2$] along the 
+        imaginary axis.
+        @end tex
+
+PORTABILITY
+        <<casinh>> and <<casinhf>> are ISO C99
+
+QUICKREF
+        <<casinh>> and <<casinhf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+
+double complex
+casinh(double complex z)
+{
+	double complex w;
+
+	w = -1.0 * I * casin(z * I);
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/casinhf.c
@@ -0,0 +1,44 @@
+/* $NetBSD: casinhf.c,v 1.1 2007/08/20 16:01:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+
+float complex
+casinhf(float complex z)
+{
+	float complex w;
+
+	w = -1.0f * I * casinf(z * I);
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/catan.c
@@ -0,0 +1,130 @@
+/* $NetBSD: catan.c,v 1.1 2007/08/20 16:01:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<catan>>, <<catanf>>---complex arc tangent
+
+INDEX
+        catan
+INDEX
+        catanf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex catan(double complex <[z]>);
+       float complex catanf(float complex <[z]>);
+
+
+DESCRIPTION
+        @ifnottex
+        These functions compute the complex arc tangent of <[z]>,
+        with branch cuts outside the interval [-i, +i] along the 
+        imaginary axis.
+        @end ifnottex
+        @tex
+        These functions compute the complex arc tangent of <[z]>,
+        with branch cuts outside the interval [$-i$, $+i$] along the 
+        imaginary axis.
+        @end tex
+
+        <<catanf>> is identical to <<catan>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        These functions return the complex arc tangent value, in the range
+        of a strip mathematically  unbounded  along the imaginary axis
+        and in the interval [-pi/2, +pi/2] along the real axis.
+        @end ifnottex
+        @tex
+        These functions return the complex arc tangent, in the range
+        of a strip mathematically  unbounded  along the imaginary axis
+        and in the interval [$-\pi/2$, $+\pi/2$] along the real axis.
+        @end tex
+
+PORTABILITY
+        <<catan>> and <<catanf>> are ISO C99
+
+QUICKREF
+        <<catan>> and <<catanf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subr.h"
+
+#ifdef __weak_alias
+__weak_alias(catan, _catan)
+#endif
+
+double complex
+catan(double complex z)
+{
+	double complex w;
+	double a, t, x, x2, y;
+
+	x = creal(z);
+	y = cimag(z);
+
+	if ((x == 0.0) && (y > 1.0))
+		goto ovrf;
+
+	x2 = x * x;
+	a = 1.0 - x2 - (y * y);
+	if (a == 0.0)
+		goto ovrf;
+
+	t = 0.5 * atan2(2.0 * x, a);
+	w = _redupi(t);
+
+	t = y - 1.0;
+	a = x2 + (t * t);
+	if (a == 0.0)
+		goto ovrf;
+
+	t = y + 1.0;
+	a = (x2 + (t * t))/a;
+	w = w + (0.25 * log(a)) * I;
+	return w;
+
+ovrf:
+#if 0
+	mtherr ("catan", OVERFLOW);
+#endif
+	w = HUGE_VAL + HUGE_VAL * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/catanf.c
@@ -0,0 +1,79 @@
+/* $NetBSD: catanf.c,v 1.1 2007/08/20 16:01:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subrf.h"
+
+#ifdef __weak_alias
+__weak_alias(catanf, _catanf)
+#endif
+
+float complex
+catanf(float complex z)
+{
+	float complex w;
+	float a, t, x, x2, y;
+
+	x = crealf(z);
+	y = cimagf(z);
+
+	if ((x == 0.0f) && (y > 1.0f))
+		goto ovrf;
+
+	x2 = x * x;
+	a = 1.0f - x2 - (y * y);
+	if (a == 0.0f)
+		goto ovrf;
+
+	t = 0.5f * atan2f(2.0f * x, a);
+	w = _redupif(t);
+
+	t = y - 1.0f;
+	a = x2 + (t * t);
+	if (a == 0.0f)
+		goto ovrf;
+
+	t = y + 1.0f;
+	a = (x2 + (t * t))/a;
+	w = w + (0.25f * logf(a)) * I;
+	return w;
+
+ovrf:
+#if 0
+	mtherr ("catan", OVERFLOW);
+#endif
+	w = HUGE_VALF + HUGE_VALF * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/catanh.c
@@ -0,0 +1,90 @@
+/* $NetBSD: catanh.c,v 1.1 2007/08/20 16:01:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<catanh>>, <<catanhf>>---complex arc hyperbolic tangent
+
+INDEX
+        catanh
+INDEX
+        catanhf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex catanh(double complex <[z]>);
+       float complex catanhf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex arc hyperbolic tan of <[z]>,
+        with branch cuts outside the interval [-1, +1] along the
+        real axis.
+
+        <<catanhf>> is identical to <<catanh>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        These functions return the complex arc hyperbolic tangent value,
+        in the range of a strip mathematically unbounded along the
+        real axis and in the interval [-i*p/2, +i*p/2] along the
+        imaginary axis.
+        @end ifnottex
+        @tex
+        These functions return the complex arc hyperbolic tangent value,
+        in the range of a strip mathematically unbounded along the
+        real axis and in the interval [$-i\pi/2$, $+i\pi/2$] along the
+        imaginary axis.
+        @end tex
+
+PORTABILITY
+        <<catanh>> and <<catanhf>> are ISO C99
+
+QUICKREF
+        <<catanh>> and <<catanhf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+
+double complex
+catanh(double complex z)
+{
+	double complex w;
+
+	w = -1.0 * I * catan(z * I);
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/catanhf.c
@@ -0,0 +1,44 @@
+/* $NetBSD: catanhf.c,v 1.1 2007/08/20 16:01:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+
+float complex
+catanhf(float complex z)
+{
+	float complex w;
+
+	w = -1.0f * I * catanf(z * I);
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ccos.c
@@ -0,0 +1,81 @@
+/* $NetBSD: ccos.c,v 1.1 2007/08/20 16:01:32 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<ccos>>, <<ccosf>>---complex cosine
+
+INDEX
+        ccos
+INDEX
+        ccosf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex ccos(double complex <[z]>);
+       float complex ccosf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex cosine of <[z]>.
+
+        <<ccosf>> is identical to <<ccos>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        These functions return the complex cosine value.
+
+PORTABILITY
+        <<ccos>> and <<ccosf>> are ISO C99
+
+QUICKREF
+        <<ccos>> and <<ccosf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subr.h"
+
+double complex
+ccos(double complex z)
+{
+	double complex w;
+	double ch, sh;
+
+	_cchsh(cimag(z), &ch, &sh);
+	w = cos(creal(z)) * ch - (sin(creal(z)) * sh) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ccosf.c
@@ -0,0 +1,48 @@
+/* $NetBSD: ccosf.c,v 1.1 2007/08/20 16:01:33 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subrf.h"
+
+float complex
+ccosf(float complex z)
+{
+	float complex w;
+	float ch, sh;
+
+	_cchshf(cimagf(z), &ch, &sh);
+	w = cosf(crealf(z)) * ch - (sinf(crealf(z)) * sh) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ccosh.c
@@ -0,0 +1,81 @@
+/* $NetBSD: ccosh.c,v 1.1 2007/08/20 16:01:33 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<ccosh>>, <<ccoshf>>---complex hyperbolic cosine
+
+INDEX
+        ccosh
+INDEX
+        ccoshf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex ccosh(double complex <[z]>);
+       float complex ccoshf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex hyperbolic cosine of <[z]>.
+
+        <<ccoshf>> is identical to <<ccosh>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        These functions return the complex hyperbolic cosine value.
+
+PORTABILITY
+        <<ccosh>> and <<ccoshf>> are ISO C99
+
+QUICKREF
+        <<ccosh>> and <<ccoshf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+ccosh(double complex z)
+{
+	double complex w;
+	double x, y;
+
+	x = creal(z);
+	y = cimag(z);
+	w = cosh(x) * cos(y) + (sinh(x) * sin(y)) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ccoshf.c
@@ -0,0 +1,48 @@
+/* $NetBSD: ccoshf.c,v 1.1 2007/08/20 16:01:33 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+ccoshf(float complex z)
+{
+	float complex w;
+	float x, y;
+
+	x = crealf(z);
+	y = cimagf(z);
+	w = coshf(x) * cosf(y) + (sinhf(x) * sinf(y)) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cephes_subr.c
@@ -0,0 +1,126 @@
+/* $NetBSD: cephes_subr.c,v 1.1 2007/08/20 16:01:33 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subr.h"
+
+/* calculate cosh and sinh */
+
+void
+_cchsh(double x, double *c, double *s)
+{
+	double e, ei;
+
+	if (fabs(x) <= 0.5) {
+		*c = cosh(x);
+		*s = sinh(x);
+	} else {
+		e = exp(x);
+		ei = 0.5 / e;
+		e = 0.5 * e;
+		*s = e - ei;
+		*c = e + ei;
+	}
+}
+
+/* Program to subtract nearest integer multiple of PI */
+
+/* extended precision value of PI: */
+static const double DP1 = 3.14159265160560607910E0;
+static const double DP2 = 1.98418714791870343106E-9;
+static const double DP3 = 1.14423774522196636802E-17;
+#define MACHEP 1.1e-16
+
+double
+_redupi(double x)
+{
+	double t;
+	long i;
+
+	t = x / M_PI;
+	if (t >= 0.0)
+		t += 0.5;
+	else
+		t -= 0.5;
+
+	i = t;	/* the multiple */
+	t = i;
+	t = ((x - t * DP1) - t * DP2) - t * DP3;
+	return t;
+}
+
+/* Taylor series expansion for cosh(2y) - cos(2x) */
+
+double
+_ctans(double complex z)
+{
+	double f, x, x2, y, y2, rn, t;
+	double d;
+
+	x = fabs(2.0 * creal(z));
+	y = fabs(2.0 * cimag(z));
+
+	x = _redupi(x);
+
+	x = x * x;
+	y = y * y;
+	x2 = 1.0;
+	y2 = 1.0;
+	f = 1.0;
+	rn = 0.0;
+	d = 0.0;
+	do {
+		rn += 1.0;
+		f *= rn;
+		rn += 1.0;
+		f *= rn;
+		x2 *= x;
+		y2 *= y;
+		t = y2 + x2;
+		t /= f;
+		d += t;
+
+		rn += 1.0;
+		f *= rn;
+		rn += 1.0;
+		f *= rn;
+		x2 *= x;
+		y2 *= y;
+		t = y2 - x2;
+		t /= f;
+		d += t;
+	} while (fabs(t/d) > MACHEP);
+	return d;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cephes_subr.h
@@ -0,0 +1,5 @@
+/* $NetBSD: cephes_subr.h,v 1.1 2007/08/20 16:01:33 drochner Exp $ */
+
+void _cchsh(double, double *, double *);
+double _redupi(double);
+double _ctans(double complex);
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cephes_subrf.c
@@ -0,0 +1,125 @@
+/* $NetBSD: cephes_subrf.c,v 1.1 2007/08/20 16:01:34 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subrf.h"
+
+/* calculate cosh and sinh */
+
+void
+_cchshf(float x, float *c, float *s)
+{
+	float e, ei;
+
+	if (fabsf(x) <= 0.5f) {
+		*c = coshf(x);
+		*s = sinhf(x);
+	} else {
+		e = expf(x);
+		ei = 0.5f / e;
+		e = 0.5f * e;
+		*s = e - ei;
+		*c = e + ei;
+	}
+}
+
+/* Program to subtract nearest integer multiple of PI */
+
+/* extended precision value of PI: */
+static const double DP1 =  3.140625;
+static const double DP2 =  9.67502593994140625E-4;
+static const double DP3 =  1.509957990978376432E-7;
+#define MACHEPF 3.0e-8
+
+float
+_redupif(float x)
+{
+	float t;
+	long i;
+
+	t = x / (float)M_PI;
+	if (t >= 0.0f)
+		t += 0.5f;
+	else
+		t -= 0.5f;
+
+	i = t;	/* the multiple */
+	t = i;
+	t = ((x - t * DP1) - t * DP2) - t * DP3;
+	return t;
+}
+
+/* Taylor series expansion for cosh(2y) - cos(2x) */
+
+float
+_ctansf(float complex z)
+{
+	float f, x, x2, y, y2, rn, t, d;
+
+	x = fabsf(2.0f * crealf(z));
+	y = fabsf(2.0f * cimagf(z));
+
+	x = _redupif(x);
+
+	x = x * x;
+	y = y * y;
+	x2 = 1.0f;
+	y2 = 1.0f;
+	f = 1.0f;
+	rn = 0.0f;
+	d = 0.0f;
+	do {
+		rn += 1.0f;
+		f *= rn;
+		rn += 1.0f;
+		f *= rn;
+		x2 *= x;
+		y2 *= y;
+		t = y2 + x2;
+		t /= f;
+		d += t;
+
+		rn += 1.0f;
+		f *= rn;
+		rn += 1.0f;
+		f *= rn;
+		x2 *= x;
+		y2 *= y;
+		t = y2 - x2;
+		t /= f;
+		d += t;
+	} while (fabsf(t/d) > MACHEPF);
+	return d;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cephes_subrf.h
@@ -0,0 +1,5 @@
+/* $NetBSD: cephes_subrf.h,v 1.1 2007/08/20 16:01:34 drochner Exp $ */
+
+void _cchshf(float, float *, float *);
+float _redupif(float);
+float _ctansf(float complex);
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cexp.c
@@ -0,0 +1,82 @@
+/* $NetBSD: cexp.c,v 1.1 2007/08/20 16:01:34 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<cexp>>, <<cexpf>>---complex base-e exponential
+
+INDEX
+        cexp
+INDEX
+        cexpf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex cexp(double complex <[z]>);
+       float complex cexpf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute  the complex base-<[e]> exponential of <[z]>.
+
+        <<cexpf>> is identical to <<cexp>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        The cexp functions return the complex base-<[e]> exponential value.
+
+PORTABILITY
+        <<cexp>> and <<cexpf>> are ISO C99
+
+QUICKREF
+        <<cexp>> and <<cexpf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+cexp(double complex z)
+{
+	double complex w;
+	double r, x, y;
+
+	x = creal(z);
+	y = cimag(z);
+	r = exp(x);
+	w = r * cos(y) + r * sin(y) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cexpf.c
@@ -0,0 +1,49 @@
+/* $NetBSD: cexpf.c,v 1.1 2007/08/20 16:01:34 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+cexpf(float complex z)
+{
+	float complex w;
+	float r, x, y;
+
+	x = crealf(z);
+	y = cimagf(z);
+	r = expf(x);
+	w = r * cosf(y) + r * sinf(y) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cimag.c
@@ -0,0 +1,61 @@
+//===========================================================================
+//
+//      cimag.c
+//
+//      Complex numbr real part  - double precision.
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    ilijak
+// Contributors:
+// Date:         2013-06-06
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <complex.h>
+
+double
+cimag(double complex z)
+{
+    return __builtin_cimag(z);
+}
+
+//  End of cimag.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cimagf.c
@@ -0,0 +1,61 @@
+//===========================================================================
+//
+//      cimagf.c
+//
+//      Complex numbr real part  - single precision.
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    ilijak
+// Contributors:
+// Date:         2013-06-06
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <complex.h>
+
+float
+cimagf(float complex z)
+{
+    return __builtin_cimagf(z);
+}
+
+// End of cimagf.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/clog.c
@@ -0,0 +1,91 @@
+/* $NetBSD: clog.c,v 1.1 2007/08/20 16:01:35 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<clog>>, <<clogf>>---complex base-e logarithm
+
+INDEX
+        clog
+INDEX
+        clogf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex clog(double complex <[z]>);
+       float complex clogf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex natural (base-<[e]>) logarithm 
+        of <[z]>, with a branch cut along the negative real axis. 
+
+        <<clogf>> is identical to <<clog>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        @ifnottex
+        The clog functions return the complex natural logarithm value, in 
+        the range of a strip mathematically unbounded along the real axis 
+        and in the interval [-i*pi , +i*pi] along the imaginary axis.
+        @end ifnottex
+        @tex
+        The clog functions return the complex natural logarithm value, in
+        the range of a strip mathematically unbounded along the real axis
+         and in the interval [$-i\pi$, $+i\pi$] along the imaginary axis.
+        @end tex
+
+PORTABILITY
+        <<clog>> and <<clogf>> are ISO C99
+
+QUICKREF
+        <<clog>> and <<clogf>> are ISO C99
+
+*/
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+clog(double complex z)
+{
+	double complex w;
+	double p, rr;
+
+	rr = cabs(z);
+	p = log(rr);
+	rr = atan2(cimag(z), creal(z));
+	w = p + rr * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/clogf.c
@@ -0,0 +1,49 @@
+/* $NetBSD: clogf.c,v 1.1 2007/08/20 16:01:35 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+clogf(float complex z)
+{
+	float complex w;
+	float p, rr;
+
+	rr = cabsf(z);
+	p = logf(rr);
+	rr = atan2f(cimagf(z), crealf(z));
+	w = p + rr * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/complex.tex
@@ -0,0 +1,55 @@
+@node Complex
+@chapter Mathematical Complex Functions (@file{complex.h})
+
+This chapter groups the complex mathematical functions.  The
+corresponding definitions and declarations are in @file{complex.h}.  
+Functions and documentations are taken from NetBSD.
+
+@menu 
+* cabs::	Complex absolute value
+* cacos::	Complex arc cosine
+* cacosh::	Complex arc hyperbolic cosine
+* carg::	Argument (also called phase angle)
+* casin::	Complex arc sine
+* casinh::	Complex arc hyperbolic sine
+* catan::	Complex arc tangent
+* catanh::	Complex arc hyperbolic tangent
+* ccos::	Complex cosine
+* ccosh::	Complex hyperbolic cosine
+* cexp::	Complex exponent
+* cimag::	Imaginary part
+* clog::	Complex natural (base e) logarithm
+* conj::	Complex conjugate
+* cpow::	Complex power function
+* cproj::	Compute a projection on the Riemann sphere
+* creal::	Real part
+* csin::	Complex sine
+* csinh::	Complex hyperbolic sine
+* csqrt::	Complex square root
+* ctan::	Complex tangent
+* ctanh::	Complex hyperbolic tangent
+@end menu
+
+
+@page @include   complex/cabs.def
+@page @include   complex/cacos.def
+@page @include   complex/cacosh.def
+@page @include   complex/carg.def
+@page @include   complex/casin.def
+@page @include   complex/casinh.def
+@page @include   complex/catan.def
+@page @include   complex/catanh.def
+@page @include   complex/ccos.def
+@page @include   complex/ccosh.def
+@page @include   complex/cexp.def
+@page @include   complex/cimag.def
+@page @include   complex/clog.def
+@page @include   complex/conj.def
+@page @include   complex/cpow.def
+@page @include   complex/cproj.def
+@page @include   complex/creal.def
+@page @include   complex/csin.def
+@page @include   complex/csinh.def
+@page @include   complex/csqrt.def
+@page @include   complex/ctan.def
+@page @include   complex/ctanh.def
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/conj.c
@@ -0,0 +1,61 @@
+//===========================================================================
+//
+//      conj.c
+//
+//      Complex cojugate - double precision.
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     ilijak
+// Contributors:
+// Date:         2013-06-06
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <complex.h>
+
+double complex
+conj(double complex z)
+{
+    return __builtin_conj(z);
+}
+
+// End of conj.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/conjf.c
@@ -0,0 +1,61 @@
+//===========================================================================
+//
+//      conjf.c
+//
+//      Complex cojugate - single precision.
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: ilijak
+// Date:         2013-06-06
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <complex.h>
+
+float complex
+conjf(float complex z)
+{
+    return __builtin_conjf(z);
+}
+
+// End of conjf.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cpow.c
@@ -0,0 +1,101 @@
+/* $NetBSD: cpow.c,v 1.1 2007/08/20 16:01:35 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<cpow>>, <<cpowf>>---complex power
+
+INDEX
+        cpow
+INDEX
+        cpowf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex cpow(double complex <[x]>, double complex <[y]>);
+       float complex cpowf(float complex <[x]>, float complex <[y]>);
+
+
+DESCRIPTION
+        @ifnottex
+        The cpow functions compute the complex power function x^y 
+        power, with a branch cut for the first parameter along the 
+        negative real axis.
+        @end ifnottex
+        @tex
+        The cpow functions compute the complex power function $x^y$ 
+        power, with a branch cut for the first parameter along the 
+        negative real axis.
+        @end tex
+
+        <<cpowf>> is identical to <<cpow>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        The cpow functions return the complex power function value.
+
+PORTABILITY
+        <<cpow>> and <<cpowf>> are ISO C99
+
+QUICKREF
+        <<cpow>> and <<cpowf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+cpow(double complex a, double complex z)
+{
+	double complex w;
+	double x, y, r, theta, absa, arga;
+
+	x = creal(z);
+	y = cimag(z);
+	absa = cabs(a);
+	if (absa == 0.0) {
+		return (0.0 + 0.0 * I);
+	}
+	arga = carg(a);
+	r = pow(absa, x);
+	theta = x * arga;
+	if (y != 0.0) {
+		r = r * exp(-y * arga);
+		theta = theta + y * log(absa);
+	}
+	w = r * cos(theta) + (r * sin(theta)) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cpowf.c
@@ -0,0 +1,59 @@
+/* $NetBSD: cpowf.c,v 1.1 2007/08/20 16:01:36 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+cpowf(float complex a, float complex z)
+{
+	float complex w;
+	float x, y, r, theta, absa, arga;
+
+	x = crealf(z);
+	y = cimagf(z);
+	absa = cabsf(a);
+	if (absa == 0.0f) {
+		return (0.0f + 0.0f * I);
+	}
+	arga = cargf(a);
+	r = powf(absa, x);
+	theta = x * arga;
+	if (y != 0.0f) {
+		r = r * expf(-y * arga);
+		theta = theta + y * logf(absa);
+	}
+	w = r * cosf(theta) + (r * sinf(theta)) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cproj.c
@@ -0,0 +1,106 @@
+/*	$NetBSD: cproj.c,v 1.3 2010/09/20 17:51:38 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<cproj>>, <<cprojf>>--- Riemann sphere projection
+ 
+INDEX
+        cproj
+INDEX
+        cprojf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex cproj(double complex <[z]>);
+       float complex cprojf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute a projection of <[z]> onto the Riemann 
+        sphere: <[z]> projects to <[z]> except that all complex infinities 
+        (even those with one infinite part and one NaN part) project 
+        to positive infinity on the real axis. If <[z]> has an infinite part,
+        then <<cproj>>(<[z]>) is equivalent to
+
+                 INFINITY + I * copysign(0.0, cimag(z))
+
+        <<cprojf>> is identical to <<cproj>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        The cproj functions return the value of the projection onto 
+        the Riemann sphere.
+
+PORTABILITY
+        <<cproj>> and <<cprojf>> are ISO C99
+
+QUICKREF
+        <<cproj>> and <<cprojf>> are ISO C99
+
+*/
+
+//#include <sys/cdefs.h>
+/*__RCSID("$NetBSD: cproj.c,v 1.3 2010/09/20 17:51:38 christos Exp $"); */
+
+#include <complex.h>
+#include <math.h>
+
+#include "../mathincl/fdlibm.h"
+
+/*
+ * cproj(double complex z)
+ *
+ * These functions return the value of the projection (not stereographic!)
+ * onto the Riemann sphere.
+ *
+ * z projects to z, except that all complex infinities (even those with one
+ * infinite part and one NaN part) project to positive infinity on the real axis.
+ * If z has an infinite part, then cproj(z) shall be equivalent to:
+ *
+ * INFINITY + I * copysign(0.0, cimag(z))
+ */
+double complex
+cproj(double complex z)
+{
+	double_complex w = { .z = z };
+
+	if (isinf(creal(z)) || isinf(cimag(z))) {
+#ifdef __INFINITY
+		REAL_PART(w) = __INFINITY;
+#else
+		REAL_PART(w) = HUGE_VAL;
+#endif
+		IMAG_PART(w) = copysign(0.0, cimag(z));
+	}
+
+	return (w.z);
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/cprojf.c
@@ -0,0 +1,67 @@
+/*	$NetBSD: cprojf.c,v 1.3 2010/09/20 17:51:38 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*__RCSID("$NetBSD: cprojf.c,v 1.3 2010/09/20 17:51:38 christos Exp $"); */
+
+#include <complex.h>
+#include <math.h>
+
+#include "../mathincl/fdlibm.h"
+
+/*
+ * cprojf(float complex z)
+ *
+ * These functions return the value of the projection (not stereographic!)
+ * onto the Riemann sphere.
+ *
+ * z projects to z, except that all complex infinities (even those with one
+ * infinite part and one NaN part) project to positive infinity on the real axis.
+ * If z has an infinite part, then cproj(z) shall be equivalent to:
+ *
+ * INFINITY + I * copysign(0.0, cimag(z))
+ */
+
+float complex
+cprojf(float complex z)
+{
+	float_complex w = { .z = z };
+
+	if (isinff(crealf(z)) || isinff(cimagf(z))) {
+#ifdef __INFINITY
+		REAL_PART(w) = __INFINITY;
+#else
+		REAL_PART(w) = HUGE_VALF;
+#endif
+		IMAG_PART(w) = copysignf(0.0, cimagf(z));
+	}
+
+	return (w.z);
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/creal.c
@@ -0,0 +1,61 @@
+//===========================================================================
+//
+//      creal.c
+//
+//      Complex numbr real part  - double precision.
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    ilijak
+// Contributors:
+// Date:         2013-06-06
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <complex.h>
+
+double
+creal(double complex z)
+{
+    return __builtin_creal(z);
+}
+
+//  End of creal.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/crealf.c
@@ -0,0 +1,61 @@
+//===========================================================================
+//
+//      crealf.c
+//
+//      Complex numbr real part  - single precision.
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    ilijak
+// Contributors:
+// Date:         2013-06-06
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <complex.h>
+
+float
+crealf(float complex z)
+{
+    return __builtin_crealf(z);
+}
+
+// End of crealf.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/csin.c
@@ -0,0 +1,81 @@
+/* $NetBSD: csin.c,v 1.1 2007/08/20 16:01:36 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<csin>>, <<csinf>>---complex sine
+
+INDEX
+        csin
+INDEX
+        csinf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex csin(double complex <[z]>);
+       float complex csinf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex sine of <[z]>.
+
+        <<csinf>> is identical to <<csin>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        These functions return the complex sine value.
+
+PORTABILITY
+        <<csin>> and <<csinf>> are ISO C99
+
+QUICKREF
+        <<csin>> and <<csinf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subr.h"
+
+double complex
+csin(double complex z)
+{
+	double complex w;
+	double ch, sh;
+
+	_cchsh(cimag(z), &ch, &sh);
+	w = sin(creal(z)) * ch + (cos(creal(z)) * sh) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/csinf.c
@@ -0,0 +1,48 @@
+/* $NetBSD: csinf.c,v 1.1 2007/08/20 16:01:36 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subrf.h"
+
+float complex
+csinf(float complex z)
+{
+	float complex w;
+	float ch, sh;
+
+	_cchshf(cimagf(z), &ch, &sh);
+	w = sinf(crealf(z)) * ch + (cosf(crealf(z)) * sh) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/csinh.c
@@ -0,0 +1,80 @@
+/* $NetBSD: csinh.c,v 1.1 2007/08/20 16:01:36 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<csinh>>, <<csinhf>>---complex hyperbolic sine
+
+INDEX
+        csinh
+INDEX
+        csinhf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex csinh(double complex <[z]>);
+       float complex csinhf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex hyperbolic sine of <[z]>.
+
+        <<ccoshf>> is identical to <<ccosh>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        These functions return the complex hyperbolic sine value.
+
+PORTABILITY
+        <<csinh>> and <<csinhf>> are ISO C99
+
+QUICKREF
+        <<csinh>> and <<csinhf>> are ISO C99
+
+*/
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+csinh(double complex z)
+{
+	double complex w;
+	double x, y;
+
+	x = creal(z);
+	y = cimag(z);
+	w = sinh(x) * cos(y) + (cosh(x) * sin(y)) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/csinhf.c
@@ -0,0 +1,48 @@
+/* $NetBSD: csinhf.c,v 1.1 2007/08/20 16:01:37 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+csinhf(float complex z)
+{
+	float complex w;
+	float x, y;
+
+	x = crealf(z);
+	y = cimagf(z);
+	w = sinhf(x) * cosf(y) + (coshf(x) * sinf(y)) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/csqrt.c
@@ -0,0 +1,137 @@
+/* $NetBSD: csqrt.c,v 1.1 2007/08/20 16:01:37 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<csqrt>>, <<csqrtf>>---complex square root
+
+INDEX
+        csqrt
+INDEX
+        csqrtf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex csqrt(double complex <[z]>);
+       float complex csqrtf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex square root of <[z]>, with 
+        a branch cut along the negative real axis. 
+
+        <<csqrtf>> is identical to <<csqrt>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        The csqrt functions return the complex square root value, in 
+        the range of the right halfplane (including the imaginary axis).
+
+PORTABILITY
+        <<csqrt>> and <<csqrtf>> are ISO C99
+
+QUICKREF
+        <<csqrt>> and <<csqrtf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+csqrt(double complex z)
+{
+	double complex w;
+	double x, y, r, t, scale;
+
+	x = creal (z);
+	y = cimag (z);
+
+	if (y == 0.0) {
+		if (x == 0.0) {
+			w = 0.0 + y * I;
+		} else {
+			r = fabs(x);
+			r = sqrt(r);
+			if (x < 0.0) {
+				w = 0.0 + r * I;
+			} else {
+				w = r + y * I;
+			}
+		}
+		return w;
+	}
+	if (x == 0.0) {
+		r = fabs(y);
+		r = sqrt(0.5 * r);
+		if (y > 0)
+			w = r + r * I;
+		else
+			w = r - r * I;
+		return w;
+	}
+	/* Rescale to avoid internal overflow or underflow.  */
+	if ((fabs(x) > 4.0) || (fabs(y) > 4.0)) {
+		x *= 0.25;
+		y *= 0.25;
+		scale = 2.0;
+	} else {
+#if 1
+		x *= 1.8014398509481984e16;  /* 2^54 */
+		y *= 1.8014398509481984e16;
+		scale = 7.450580596923828125e-9; /* 2^-27 */
+#else
+		x *= 4.0;
+		y *= 4.0;
+		scale = 0.5;
+#endif
+	}
+	w = x + y * I;
+	r = cabs(w);
+	if (x > 0) {
+		t = sqrt(0.5 * r + 0.5 * x);
+		r = scale * fabs((0.5 * y) / t );
+		t *= scale;
+	} else {
+		r = sqrt(0.5 * r - 0.5 * x);
+		t = scale * fabs((0.5 * y) / r);
+		r *= scale;
+	}
+	if (y < 0)
+		w = t - r * I;
+	else
+		w = t + r * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/csqrtf.c
@@ -0,0 +1,102 @@
+/* $NetBSD: csqrtf.c,v 1.1 2007/08/20 16:01:37 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+csqrtf(float complex z)
+{
+	float complex w;
+	float x, y, r, t, scale;
+
+	x = crealf (z);
+	y = cimagf (z);
+
+	if (y == 0.0f) {
+		if (x < 0.0f) {
+			w = 0.0f + sqrtf(-x) * I;
+			return w;
+		} else if (x == 0.0f) {
+			return (0.0f + y * I);
+		} else {
+			w = sqrtf(x) + y * I;
+			return w;
+		}
+	}
+
+	if (x == 0.0f) {
+		r = fabsf(y);
+		r = sqrtf(0.5f * r);
+		if (y > 0)
+			w = r + r * I;
+		else
+			w = r - r * I;
+		return w;
+	}
+
+	/* Rescale to avoid internal overflow or underflow.  */
+	if ((fabsf(x) > 4.0f) || (fabsf(y) > 4.0f)) {
+		x *= 0.25f;
+		y *= 0.25f;
+		scale = 2.0f;
+	} else {
+#if 1
+		x *= 6.7108864e7f; /* 2^26 */
+		y *= 6.7108864e7f;
+		scale = 1.220703125e-4f; /* 2^-13 */
+#else
+		x *= 4.0f;
+		y *= 4.0f;
+		scale = 0.5f;
+#endif
+	}
+	w = x + y * I;
+	r = cabsf(w);
+	if( x > 0 ) {
+		t = sqrtf(0.5f * r + 0.5f * x);
+		r = scale * fabsf((0.5f * y) / t);
+		t *= scale;
+	} else {
+		r = sqrtf(0.5f * r - 0.5f * x);
+		t = scale * fabsf((0.5f * y) / r);
+		r *= scale;
+	}
+
+	if (y < 0)
+		w = t - r * I;
+	else
+		w = t + r * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ctan.c
@@ -0,0 +1,91 @@
+/* $NetBSD: ctan.c,v 1.1 2007/08/20 16:01:37 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<ctan>>, <<ctanf>>---complex tangent
+
+INDEX
+        ctan
+INDEX
+        ctanf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex ctan(double complex <[z]>);
+       float complex ctanf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex tangent of <[z]>.
+
+        <<ctanf>> is identical to <<ctan>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        These functions return the complex tangent value.
+
+PORTABILITY
+        <<ctan>> and <<ctanf>> are ISO C99
+
+QUICKREF
+        <<ctan>> and <<ctanf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subr.h"
+
+double complex
+ctan(double complex z)
+{
+	double complex w;
+	double d;
+
+	d = cos(2.0 * creal(z)) + cosh(2.0 * cimag(z));
+
+	if (fabs(d) < 0.25)
+		d = _ctans(z);
+
+	if (d == 0.0) {
+		/* mtherr ("ctan", OVERFLOW); */
+		w = HUGE_VAL + HUGE_VAL * I;
+		return w;
+	}
+
+	w = sin(2.0 * creal(z)) / d + (sinh(2.0 * cimag(z)) / d) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ctanf.c
@@ -0,0 +1,58 @@
+/* $NetBSD: ctanf.c,v 1.1 2007/08/20 16:01:38 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+#include "cephes_subrf.h"
+
+float complex
+ctanf(float complex z)
+{
+	float complex w;
+	float d;
+
+	d = cosf(2.0f * crealf(z)) + coshf(2.0f * cimagf(z));
+
+	if (fabsf(d) < 0.25f)
+		d = _ctansf(z);
+
+	if (d == 0.0f) {
+		/* mtherr ("ctan", OVERFLOW); */
+		w = HUGE_VALF + HUGE_VALF * I;
+		return w;
+	}
+
+	w = sinf(2.0f * crealf(z)) / d + (sinhf(2.0f * cimagf(z)) / d) * I;
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ctanh.c
@@ -0,0 +1,83 @@
+/* $NetBSD: ctanh.c,v 1.1 2007/08/20 16:01:38 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+/*
+FUNCTION
+        <<ctanh>>, <<ctanf>>---complex hyperbolic tangent
+
+INDEX
+        ctanh
+INDEX
+        ctanhf
+
+ANSI_SYNOPSIS
+       #include <complex.h>
+       double complex ctanh(double complex <[z]>);
+       float complex ctanhf(float complex <[z]>);
+
+
+DESCRIPTION
+        These functions compute the complex hyperbolic tangent of <[z]>.
+
+        <<ctanhf>> is identical to <<ctanh>>, except that it performs
+        its calculations on <<floats complex>>.
+
+RETURNS
+        These functions return the complex hyperbolic tangent value.
+
+PORTABILITY
+        <<ctanh>> and <<ctanhf>> are ISO C99
+
+QUICKREF
+        <<ctanh>> and <<ctanhf>> are ISO C99
+
+*/
+
+
+#include <complex.h>
+#include <math.h>
+
+double complex
+ctanh(double complex z)
+{
+	double complex w;
+	double x, y, d;
+
+	x = creal(z);
+	y = cimag(z);
+	d = cosh(2.0 * x) + cos(2.0 * y);
+	w = sinh(2.0 * x) / d  +  (sin(2.0 * y) / d) * I;
+
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/complex/ctanhf.c
@@ -0,0 +1,50 @@
+/* $NetBSD: ctanhf.c,v 1.1 2007/08/20 16:01:38 drochner Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software written by Stephen L. Moshier.
+ * It is redistributed by the NetBSD Foundation by permission of the author.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * imported and modified include for newlib 2010/10/03 
+ * Marco Atzeri <marco_atzeri@yahoo.it>
+ */
+
+#include <complex.h>
+#include <math.h>
+
+float complex
+ctanhf(float complex z)
+{
+	float complex w;
+	float x, y, d;
+
+	x = crealf(z);
+	y = cimagf(z);
+	d = coshf(2.0f * x) + cosf(2.0f * y);
+	w = sinhf(2.0f * x) / d  +  (sinf(2.0f * y) / d) * I;
+
+	return w;
+}
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_acos.c
@@ -0,0 +1,103 @@
+//===========================================================================
+//
+//      wf_acos.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrap_acosf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef _HAVE_STDC
+	float acosf(float x)		/* wrapper acosf */
+#else
+	float acosf(x)			/* wrapper acosf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_acosf(x);
+#else
+    float z;
+
+    z = __ieee754_acosf(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    if(fabsf(x)>(float)1.0) {
+        return __kernel_standard_float(x,x,1); /* acos(|x|>1) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_acos.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_acosh.c
@@ -0,0 +1,103 @@
+//===========================================================================
+//
+//      wf_acosh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+/*
+ * wrapper acoshf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float acoshf(float x)		/* wrapper acoshf */
+#else
+	float acoshf(x)			/* wrapper acoshf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_acoshf(x);
+#else
+    float z;
+    z = __ieee754_acoshf(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    if(x<1.0) {
+        return __kernel_standard(x,x,29); /* acosh(x<1) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_acosh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_asin.c
@@ -0,0 +1,104 @@
+//===========================================================================
+//
+//      wf_asin.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+/*
+ * wrapper asinf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float asinf(float x)		/* wrapper asinf */
+#else
+	float asinf(x)			/* wrapper asinf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_asinf(x);
+#else
+    float z;
+
+    z = __ieee754_asinf(x);
+    if( cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    if(fabsf(x)>(float)1.0) {
+        return __kernel_standard_float(x,x,2); /* asin(|x|>1) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_asin.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_atan2.c
@@ -0,0 +1,93 @@
+//===========================================================================
+//
+//      wf_atan2.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+/*
+ * wrapper atan2f(y,x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float atan2f(float y, float x)		/* wrapper atan2f */
+#else
+	float atan2f(y,x)			/* wrapper atan2 */
+	float y,x;
+#endif
+{
+	return __ieee754_atan2f(y,x);
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_atan2.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_atanh.c
@@ -0,0 +1,105 @@
+//===========================================================================
+//
+//      wf_atanh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+/*
+ * wrapper atanhf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float atanhf(float x)		/* wrapper atanhf */
+#else
+	float atanhf(x)			/* wrapper atanhf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_atanhf(x);
+#else
+    float z,y;
+    z = __ieee754_atanhf(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    y = fabs(x);
+    if(y>=1.0) {
+        if(y>1.0)
+            return __kernel_standard(x,x,30); /* atanh(|x|>1) */
+        else
+            return __kernel_standard(x,x,31); /* atanh(|x|==1) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_atanh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_cosh.c
@@ -0,0 +1,102 @@
+//===========================================================================
+//
+//      wf_cosh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper coshf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float coshf(float x)		/* wrapper coshf */
+#else
+	float coshf(x)			/* wrapper coshf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_coshf(x);
+#else
+    float z;
+    z = __ieee754_coshf(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    if(fabsf(x)>(float)8.9415985107e+01) {
+        return __kernel_standard(x,x,5); /* cosh overflow */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_cosh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_exp.c
@@ -0,0 +1,114 @@
+//===========================================================================
+//
+//      wf_exp.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper expf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+o_threshold=  8.8721679688e+01,  /* 0x42b17180 */
+u_threshold= -1.0397208405e+02;  /* 0xc2cff1b5 */
+
+#ifdef __STDC__
+	float expf(float x)		/* wrapper expf */
+#else
+	float expf(x)			/* wrapper expf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_expf(x);
+#else
+	float z;
+	//struct exception exc;
+	z = __ieee754_expf(x);
+	if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z;
+	if(finitef(x)) {
+	    if(x>o_threshold)
+	        return __kernel_standard(x,x,6); /* exp overflow */
+       else if(x<u_threshold)
+            return __kernel_standard(x,x,7); /* exp underflow */
+	}
+	return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_exp.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_fmod.c
@@ -0,0 +1,102 @@
+//===========================================================================
+//
+//      w_fmod.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper fmodf(x,y)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float fmodf(float x, float y)	/* wrapper fmodf */
+#else
+	float fmodf(x,y)		/* wrapper fmodf */
+	float x,y;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_fmodf(x,y);
+#else
+    float z;
+    z = __ieee754_fmodf(x,y);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE ||isnanf(y)||isnanf(x)) return z;
+    if(y==0.0) {
+        return __kernel_standard(x,y,27); /* fmod(x,0) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_fmod.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_gamma.c
@@ -0,0 +1,103 @@
+//===========================================================================
+//
+//      wf_gamma.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+#include <math.h>
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float gammaf(float x)
+#else
+	float gammaf(x)
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_gammaf_r(x,&signgam);
+#else
+    float y;
+    y = __ieee754_gammaf_r(x,&signgam);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return y;
+    if(!finitef(y)&&finitef(x)) {
+        if(floorf(x)==x&&x<=0.0)
+            return __kernel_standard(x,x,41); /* gamma pole */
+        else
+            return __kernel_standard(x,x,40); /* gamma overflow */
+    } else
+        return y;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_gamma.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_gamma_r.c
@@ -0,0 +1,106 @@
+//===========================================================================
+//
+//      wf_gamma_r.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper float gammaf_r(float x, int *signgamp)
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float gammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
+#else
+	float gammaf_r(x,signgamp)              /* wrapper lgammaf_r */
+	float x; int *signgamp;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_gammaf_r(x,signgamp);
+#else
+    float y;
+    y = __ieee754_gammaf_r(x,signgamp);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return y;
+    if(!finitef(y)&&finitef(x)) {
+        if(floorf(x)==x&&x<=0.0)
+            return __kernel_standard(x,x,41); /* gamma pole */
+        else
+            return __kernel_standard(x,x,40); /* gamma overflow */
+    } else
+        return y;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_gamma_r.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_hypot.c
@@ -0,0 +1,102 @@
+//===========================================================================
+//
+//      wf_hypot.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper hypotf(x,y)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float hypotf(float x, float y)	/* wrapper hypotf */
+#else
+	float hypotf(x,y)		/* wrapper hypotf */
+	float x,y;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_hypotf(x,y);
+#else
+    float z;
+    z = __ieee754_hypotf(x,y);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z;
+    if((!finitef(z))&&finitef(x)&&finitef(y))
+        return __kernel_standard(x,y,4); /* hypot overflow */
+    else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_hypot.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_j0.c
@@ -0,0 +1,129 @@
+//===========================================================================
+//
+//      w_j0.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper j0f(float x), y0f(float x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float j0f(float x)		/* wrapper j0f */
+#else
+	float j0f(x)			/* wrapper j0f */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_j0f(x);
+#else
+    float z = __ieee754_j0f(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    if(fabsf(x)>(float)X_TLOSS) {
+        return __kernel_standard(x,x,34); /* j0(|x|>X_TLOSS) */
+    } else
+        return z;
+#endif
+}
+
+#ifdef __STDC__
+	float y0f(float x)		/* wrapper y0f */
+#else
+	float y0f(x)			/* wrapper y0f */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_y0f(x);
+#else
+    float z;
+    z = __ieee754_y0f(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x) ) return z;
+    if(x <= 0.0){
+        if(x==0.0)
+            /* d= -one/(x-x); */
+            return __kernel_standard(x,x,8);
+        else
+            /* d = zero/(x-x); */
+            return __kernel_standard(x,x,9);
+    }
+    if(x>X_TLOSS) {
+        return __kernel_standard(x,x,35); /* y0(x>X_TLOSS) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_j0.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_j1.c
@@ -0,0 +1,130 @@
+//===========================================================================
+//
+//      wf_j1.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper of j1f,y1f
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float j1f(float x)		/* wrapper j1f */
+#else
+	float j1f(x)			/* wrapper j1f */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_j1f(x);
+#else
+    float z;
+    z = __ieee754_j1f(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x) ) return z;
+    if(fabs(x)>X_TLOSS) {
+        return __kernel_standard(x,x,36); /* j1(|x|>X_TLOSS) */
+    } else
+        return z;
+#endif
+}
+
+#ifdef __STDC__
+	float y1f(float x)		/* wrapper y1f */
+#else
+	float y1f(x)			/* wrapper y1f */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_y1f(x);
+#else
+    float z;
+    z = __ieee754_y1f(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x) ) return z;
+    if(x <= 0.0){
+        if(x==0.0)
+            /* d= -one/(x-x); */
+            return __kernel_standard(x,x,10);
+        else
+            /* d = zero/(x-x); */
+            return __kernel_standard(x,x,11);
+    }
+    if(x>X_TLOSS) {
+        return __kernel_standard(x,x,37); /* y1(x>X_TLOSS) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_j1.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_jn.c
@@ -0,0 +1,117 @@
+//===========================================================================
+//
+//      wf_jn.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include "mathincl/fdlibm.h"
+
+	float jnf(int n, float x)	/* wrapper jnf */
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_jnf(n,x);
+#else
+    float z;
+    z = __ieee754_jnf(n,x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x) ) return z;
+    if(fabsf(x)>(float)X_TLOSS) {
+        return __kernel_standard((double)n,x,38); /* jn(|x|>X_TLOSS,n) */
+    } else
+        return z;
+#endif
+}
+
+
+	float ynf(int n, float x)	/* wrapper ynf */
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_ynf(n,x);
+#else
+    float z;
+    z = __ieee754_ynf(n,x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x) ) return z;
+    if(x <= 0.0){
+        if(x==0.0)
+        /* d= -one/(x-x); */
+        return __kernel_standard((double)n,x,12);
+    else
+        /* d = zero/(x-x); */
+        return __kernel_standard((double)n,x,13);
+    }
+    if(x>X_TLOSS) {
+        return __kernel_standard((double)n,x,39); /* yn(x>X_TLOSS,n) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_jn.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_lgamma.c
@@ -0,0 +1,103 @@
+//===========================================================================
+//
+//      wf_lgamma.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+#include <math.h>
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float lgammaf(float x)
+#else
+	float lgammaf(x)
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_lgammaf_r(x,&signgam);
+#else
+    float y;
+    y = __ieee754_lgammaf_r(x,&signgam);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return y;
+    if(!finitef(y)&&finitef(x)) {
+        if(floorf(x)==x&&x<=0.0)
+            return __kernel_standard(x,x,15); /* lgamma pole */
+        else
+            return __kernel_standard(x,x,14); /* lgamma overflow */
+    } else
+        return y;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_lgamma.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_lgamma_r.c
@@ -0,0 +1,105 @@
+//===========================================================================
+//
+//      w_lgamma_r.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper float lgammaf_r(float x, int *signgamp)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float lgammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
+#else
+	float lgammaf_r(x,signgamp)              /* wrapper lgammaf_r */
+	float x; int *signgamp;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_lgammaf_r(x,signgamp);
+#else
+    float y;
+    y = __ieee754_lgammaf_r(x,signgamp);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return y;
+        if(!finitef(y)&&finitef(x)) {
+            if(floorf(x)==x&&x<=0.0)
+                return __kernel_standard(x,x,15); /* lgamma pole */
+            else
+                return __kernel_standard(x,x,14); /* lgamma overflow */
+        } else
+            return y;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_lgamma_r.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_log.c
@@ -0,0 +1,102 @@
+//===========================================================================
+//
+//      wf_log.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper logf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float logf(float x)		/* wrapper logf */
+#else
+	float logf(x)			/* wrapper logf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_logf(x);
+#else
+	float z;
+    z = __ieee754_logf(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x) || x > 0.0) return z;
+    if(x==0.0)
+        return __kernel_standard_float(x,x,16); /* log(0) */
+    else
+        return __kernel_standard_float(x,x,17); /* log(x<0) */
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_log.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_log10.c
@@ -0,0 +1,111 @@
+//===========================================================================
+//
+//      w_log10.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper log10f(X)
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float log10f(float x)		/* wrapper log10f */
+#else
+	float log10f(x)			/* wrapper log10f */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_log10f(x);
+#else
+	float z;
+    cyg_uint32 compat_mode = cyg_libm_get_compat_mode();
+
+	z = __ieee754_log10f(x);
+    if(
+#ifdef CYGOPT_LIBM_COMPAT_POSIX_IEEE
+       compat_mode == CYGNUM_LIBM_COMPAT_POSIX ||
+#endif
+       compat_mode == CYGNUM_LIBM_COMPAT_IEEE || isnanf(x)) return z;
+    if(x<=0.0) {
+        if(x==0.0)
+            return __kernel_standard(x,x,18); /* log10(0) */
+        else
+           return __kernel_standard(x,x,19); /* log10(x<0) */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_log10.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_pow.c
@@ -0,0 +1,119 @@
+//========================================================================
+//
+//      wf_pow.c
+//
+//      Part of the standard mathematical function library
+//
+//========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     jlarmour
+// Contributors: visar, ilijak
+// Date:          1998-02-13
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper powf(x,y) return x**y
+ */
+
+#include "mathincl/fdlibm.h"
+
+	float powf(float x, float y)	/* wrapper powf */
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return  __ieee754_powf(x,y);
+#else
+	float z;
+    z=__ieee754_powf(x,y);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE||
+        isnan(y))
+        return z;
+    if(isnan(x)) {
+        if(y==0.0)
+            return __kernel_standard(x,y,42); /* pow(NaN,0.0) */
+        else
+            return z;
+    }
+    if(x==0.0){
+        if(y==0.0)
+            return __kernel_standard(x,y,20); /* pow(0.0,0.0) */
+        if(finitef(y)&&y<0.0)
+            return __kernel_standard(x,y,23); /* pow(0.0,negative) */
+    return z;
+    }
+    if(!finitef(z)) {
+        if(finitef(x)&&finitef(y)) {
+            if(isnan(z))
+                return __kernel_standard(x,y,24);/* pow neg**non-int */
+            else
+                return __kernel_standard(x,y,21); /* pow overflow */
+        }
+    }
+    if(z==0.0&&finitef(x)&&finitef(y))
+        return __kernel_standard(x,y,22); /* pow underflow */
+    return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_pow.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_remainder.c
@@ -0,0 +1,103 @@
+//===========================================================================
+//
+//      wf_remainder.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper remainderf(x,p)
+ */
+
+#include "mathincl/fdlibm.h"
+//#include <errno.h>
+
+#ifdef __STDC__
+	float remainderf(float x, float y)	/* wrapper remainder */
+#else
+	float remainderf(x,y)			/* wrapper remainder */
+	float x,y;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_remainderf(x,y);
+#else
+    double z;
+    z = __ieee754_remainderf(x,y);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnanf(y)) return z;
+    if(y==0.0)
+        return __kernel_standard(x,y,28); /* remainder(x,0) */
+    else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_remainder.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_scalb.c
@@ -0,0 +1,124 @@
+//===========================================================================
+//
+//      wf_scalb.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper scalbf(float x, float fn) is provide for
+ * passing various standard test suite. One
+ * should use scalbn() instead.
+ */
+
+// CONFIGURATION
+
+
+#include "mathincl/fdlibm.h"
+#ifndef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+# include <errno.h>
+#endif
+
+#ifdef __STDC__
+#ifdef CYGFUN_LIBM_SVID3_scalb
+	float scalbf(float x, float fn)		/* wrapper scalbf */
+#else
+	float scalbf(float x, int fn)		/* wrapper scalbf */
+#endif
+#else
+	float scalbf(x,fn)			/* wrapper scalbf */
+#ifdef CYGFUN_LIBM_SVID3_scalb
+	float x,fn;
+#else
+	float x; int fn;
+#endif
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_scalbf(x,fn);
+#else
+    double z;
+    z = __ieee754_scalbf(x,fn);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z;
+    if(!(finitef(z)||isnanf(z))&&finitef(x)) {
+        return __kernel_standard(x,(double)fn,32); /* scalb overflow */
+    }
+    if(z==0.0&&z!=x) {
+        return __kernel_standard(x,(double)fn,33); /* scalb underflow */
+    }
+#ifdef CYGFUN_LIBM_SVID3_scalb
+    if(!finitef(fn)) errno = ERANGE;
+#endif
+    return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_scalb.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_sinh.c
@@ -0,0 +1,104 @@
+//===========================================================================
+//
+//      wf_sinh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper sinhf(x)
+ */
+
+// CONFIGURATION
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float sinhf(float x)		/* wrapper sinhf */
+#else
+	float sinhf(x)			/* wrapper sinhf */
+	float x;
+#endif
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_sinhf(x);
+#else
+    float z;
+    z = __ieee754_sinhf(x);
+    if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE) return z;
+    if(!finitef(z)&&finitef(x)) {
+        return __kernel_standard(x,x,25); /* sinh overflow */
+    } else
+        return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_sinh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-api/wf_sqrt.c
@@ -0,0 +1,98 @@
+//===========================================================================
+//
+//      wf_sqrt.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper sqrtf(x)
+ */
+
+#include "mathincl/fdlibm.h"
+
+float sqrtf(float x)		/* wrapper sqrtf */
+
+{
+#ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
+	return __ieee754_sqrtf(x);
+#else
+	float z;
+	z = __ieee754_sqrtf(x);
+	if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z;
+        if(x<0.0) {
+            return __kernel_standard(x,x,26); /* sqrt(negative) */
+        } else
+            return z;
+#endif
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF wf_sqrtf.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_acos.c
@@ -0,0 +1,151 @@
+//===========================================================================
+//
+//      ef_acos.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_acos.c -- float version of e_acos.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+one =  1.0000000000e+00, /* 0x3F800000 */
+pi =  3.1415925026e+00, /* 0x40490fda */
+pio2_hi =  1.5707962513e+00, /* 0x3fc90fda */
+pio2_lo =  7.5497894159e-08, /* 0x33a22168 */
+pS0 =  1.6666667163e-01, /* 0x3e2aaaab */
+pS1 = -3.2556581497e-01, /* 0xbea6b090 */
+pS2 =  2.0121252537e-01, /* 0x3e4e0aa8 */
+pS3 = -4.0055535734e-02, /* 0xbd241146 */
+pS4 =  7.9153501429e-04, /* 0x3a4f7f04 */
+pS5 =  3.4793309169e-05, /* 0x3811ef08 */
+qS1 = -2.4033949375e+00, /* 0xc019d139 */
+qS2 =  2.0209457874e+00, /* 0x4001572d */
+qS3 = -6.8828397989e-01, /* 0xbf303361 */
+qS4 =  7.7038154006e-02; /* 0x3d9dc62e */
+
+#ifdef __STDC__
+	float __ieee754_acosf(float x)
+#else
+	float __ieee754_acosf(x)
+	float x;
+#endif
+{
+	float z,p,q,r,w,s,c,df;
+	__int32_t hx,ix;
+	hx = CYG_LIBM_WORD(x);
+	ix = hx&0x7fffffff;
+	if(ix==0x3f800000) {		/* |x|==1 */
+	    if(hx>0) return 0.0;	/* acos(1) = 0  */
+	    else return pi+(float)2.0*pio2_lo;	/* acos(-1)= pi */
+	} else if(ix>0x3f800000) {	/* |x| >= 1 */
+	    return (x-x)/(x-x);		/* acos(|x|>1) is NaN */
+	}
+	if(ix<0x3f000000) {	/* |x| < 0.5 */
+	    if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
+	    z = x*x;
+	    p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
+	    q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
+	    r = p/q;
+	    return pio2_hi - (x - (pio2_lo-x*r));
+	} else  if (hx<0) {		/* x < -0.5 */
+	    z = (one+x)*(float)0.5;
+	    p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
+	    q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
+	    s = __ieee754_sqrtf(z);
+	    r = p/q;
+	    w = r*s-pio2_lo;
+	    return pi - (float)2.0*(s+w);
+	} else {			/* x > 0.5 */
+	    __int32_t idf;
+	    z = (one-x)*(float)0.5;
+	    s = __ieee754_sqrtf(z);
+	    df = s;
+	    idf = CYG_LIBM_WORD(df);
+	    SET_FLOAT_WORD(df,idf&0xfffff000);
+	    c  = (z-df*df)/(s+df);
+	    p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
+	    q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
+	    r = p/q;
+	    w = r*s+c;
+	    return (float)2.0*(df+w);
+	}
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_acos.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_acosh.c
@@ -0,0 +1,120 @@
+//===========================================================================
+//
+//      ef_acosh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_acosh.c -- float version of e_acosh.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+one	= 1.0,
+ln2	= 6.9314718246e-01;  /* 0x3f317218 */
+
+#ifdef __STDC__
+	float __ieee754_acoshf(float x)
+#else
+	float __ieee754_acoshf(x)
+	float x;
+#endif
+{
+	float t;
+	__int32_t hx;
+	hx = CYG_LIBM_WORD(x);
+	if(hx<0x3f800000) {		/* x < 1 */
+	    return (x-x)/(x-x);
+	} else if(hx >=0x4d800000) {	/* x > 2**28 */
+	    if(!FLT_UWORD_IS_FINITE(hx)) {	/* x is inf of NaN */
+	        return x+x;
+	    } else
+		return __ieee754_logf(x)+ln2;	/* acosh(huge)=log(2x) */
+	} else if (hx==0x3f800000) {
+	    return 0.0;			/* acosh(1) = 0 */
+	} else if (hx > 0x40000000) {	/* 2**28 > x > 2 */
+	    t=x*x;
+	    return __ieee754_logf((float)2.0*x-one/(x+__ieee754_sqrtf(t-one)));
+	} else {			/* 1<x<2 */
+	    t = x-one;
+	    return log1pf(t+__ieee754_sqrtf((float)2.0*t+t*t));
+	}
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF e_acosh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_asin.c
@@ -0,0 +1,151 @@
+//===========================================================================
+//
+//      ef_asin.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+one =  1.0000000000e+00, /* 0x3F800000 */
+huge =  1.000e+30,
+pio2_hi = 1.57079637050628662109375f,
+pio2_lo = -4.37113900018624283e-8f,
+pio4_hi = 0.785398185253143310546875f,
+	/* coefficient for R(x^2) */
+pS0 =  1.6666667163e-01, /* 0x3e2aaaab */
+pS1 = -3.2556581497e-01, /* 0xbea6b090 */
+pS2 =  2.0121252537e-01, /* 0x3e4e0aa8 */
+pS3 = -4.0055535734e-02, /* 0xbd241146 */
+pS4 =  7.9153501429e-04, /* 0x3a4f7f04 */
+pS5 =  3.4793309169e-05, /* 0x3811ef08 */
+qS1 = -2.4033949375e+00, /* 0xc019d139 */
+qS2 =  2.0209457874e+00, /* 0x4001572d */
+qS3 = -6.8828397989e-01, /* 0xbf303361 */
+qS4 =  7.7038154006e-02; /* 0x3d9dc62e */
+
+#ifdef __STDC__
+	float __ieee754_asinf(float x)
+#else
+	float __ieee754_asinf(x)
+	float x;
+#endif
+{
+	float t,w,p,q,c,r,s;
+	__int32_t hx,ix;
+	hx = CYG_LIBM_WORD(x);
+	ix = hx&0x7fffffff;
+	if(ix==0x3f800000) {
+		/* asin(1)=+-pi/2 with inexact */
+	    return x*pio2_hi+x*pio2_lo;
+	} else if(ix> 0x3f800000) {	/* |x|>= 1 */
+	    return (x-x)/(x-x);		/* asin(|x|>1) is NaN */
+	} else if (ix<0x3f000000) {	/* |x|<0.5 */
+	    if(ix<0x32000000) {		/* if |x| < 2**-27 */
+		if(huge+x>one) return x;/* return x with inexact if x!=0*/
+          } else {
+		t = x*x;
+		p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
+		q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
+		w = p/q;
+		return x+x*w;
+          }
+	}
+	/* 1> |x|>= 0.5 */
+	w = one-fabsf(x);
+	t = w*(float)0.5;
+	p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
+	q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
+	s = __ieee754_sqrtf(t);
+	if(ix>=0x3F79999A) {	/* if |x| > 0.975 */
+	    w = p/q;
+	    t = pio2_hi-((float)2.0*(s+s*w)-pio2_lo);
+	} else {
+	    __int32_t iw;
+	    w  = s;
+	    iw = CYG_LIBM_WORD(w);
+	    SET_FLOAT_WORD(w,iw&0xfffff000);
+	    c  = (t-w*w)/(s+w);
+	    r  = p/q;
+	    p  = (float)2.0*s*r-(pio2_lo-(float)2.0*c);
+	    q  = pio4_hi-(float)2.0*w;
+	    t  = pio4_hi-(p-q);
+	}
+	if(hx>0) return t; else return -t;
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_asin.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_atan2.c
@@ -0,0 +1,167 @@
+//===========================================================================
+//
+//      e_atan2.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_atan2.c -- float version of e_atan2.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+tiny  = 1.0e-30,
+zero  = 0.0,
+pi_o_4  = 7.8539818525e-01, /* 0x3f490fdb */
+pi_o_2  = 1.5707963705e+00, /* 0x3fc90fdb */
+pi      = 3.1415927410e+00,  /* 0x40490fdb */
+pi_lo   = -8.7422776573e-08; /* 0xb3bbbd2e */
+
+#ifdef __STDC__
+	float __ieee754_atan2f(float y, float x)
+#else
+	float __ieee754_atan2f(y,x)
+	float  y,x;
+#endif
+{
+	float z;
+	__int32_t k,m,hx,hy,ix,iy;
+
+	hx = CYG_LIBM_WORD(x);
+	ix = hx&0x7fffffff;
+	hy = CYG_LIBM_WORD(y);
+	iy = hy&0x7fffffff;
+	if(FLT_UWORD_IS_NAN(ix)||
+	   FLT_UWORD_IS_NAN(iy))	/* x or y is NaN */
+	   return x+y;
+	if(hx==0x3f800000) return atanf(y);   /* x=1.0 */
+	m = ((hy>>31)&1)|((hx>>30)&2);	/* 2*sign(x)+sign(y) */
+
+    /* when y = 0 */
+	if(FLT_UWORD_IS_ZERO(iy)) {
+	    switch(m) {
+		case 0:
+		case 1: return y;	/* atan(+-0,+anything)=+-0 */
+		case 2: return  pi+tiny;/* atan(+0,-anything) = pi */
+		case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */
+	    }
+	}
+    /* when x = 0 */
+	if(FLT_UWORD_IS_ZERO(ix)) return (hy<0)?  -pi_o_2-tiny: pi_o_2+tiny;
+
+    /* when x is INF */
+	if(FLT_UWORD_IS_INFINITE(ix)) {
+	    if(FLT_UWORD_IS_INFINITE(iy)) {
+		switch(m) {
+		    case 0: return  pi_o_4+tiny;/* atan(+INF,+INF) */
+		    case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
+		    case 2: return  (float)3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/
+		    case 3: return (float)-3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/
+		}
+	    } else {
+		switch(m) {
+		    case 0: return  zero  ;	/* atan(+...,+INF) */
+		    case 1: return -zero  ;	/* atan(-...,+INF) */
+		    case 2: return  pi+tiny  ;	/* atan(+...,-INF) */
+		    case 3: return -pi-tiny  ;	/* atan(-...,-INF) */
+		}
+	    }
+	}
+    /* when y is INF */
+	if(FLT_UWORD_IS_INFINITE(iy)) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
+
+    /* compute y/x */
+	k = (iy-ix)>>23;
+	if(k > 60) z=pi_o_2+(float)0.5*pi_lo;	/* |y/x| >  2**60 */
+	else if(hx<0&&k<-60) z=0.0;	/* |y|/x < -2**60 */
+	else z=atanf(fabsf(y/x));	/* safe to do y/x */
+	switch (m) {
+	    case 0: return       z  ;	/* atan(+,+) */
+	    case 1: {
+		      __uint32_t zh;
+		      zh = CYG_LIBM_WORD(z);
+		      SET_FLOAT_WORD(z,zh ^ 0x80000000);
+		    }
+		    return       z  ;	/* atan(-,+) */
+	    case 2: return  pi-(z-pi_lo);/* atan(+,-) */
+	    default: /* case 3 */
+		    return  (z-pi_lo)-pi;/* atan(-,-) */
+	}
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_atan2.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_atanh.c
@@ -0,0 +1,121 @@
+//===========================================================================
+//
+//      ef_atanh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_atanh.c -- float version of e_atanh.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float one = 1.0, huge = 1e30;
+#else
+static float one = 1.0, huge = 1e30;
+#endif
+
+#ifdef __STDC__
+static const float zero = 0.0;
+#else
+static float zero = 0.0;
+#endif
+
+#ifdef __STDC__
+	float __ieee754_atanhf(float x)
+#else
+	float __ieee754_atanhf(x)
+	float x;
+#endif
+{
+	float t;
+	__int32_t hx,ix;
+	hx = CYG_LIBM_WORD(x);
+	ix = hx&0x7fffffff;
+	if (ix>0x3f800000)		/* |x|>1 */
+	    return (x-x)/(x-x);
+	if(ix==0x3f800000)
+	    return x/zero;
+	if(ix<0x31800000&&(huge+x)>zero) return x;	/* x<2**-28 */
+	SET_FLOAT_WORD(x,ix);
+	if(ix<0x3f000000) {		/* x < 0.5 */
+	    t = x+x;
+	    t = (float)0.5*log1pf(t+t*x/(one-x));
+	} else
+	    t = (float)0.5*log1pf((x+x)/(one-x));
+	if(hx>=0) return t; else return -t;
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_atanh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_cosh.c
@@ -0,0 +1,134 @@
+//===========================================================================
+//
+//      ef_cosh.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_cosh.c -- float version of e_cosh.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float one = 1.0, half=0.5, huge = 1.0e30;
+#else
+static float one = 1.0, half=0.5, huge = 1.0e30;
+#endif
+
+#ifdef __STDC__
+	float __ieee754_coshf(float x)
+#else
+	float __ieee754_coshf(x)
+	float x;
+#endif
+{
+	float t,w;
+	__int32_t ix;
+
+	ix = CYG_LIBM_WORD(x);
+	ix &= 0x7fffffff;
+
+    /* x is INF or NaN */
+	if(!FLT_UWORD_IS_FINITE(ix)) return x*x;
+
+    /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */
+	if(ix<0x3eb17218) {
+	    t = expm1f(fabsf(x));
+	    w = one+t;
+	    if (ix<0x24000000) return w;	/* cosh(tiny) = 1 */
+	    return one+(t*t)/(w+w);
+	}
+
+    /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
+	if (ix < 0x41b00000) {
+		t = __ieee754_expf(fabsf(x));
+		return half*t+half/t;
+	}
+
+    /* |x| in [22, log(maxdouble)] return half*exp(|x|) */
+	if (ix <= FLT_UWORD_LOG_MAX)
+	  return half*__ieee754_expf(fabsf(x));
+
+    /* |x| in [log(maxdouble), overflowthresold] */
+	if (ix <= FLT_UWORD_LOG_2MAX) {
+	    w = __ieee754_expf(half*fabsf(x));
+	    t = half*w;
+	    return t*w;
+	}
+
+    /* |x| > overflowthresold, cosh(x) overflow */
+	return huge*huge;
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_cosh.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_exp.c
@@ -0,0 +1,165 @@
+//===========================================================================
+//
+//      ef_exp.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_exp.c -- float version of e_exp.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+one	= 1.0,
+halF[2]	= {0.5,-0.5,},
+huge	= 1.0e+30,
+twom100 = 7.8886090522e-31,      /* 2**-100=0x0d800000 */
+ln2HI[2]   ={ 6.9313812256e-01,		/* 0x3f317180 */
+	     -6.9313812256e-01,},	/* 0xbf317180 */
+ln2LO[2]   ={ 9.0580006145e-06,	/* 0x3717f7d1 */
+	     -9.0580006145e-06,},	/* 0xb717f7d1 */
+invln2 =  1.4426950216e+00,		/* 0x3fb8aa3b */
+P1   =  1.6666667163e-01, /* 0x3e2aaaab */
+P2   = -2.7777778450e-03, /* 0xbb360b61 */
+P3   =  6.6137559770e-05, /* 0x388ab355 */
+P4   = -1.6533901999e-06, /* 0xb5ddea0e */
+P5   =  4.1381369442e-08; /* 0x3331bb4c */
+
+#ifdef __STDC__
+	float __ieee754_expf(float x)	/* default IEEE double exp */
+#else
+	float __ieee754_expf(x)	/* default IEEE double exp */
+	float x;
+#endif
+{
+	float y,hi,lo,c,t;
+	__int32_t k,xsb,sx;
+	__uint32_t hx;
+
+	sx = CYG_LIBM_WORD(x);
+	xsb = (sx>>31)&1;		/* sign bit of x */
+	hx = sx & 0x7fffffff;		/* high word of |x| */
+
+    /* filter out non-finite argument */
+        if(FLT_UWORD_IS_NAN(hx))
+            return x+x;		/* NaN */
+        if(FLT_UWORD_IS_INFINITE(hx))
+	    return (xsb==0)? x:0.0;		/* exp(+-inf)={inf,0} */
+	if(sx > FLT_UWORD_LOG_MAX)
+	    return huge*huge; /* overflow */
+	if(sx < 0 && hx > FLT_UWORD_LOG_MIN)
+	    return twom100*twom100; /* underflow */
+
+    /* argument reduction */
+	if(hx > 0x3eb17218) {		/* if  |x| > 0.5 ln2 */
+	    if(hx < 0x3F851592) {	/* and |x| < 1.5 ln2 */
+		hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
+	    } else {
+		k  = invln2*x+halF[xsb];
+		t  = k;
+		hi = x - t*ln2HI[0];	/* t*ln2HI is exact here */
+		lo = t*ln2LO[0];
+	    }
+	    x  = hi - lo;
+	}
+	else if(hx < 0x31800000)  {	/* when |x|<2**-28 */
+	    if(huge+x>one)
+            return one+x;/* trigger inexact */
+        else // VAE
+            k = 0;
+	}
+	else k = 0;
+
+    /* x is now in primary range */
+	t  = x*x;
+	c  = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
+	if(k==0)	return one-((x*c)/(c-(float)2.0)-x);
+	else		y = one-((lo-(x*c)/((float)2.0-c))-hi);
+	if(k >= -125) {
+	    __uint32_t hy;
+	    hy = CYG_LIBM_WORD(y);
+	    SET_FLOAT_WORD(y,hy+(k<<23));	/* add k to y's exponent */
+	    return y;
+	} else {
+	    __uint32_t hy;
+	    hy = CYG_LIBM_WORD(y);
+	    SET_FLOAT_WORD(y,hy+((k+100)<<23));	/* add k to y's exponent */
+	    return y*twom100;
+	}
+}
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_exp.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_fmod.c
@@ -0,0 +1,180 @@
+//===========================================================================
+//
+//      ef_fmod.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_fmod.c -- float version of e_fmod.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * __ieee754_fmodf(x,y)
+ * Return x mod y in exact arithmetic
+ * Method: shift and subtract
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static const float one = 1.0, Zero[] = {0.0, -0.0,};
+#else
+static float one = 1.0, Zero[] = {0.0, -0.0,};
+#endif
+
+#ifdef __STDC__
+	float __ieee754_fmodf(float x, float y)
+#else
+	float __ieee754_fmodf(x,y)
+	float x,y ;
+#endif
+{
+	__int32_t n,hx,hy,hz,ix,iy,sx,i;
+
+	hx = CYG_LIBM_WORD(x);
+	hy = CYG_LIBM_WORD(y);
+	sx = hx&0x80000000;		/* sign of x */
+	hx ^=sx;		/* |x| */
+	hy &= 0x7fffffff;	/* |y| */
+
+    /* purge off exception values */
+	if(FLT_UWORD_IS_ZERO(hy)||
+	   !FLT_UWORD_IS_FINITE(hx)||
+	   FLT_UWORD_IS_NAN(hy))
+	    return (x*y)/(x*y);
+	if(hx<hy) return x;			/* |x|<|y| return x */
+	if(hx==hy)
+	    return Zero[(__uint32_t)sx>>31];	/* |x|=|y| return x*0*/
+
+    /* Note: y cannot be zero if we reach here. */
+
+    /* determine ix = ilogb(x) */
+	if(FLT_UWORD_IS_SUBNORMAL(hx)) {	/* subnormal x */
+	    for (ix = -126,i=(hx<<8); i>0; i<<=1) ix -=1;
+	} else ix = (hx>>23)-127;
+
+    /* determine iy = ilogb(y) */
+	if(FLT_UWORD_IS_SUBNORMAL(hy)) {	/* subnormal y */
+	    for (iy = -126,i=(hy<<8); i>=0; i<<=1) iy -=1;
+	} else iy = (hy>>23)-127;
+
+    /* set up {hx,lx}, {hy,ly} and align y to x */
+	if(ix >= -126)
+	    hx = 0x00800000|(0x007fffff&hx);
+	else {		/* subnormal x, shift x to normal */
+	    n = -126-ix;
+	    hx = hx<<n;
+	}
+	if(iy >= -126)
+	    hy = 0x00800000|(0x007fffff&hy);
+	else {		/* subnormal y, shift y to normal */
+	    n = -126-iy;
+	    hy = hy<<n;
+	}
+
+    /* fix point fmod */
+	n = ix - iy;
+	while(n--) {
+	    hz=hx-hy;
+	    if(hz<0){hx = hx+hx;}
+	    else {
+		if(hz==0)		/* return sign(x)*0 */
+		    return Zero[(__uint32_t)sx>>31];
+		hx = hz+hz;
+	    }
+	}
+	hz=hx-hy;
+	if(hz>=0) {hx=hz;}
+
+    /* convert back to floating value and restore the sign */
+	if(hx==0)			/* return sign(x)*0 */
+	    return Zero[(__uint32_t)sx>>31];
+	while(hx<0x00800000) {		/* normalize x */
+	    hx = hx+hx;
+	    iy -= 1;
+	}
+	if(iy>= -126) {		/* normalize output */
+	    hx = ((hx-0x00800000)|((iy+127)<<23));
+	    SET_FLOAT_WORD(x,hx|sx);
+	} else {		/* subnormal output */
+	    /* If denormals are not supported, this code will generate a
+	       zero representation.  */
+	    n = -126 - iy;
+	    hx >>= n;
+	    SET_FLOAT_WORD(x,hx|sx);
+	    x *= one;		/* create necessary signal */
+	}
+	return x;		/* exact output */
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_fmod.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_gamma.c
@@ -0,0 +1,93 @@
+//===========================================================================
+//
+//      ef_gamma.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* @(#)ef_gamma.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+/* __ieee754_gamma(x)
+ * Return the logarithm of the Gamma function of x.
+ *
+ * Method: call __ieee754_gamma_r
+ */
+
+#include <math.h>
+#include "mathincl/fdlibm.h"
+
+float
+__ieee754_gammaf(float x)
+{
+        return __ieee754_gammaf_r(x,&signgam);
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_gamma.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_gamma_r.c
@@ -0,0 +1,106 @@
+//===========================================================================
+//
+//      ef_gamma_r.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+/* erf_gamma.c -- float version of er_gamma.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ */
+
+/* __ieee754_gammaf_r(x, signgamp)
+ * Reentrant version of the logarithm of the Gamma function
+ * with user provide pointer for the sign of Gamma(x).
+ *
+ * Method: See __ieee754_lgammaf_r
+ */
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float __ieee754_gammaf_r(float x, int *signgamp)
+#else
+	float __ieee754_gammaf_r(x,signgamp)
+	float x; int *signgamp;
+#endif
+{
+	return __ieee754_lgammaf_r(x,signgamp);
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_gamma_r.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_hypot.c
@@ -0,0 +1,149 @@
+//===========================================================================
+//
+//      ef_hypot.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_hypot.c -- float version of e_hypot.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+	float __ieee754_hypotf(float x, float y)
+#else
+	float __ieee754_hypotf(x,y)
+	float x, y;
+#endif
+{
+	float a=x,b=y,t1,t2,y1,y2,w;
+	__int32_t j,k,ha,hb;
+
+	ha = CYG_LIBM_WORD(x);
+	ha &= 0x7fffffffL;
+	hb = CYG_LIBM_WORD(y);
+	hb &= 0x7fffffffL;
+	if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
+	SET_FLOAT_WORD(a,ha);	/* a <- |a| */
+	SET_FLOAT_WORD(b,hb);	/* b <- |b| */
+	if((ha-hb)>0xf000000L) {return a+b;} /* x/y > 2**30 */
+	k=0;
+	if(ha > 0x58800000L) {	/* a>2**50 */
+	   if(!FLT_UWORD_IS_FINITE(ha)) {	/* Inf or NaN */
+	       w = a+b;			/* for sNaN */
+	       if(FLT_UWORD_IS_INFINITE(ha)) w = a;
+	       if(FLT_UWORD_IS_INFINITE(hb)) w = b;
+	       return w;
+	   }
+	   /* scale a and b by 2**-68 */
+	   ha -= 0x22000000L; hb -= 0x22000000L;	k += 68;
+	   SET_FLOAT_WORD(a,ha);
+	   SET_FLOAT_WORD(b,hb);
+	}
+	if(hb < 0x26800000L) {	/* b < 2**-50 */
+	    if(FLT_UWORD_IS_ZERO(hb)) {
+	        return a;
+	    } else if(FLT_UWORD_IS_SUBNORMAL(hb)) {
+		SET_FLOAT_WORD(t1,0x7e800000L);	/* t1=2^126 */
+		b *= t1;
+		a *= t1;
+		k -= 126;
+	    } else {		/* scale a and b by 2^68 */
+	        ha += 0x22000000;	/* a *= 2^68 */
+		hb += 0x22000000;	/* b *= 2^68 */
+		k -= 68;
+		SET_FLOAT_WORD(a,ha);
+		SET_FLOAT_WORD(b,hb);
+	    }
+	}
+    /* medium size a and b */
+	w = a-b;
+	if (w>b) {
+	    SET_FLOAT_WORD(t1,ha&0xfffff000L);
+	    t2 = a-t1;
+	    w  = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1)));
+	} else {
+	    a  = a+a;
+	    SET_FLOAT_WORD(y1,hb&0xfffff000L);
+	    y2 = b - y1;
+	    SET_FLOAT_WORD(t1,ha+0x00800000L);
+	    t2 = a - t1;
+	    w  = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
+	}
+	if(k!=0) {
+	    SET_FLOAT_WORD(t1,0x3f800000L+(k<<23));
+	    return t1*w;
+	} else return w;
+}
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_hypot.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_j0.c
@@ -0,0 +1,506 @@
+//===========================================================================
+//
+//      ef_j0.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+// As a special exception, if other files instantiate templates or use
+// macros or inline functions from this file, or you compile this file
+// and link it with other works to produce a work based on this file,
+// this file does not by itself cause the resulting work to be covered by
+// the GNU General Public License. However the source code for this file
+// must still be made available in accordance with section (3) of the GNU
+// General Public License v2.
+//
+// This exception does not invalidate any other reasons why a work based
+// on this file might be covered by the GNU General Public License.
+// -------------------------------------------
+// ####ECOSGPLCOPYRIGHTEND####
+//===========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):
+// Contributors: visar, ilijak
+// Date:        2012-03-08
+// Purpose:
+// Description:
+// Usage:
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+// CONFIGURATION
+
+#include <pkgconf/libm.h>   // Configuration header
+
+// Include the Math library?
+#ifdef CYGPKG_LIBM
+
+// Derived from code with the following copyright
+
+
+/* ef_j0.c -- float version of e_j0.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+
+#include "mathincl/fdlibm.h"
+
+#ifdef __STDC__
+static float pzerof(float), qzerof(float);
+#else
+static float pzerof(), qzerof();
+#endif
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+huge	= 1e30,
+one	= 1.0,
+invsqrtpi=  5.6418961287e-01, /* 0x3f106ebb */
+tpi      =  6.3661974669e-01, /* 0x3f22f983 */
+		/* R0/S0 on [0, 2.00] */
+R02  =  1.5625000000e-02, /* 0x3c800000 */
+R03  = -1.8997929874e-04, /* 0xb947352e */
+R04  =  1.8295404516e-06, /* 0x35f58e88 */
+R05  = -4.6183270541e-09, /* 0xb19eaf3c */
+S01  =  1.5619102865e-02, /* 0x3c7fe744 */
+S02  =  1.1692678527e-04, /* 0x38f53697 */
+S03  =  5.1354652442e-07, /* 0x3509daa6 */
+S04  =  1.1661400734e-09; /* 0x30a045e8 */
+
+#ifdef __STDC__
+static const float zero = 0.0;
+#else
+static float zero = 0.0;
+#endif
+
+#ifdef __STDC__
+	float __ieee754_j0f(float x)
+#else
+	float __ieee754_j0f(x)
+	float x;
+#endif
+{
+	float z, s,c,ss,cc,r,u,v;
+	__int32_t hx,ix;
+
+	hx = CYG_LIBM_WORD(x);
+	ix = hx&0x7fffffff;
+	if(!FLT_UWORD_IS_FINITE(ix)) return one/(x*x);
+	x = fabsf(x);
+	if(ix >= 0x40000000) {	/* |x| >= 2.0 */
+		s = sinf(x);
+		c = cosf(x);
+		ss = s-c;
+		cc = s+c;
+		if(ix<=FLT_UWORD_HALF_MAX) {  /* make sure x+x not overflow */
+		    z = -cosf(x+x);
+		    if ((s*c)<zero) cc = z/ss;
+		    else	    ss = z/cc;
+		}
+	/*
+	 * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
+	 * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
+	 */
+		if(ix>0x80000000) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
+		else {
+		    u = pzerof(x); v = qzerof(x);
+		    z = invsqrtpi*(u*cc-v*ss)/__ieee754_sqrtf(x);
+		}
+		return z;
+	}
+	if(ix<0x39000000) {	/* |x| < 2**-13 */
+	    if(huge+x>one) {	/* raise inexact if x != 0 */
+	        if(ix<0x32000000) return one;	/* |x|<2**-27 */
+	        else	      return one - (float)0.25*x*x;
+	    }
+	}
+	z = x*x;
+	r =  z*(R02+z*(R03+z*(R04+z*R05)));
+	s =  one+z*(S01+z*(S02+z*(S03+z*S04)));
+	if(ix < 0x3F800000) {	/* |x| < 1.00 */
+	    return one + z*((float)-0.25+(r/s));
+	} else {
+	    u = (float)0.5*x;
+	    return((one+u)*(one-u)+z*(r/s));
+	}
+}
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+u00  = -7.3804296553e-02, /* 0xbd9726b5 */
+u01  =  1.7666645348e-01, /* 0x3e34e80d */
+u02  = -1.3818567619e-02, /* 0xbc626746 */
+u03  =  3.4745343146e-04, /* 0x39b62a69 */
+u04  = -3.8140706238e-06, /* 0xb67ff53c */
+u05  =  1.9559013964e-08, /* 0x32a802ba */
+u06  = -3.9820518410e-11, /* 0xae2f21eb */
+v01  =  1.2730483897e-02, /* 0x3c509385 */
+v02  =  7.6006865129e-05, /* 0x389f65e0 */
+v03  =  2.5915085189e-07, /* 0x348b216c */
+v04  =  4.4111031494e-10; /* 0x2ff280c2 */
+
+#ifdef __STDC__
+	float __ieee754_y0f(float x)
+#else
+	float __ieee754_y0f(x)
+	float x;
+#endif
+{
+	float z, s,c,ss,cc,u,v;
+	__int32_t hx,ix;
+
+	hx = CYG_LIBM_WORD(x);
+        ix = 0x7fffffff&hx;
+    /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0  */
+	if(!FLT_UWORD_IS_FINITE(ix)) return  one/(x+x*x);
+        if(FLT_UWORD_IS_ZERO(ix)) return -one/zero;
+        if(hx<0) return zero/zero;
+        if(ix >= 0x40000000) {  /* |x| >= 2.0 */
+        /* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
+         * where x0 = x-pi/4
+         *      Better formula:
+         *              cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
+         *                      =  1/sqrt(2) * (sin(x) + cos(x))
+         *              sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
+         *                      =  1/sqrt(2) * (sin(x) - cos(x))
+         * To avoid cancellation, use
+         *              sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+         * to compute the worse one.
+         */
+                s = sinf(x);
+                c = cosf(x);
+                ss = s-c;
+                cc = s+c;
+	/*
+	 * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
+	 * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
+	 */
+                if(ix<=FLT_UWORD_HALF_MAX) {  /* make sure x+x not overflow */
+                    z = -cosf(x+x);
+                    if ((s*c)<zero) cc = z/ss;
+                    else            ss = z/cc;
+                }
+                if(ix>0x80000000) z = (invsqrtpi*ss)/__ieee754_sqrtf(x);
+                else {
+                    u = pzerof(x); v = qzerof(x);
+                    z = invsqrtpi*(u*ss+v*cc)/__ieee754_sqrtf(x);
+                }
+                return z;
+	}
+	if(ix<=0x32000000) {	/* x < 2**-27 */
+	    return(u00 + tpi*__ieee754_logf(x));
+	}
+	z = x*x;
+	u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06)))));
+	v = one+z*(v01+z*(v02+z*(v03+z*v04)));
+	return(u/v + tpi*(__ieee754_j0f(x)*__ieee754_logf(x)));
+}
+
+/* The asymptotic expansions of pzero is
+ *	1 - 9/128 s^2 + 11025/98304 s^4 - ...,	where s = 1/x.
+ * For x >= 2, We approximate pzero by
+ *	pzero(x) = 1 + (R/S)
+ * where  R = pR0 + pR1*s^2 + pR2*s^4 + ... + pR5*s^10
+ *	  S = 1 + pS0*s^2 + ... + pS4*s^10
+ * and
+ *	| pzero(x)-1-R/S | <= 2  ** ( -60.26)
+ */
+#ifdef __STDC__
+static const float pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
+#else
+static float pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
+#endif
+  0.0000000000e+00, /* 0x00000000 */
+ -7.0312500000e-02, /* 0xbd900000 */
+ -8.0816707611e+00, /* 0xc1014e86 */
+ -2.5706311035e+02, /* 0xc3808814 */
+ -2.4852163086e+03, /* 0xc51b5376 */
+ -5.2530439453e+03, /* 0xc5a4285a */
+};
+#ifdef __STDC__
+static const float pS8[5] = {
+#else
+static float pS8[5] = {
+#endif
+  1.1653436279e+02, /* 0x42e91198 */
+  3.8337448730e+03, /* 0x456f9beb */
+  4.0597855469e+04, /* 0x471e95db */
+  1.1675296875e+05, /* 0x47e4087c */
+  4.7627726562e+04, /* 0x473a0bba */
+};
+#ifdef __STDC__
+static const float pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
+#else
+static float pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
+#endif
+ -1.1412546255e-11, /* 0xad48c58a */
+ -7.0312492549e-02, /* 0xbd8fffff */
+ -4.1596107483e+00, /* 0xc0851b88 */
+ -6.7674766541e+01, /* 0xc287597b */
+ -3.3123129272e+02, /* 0xc3a59d9b */
+ -3.4643338013e+02, /* 0xc3ad3779 */
+};
+#ifdef __STDC__
+static const float pS5[5] = {
+#else
+static float pS5[5] = {
+#endif
+  6.0753936768e+01, /* 0x42730408 */
+  1.0512523193e+03, /* 0x44836813 */
+  5.9789707031e+03, /* 0x45bad7c4 */
+  9.6254453125e+03, /* 0x461665c8 */
+  2.4060581055e+03, /* 0x451660ee */
+};
+
+#ifdef __STDC__
+static const float pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
+#else
+static float pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
+#endif
+ -2.5470459075e-09, /* 0xb12f081b */
+ -7.0311963558e-02, /* 0xbd8fffb8 */
+ -2.4090321064e+00, /* 0xc01a2d95 */
+ -2.1965976715e+01, /* 0xc1afba52 */
+ -5.8079170227e+01, /* 0xc2685112 */
+ -3.1447946548e+01, /* 0xc1fb9565 */
+};
+#ifdef __STDC__
+static const float pS3[5] = {
+#else
+static float pS3[5] = {
+#endif
+  3.5856033325e+01, /* 0x420f6c94 */
+  3.6151397705e+02, /* 0x43b4c1ca */
+  1.1936077881e+03, /* 0x44953373 */
+  1.1279968262e+03, /* 0x448cffe6 */
+  1.7358093262e+02, /* 0x432d94b8 */
+};
+
+#ifdef __STDC__
+static const float pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
+#else
+static float pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
+#endif
+ -8.8753431271e-08, /* 0xb3be98b7 */
+ -7.0303097367e-02, /* 0xbd8ffb12 */
+ -1.4507384300e+00, /* 0xbfb9b1cc */
+ -7.6356959343e+00, /* 0xc0f4579f */
+ -1.1193166733e+01, /* 0xc1331736 */
+ -3.2336456776e+00, /* 0xc04ef40d */
+};
+#ifdef __STDC__
+static const float pS2[5] = {
+#else
+static float pS2[5] = {
+#endif
+  2.2220300674e+01, /* 0x41b1c32d */
+  1.3620678711e+02, /* 0x430834f0 */
+  2.7047027588e+02, /* 0x43873c32 */
+  1.5387539673e+02, /* 0x4319e01a */
+  1.4657617569e+01, /* 0x416a859a */
+};
+
+#ifdef __STDC__
+	static float pzerof(float x)
+#else
+	static float pzerof(x)
+	float x;
+#endif
+{
+#ifdef __STDC__
+	const float *p,*q;
+#else
+	float *p,*q;
+#endif
+	float z,r,s;
+	__int32_t ix;
+	ix = CYG_LIBM_WORD(x);
+	ix &= 0x7fffffff;
+	if(ix>=0x41000000)     {p = pR8; q= pS8;}
+	else if(ix>=0x40f71c58){p = pR5; q= pS5;}
+	else if(ix>=0x4036db68){p = pR3; q= pS3;}
+      else {p = pR2; q= pS2;}
+	z = one/(x*x);
+	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
+	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
+	return one+ r/s;
+}
+
+
+/* For x >= 8, the asymptotic expansions of qzero is
+ *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
+ * We approximate qzero by
+ *	qzero(x) = s*(-1.25 + (R/S))
+ * where  R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
+ *	  S = 1 + qS0*s^2 + ... + qS5*s^12
+ * and
+ *	| qzero(x)/s +1.25-R/S | <= 2  ** ( -61.22)
+ */
+#ifdef __STDC__
+static const float qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
+#else
+static float qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
+#endif
+  0.0000000000e+00, /* 0x00000000 */
+  7.3242187500e-02, /* 0x3d960000 */
+  1.1768206596e+01, /* 0x413c4a93 */
+  5.5767340088e+02, /* 0x440b6b19 */
+  8.8591972656e+03, /* 0x460a6cca */
+  3.7014625000e+04, /* 0x471096a0 */
+};
+#ifdef __STDC__
+static const float qS8[6] = {
+#else
+static float qS8[6] = {
+#endif
+  1.6377603149e+02, /* 0x4323c6aa */
+  8.0983447266e+03, /* 0x45fd12c2 */
+  1.4253829688e+05, /* 0x480b3293 */
+  8.0330925000e+05, /* 0x49441ed4 */
+  8.4050156250e+05, /* 0x494d3359 */
+ -3.4389928125e+05, /* 0xc8a7eb69 */
+};
+
+#ifdef __STDC__
+static const float qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
+#else
+static float qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
+#endif
+  1.8408595828e-11, /* 0x2da1ec79 */
+  7.3242180049e-02, /* 0x3d95ffff */
+  5.8356351852e+00, /* 0x40babd86 */
+  1.3511157227e+02, /* 0x43071c90 */
+  1.0272437744e+03, /* 0x448067cd */
+  1.9899779053e+03, /* 0x44f8bf4b */
+};
+#ifdef __STDC__
+static const float qS5[6] = {
+#else
+static float qS5[6] = {
+#endif
+  8.2776611328e+01, /* 0x42a58da0 */
+  2.0778142090e+03, /* 0x4501dd07 */
+  1.8847289062e+04, /* 0x46933e94 */
+  5.6751113281e+04, /* 0x475daf1d */
+  3.5976753906e+04, /* 0x470c88c1 */
+ -5.3543427734e+03, /* 0xc5a752be */
+};
+
+#ifdef __STDC__
+static const float qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
+#else
+static float qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
+#endif
+  4.3774099900e-09, /* 0x3196681b */
+  7.3241114616e-02, /* 0x3d95ff70 */
+  3.3442313671e+00, /* 0x405607e3 */
+  4.2621845245e+01, /* 0x422a7cc5 */
+  1.7080809021e+02, /* 0x432acedf */
+  1.6673394775e+02, /* 0x4326bbe4 */
+};
+#ifdef __STDC__
+static const float qS3[6] = {
+#else
+static float qS3[6] = {
+#endif
+  4.8758872986e+01, /* 0x42430916 */
+  7.0968920898e+02, /* 0x44316c1c */
+  3.7041481934e+03, /* 0x4567825f */
+  6.4604252930e+03, /* 0x45c9e367 */
+  2.5163337402e+03, /* 0x451d4557 */
+ -1.4924745178e+02, /* 0xc3153f59 */
+};
+
+#ifdef __STDC__
+static const float qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
+#else
+static float qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
+#endif
+  1.5044444979e-07, /* 0x342189db */
+  7.3223426938e-02, /* 0x3d95f62a */
+  1.9981917143e+00, /* 0x3fffc4bf */
+  1.4495602608e+01, /* 0x4167edfd */
+  3.1666231155e+01, /* 0x41fd5471 */
+  1.6252708435e+01, /* 0x4182058c */
+};
+#ifdef __STDC__
+static const float qS2[6] = {
+#else
+static float qS2[6] = {
+#endif
+  3.0365585327e+01, /* 0x41f2ecb8 */
+  2.6934811401e+02, /* 0x4386ac8f */
+  8.4478375244e+02, /* 0x44533229 */
+  8.8293585205e+02, /* 0x445cbbe5 */
+  2.1266638184e+02, /* 0x4354aa98 */
+ -5.3109550476e+00, /* 0xc0a9f358 */
+};
+
+#ifdef __STDC__
+	static float qzerof(float x)
+#else
+	static float qzerof(x)
+	float x;
+#endif
+{
+#ifdef __STDC__
+	const float *p,*q;
+#else
+	float *p,*q;
+#endif
+	float s,r,z;
+	__int32_t ix;
+	ix = CYG_LIBM_WORD(x);
+	ix &= 0x7fffffff;
+	if(ix>=0x41000000)     {p = qR8; q= qS8;}
+	else if(ix>=0x40f71c58){p = qR5; q= qS5;}
+	else if(ix>=0x4036db68){p = qR3; q= qS3;}
+      else {p = qR2; q= qS2;}
+	z = one/(x*x);
+	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
+	s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
+	return (-(float).125 + r/s)/x;
+}
+
+#endif // ifdef CYGPKG_LIBM
+
+// EOF ef_j0.c
new file mode 100644
--- /dev/null
+++ b/packages/language/c/libm/current/src/float/ieee754-core/ef_j1.c
@@ -0,0 +1,506 @@
+//===========================================================================
+//
+//      ef_j1.c
+//
+//      Part of the standard mathematical function library
+//
+//===========================================================================
+// ####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later
+// version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with eCos; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.