double calcGeomMeanLongSun(double t) {
  double L0 = 280.46646 + t * (36000.76983 + 0.0003032 * t);
  while (L0 > 360.0) {
    L0 -= 360.0;
  }
  while (L0 < 0.0) {
    L0 += 360.0;
  }
  return L0;
}


x86 assembly (clang, -O0):
<calcGeomMeanLongSun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeed(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee9(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1172 <calcGeomMeanLongSun+0x72>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1140 <calcGeomMeanLongSun+0x40>
jmp    1177 <calcGeomMeanLongSun+0x77>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119c <calcGeomMeanLongSun+0x9c>
movsd  0xe8b(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1177 <calcGeomMeanLongSun+0x77>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcGeomMeanLongSun>:
movapd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ucomisd 0xeec(%rip),%xmm0
jbe    114a <calcGeomMeanLongSun+0x4a>
movsd  0xeea(%rip),%xmm1
movsd  0xeda(%rip),%xmm2
xchg   %ax,%ax
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1140 <calcGeomMeanLongSun+0x40>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    116a <calcGeomMeanLongSun+0x6a>
movsd  0xebc(%rip),%xmm2
nopl   0x0(%rax)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1160 <calcGeomMeanLongSun+0x60>
ret

LLVM IR (-O0):
define double @calcGeomMeanLongSun(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double 3.032000e-04, double %5, double 0x40E19418A272862F)
%7 = call double @llvm.fmuladd.f64(double %4, double %6, double 0x407187769EC2CE46)
store double %7, double* %3
br label %8
8: ; preds = %11, %1
%9 = load double, double* %3
%10 = fcmp ogt double %9, 3.600000e+02
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load double, double* %3
%13 = fsub double %12, 3.600000e+02
store double %13, double* %3
br label %8
14: ; preds = %8
br label %15
15: ; preds = %18, %14
%16 = load double, double* %3
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %3
%20 = fadd double %19, 3.600000e+02
store double %20, double* %3
br label %15
21: ; preds = %15
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
define double @calcGeomMeanLongSun(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.032000e-04, double 0x40E19418A272862F)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0x407187769EC2CE46)
%4 = fcmp ogt double %3, 3.600000e+02
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = phi double [ %3, %1 ], [ %10, %8 ]
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %12, label %16
8: ; preds = %1, %8
%9 = phi double [ %10, %8 ], [ %3, %1 ]
%10 = fadd double %9, -3.600000e+02
%11 = fcmp ogt double %10, 3.600000e+02
br i1 %11, label %8, label %5
12: ; preds = %5, %12
%13 = phi double [ %14, %12 ], [ %6, %5 ]
%14 = fadd double %13, 3.600000e+02
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %12, label %16
16: ; preds = %12, %5
%17 = phi double [ %6, %5 ], [ %14, %12 ]
ret double %17
}