double product_mod_46(double t1, double t2) {
  double a1;
  double b1;
  double a2;
  double b2;
  a1 = (double)((long)(t1 / 8388608.0e0));
  a2 = t1 - a1 * 8388608.0e0;
  b1 = (double)((long)(t2 / 8388608.0e0));
  b2 = t2 - b1 * 8388608.0e0;
  t1 = a1 * b2 + a2 * b1;
  t2 = (double)((long)(t1 / 8388608.0e0));
  t2 = t1 - t2 * 8388608.0e0;
  t1 = t2 * 8388608.0e0 + a2 * b2;
  t2 = (double)((long)(t1 / 70368744177664.0e0));
  return (t1 - t2 * 70368744177664.0e0);
}


x86 assembly (clang, -O0):
<product_mod_46>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeed(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe5b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe20(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xde4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  0xdc0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xd9e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd62(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<product_mod_46>:
movsd  0xef8(%rip),%xmm3
movapd %xmm0,%xmm2
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%rax
xorps  %xmm2,%xmm2
cvtsi2sd %rax,%xmm2
movsd  0xee3(%rip),%xmm4
movapd %xmm2,%xmm5
mulsd  %xmm4,%xmm5
subsd  %xmm5,%xmm0
movapd %xmm1,%xmm5
mulsd  %xmm3,%xmm5
cvttsd2si %xmm5,%rax
xorps  %xmm5,%xmm5
cvtsi2sd %rax,%xmm5
movapd %xmm0,%xmm6
mulsd  %xmm5,%xmm6
mulsd  %xmm4,%xmm5
subsd  %xmm5,%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm6,%xmm2
mulsd  %xmm2,%xmm3
cvttsd2si %xmm3,%rax
xorps  %xmm3,%xmm3
cvtsi2sd %rax,%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm2
addsd  %xmm2,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mulsd  0xe74(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @product_mod_46(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %3
%10 = fdiv double %9, 0x4160000000000000
%11 = fptosi double %10 to i64
%12 = sitofp i64 %11 to double
store double %12, double* %5
%13 = load double, double* %3
%14 = load double, double* %5
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %15, double 0x4160000000000000, double %13)
store double %16, double* %7
%17 = load double, double* %4
%18 = fdiv double %17, 0x4160000000000000
%19 = fptosi double %18 to i64
%20 = sitofp i64 %19 to double
store double %20, double* %6
%21 = load double, double* %4
%22 = load double, double* %6
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double %23, double 0x4160000000000000, double %21)
store double %24, double* %8
%25 = load double, double* %5
%26 = load double, double* %8
%27 = load double, double* %7
%28 = load double, double* %6
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
store double %30, double* %3
%31 = load double, double* %3
%32 = fdiv double %31, 0x4160000000000000
%33 = fptosi double %32 to i64
%34 = sitofp i64 %33 to double
store double %34, double* %4
%35 = load double, double* %3
%36 = load double, double* %4
%37 = fneg double %36
%38 = call double @llvm.fmuladd.f64(double %37, double 0x4160000000000000, double %35)
store double %38, double* %4
%39 = load double, double* %4
%40 = load double, double* %7
%41 = load double, double* %8
%42 = fmul double %40, %41
%43 = call double @llvm.fmuladd.f64(double %39, double 0x4160000000000000, double %42)
store double %43, double* %3
%44 = load double, double* %3
%45 = fdiv double %44, 0x42D0000000000000
%46 = fptosi double %45 to i64
%47 = sitofp i64 %46 to double
store double %47, double* %4
%48 = load double, double* %3
%49 = load double, double* %4
%50 = fneg double %49
%51 = call double @llvm.fmuladd.f64(double %50, double 0x42D0000000000000, double %48)
ret double %51
}

LLVM IR (-O2):
define double @product_mod_46(double %0, double %1) {
%3 = fmul double %0, 0x3E80000000000000
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x4160000000000000, double %0)
%8 = fmul double %1, 0x3E80000000000000
%9 = fptosi double %8 to i64
%10 = sitofp i64 %9 to double
%11 = fneg double %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x4160000000000000, double %1)
%13 = fmul double %7, %10
%14 = tail call double @llvm.fmuladd.f64(double %5, double %12, double %13)
%15 = fmul double %14, 0x3E80000000000000
%16 = fptosi double %15 to i64
%17 = sitofp i64 %16 to double
%18 = fneg double %17
%19 = tail call double @llvm.fmuladd.f64(double %18, double 0x4160000000000000, double %14)
%20 = fmul double %7, %12
%21 = tail call double @llvm.fmuladd.f64(double %19, double 0x4160000000000000, double %20)
%22 = fmul double %21, 0x3D10000000000000
%23 = fptosi double %22 to i64
%24 = sitofp i64 %23 to double
%25 = fneg double %24
%26 = tail call double @llvm.fmuladd.f64(double %25, double 0x42D0000000000000, double %21)
ret double %26
}