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

ERROR: DomainError with -43.0: log will only return a complex result if called with a complex argument. Try log(Complex(x)). #245

Open
viraltux opened this issue Aug 5, 2021 · 5 comments
Assignees
Labels

Comments

@viraltux
Copy link

viraltux commented Aug 5, 2021

in BenchmarkTools v1.1.1 and v1.1.2 the following benchmark produces an error.

julia> @benchmark for i in 1:100 sin(x[i]) end  setup = (x = rand(100)) evals = 1 samples = 100
BenchmarkTools.Trial: 100 samples with 1 evaluation.
 Range (min … max):  836.000 ns …  10.789 μs  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):       1.006 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):     1.109 μs ± 981.010 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%Error showing value of type BenchmarkTools.Trial:                                          
ERROR: DomainError with -8.0:
log will only return a complex result if called with a complex argument. Try log(Complex(x)).
Stacktrace:
@felix-eku
Copy link

I also encountered this error in a different benchmark, which also used multiple samples.

It is also not hard to find the source of the error:
The code that computes the bins for the histogram of the times assumes that the times are sorted, which is not the case.

@lucifer1004
Copy link

When was this issue introduced into the code base?

@tecosaur
Copy link
Collaborator

When implementing the new display method, I noticed that the times were always sorted. I'm surprised to hear this isn't always the case? I tried running that benchmark and I didn't see any error.

image

@lucifer1004
Copy link

I also ran into this issue, which occurred at times.

@gdalle gdalle added the bug label Jun 13, 2023
@gdalle gdalle added this to the v2.0 milestone Sep 18, 2023
@gdalle
Copy link
Collaborator

gdalle commented Sep 18, 2023

@felix-eku wanna try a quick PR since you spotted the source of the bug?

@gdalle gdalle removed this from the v2.0 milestone Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants