void obliquity(double mj, double *eps) {
  static double lastmj = -16347, lasteps;
  if (mj != lastmj) {
    double t = (mj - (2451545.0 - 2415020.0)) / 36525.;
    lasteps = ((23.4392911 +
                t * (-46.8150 + t * (-0.00059 + t * (0.001813))) / 3600.0) *
               3.141592653589793 / 180.);
    lastmj = mj;
  }
  *eps = lasteps;
}


x86 assembly (clang, -O0):
<obliquity>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd 0x2f06(%rip),%xmm0
jne    112b <obliquity+0x2b>
jp     112b <obliquity+0x2b>
jmp    11cd <obliquity+0xcd>
movsd  -0x8(%rbp),%xmm0
movsd  0xf00(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xec4(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xec0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  0xea0(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe88(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe74(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe60(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2e70(%rip)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,0x2e53(%rip)
movsd  0x2e5b(%rip),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<obliquity>:
movsd  0x2f18(%rip),%xmm1
ucomisd %xmm0,%xmm1
jne    1110 <obliquity+0x10>
jnp    117d <obliquity+0x7d>
movsd  0xee8(%rip),%xmm2
addsd  %xmm0,%xmm2
divsd  0xee4(%rip),%xmm2
movsd  0xee4(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xee0(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xedc(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  0xed8(%rip),%xmm1
addsd  0xed8(%rip),%xmm1
mulsd  0xed8(%rip),%xmm1
divsd  0xed8(%rip),%xmm1
movsd  %xmm1,0x2ec0(%rip)
movsd  %xmm0,0x2ea8(%rip)
movsd  %xmm1,(%rdi)
ret
movsd  0x2eab(%rip),%xmm1
movsd  %xmm1,(%rdi)
ret

LLVM IR (-O0):
@obliquity.lastmj = internal global double -1.634700e+04
@obliquity.lasteps = internal global double 0.000000e+00
define void @obliquity(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca double
store double %0, double* %3
store double* %1, double** %4
%6 = load double, double* %3
%7 = load double, double* @obliquity.lastmj
%8 = fcmp une double %6, %7
br i1 %8, label %9, label %24
9: ; preds = %2
%10 = load double, double* %3
%11 = fsub double %10, 3.652500e+04
%12 = fdiv double %11, 3.652500e+04
store double %12, double* %5
%13 = load double, double* %5
%14 = load double, double* %5
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double %15, double 1.813000e-03, double -5.900000e-04)
%17 = call double @llvm.fmuladd.f64(double %14, double %16, double -4.681500e+01)
%18 = fmul double %13, %17
%19 = fdiv double %18, 3.600000e+03
%20 = fadd double 0x4037707561ABEC82, %19
%21 = fmul double %20, 0x400921FB54442D18
%22 = fdiv double %21, 1.800000e+02
store double %22, double* @obliquity.lasteps
%23 = load double, double* %3
store double %23, double* @obliquity.lastmj
br label %24
24: ; preds = %9, %2
%25 = load double, double* @obliquity.lasteps
%26 = load double*, double** %4
store double %25, double* %26
ret void
}

LLVM IR (-O2):
@obliquity.lastmj = internal unnamed_addr global double -1.634700e+04
@obliquity.lasteps = internal unnamed_addr global double 0.000000e+00
define void @obliquity(double %0, double* nocapture writeonly %1) {
%3 = load double, double* @obliquity.lastmj
%4 = fcmp une double %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load double, double* @obliquity.lasteps
br label %17
7: ; preds = %2
%8 = fadd double %0, -3.652500e+04
%9 = fdiv double %8, 3.652500e+04
%10 = tail call double @llvm.fmuladd.f64(double %9, double 1.813000e-03, double -5.900000e-04)
%11 = tail call double @llvm.fmuladd.f64(double %9, double %10, double -4.681500e+01)
%12 = fmul double %9, %11
%13 = fdiv double %12, 3.600000e+03
%14 = fadd double %13, 0x4037707561ABEC82
%15 = fmul double %14, 0x400921FB54442D18
%16 = fdiv double %15, 1.800000e+02
store double %16, double* @obliquity.lasteps
store double %0, double* @obliquity.lastmj
br label %17
17: ; preds = %5, %7
%18 = phi double [ %6, %5 ], [ %16, %7 ]
store double %18, double* %1
ret void
}