Skip to content

Commit

Permalink
Fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidar committed Oct 26, 2024
1 parent 3b586f4 commit f137b04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mathics/builtin/numbers/calculus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ class RootSum(SympyFunction):
</dl>
>> Integrate[1/(x^5 + 11 x + 1), {x, 1, 3}]
= RootSum[41232181 #1 ^ 5 - 212960 #1 ^ 3 - 9680 #1 ^ 2 - 165 #1 - 1&, (Log[3749971 - 3512322106304 #1 ^ 4 + 453522741 #1 + 16326568676 #1 ^ 2 + 79825502416 #1 ^ 3] - 4 Log[5]) #1&] - RootSum[41232181 #1 ^ 5 - 212960 #1 ^ 3 - 9680 #1 ^ 2 - 165 #1 - 1&, (Log[3748721 - 3512322106304 #1 ^ 4 + 453522741 #1 + 16326568676 #1 ^ 2 + 79825502416 #1 ^ 3] - 4 Log[5]) #1&]
= RootSum[-1 - 212960 #1 ^ 3 - 9680 #1 ^ 2 - 165 #1 + 41232181 #1 ^ 5&, (Log[3749971 - 3512322106304 #1 ^ 4 + 453522741 #1 + 16326568676 #1 ^ 2 + 79825502416 #1 ^ 3] - 4 Log[5]) #1&] - RootSum[-1 - 212960 #1 ^ 3 - 9680 #1 ^ 2 - 165 #1 + 41232181 #1 ^ 5&, (Log[3748721 - 3512322106304 #1 ^ 4 + 453522741 #1 + 16326568676 #1 ^ 2 + 79825502416 #1 ^ 3] - 4 Log[5]) #1&]
>> N[%, 50]
= 0.051278805184286949884270940103072421286139857550894
Expand All @@ -1700,7 +1700,7 @@ class RootSum(SympyFunction):
Use Normal to expand RootSum:
>> RootSum[1+#+#^2+#^3+#^4 &, Log[x + #] &]
= RootSum[#1 ^ 4 + #1 ^ 3 + #1 ^ 2 + #1 + 1&, Log[x + #1]&]
= RootSum[1 + #1 ^ 2 + #1 ^ 3 + #1 ^ 4 + #1&, Log[x + #1]&]
>> %//Normal
= Log[-1 / 4 - Sqrt[5] / 4 - I Sqrt[5 / 8 - Sqrt[5] / 8] + x] + Log[-1 / 4 - Sqrt[5] / 4 + I Sqrt[5 / 8 - Sqrt[5] / 8] + x] + Log[-1 / 4 - I Sqrt[5 / 8 + Sqrt[5] / 8] + Sqrt[5] / 4 + x] + Log[-1 / 4 + I Sqrt[5 / 8 + Sqrt[5] / 8] + Sqrt[5] / 4 + x]
"""
Expand Down

0 comments on commit f137b04

Please sign in to comment.