@@ -138,26 +138,38 @@ function generate_homotopy2(eq, x)
138138 h₂ = substitute_x (h₂, x, sub)
139139
140140 H = sum ((Differential (x)^ i)(h₂) for i= 1 : d- 1 ; init= (1 + h₂))
141- I = expand (expand_derivatives ((1 + h₁) * H))
141+ I = expand (expand_derivatives ((1 + h₁) * H))
142+ # H = sum((Differential(x)^i)(h₁*h₂) for i=1:d-1; init=(h₁ + h₂ + h₁*h₂))
143+ # I = expand(expand_derivatives(H))
142144 enqueue_expr_ex! (S, I, x)
143145 end
144146
145- # H = sum((Differential(x)^i)(eq) for i=1:deg-1; init=eq)
146- # I = expand((1+x) * expand_derivatives(H))
147- # enqueue_expr_ex!(S, I, x)
148-
149- # return [one(x); [s for s in S]]
150147 return [one (x); [s for s in S]]
151148end
152149
153150# #############################################################################
154151
155152∂ (x) = expand_derivatives (Differential (𝑥)(x))
153+ cabs (x) = sqrt (x * conj (x))
156154
157155H_rules = [
158156 # @rule 𝛷(+(~~xs)) => sum(map(𝛷, ~~xs))
159157 # @rule 𝛷(*(~~xs)) => prod(map(𝛷, ~~xs))
160158
159+ @rule 𝛷 (^ (sin (~ x), ~ k:: is_neg )) => 𝛷 (^ (csc (~ x), - ~ k))
160+ @rule 𝛷 (^ (cos (~ x), ~ k:: is_neg )) => 𝛷 (^ (sec (~ x), - ~ k))
161+ @rule 𝛷 (^ (tan (~ x), ~ k:: is_neg )) => 𝛷 (^ (cot (~ x), - ~ k))
162+ @rule 𝛷 (^ (csc (~ x), ~ k:: is_neg )) => 𝛷 (^ (sin (~ x), - ~ k))
163+ @rule 𝛷 (^ (sec (~ x), ~ k:: is_neg )) => 𝛷 (^ (cos (~ x), - ~ k))
164+ @rule 𝛷 (^ (cot (~ x), ~ k:: is_neg )) => 𝛷 (^ (tan (~ x), - ~ k))
165+
166+ @rule 𝛷 (^ (sinh (~ x), ~ k:: is_neg )) => 𝛷 (^ (csch (~ x), - ~ k))
167+ @rule 𝛷 (^ (cosh (~ x), ~ k:: is_neg )) => 𝛷 (^ (sech (~ x), - ~ k))
168+ @rule 𝛷 (^ (tanh (~ x), ~ k:: is_neg )) => 𝛷 (^ (coth (~ x), - ~ k))
169+ @rule 𝛷 (^ (csch (~ x), ~ k:: is_neg )) => 𝛷 (^ (sinh (~ x), - ~ k))
170+ @rule 𝛷 (^ (sech (~ x), ~ k:: is_neg )) => 𝛷 (^ (cosh (~ x), - ~ k))
171+ @rule 𝛷 (^ (coth (~ x), ~ k:: is_neg )) => 𝛷 (^ (tanh (~ x), - ~ k))
172+
161173 @rule 𝛷 (sin (~ x)) => cos (~ x) * ∂ (~ x)^- 1
162174 @rule 𝛷 (cos (~ x)) => sin (~ x) * ∂ (~ x)^- 1
163175 @rule 𝛷 (tan (~ x)) => log (cos (~ x)) * ∂ (~ x)^- 1
@@ -175,8 +187,8 @@ H_rules = [
175187 @rule 𝛷 (asin (~ x)) => (~ x* asin (~ x) + sqrt (1 - ~ x* ~ x)) * ∂ (~ x)^- 1
176188 @rule 𝛷 (acos (~ x)) => (~ x* acos (~ x) + sqrt (1 - ~ x* ~ x)) * ∂ (~ x)^- 1
177189 @rule 𝛷 (atan (~ x)) => (~ x* atan (~ x) + log (~ x* ~ x + 1 )) * ∂ (~ x)^- 1
178- @rule 𝛷 (acsc (~ x)) => acsc (~ x) * ∂ (~ x)^- 1
179- @rule 𝛷 (asec (~ x)) => asec (~ x) * ∂ (~ x)^- 1
190+ @rule 𝛷 (acsc (~ x)) => ( ~ x * acsc (~ x) + acosh ( cabs ( ~ x)) ) * ∂ (~ x)^- 1
191+ @rule 𝛷 (asec (~ x)) => ( ~ x * asec (~ x) + acosh ( cabs ( ~ x)) ) * ∂ (~ x)^- 1
180192 @rule 𝛷 (acot (~ x)) => (~ x* acot (~ x) + log (~ x* ~ x + 1 )) * ∂ (~ x)^- 1
181193
182194 @rule 𝛷 (asinh (~ x)) => (~ x* asinh (~ x) + sqrt (~ x* ~ x + 1 )) * ∂ (~ x)^- 1
0 commit comments