�
��g`T � �� � d dl mZmZmZmZmZ d dlmZmZm Z d dl
mZ d dlm
Z
d dlmZmZmZ d dlmZmZ d� Zdefd �Zd
� Zd� Zdd
�Zd� Z G d� de� � Zd� Zd� Zdd�Z d� Z!d� Z"d� Z#d� Z$d� Z%dS )� )�Add�Expr�Mul�S�sympify)�_mexpand� count_ops�
expand_mul)�default_sort_key)�Dummy)�root�sign�sqrt)�Poly�PolynomialErrorc �h � | j o+| j j ot | j � � t j u S )z/Return True if expr is a sqrt, otherwise False.)�is_Pow�exp�is_Rational�absr �Half)�exprs �i/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/simplify/sqrtdenest.py�is_sqrtr s* � � �;�K�4�8�/�K�C���M�M�Q�V�4K�K� �returnc �� � | t j u rdS | j rdS | j s| j rt d� | j D � � � � S t | � � rt | j � � dz S dS )a� Return the maximum depth of any square root argument of p.
>>> from sympy.functions.elementary.miscellaneous import sqrt
>>> from sympy.simplify.sqrtdenest import sqrt_depth
Neither of these square roots contains any other square roots
so the depth is 1:
>>> sqrt_depth(1 + sqrt(2)*(1 + sqrt(3)))
1
The sqrt(3) is contained within a square root so the depth is
2:
>>> sqrt_depth(1 + sqrt(2)*sqrt(1 + sqrt(3)))
2
� r c 3 �4 K � | ]}t |� � V � �d S �N��
sqrt_depth��.0�xs r � <genexpr>zsqrt_depth.<locals>.<genexpr>&