K i ddlmZmZmZddlmZddlmZddlm Z ddl m Z m Z dddZ Gd d eZddd ZGd d eZy))AddArgumentIndexErrorFunction)Pow)S)log)cossinTevaluatecRtt||tj |SNr )rr rOne)xr s _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/codegen/scipy_nodes.py_cosm1rs s1x(155&8 DDc.eZdZdZdZddZdZdZdZy) cosm1z Minus one plus cosine of x, i.e. cos(x) - 1. For use when x is close to zero. Helper class for use with e.g. scipy.special.cosm1 See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.cosm1.html cJ|dk(rt|j St||)@ Returns the first derivative of this function. r)r argsrselfargindexs rfdiffz cosm1.fdiffs) q=O# #$T84 4rc t|SN)r)rrkwargss r_eval_rewrite_as_coszcosm1._eval_rewrite_as_coss ayrcL|jtj|i|Sr)rewriter evalfrrr s r _eval_evalfzcosm1._eval_evalf #&t||C &&777rc |j\}t|jdi|}|t|dk7r|St|SNFr )rrsimplifyr)rr r candidates r_eval_simplifyzcosm1._eval_simplify#sC YY:1:://0 q51 1 8OrNr) __name__ __module__ __qualname____doc__nargsrr!r&r-r*rrrr s" E58rrcTtt|||tj |Sr)rrrr)ryr s r_powm1r6,s s1a(+aeeVh GGrc.eZdZdZdZddZdZdZdZy) powm1z Minus one plus x to the power of y, i.e. x**y - 1. For use when x is close to one or y is close to zero. Helper class for use with e.g. scipy.special.powm1 See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.powm1.html c|dk(rFt|jd|jd|jdz|jdz S|dk(r+t|jdt|jzSt||)rrrr9)rrrrrs rrz powm1.fdiff8sv q=tyy|TYYq\2499Q<? ! L L ]tyy|$S$))_4 4$T84 4rc t||Sr)r6)rrr5r s r_eval_rewrite_as_Powzpowm1._eval_rewrite_as_PowCsa|rcL|jtj|i|Sr)r#rr$r%s rr&zpowm1._eval_evalfFr'rc |j\}}t|jdi||jdi|}|t||dk7r|St||Sr))rr6r+r8)rr rr5r,s rr-zpowm1._eval_simplifyIsZyy1:1:://1Ef1EF q!e4 4 A; rNr.) r/r0r1r2r3rr<r&r-r*rrr8r80s" E 58rr8N)sympy.core.functionrrrsympy.core.powerrsympy.core.singletonr&sympy.functions.elementary.exponentialr(sympy.functions.elementary.trigonometricr r rrr6r8r*rrrDsFAA "6=EH@"HHr