-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtest_denest.mac
79 lines (51 loc) · 919 Bytes
/
rtest_denest.mac
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
(kill(all),load("denest"),0);
0$
/* denest_if_square */
denest_if_square(x);
x$
denest_if_square(4);
4$
denest_if_square(sqrt(x));
sqrt(x)$
denest_if_square([]);
[]$
tmp:sqrt(x^2),radexpand:false;
denest_if_square(tmp);
x$
denest_if_square(sqrt(1+x^2));
sqrt(1+x^2)$
/* simple helpers */
is_sqrt(sqrt(2));
true$
is_sqrt(-sqrt(3));
false$
is_sqrt(1);
false$
is_sqrt(a);
false$
is_power(a^2);
true$
is_power(2^a);
true$
is_power(a);
false$
is_power(-a^2);
false$
is_const_times_sqrt(a*sqrt(b));
true$
is_const_times_sqrt(sqrt(b));
true$
is_const_times_sqrt(-a*sqrt(b));
true$
is_const_times_sqrt(-sqrt(b));
true$
is_const_times_sqrt((a+q)*sqrt(b+c));
true$
is_const_times_sqrt(sqrt(b-c));
true$
is_const_times_sqrt(-(a+q)*sqrt(b*c));
true$
is_const_times_sqrt(-sqrt(3)*sqrt(b));
true$
s2e:sqrt(16 - 2*sqrt(29) + 2*sqrt(55-10*sqrt(29)))$
s6e:sqrt(sqrt(112+70*sqrt(2))+(46+34*sqrt(2))*sqrt(5));