Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider renaming realpart to value or primalpart or similar #81

Open
jwscook opened this issue Mar 6, 2021 · 0 comments
Open

Consider renaming realpart to value or primalpart or similar #81

jwscook opened this issue Mar 6, 2021 · 0 comments

Comments

@jwscook
Copy link
Contributor

jwscook commented Mar 6, 2021

This package works a treat for evaluating the derivative functions at complex locations:

julia> using DualNumbers

julia> f(x) = (1, -2 *x) .* exp(-x^2) # value and derivative
f (generic function with 1 method)

julia> z = 1.0 + im # some complex location to evaluate the derivative
1.0 + 1.0im

julia> f(z)
(-0.4161468365471424 - 0.9092974268256817im, -0.9863011805570786 + 2.650888526745648im)

julia> realpart(f(Dual(z, 1))[1])
-0.4161468365471424 - 0.9092974268256817im

julia> dualpart(f(Dual(z, 1))[1])
-0.9863011805570786 + 2.650888526745648im

In this instance, realpart returns a complex value, which is a little misleading. @goretkin suggested in Slack that primalpart could be a better adjective. Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant