File: cpp-intrinsics_02-707a51a.stdout

package info (click to toggle)
lfortran 0.59.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 56,736 kB
  • sloc: cpp: 168,052; f90: 74,272; python: 17,537; ansic: 7,705; yacc: 2,345; sh: 1,334; fortran: 895; makefile: 37; javascript: 15
file content (62 lines) | stat: -rw-r--r-- 1,629 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#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;
}