Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2015 23:32:29 +0000
From:      "Montgomery-Smith, Stephen" <stephen@missouri.edu>
To:        "freebsd-numerics@freebsd.org" <freebsd-numerics@freebsd.org>
Subject:   Let's get moving
Message-ID:  <556CEB8C.90605@missouri.edu>

index | next in thread | raw e-mail

Hey people,

I was looking at https://wiki.freebsd.org/Numerics, and we are stalling.
 For example, we have working code for clog and clogf - why don't we
commit it?

One of the reasons I bring this up is I would like to create a port for
http://librsb.sourceforge.net/, and the only barriers are the lack of
cpowf and cpow.  Right now I intend to commit it with a rather
simplistic patch:

+complex float clogf(complex float a) {
+       return logf(cabsf(a)) + I*cargf(a);
+}
+
+complex float cpowf(complex float a, complex float b) {
+       return cexpf(b*clogf(a));
+}
+
+complex double clog(complex double a) {
+       return log(cabs(a)) + I*carg(a);
+}
+
+complex double cpow(complex double a, complex double b) {
+       return cexp(b*clog(a));
+}
+
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?556CEB8C.90605>