// File: ArashPartow[P]exprtk/exprtk_test.cpp
// Function: bool run_test06<double>()
bool run_test06()
{
   typedef exprtk::expression<T> expression_t;

   const std::string expression_string = "sqrt(1 - (x^2))";

   T x = T(0);

   exprtk::symbol_table<T> symbol_table;
   symbol_table.add_variable("x",x);

   expression_t expression;
   expression.register_symbol_table(symbol_table);

   {
      exprtk::parser<T> parser;

      if (!parser.compile(expression_string,expression))
      {
         printf("run_test06() - Error: %s   Expression: %s\n",
                parser.error().c_str(),
                expression_string.c_str());

         return false;
      }
   }

   T total_area1 = exprtk::integrate(expression,x,T(-1),T(1));
   T total_area2 = exprtk::integrate(expression,"x",T(-1),T(1));
   const T pi = T(3.141592653589793238462643383279502);

   if (not_equal(total_area1,total_area2,T(0.000001)))
   {
      printf("run_test06() - Integration Error:  area1 != area2\n");
      return false;
   }

   if (not_equal(total_area1,T(pi) / T(2),T(0.000001)))
   {
      printf("run_test06() - Integration Error:  Expected: %19.15f\tResult: %19.15f\n",
             static_cast<double>(pi / T(2)),
             static_cast<double>(total_area1));

      return false;
   }

   return true;
}

// Assembly:
subq $0xbf8, %rsp            # imm = 0xBF8
leaq 0xbcf(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x11b6f0
movq 0x40(%rsp), %rdx
leaq 0x40075f(%rip), %rsi    # 0x5b5e04
leaq 0xbd0(%rsp), %rdi
callq 0x134520
jmp 0x1b56b4
leaq 0xbcf(%rsp), %rdi
callq 0x11b820
movq $0x0, 0xbb0(%rsp)
leaq 0xba8(%rsp), %rdi
movl $0x1, %esi
callq 0x22de90
jmp 0x1b56e1
leaq 0xb87(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x11b6f0
movq 0x38(%rsp), %rdx
leaq 0x41b1b8(%rip), %rsi    # 0x5d08b7
leaq 0xb88(%rsp), %rdi
callq 0x134520
jmp 0x1b570e
leaq 0xba8(%rsp), %rdi
leaq 0xb88(%rsp), %rsi
leaq 0xbb0(%rsp), %rdx
xorl %ecx, %ecx
callq 0x2341e0
jmp 0x1b572f
leaq 0xb88(%rsp), %rdi
callq 0x11b838
leaq 0xb87(%rsp), %rdi
callq 0x11b820
leaq 0xb60(%rsp), %rdi
callq 0x22e450
jmp 0x1b5758
leaq 0xb60(%rsp), %rdi
leaq 0xba8(%rsp), %rsi
callq 0x22e500
jmp 0x1b576f
leaq 0xe8(%rsp), %rdi
movl $0x7f, %esi
callq 0x22e5b0
jmp 0x1b5783
leaq 0x238(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x22e6e0
jmp 0x1b579a
leaq 0xe8(%rsp), %rdi
callq 0x22ef10
leaq 0x238(%rsp), %rdi
leaq 0xbd0(%rsp), %rsi
leaq 0xb60(%rsp), %rdx
callq 0x22ef80
movb %al, 0x37(%rsp)
jmp 0x1b57ca
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x1b596a
jmp 0x1b57d8
leaq 0xc8(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x22f810
jmp 0x1b57ef
leaq 0xc8(%rsp), %rdi
callq 0x11b120
movq %rax, 0x28(%rsp)
leaq 0xbd0(%rsp), %rdi
callq 0x11b120
movq 0x28(%rsp), %rsi
movq %rax, %rdx
leaq 0x4005f7(%rip), %rdi    # 0x5b5e14
xorl %eax, %eax
callq 0x11b0b0
jmp 0x1b5826
leaq 0xc8(%rsp), %rdi
callq 0x11b838
movb $0x0, 0xbf7(%rsp)
movl $0x1, 0xc4(%rsp)
jmp 0x1b5975
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
leaq 0xbcf(%rsp), %rdi
callq 0x11b820
jmp 0x1b5c4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
jmp 0x1b5c3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
jmp 0x1b58c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
leaq 0xb88(%rsp), %rdi
callq 0x11b838
leaq 0xb87(%rsp), %rdi
callq 0x11b820
jmp 0x1b5c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
jmp 0x1b5c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
jmp 0x1b5c25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x22ef10
jmp 0x1b5c25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
jmp 0x1b5b07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x11b838
jmp 0x1b5b07
movl $0x0, 0xc4(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x22f8d0
movl 0xc4(%rsp), %eax
testl %eax, %eax
jne 0x1b5bed
jmp 0x1b5993
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0xb0(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xa8(%rsp)
leaq 0xb60(%rsp), %rdi
leaq 0xbb0(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movl $0xf4240, %r8d          # imm = 0xF4240
callq 0x563150
movsd %xmm0, 0x20(%rsp)
jmp 0x1b59ea
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x11b6f0
movq 0x18(%rsp), %rdx
leaq 0x41aea3(%rip), %rsi    # 0x5d08b7
leaq 0x80(%rsp), %rdi
callq 0x134520
jmp 0x1b5a23
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x70(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x68(%rsp)
leaq 0xb60(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movl $0xf4240, %r8d          # imm = 0xF4240
callq 0x563330
movsd %xmm0, 0x10(%rsp)
jmp 0x1b5a6e
leaq 0x80(%rsp), %rdi
callq 0x11b838
leaq 0x7f(%rsp), %rdi
callq 0x11b820
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movabsq $0x400921fb54442d18, %rax # imm = 0x400921FB54442D18
movq %rax, 0x60(%rsp)
movabsq $0x3eb0c6f7a0b5ed8d, %rax # imm = 0x3EB0C6F7A0B5ED8D
movq %rax, 0x58(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x22fb30
movb %al, 0xf(%rsp)
jmp 0x1b5ad2
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x1b5adf
jmp 0x1b5b5f
leaq 0x400359(%rip), %rdi    # 0x5b5e3f
xorl %eax, %eax
callq 0x11b0b0
jmp 0x1b5aef
movb $0x0, 0xbf7(%rsp)
movl $0x1, 0xc4(%rsp)
jmp 0x1b5bed
leaq 0x238(%rsp), %rdi
callq 0x22f8d0
jmp 0x1b5c25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
jmp 0x1b5b50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xbc0(%rsp)
movl %eax, 0xbbc(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x11b838
leaq 0x7f(%rsp), %rdi
callq 0x11b820
jmp 0x1b5c25
movabsq $0x3ff921fb54442d18, %rax # imm = 0x3FF921FB54442D18
movq %rax, 0x50(%rsp)
movabsq $0x3eb0c6f7a0b5ed8d, %rax # imm = 0x3EB0C6F7A0B5ED8D
movq %rax, 0x48(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x22fb30
movb %al, 0xe(%rsp)
jmp 0x1b5b9a
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x1b5ba4
jmp 0x1b5bda
movsd 0xb8(%rsp), %xmm1
leaq 0x4002be(%rip), %rdi    # 0x5b5e72
movsd 0x3e54d4(%rip), %xmm0   # 0x59b090
movb $0x2, %al
callq 0x11b0b0
jmp 0x1b5bc5
movb $0x0, 0xbf7(%rsp)
movl $0x1, 0xc4(%rsp)
jmp 0x1b5bed
movb $0x1, 0xbf7(%rsp)
movl $0x1, 0xc4(%rsp)
leaq 0xb60(%rsp), %rdi
callq 0x22fb60
leaq 0xba8(%rsp), %rdi
callq 0x22fc60
leaq 0xbd0(%rsp), %rdi
callq 0x11b838
movb 0xbf7(%rsp), %al
andb $0x1, %al
addq $0xbf8, %rsp            # imm = 0xBF8
retq
leaq 0xb60(%rsp), %rdi
callq 0x22fb60
leaq 0xba8(%rsp), %rdi
callq 0x22fc60
leaq 0xbd0(%rsp), %rdi
callq 0x11b838
movq 0xbc0(%rsp), %rdi
callq 0x11b4e0
nopl (%rax)