-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Description
For reference: https://stackoverflow.com/questions/73522774/how-to-translate-cschx21-2-to-julia-symbolic-error-domainerror-with
I am adding this as issue just in case it is new.
>julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.8.0 (2022-08-17)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Symbolics
julia> @syms x
(x,)
julia> (-csch(x)^2)^(1//2)
ERROR: DomainError with -1.0:
Exponentiation yielding a complex result requires a complex argument.
Replace x^y with (x+0im)^y, Complex(x)^y, or similar.
Stacktrace:
[1] throw_exp_domainerror(x::Float64)
@ Base.Math ./math.jl:37
[2] ^(x::Float64, y::Float64)
@ Base.Math ./math.jl:1003
[3] ^
@ ./promotion.jl:422 [inlined]
[4] ^
@ ./rational.jl:481 [inlined]
[5] unstable_pow
@ ~/.julia/packages/SymbolicUtils/qulQp/src/types.jl:801 [inlined]
[6] ^(a::SymbolicUtils.Mul{Number, Int64, Dict{Any, Number}, Nothing}, b::Rational{Int64})
@ SymbolicUtils ~/.julia/packages/SymbolicUtils/qulQp/src/types.jl:1047
[7] top-level scope
@ REPL[3]:1
julia>
However this works
julia> sqrt((-csch(x)^2))
sqrt(-(csch(x)^2))
Metadata
Metadata
Assignees
Labels
No labels