#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <cmath>
#include <complex>
#include <Kokkos_Core.hpp>
#include <lfortran_intrinsics.h>

template <typename T>
Kokkos::View<T*> from_std_vector(const std::vector<T> &v)
{
    Kokkos::View<T*> r("r", v.size());
    for (size_t i=0; i < v.size(); i++) {
        r(i) = v[i];
    }
    return r;
}

// Forward declarations
namespace {
}

// Implementations
namespace {

void main2() {
    static float x=sin(  1.50000000000000000e+00);
    double y;
    y = sin(  1.50000000000000000e+00);
    std::cout << x << " " << y << std::endl;
    if (fabs(x -   9.97494995594024658e-01) >   9.99999997475242708e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (fabs(sin(x) -   8.40114891529083252e-01) >   9.99999997475242708e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (fabs(y -   9.97494995594024658e-01) >   1.00000001168609742e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (fabs(sin(sin(  1.50000000000000000e+00) + (sin(  5.00000000000000000e-01 + sin(  5.00000000000000000e-01)))) -   9.67188417911529541e-01) >   1.00000001168609742e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (fabs(sin(sin(y) + (sin(x + sin(x)))) -   9.72761869430541992e-01) >   1.00000001168609742e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
}

}
int main(int argc, char* argv[])
{
    Kokkos::initialize(argc, argv);
    main2();
    Kokkos::finalize();
    return 0;
}
