// File: ashlall[P]StreamStats/Test/BasicStats_test.cpp
// Function: test_SD()
void test_SD()
{
  BasicStats a; // tests with 10 items in the stream in ascending order
  for (int i=1;i<=10;i++)
    a.insert(i);
  assert(3.02765 <= a.SD() <= 3.0275);

  for (int i=100;i>=11;i--) // tests with 100 items in the stream in descending order
    a.insert(i);
  assert(29.01149<=a.SD()<=29.01149);

  a.insert(1000); // tests adding an outlier to the stream
  assert(98.79013<=a.SD()<=98.79013);

  for (int i=1;i<10;i++) // tests having 10 max values in the stream
    a.insert(1000);
  assert(275.6017<=a.SD()<=275.6017);

  BasicStats b; // tests with father apart integers
  for (int i=1;i<=50;i++)
    b.insert(i*3);
  assert(43.73214<=b.SD()<=43.73214);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
leaq -0x28(%rbp), %rdi
callq 0x11d0
movl $0x1, -0x2c(%rbp)
cmpl $0xa, -0x2c(%rbp)
jg 0x204f
cvtsi2sdl -0x2c(%rbp), %xmm0
leaq -0x28(%rbp), %rdi
callq 0x12d0
jmp 0x2031
jmp 0x2033
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x201b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x22b7
leaq -0x28(%rbp), %rdi
callq 0x1470
movsd 0x1008(%rip), %xmm1     # 0x3068
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
movsd 0xfe8(%rip), %xmm0      # 0x3060
ucomisd %xmm1, %xmm0
jb 0x2080
jmp 0x209f
leaq 0x1128(%rip), %rdi      # 0x31af
leaq 0x1015(%rip), %rsi      # 0x30a3
movl $0x68, %edx
leaq 0x1131(%rip), %rcx      # 0x31cb
callq 0x1040
movl $0x64, -0x40(%rbp)
cmpl $0xb, -0x40(%rbp)
jl 0x20c9
cvtsi2sdl -0x40(%rbp), %xmm0
leaq -0x28(%rbp), %rdi
callq 0x12d0
jmp 0x20bc
jmp 0x20be
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x20a6
leaq -0x28(%rbp), %rdi
callq 0x1470
movsd 0xf96(%rip), %xmm1      # 0x3070
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
movsd 0xf7e(%rip), %xmm0      # 0x3070
ucomisd %xmm1, %xmm0
jb 0x20fa
jmp 0x2119
leaq 0x10d9(%rip), %rdi      # 0x31da
leaq 0xf9b(%rip), %rsi       # 0x30a3
movl $0x6c, %edx
leaq 0x10b7(%rip), %rcx      # 0x31cb
callq 0x1040
leaq -0x28(%rbp), %rdi
movsd 0xf53(%rip), %xmm0      # 0x3078
callq 0x12d0
jmp 0x212c
leaq -0x28(%rbp), %rdi
callq 0x1470
movsd 0xf43(%rip), %xmm1      # 0x3080
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
movsd 0xf2b(%rip), %xmm0      # 0x3080
ucomisd %xmm1, %xmm0
jb 0x215d
jmp 0x217c
leaq 0x1091(%rip), %rdi      # 0x31f5
leaq 0xf38(%rip), %rsi       # 0x30a3
movl $0x6f, %edx
leaq 0x1054(%rip), %rcx      # 0x31cb
callq 0x1040
movl $0x1, -0x44(%rbp)
cmpl $0xa, -0x44(%rbp)
jge 0x21a9
leaq -0x28(%rbp), %rdi
movsd 0xee3(%rip), %xmm0      # 0x3078
callq 0x12d0
jmp 0x219c
jmp 0x219e
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2183
leaq -0x28(%rbp), %rdi
callq 0x1470
movsd 0xece(%rip), %xmm1      # 0x3088
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
movsd 0xeb6(%rip), %xmm0      # 0x3088
ucomisd %xmm1, %xmm0
jb 0x21da
jmp 0x21f9
leaq 0x102f(%rip), %rdi      # 0x3210
leaq 0xebb(%rip), %rsi       # 0x30a3
movl $0x73, %edx
leaq 0xfd7(%rip), %rcx       # 0x31cb
callq 0x1040
leaq -0x70(%rbp), %rdi
callq 0x11d0
jmp 0x2204
movl $0x1, -0x74(%rbp)
cmpl $0x32, -0x74(%rbp)
jg 0x224c
movl -0x74(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm0
leaq -0x70(%rbp), %rdi
callq 0x12d0
jmp 0x2228
jmp 0x222a
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x220b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x22f0
jmp 0x22b7
leaq -0x70(%rbp), %rdi
callq 0x1470
movsd 0xe33(%rip), %xmm1      # 0x3090
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
movsd 0xe1b(%rip), %xmm0      # 0x3090
ucomisd %xmm1, %xmm0
jb 0x227d
jmp 0x229c
leaq 0xfa7(%rip), %rdi       # 0x322b
leaq 0xe18(%rip), %rsi       # 0x30a3
movl $0x78, %edx
leaq 0xf34(%rip), %rcx       # 0x31cb
callq 0x1040
leaq -0x70(%rbp), %rdi
callq 0x22f0
leaq -0x28(%rbp), %rdi
callq 0x22f0
addq $0x80, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x22f0
movq -0x38(%rbp), %rdi
callq 0x1080
nopl (%rax)