#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 (abs(x -   9.97494996000000023e-01) >   9.99999999999999955e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (abs(sin(x) -   8.40114892000000002e-01) >   9.99999999999999955e-07) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (abs(y -   9.97494995000000051e-01) >   9.99999999999999955e-08) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (abs(sin(sin(  1.50000000000000000e+00) + (sin(  5.00000000000000000e-01 + sin(  5.00000000000000000e-01)))) -   9.67188417999999994e-01) >   9.99999999999999955e-08) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
    if (abs(sin(sin(y) + (sin(x + sin(x)))) -   9.72761879999999968e-01) >   9.99999999999999955e-08) {
        std::cerr << "ERROR STOP" << std::endl;
        exit(1);
    }
}

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