forked from dreal/dreal-cmake-example-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Trefethen.cpp
43 lines (38 loc) · 894 Bytes
/
Trefethen.cpp
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
//
// Trefethen.cpp
// dreal-cmake-example-project
//
// Created by Yoshi Takashima on 6/21/1 R.
// Copyright © 1 Reiwa Yoshi Takashima. All rights reserved.
//
#include "Trefethen.hpp"
namespace dreal {
Trefethen::Trefethen() {};
double Trefethen::eval(const double x, const double y) const {
using std::pow;
using std::sin;
using std::cos;
using std::abs;
using std::exp;
using std::sqrt;
return (0.25*pow(x,2)) +
(0.25*pow(y,2)) +
(exp(sin(50*x))) -
(sin((10*x)+(10*x))) +
(sin(60*exp(y))) +
(sin(70*sin(x))) +
(sin(sin(80*y)));
};
Expression Trefethen::getFunction(const Variable& x, const Variable& y) const {
return (0.25*pow(x,2)) +
(0.25*pow(y,2)) +
(exp(sin(50*x))) -
(sin((10*x)+(10*x))) +
(sin(60*exp(y))) +
(sin(70*sin(x))) +
(sin(sin(80*y)));
};
std::string Trefethen::name() const {
return "Trefethen Function";
};
}