�
��g � � � d dl mZ d dlmZmZmZ d dlmZ d dlm Z m
Z
mZmZm
Z
d dlmZmZ d dlmZmZ d dlmZmZ d� Zd d
d�d�Zd
S )� )�combinations_with_replacement)�symbols�Add�Dummy)�Rational)�cancel�ComputationFailed�parallel_poly_from_expr�reduced�Poly)�Monomial�monomial_div)�DomainError�PolificationFailed)�debug�debugfc �� � t | � � � � � \ }} t ||gdd�� � \ }}n# t $ r ||z cY S w xY wt |� t ||z � � z S )z�
Put an expression over a common denominator, cancel and reduce.
Examples
========
>>> from sympy import ratsimp
>>> from sympy.abc import x, y
>>> ratsimp(1/x + 1/y)
(x + y)/(x*y)
TF)�field�expand)r �as_numer_denomr r r )�expr�f�g�Q�rs �f/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/simplify/ratsimp.py�ratsimpr s� � � �$�<�<�&�&�(�(�D�A�q���q�1�#�T�%�8�8�8���1�1��� � � ���s�
�
�
����� ��7�V�A�a�C�[�[� � s �>