Skip to content

Commit

Permalink
Fix unit tests (issue #499); Fix some limits broken by countTotalChil…
Browse files Browse the repository at this point in the history
…dren() update
  • Loading branch information
hanna-kn committed Dec 28, 2022
1 parent f7166de commit e4c86b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion libqalculate/MathStructure-limit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ bool calculate_limit_sub(MathStructure &mstruct, const MathStructure &x_var, con
}
}
}
if(!b_possible_zero && !b_fail && lhop_depth < 5 && !mzero.isOne() && !minfp.isOne() && mzero.countTotalChildren(false) + minfp.countTotalChildren(false) < 50) {
if(!b_possible_zero && !b_fail && lhop_depth < 5 && !mzero.isOne() && !minfp.isOne() && mzero.countTotalChildren(false) + minfp.countTotalChildren(false) < 250) {
//L'Hôpital's rule
MathStructure mden, mnum;
for(size_t i2 = 0; i2 < 2; i2++) {
Expand Down
2 changes: 1 addition & 1 deletion tests/calculus.batch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff(6x^2)
12x
diff(sinh(x^2)/(5x) + 3xy/sqrt(x))
0.4 * cosh(x^2) - sinh(x^2) / (5x^2) + (3y) / (2 * sqrt(x))
0.4 * cosh(x^2) + (3y) / (2 * sqrt(x)) - sinh(x^2) / (5x^2)

integrate(6x^2)
2x^3 + C
Expand Down
20 changes: 10 additions & 10 deletions tests/solver.batch
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@ x^(-3x) = 2
x = e^lambertw(-ln(2) / 3) or x = e^lambertw(-ln(2) / 3, -1)

1/3 * sin(3x) - 1/3 = 0
x = pi / 6 + (2/3) * pi * n
x = (2/3) * pi * n + pi / 6

2/3 * sin(3x) - 1/3 = 0
x = (5/18) * pi + (2/3) * pi * n or x = pi / 18 + (2/3) * pi * n
x = (2/3) * pi * n + (5/18) * pi or x = (2/3) * pi * n + pi / 18

sin(x) + cos(x) = 1
x = 2 pi * n or x = pi / 2 + 2 pi * n
x = 2 pi * n or x = 2 pi * n + pi / 2

sin(x) = 1 + cos(x)
x = pi + 2 pi * n or x = pi / 2 + 2 pi * n
x = 2 pi * n + pi or x = 2 pi * n + pi / 2

sqrt(2) * cos(3x + pi/6) = 1
x = (2/3) * pi * n - (5/36) * pi or x = pi / 36 + (2/3) * pi * n
x = (2/3) * pi * n + pi / 36 or x = (2/3) * pi * n - (5/36) * pi

2 * sin(3x/4) = 1
x = (10/9) * pi + (8/3) * pi * n or x = (2/9) * pi + (8/3) * pi * n
x = (8/3) * pi * n + (10/9) * pi or x = (8/3) * pi * n + (2/9) * pi

tan(x/4 + pi/3) = sqrt(3)
x = 4 pi * n

sqrt(3) * sin(x) + cos(x) = sqrt(3)
x = pi / 2 + 2 pi * n or x = pi / 6 + 2 pi * n
x = 2 pi * n + pi / 2 or x = 2 pi * n + pi / 6

sin(x)^2 = sin(x)^3
x = pi * n or x = pi / 2 + 2 pi * n
x = pi * n or x = 2 pi * n + pi / 2

sin(x) = sin(x/2)
x = 2 pi * n or x = 4 pi * n - (2/3) * pi or x = (2/3) * pi + 4 pi * n
x = 2 pi * n or x = 4 pi * n + (2/3) * pi or x = 4 pi * n - (2/3) * pi

sin(4x) + cos(2x) = 0
x = pi * n - pi / 12 or x = (7/12) * pi + pi * n or x = (pi * n) / 2 - pi / 4
x = pi * n + (7/12) * pi or x = pi * n - pi / 12 or x = (pi * n) / 2 - pi / 4

/set approximation try exact

Expand Down

0 comments on commit e4c86b6

Please sign in to comment.