Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: fusl/src/math/__cos.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: fusl/src/math/__cos.c
diff --git a/fusl/src/math/__cos.c b/fusl/src/math/__cos.c
index 46cefb38134398a4e0e7b40621eb6ea6e514ca38..f7a1af35b859361b9729fa319749fbd2d9b5a900 100644
--- a/fusl/src/math/__cos.c
+++ b/fusl/src/math/__cos.c
@@ -50,22 +50,21 @@
#include "libm.h"
-static const double
-C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
-C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
-C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
-C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */
-C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */
-C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
+static const double C1 =
+ 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
+ C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
+ C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
+ C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */
+ C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */
+ C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
-double __cos(double x, double y)
-{
- double_t hz,z,r,w;
+double __cos(double x, double y) {
+ double_t hz, z, r, w;
- z = x*x;
- w = z*z;
- r = z*(C1+z*(C2+z*C3)) + w*w*(C4+z*(C5+z*C6));
- hz = 0.5*z;
- w = 1.0-hz;
- return w + (((1.0-w)-hz) + (z*r-x*y));
+ z = x * x;
+ w = z * z;
+ r = z * (C1 + z * (C2 + z * C3)) + w * w * (C4 + z * (C5 + z * C6));
+ hz = 0.5 * z;
+ w = 1.0 - hz;
+ return w + (((1.0 - w) - hz) + (z * r - x * y));
}

Powered by Google App Engine
This is Rietveld 408576698