Add more use-cases

Co-authored-by: Ezequiel Bellver <ebellver@itba.edu.ar>
Co-authored-by: Juan Barmasch <jbarmasch@itba.edu.ar>
This commit is contained in:
Santiago Lo Coco 2022-04-15 17:40:47 -03:00
parent 2f62eebf94
commit d2eeda3d24
14 changed files with 57 additions and 16 deletions

View File

@ -1,11 +1,12 @@
function f = x^2;
fun h = 3*x;
function g = { x - 2: x < 3,
x^3: x >= 5
};
x^3: x >= 5,
x: x > 7
};
fun h = x/(x-2);
evaluate f in 3; // 9
g(5); // 125
evaluate g in 4; // Error
g(2); // 0
h(2); // Error
evaluate f in 3;
g(5);
evaluate g in 4;
g(2);
h(2);

View File

@ -1,2 +1,3 @@
fun f = 1/x;
fun g = f(3) + f'(3)*(x-3) + f''(3)/2 * (x-3)^2 + f'''(3) / 6 * (x-3)^3 + f''''(3) / 24 * (x-3)^4;
fun g = f(3) + f'(3)*(x-3) + f''(3)/2 * (x-3)^2 + f'''(3) / 6 * (x-3)^3 + f''''(3) / 24 * (x-3)^4;
taylor 5 f;

View File

@ -0,0 +1,2 @@
fun f = x;
fun g = fo4;

View File

@ -0,0 +1 @@
fun f = { x < 2: x ^ 2 };

View File

@ -0,0 +1,2 @@
fun f = 1/x;
derivative f in 3 err -2;

View File

@ -1,6 +1,4 @@
if (f(0) == 1) {
if (g(2) == 4) {
print("Hola");
}
}
if (1 == 1) {
print("Hola");
}
}

View File

@ -1,3 +1,6 @@
eval f in 5;
function g = { x - 2: x < 3,
x^3: x >= 5,
x: x > 7
};
int f 3 ~ 5;
print(evaluate g in [3, 5, 7]);

View File

@ -0,0 +1,4 @@
fun h = x/(x-2);
fun g = hohohoh;
printCsv g(1)
printCsv g(1)

View File

@ -0,0 +1,6 @@
fun f = e^x;
f'(2);
f''(2);
f'''(2);
f''''(2);
f'''''(2);

View File

@ -0,0 +1,6 @@
fun f = x^2;
derivative f in 3;
derivative 2 f in 3;
derivative 3 f in 3;
derivative 4 f in 3;
derivative 5 f in 3;

View File

@ -0,0 +1,7 @@
fun f = { x: x < 3,
x^2: 3 < x < 4
};
fun g = { x^2: 6 < x < 7,
x^7: x > 8
};
fun h = fog;

View File

@ -0,0 +1,5 @@
fun f = - x^2 / 2 + 5*x;
fun g = x^2 - 5*x - 2;
fun h = x^2 - 5*x - 82;
integrate [f, g, h] between 2 ~ 7;

View File

@ -0,0 +1 @@
var x = f(3) * x * 4 + 3;

View File

@ -0,0 +1,4 @@
fun f = x^2;
var a = int f 0 ~ 5;
var b = int f 0 ~ 1 + int f 1 ~ 2 + int f 2 ~ 3 + int f 3 ~ 4 + int f 4 ~ 5;
var c = a - b;