// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %r14
pushq %rbx
subq $0xaf8, %rsp            # imm = 0xAF8
leaq 0x1816b7(%rip), %rsi    # 0x2e8ac5
leaq 0x58(%rsp), %rdi
leaq 0x1d0(%rsp), %rdx
callq 0x127016
andq $0x0, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x19486e
leaq 0x19ae6b(%rip), %rsi    # 0x3022a5
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x127016
leaq 0x10(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x18(%rsp), %rdx
xorl %ecx, %ecx
callq 0x19666e
leaq 0x1d0(%rsp), %rdi
callq 0x118648
leaq 0x38(%rsp), %rdi
callq 0x194918
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x194978
leaq 0x80(%rsp), %rdi
pushq $0x7f
popq %rsi
callq 0x1949d4
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x194ae4
leaq 0x80(%rsp), %rdi
callq 0x1950fc
leaq 0x1d0(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x195144
testb %al, %al
je 0x1675d1
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
callq 0x19561a
movabsq $-0x4010000000000000, %r14 # imm = 0xBFF0000000000000
movq %r14, (%rbx)
movabsq $0x3ff0000000000000, %rbx # imm = 0x3FF0000000000000
leaq 0x30(%rsp), %rcx
movq %rbx, (%rcx)
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
movl $0xf4240, %r8d          # imm = 0xF4240
callq 0x2bbe9f
movsd %xmm0, 0x80(%rsp)
leaq 0x19ad6a(%rip), %rsi    # 0x3022a5
leaq 0x1d0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x127016
leaq 0x28(%rsp), %rdx
movq %r14, (%rdx)
leaq 0x78(%rsp), %rcx
movq %rbx, (%rcx)
leaq 0x38(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
movl $0xf4240, %r8d          # imm = 0xF4240
callq 0x2bbff8
movsd %xmm0, 0x20(%rsp)
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
callq 0x118648
leaq 0x30(%rsp), %rsi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsi)
movabsq $0x3eb0c6f7a0b5ed8d, %r14 # imm = 0x3EB0C6F7A0B5ED8D
movq %r14, (%rbx)
leaq 0x80(%rsp), %rdi
leaq 0x1d0(%rsp), %rdx
callq 0x2ba163
testb %al, %al
je 0x16761d
leaq 0x1a3bb2(%rip), %rdi    # 0x30b179
callq 0x118550
jmp 0x16766c
leaq 0x80(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x1955c6
leaq 0x80(%rsp), %r14
movq (%r14), %rsi
movq 0x58(%rsp), %rdx
leaq 0x1814d8(%rip), %rdi    # 0x2e8ad5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x118080
movq %r14, %rdi
callq 0x118648
leaq 0x1d0(%rsp), %rdi
callq 0x19561a
jmp 0x16766e
movabsq $0x3ff921fb54442d18, %rax # imm = 0x3FF921FB54442D18
leaq 0x1d0(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x28(%rsp), %rdx
movq %r14, (%rdx)
leaq 0x80(%rsp), %rdi
callq 0x2ba163
movb $0x1, %bl
testb %al, %al
je 0x16766e
movsd 0x80(%rsp), %xmm1
leaq 0x1814a3(%rip), %rdi    # 0x2e8b00
movsd 0x166bdb(%rip), %xmm0   # 0x2ce240
movb $0x2, %al
callq 0x118080
xorl %ebx, %ebx
leaq 0x38(%rsp), %rdi
callq 0x19577a
leaq 0x10(%rsp), %rdi
callq 0x195790
leaq 0x58(%rsp), %rdi
callq 0x118648
movl %ebx, %eax
addq $0xaf8, %rsp            # imm = 0xAF8
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x118648
jmp 0x1676da
jmp 0x1676d7
jmp 0x1676b1
jmp 0x1676d7
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x19561a
jmp 0x1676da
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1950fc
jmp 0x1676da
jmp 0x1676d7
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x19577a
jmp 0x1676fd
jmp 0x1676fa
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x118648
jmp 0x1676fd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x195790
leaq 0x58(%rsp), %rdi
callq 0x118648
movq %rbx, %rdi
callq 0x118360
movq %rax, %rbx
jmp 0x167707