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

   const std::string expression_string = "sin(2x + 1 / 3)";

   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_test07() - Error: %s   Expression: %s\n",
                parser.error().c_str(),
                expression_string.c_str());

         return false;
      }
   }

   for (x = T(-200); x < T(200); x += T(0.0001))
   {
      {
         T deriv1_real_result = T(2) * std::cos(T(2) * x + T(1.0 / 3.0));
         T deriv1_result1 = exprtk::derivative(expression,x);
         T deriv1_result2 = exprtk::derivative(expression,"x");

         if (not_equal(deriv1_result1,deriv1_result2,T(0.00001)))
         {
            printf("run_test07() - 1st Derivative Error:  result1 != result2\n");
            return false;
         }

         if (not_equal(deriv1_result1,deriv1_real_result,T(0.00001)))
         {
            printf("run_test07() - 1st Derivative Error:  x: %19.15f\tExpected: %19.15f\tResult: %19.15f\n",
                   static_cast<double>(x),
                   static_cast<double>(deriv1_real_result),
                   static_cast<double>(deriv1_result1));

            return false;
         }
      }

      {
         T deriv2_real_result = T(-4) * std::sin(T(2) * x + T(1.0 / 3.0));
         T deriv2_result1 = exprtk::second_derivative(expression,x);
         T deriv2_result2 = exprtk::second_derivative(expression,"x");

         if (not_equal(deriv2_result1,deriv2_result2,T(0.0000001)))
         {
            printf("run_test07() - 2nd Derivative Error:  result1 != result2\n");
            return false;
         }

         if (not_equal(deriv2_result1,deriv2_real_result,T(0.01)))
         {
            printf("run_test07() - 2nd Derivative Error:  x: %19.15f\tExpected: %19.15f\tResult: %19.15f\n",
                   static_cast<double>(x),
                   static_cast<double>(deriv2_real_result),
                   static_cast<double>(deriv2_result1));

            return false;
         }
      }

      {
         T deriv3_real_result = T(-8) * std::cos(T(2) * x + T(1.0 / 3.0));
         T deriv3_result1 = exprtk::third_derivative(expression,x);
         T deriv3_result2 = exprtk::third_derivative(expression,"x");

         if (not_equal(deriv3_result1,deriv3_result2,T(0.0000001)))
         {
            printf("run_test07() - 3rd Derivative Error:  result1 != result2\n");
            return false;
         }

         if (not_equal(deriv3_result1,deriv3_real_result,T(0.01)))
         {
            printf("run_test07() - 3rd Derivative Error:  x: %19.15f\tExpected: %19.15f\tResult: %19.15f\n",
                   static_cast<double>(x),
                   static_cast<double>(deriv3_real_result),
                   static_cast<double>(deriv3_result1));

            return false;
         }
      }
   }

   return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xaf8, %rsp            # imm = 0xAF8
leaq 0x181410(%rip), %rsi    # 0x2e8b46
leaq 0x60(%rsp), %rdi
leaq 0x1d0(%rsp), %rdx
callq 0x127016
andq $0x0, 0x10(%rsp)
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x19486e
leaq 0x19ab43(%rip), %rsi    # 0x3022a5
leaq 0x1d0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x127016
leaq 0x28(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x10(%rsp), %rdx
xorl %ecx, %ecx
callq 0x19666e
leaq 0x1d0(%rsp), %rdi
callq 0x118648
leaq 0x40(%rsp), %rdi
callq 0x194918
leaq 0x40(%rsp), %rdi
leaq 0x28(%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 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x195144
testb %al, %al
je 0x167b06
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
callq 0x19561a
movsd 0x166a29(%rip), %xmm0   # 0x2ce248
leaq 0x40(%rsp), %r14
leaq 0x30(%rsp), %rbp
movabsq $0x3ee4f8b588e368f1, %r13 # imm = 0x3EE4F8B588E368F1
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r12
movsd %xmm0, 0x10(%rsp)
movsd 0x166a05(%rip), %xmm1   # 0x2ce250
ucomisd %xmm0, %xmm1
jbe 0x167b55
addsd %xmm0, %xmm0
addsd 0x1669f7(%rip), %xmm0   # 0x2ce258
callq 0x118500
addsd %xmm0, %xmm0
movsd %xmm0, 0x80(%rsp)
movabsq $0x3e45798ee2308c3a, %rax # imm = 0x3E45798EE2308C3A
movq %rax, 0x1d0(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x2bc0bb
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x19aa00(%rip), %rsi    # 0x3022a5
leaq 0xf(%rsp), %rdx
callq 0x127016
movabsq $0x3e45798ee2308c3a, %rax # imm = 0x3E45798EE2308C3A
movq %rax, 0x30(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2bc1a5
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x118648
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movq %r13, 0x1d0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2ba163
testb %al, %al
jne 0x167b5c
movq %r13, 0x1d0(%rsp)
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
movq %rbx, %rdx
callq 0x2ba163
testb %al, %al
jne 0x167b65
movsd 0x10(%rsp), %xmm0
addsd %xmm0, %xmm0
addsd 0x16691f(%rip), %xmm0   # 0x2ce258
callq 0x1181c0
mulsd 0x16691a(%rip), %xmm0   # 0x2ce260
movsd %xmm0, 0x80(%rsp)
movq %r13, 0x1d0(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x2bc20d
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x19a92e(%rip), %rsi    # 0x3022a5
leaq 0xf(%rsp), %rdx
callq 0x127016
movq %r13, 0x30(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2bc32b
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x118648
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movabsq $0x3e7ad7f29abcaf48, %rax # imm = 0x3E7AD7F29ABCAF48
movq %rax, 0x1d0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2ba163
testb %al, %al
jne 0x167b83
movabsq $0x3f847ae147ae147b, %rax # imm = 0x3F847AE147AE147B
movq %rax, 0x1d0(%rsp)
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
movq %rbx, %rdx
callq 0x2ba163
testb %al, %al
jne 0x167b8c
movsd 0x10(%rsp), %xmm0
addsd %xmm0, %xmm0
addsd 0x166843(%rip), %xmm0   # 0x2ce258
callq 0x118500
mulsd 0x166846(%rip), %xmm0   # 0x2ce268
movsd %xmm0, 0x80(%rsp)
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rax, 0x1d0(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x2bc393
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rdi
leaq 0x19a848(%rip), %rsi    # 0x3022a5
leaq 0xf(%rsp), %rdx
callq 0x127016
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rax, 0x30(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2bc485
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x118648
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movabsq $0x3e7ad7f29abcaf48, %rax # imm = 0x3E7AD7F29ABCAF48
movq %rax, 0x1d0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x2ba163
testb %al, %al
jne 0x167baa
movabsq $0x3f847ae147ae147b, %rax # imm = 0x3F847AE147AE147B
movq %rax, 0x1d0(%rsp)
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
movq %rbx, %rdx
callq 0x2ba163
testb %al, %al
jne 0x167bb8
movsd 0x10(%rsp), %xmm0
addsd 0x16672f(%rip), %xmm0   # 0x2ce230
jmp 0x16783d
leaq 0x80(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x1955c6
leaq 0x80(%rsp), %r14
movq (%r14), %rsi
movq 0x60(%rsp), %rdx
leaq 0x181024(%rip), %rdi    # 0x2e8b56
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x118080
movq %r14, %rdi
callq 0x118648
leaq 0x1d0(%rsp), %rdi
callq 0x19561a
jmp 0x167bdd
movb $0x1, %bl
jmp 0x167bdd
leaq 0x1a3648(%rip), %rdi    # 0x30b1ab
jmp 0x167bb1
movsd 0x10(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
leaq 0x181000(%rip), %rdi    # 0x2e8b81
jmp 0x167bd4
leaq 0x1a365a(%rip), %rdi    # 0x30b1e4
jmp 0x167bb1
movsd 0x10(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
leaq 0x18102d(%rip), %rdi    # 0x2e8bd5
jmp 0x167bd4
leaq 0x1a366c(%rip), %rdi    # 0x30b21d
callq 0x118550
jmp 0x167bdb
movsd 0x10(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
leaq 0x181055(%rip), %rdi    # 0x2e8c29
movb $0x3, %al
callq 0x118080
xorl %ebx, %ebx
leaq 0x40(%rsp), %rdi
callq 0x19577a
leaq 0x28(%rsp), %rdi
callq 0x195790
leaq 0x60(%rsp), %rdi
callq 0x118648
movl %ebx, %eax
addq $0xaf8, %rsp            # imm = 0xAF8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x167c11
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x19561a
jmp 0x167c7a
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1950fc
jmp 0x167c7a
jmp 0x167c77
jmp 0x167c77
jmp 0x167c4d
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x118648
jmp 0x167c84
movq %rax, %rbx
jmp 0x167c84
movq %rax, %rbx
jmp 0x167c8e
jmp 0x167c77
jmp 0x167c63
jmp 0x167c77
jmp 0x167c63
jmp 0x167c77
jmp 0x167c77
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x118648
jmp 0x167c7a
jmp 0x167c77
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x19577a
leaq 0x28(%rsp), %rdi
callq 0x195790
leaq 0x60(%rsp), %rdi
callq 0x118648
movq %rbx, %rdi
callq 0x118360