-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
Current coverage is 76.29% (diff: 94.42%)@@ master #11 diff @@
==========================================
Files 5 13 +8
Lines 137 675 +538
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 136 515 +379
- Misses 1 160 +159
Partials 0 0
|
end | ||
|
||
@inline function ldexpk(x::Float64, q::Int32) | ||
m = q >> 31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be consistent about 4-space indent
|
||
@inline long_bits_to_double(i::Int64) = reinterpret(Float64, i) | ||
|
||
@inline xfabs(x::Float64) = long_bits_to_double((0x7fffffffffffffff % Int64) & double_to_raw_long_bits(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just call abs
.
Hi simon do you any chance know why ci are failing due to merge conflicts? What should I do in order to get them online for this PR ? |
The way I like to do it is, from the command line, enter git checkout master
git fetch origin # or something else if you've renamed that remote
git rebase origin/master
git checkout sleef_port
git merge master Git will then tell you that there are conflicts. You can see the affected files with |
# todo define methods and remove many of the function below to use multiple dispatch | ||
|
||
immutable Double2 | ||
x::Float64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines should be indented. We could alternatively opt to use @simonbyrne's DoubleDouble.jl here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably don't want to add it as a dependency, but feel free to copy what you need.
Don't do merge commits. Do |
You mean like this?
|
@test xexp(-746.0) == 0 | ||
|
||
x = linspace(708.4, 709.7, 25) | ||
@test_approx_eq xexp.(x) exp.(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally up to you but what I would do personally is format it as
let x = linspace(708.4, 709.7, 25)
@test xexp.(x) ≈ exp.(x)
end
That has the benefit of scoping x
so you aren't overwriting it for each test, though it doesn't really matter much. Just a stylistic preference.
That said, we really should be using ≈
, as Base has switched away from @test_approx_eq
in favor of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the docs and it said test_approx_eq is more stringent than ≈ and takes care of NaN ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either that's out of date or I'm wrong. @StefanKarpinski lead the effort to switch things to ≈
, perhaps he can shed some light here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to ping Stefan it's right here:
http://docs.julialang.org/en/latest/stdlib/test/#other-test-macros
unless it's out of date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source code appears to claim @test_approx_eq
to be "legacy," which is why I wanted Stefan's input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok sry, thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would use ≈
.
All double prec function ported save for the intrinsics xsqrt. |
@musm It looks like for |
Thought I'd share some updated benchmarks with the latest changes. rc3 cos benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 1.3135594321329447
gctime: 1.5830813905345738
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
cosh benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 2.2493910857587225
gctime: 0.6999963120536651
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
exp benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 2.9266741183149736
gctime: 1.0
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
exp10 benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 0.9258054341064738
gctime: 0.9624319929064326
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
exp2 benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 6.573427765751141
gctime: 0.9991216268804411
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
expm1 benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 3.8094151963966514
gctime: 1.0
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
log benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 1.3722646085919237
gctime: 1.0
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
log10 benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 3.6302685517850004
gctime: 0.0
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
log1p benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 5.2261049368600885
gctime: 0.8391970470358386
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
sin benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 1.2597544538971075
gctime: 1.38391252849377
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
sinh benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 1.8508245490268889
gctime: 0.6654004161239986
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
tan benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 1.2930481323477898
gctime: 0.6552033724744087
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00%
tanh benchmark
median ratio Libm/Base
BenchmarkTools.TrialRatio:
time: 1.5733616334334983
gctime: 0.20365685183206117
memory: 1.0
allocs: 1.0
time tolerance: 5.00%
memory tolerance: 1.00% updated 8/24 |
Are these ones noted? Sometimes these are intentional to play tricks with floating point precision |
good point, I've noted them in the source it's only the atan2k helper function which is called by xatan2 xasin and xacos and aso xatan which do not use mla |
@@ -8,6 +8,9 @@ export xatan2, xasin, xacos, xatan, xsin, xcos, xsincos, xtan, xpow, xsinh, xcos | |||
# higher accuracy functions | |||
export xatan2_u1, xasin_u1, xacos_u1, xatan_u1, xsin_u1, xcos_u1, xsincos_u1, xtan_u1, xcbrt_u1, xlog_u1 | |||
|
|||
# alias for supported floating point types | |||
typealias FTypes Union{Float32,Float64} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just use LinAlg.BlasReal
, it's the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it's better to leave as is since this package doesn't deal with Blas and for clarity.
Well that was painful, but now it's done. I'd also like to modify some of the commit messages that have already been committed to this repo? @ararslan , can that be done from my fork or do I have to clone this upstream to do that. |
That's a much nicer history, thanks! Anything that has already been merged would require rebasing and force pushing over master, or I suppose you could start a new branch with revised history and either replace or merge it into master. Usually force pushing over master is a no-no on anything anyone else has cloned, since this package hasn't been registered yet maybe it would be acceptable. Or you could annotate any existing commits with explanatory commit comments on github, which would be at least trackable in the future. |
I see, I'll open another PR once I merge this bad boy, just waiting for the green light! |
Thanks for your great work here, @musm! |
big thanks to @shibatch @alyst @simonbyrne |
sleef port to Julia
Done
Before merging
Todos