503 typedef decltype(this->a_fad_)
FadType;
505 auto a_fad = this->a_fad_;
506 auto b_fad = this->b_fad_;
507 auto c_fad = this->c_fad_;
512 for (
int i=0; i<n; i++)
514 std::pow(a_fad.val(),b_fad.val())*(b_fad.val()*a_fad.dx(i)/a_fad.val() +
515 std::log(a_fad.val())*b_fad.dx(i));
518 ScalarType
val = this->urand.number();
521 for (
int i=0; i<n; i++)
528 for (
int i=0; i<n; i++)
536 for (
int i=0; i<n; i++)
537 t4.fastAccessDx(i) = 0.0;
542 for (
int i=0; i<n; i++)
543 t5.fastAccessDx(i) = 0.0;
550 for (
int i=0; i<n; i++)
551 t6.fastAccessDx(i) = 0.0;
558 for (
int i=0; i<n; i++)
560 std::pow(a_fad.val(),bb_fad.val())*(bb_fad.val()*a_fad.dx(i)/a_fad.val()
561 + std::log(a_fad.val())*b_fad.dx(i));
901 typedef decltype(this->a_fad_)
FadType;
903 auto a_fad = this->a_fad_;
904 auto b_fad = this->b_fad_;
905 auto c_fad = this->c_fad_;
908 c_fad = std::atan2(a_fad, b_fad);
909 FadType t1(n, std::atan2(a_fad.val(),b_fad.val()));
910 ScalarType t = a_fad.val()*a_fad.val() +
911 b_fad.val()*b_fad.val();
912 for (
int i=0; i<n; i++)
913 t1.fastAccessDx(i) = (b_fad.val()*a_fad.dx(i) -
914 a_fad.val()*b_fad.dx(i))/t;
917 ScalarType
val = this->urand.number();
918 c_fad = std::atan2(a_fad,
val);
920 t = a_fad.val()*a_fad.val() +
val*
val;
921 for (
int i=0; i<n; i++)
922 t2.fastAccessDx(i) =
val*a_fad.dx(i)/t;
925 c_fad = std::atan2(
val, b_fad);
927 t =
val*
val + b_fad.val()*b_fad.val();
928 for (
int i=0; i<n; i++)
929 t3.fastAccessDx(i) = -
val*b_fad.dx(i)/t;
REGISTER_TYPED_TEST_SUITE_P(FadBLASUnitTests, testSCAL1, testSCAL2, testSCAL3, testSCAL4, testCOPY1, testCOPY2, testCOPY3, testCOPY4, testAXPY1, testAXPY2, testAXPY3, testAXPY4, testDOT1, testDOT2, testDOT3, testDOT4, testNRM21, testNRM22, testGEMV1, testGEMV2, testGEMV3, testGEMV4, testGEMV5, testGEMV6, testGEMV7, testGEMV8, testGEMV9, testTRMV1, testTRMV2, testTRMV3, testTRMV4, testGER1, testGER2, testGER3, testGER4, testGER5, testGER6, testGER7, testGEMM1, testGEMM2, testGEMM3, testGEMM4, testGEMM5, testGEMM6, testGEMM7, testGEMM8, testGEMM9, testGEMM10, testSYMM1, testSYMM2, testSYMM3, testSYMM4, testSYMM5, testSYMM6, testSYMM7, testSYMM8, testSYMM9, testTRMM1, testTRMM2, testTRMM3, testTRMM4, testTRMM5, testTRMM6, testTRMM7, testTRSM1, testTRSM2, testTRSM3, testTRSM4, testTRSM5, testTRSM6, testTRSM7)