diff options
| author | zitian-gao <zitian.gao@outlook.com> | 2025-05-27 16:45:31 +0800 |
|---|---|---|
| committer | zitian-gao <zitian.gao@outlook.com> | 2025-05-27 16:45:31 +0800 |
| commit | 7c792461c8e4e4f1f8734fed143630c74e76b27f (patch) | |
| tree | cf6341ff9f2727424751da7a11a3bea6c39015bb /Qwen2.5-Eval/evaluation/latex2sympy/sandbox/sectan.py | |
| parent | 16815c8c5ec263c4bd1a0af60030c1c0efa1421e (diff) | |
init eval
Diffstat (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/sandbox/sectan.py')
| -rwxr-xr-x | Qwen2.5-Eval/evaluation/latex2sympy/sandbox/sectan.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/sandbox/sectan.py b/Qwen2.5-Eval/evaluation/latex2sympy/sandbox/sectan.py new file mode 100755 index 0000000..0e0c7aa --- /dev/null +++ b/Qwen2.5-Eval/evaluation/latex2sympy/sandbox/sectan.py @@ -0,0 +1,51 @@ +from sympy import * +import sys +sys.path.append("..") + +# # x^2\cdot \left(3\cdot \tan \left([!a!]\cdot x+[!c!]\right)+[!a!]\cdot x\left(\sec \left([!a!]\cdot x+[!c!]\right)\right)^2\right) +# latex1 = "x^2\\cdot \\left(3\\cdot \\tan \\left(2\\cdot x+5\\right)+2\\cdot x\\left(\\sec \\left(2\\cdot x+5\\right)\\right)^2\\right)" +# math1 = process_sympy(latex1) +# print("latex: %s to math: %s" %(latex1,math1)) +# +# latex2 = "x^2\\cdot \\left(3\\cdot \\tan \\left(2\\cdot x+5\\right)+2\\cdot x\\left(\\sec \\left(2\\cdot x+5\\right)^2\\right)\\right)" +# math2 = process_sympy(latex2) +# print("latex: %s to math: %s" %(latex2,math2)) +# +# latex3 = "x^2\\cdot \\left(3\\cdot \\tan \\left(2\\cdot x+5\\right)+2\\cdot x\\left(1+\\tan \\left(2\\cdot x+5\\right)^2\\right)\\right)" +# math3 = process_sympy(latex3) +# print("latex: %s to math: %s" %(latex3,math3)) +# +# print(simplify(math1 - math2)) +# print(simplify(math1 - math3)) + +# +# latex1 = "\\sec^2(2\\cdot x+5)" +# math1 = process_sympy(latex1) +# print("latex: %s to math: %s" %(latex1,math1)) +# +# latex2 = "1+\\tan^2(2\\cdot x+5)" +# math2 = process_sympy(latex2) +# print("latex: %s to math: %s" %(latex2,math2)) +# print(simplify(math1 - math2)) + + +x = Symbol('x', real=True) +y = Symbol('y', real=True) + +# BUG: 1 + tan^2(x+1) should be == sec^2(x+1) but isnt +lhs = (1 + (tan(x + 1))**2) +rhs = (sec(x + 1))**2 +eq = lhs - rhs +print(simplify(lhs)) +print(simplify(rhs)) +print(simplify(eq)) +print(simplify(lhs) == simplify(rhs)) + +# 1 + tan^2(x) == sec^2(x) but isnt +lhs = (1 + (tan(x))**2) +rhs = (sec(x))**2 +eq = lhs - rhs +print(simplify(lhs)) +print(simplify(rhs)) +print(simplify(eq)) +print(simplify(lhs) == simplify(rhs)) |
