← All challenges
easysympy/sympy · v1.1

Latex printer does not support full inverse trig function names for acsc and asec

Try this bug with AI

Fix it in the original repo with an AI agent and get feedback on how you worked.

2 free rounds each week

Round mode
  • Time limit60 min
  • Token budgetup to 1M
  • Worth up to135 XP
Sign up or sign in to start

Read the sample report

From a simulated Django round

You changed code before reproducing the bug.

Run the failing test before the first edit, so you know the failure you are fixing and can tell when it is gone.

Problem statement

For example
latex(asin(x), inv_trig_style="full") works as expected returning '\\arcsin{\\left (x \\right )}'
But latex(acsc(x), inv_trig_style="full") gives '\\operatorname{acsc}{\\left (x \\right )}' instead of '\\operatorname{arccsc}{\\left (x \\right )}'

A fix seems to be to change line 743 of sympy/printing/latex.py from
inv_trig_table = ["asin", "acos", "atan", "acot"] to
inv_trig_table = ["asin", "acos", "atan", "acsc", "asec", "acot"]

The environment starts at commit 8fc63c2d7175 (sympy/sympy 1.1), dependencies installed and tests runnable from the first minute. You are graded by hidden tests taken from the fix that was actually merged upstream.