<commit_before>#include <stan/agrad/rev/inv_cloglog.hpp>
<<<<<<< HEAD
#include <stan/agrad/rev/exp.hpp>
#include <stan/agrad/rev/operator_unary_negative.hpp>
#include <stan/agrad/rev/operator_subtraction.hpp>

#include <stan/math/functions/inv_cloglog.hpp>

=======
>>>>>>> 364e38d0e7724275230da060d6afc7f93e8c3d53
#include <test/agrad/util.hpp>
#include <gtest/gtest.h>

TEST(AgradRev,inv_cloglog) {
  using std::exp;
  using stan::agrad::exp;
  AVAR a = 2.7;
  AVAR f = inv_cloglog(a);
  EXPECT_FLOAT_EQ(std::exp(-std::exp(2.7)),f.val());

  AVEC x = createAVEC(a);
  VEC grad_f;
  f.grad(x,grad_f);
<<<<<<< HEAD

  AVAR a2 = 2.7;
  AVEC x2 = createAVEC(a2);
  AVAR f2 = 1 - exp(-exp(a2));
  VEC grad_f2;
  f2.grad(x2,grad_f2);

  EXPECT_EQ(1,grad_f.size());
  EXPECT_FLOAT_EQ(grad_f2[0],grad_f[0]);
=======
  EXPECT_FLOAT_EQ(-std::exp(2.7 - std::exp(2.7)),grad_f[0]);
>>>>>>> 364e38d0e7724275230da060d6afc7f93e8c3d53
}<commit_msg>fixed error in inv cloglog test for 1 - val<commit_after>#include <stan/agrad/rev/inv_cloglog.hpp>
#include <stan/agrad/rev/exp.hpp>
#include <stan/agrad/rev/operator_unary_negative.hpp>
#include <stan/agrad/rev/operator_subtraction.hpp>

#include <stan/math/functions/inv_cloglog.hpp>
#include <test/agrad/util.hpp>
#include <gtest/gtest.h>

TEST(AgradRev,inv_cloglog) {
  using std::exp;
  using stan::agrad::exp;
  AVAR a = 2.7;
  AVAR f = inv_cloglog(a);
  EXPECT_FLOAT_EQ(1 - std::exp(-std::exp(2.7)),f.val());

  AVEC x = createAVEC(a);
  VEC grad_f;
  f.grad(x,grad_f);

  AVAR a2 = 2.7;
  AVEC x2 = createAVEC(a2);
  AVAR f2 = 1 - exp(-exp(a2));
  VEC grad_f2;
  f2.grad(x2,grad_f2);

  EXPECT_EQ(1,grad_f.size());
  EXPECT_FLOAT_EQ(grad_f2[0],grad_f[0]);
}
{'fraction_non_alphanumeric': 0.19199057714958775, 'fraction_numerical': 0.059481743227326266, 'mean_word_length': 4.982394366197183, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4540997', 'n_tokens_mistral': 846, 'n_tokens_neox': 801, 'n_words': 109}