Comments (12)
Are there implementations available for those five functions? IIRC you said they were all rounding functions. Maybe LLVM has trustworthy intrinsics for those operations — rounding is pretty unambiguous.
from julia.
No, LLVM does not have those as intrinsics, and as far as I can tell the intrinsics LLVM does have just call libm.
We can get implementations from BSD.
from julia.
Oh, llvm-config has us linking with -lm, so we won't be able to remove it. Not a big deal.
from julia.
Those two fixed, but we are also missing tgamma.
from julia.
tgamma is called gamma — I added it the other day. We can make tgamma be an alias, but that seems like a historical accident due to a mistake that it would be fairly silly to inherit from C.
from julia.
Sure, it's called gamma in julia, but what we're missing is the actual implementation of tgamma in fdlibm:
julia> gamma(2)
dlsym: /home/jeff/src/julia2/julia/lib/libfdm.so: undefined symbol: tgamma
from julia.
That's weird. Mine work — I tested them before making that commit:
julia> gamma(4.5)
11.6317283965674498
julia> gamma(float32(4.5))
11.63172817
from julia.
It must be finding the symbol from libm somehow. grep tgamma *
in fdlibm/ is empty. Maybe try ldd and nm on libfdm.dylib.
from julia.
Ah, yeah, that's really strange. This would be found if we could force LLVM not to link against libm
since then there would be no tgamma
at all to link to.
My understanding is that gamma
is deprecated in favor of tgamma
because historically, on some systems gamma
was the log-gamma function whereas on other systems it was just the gamma function. The only way to guarantee that the implementation and the intended usage were in agreement was to deprecate gamma
and have tgamma
replace it as unambiguously meaning the non-log gamma function.
So as long as the fdlibm
we include has a gamma function that means tgamma
, we can just use its gamma function. But given the mislinking above, I'm a little afraid to do that. If we can get rid of the -lm
under llvm-config, that would work. Alternatively, we can just fork fdlibm's code and rename gamma
to tgamma
everywhere.
from julia.
Let me know if 9d1009f fixes this for you, Jeff. I can't test since it was already working for me.
from julia.
Stefan, that commit is shameful. You didn't even look at the code. fdlibm uses the old naming convention where "gamma" means log-gamma. Its "gamma" just calls lgamma.
from julia.
Ugh. Sorry. That is really embarrassing. I was somehow still linking against the libm version, so I was getting apparently correct results. I'll endeavor to find a working tgamma implementation to plug in here...
from julia.
Related Issues (20)
- pivoted cholesky(I(2)) not implemented
- Bounds check inconsistency in `keepat!`/`deleteat!`
- Unreachable reached and Illegal Instruction in v1.10+ HOT 4
- `in(::Missing, ::Any)` inconsistency
- Overallocation of arrays now seems to persist through precompile serialization on 1.11+ HOT 7
- type application doesn't infer as consistent HOT 1
- Can't compute eigenvalues of Hermitian Diagonal matrix for generic types
- Heap snapshot does not seem to work anymore on 1.11 (in chrome profile loader) HOT 3
- `@inbounds` overrides `val` variable in macros. Wrong usage of `local` HOT 4
- Unwrapped Union Alls can't be added more than two times to a vector with [] syntax. Reproducible crash when using these vectors. HOT 1
- Basic use of StaticArrays and `begin ... end` leads to GC error (probable corruption) HOT 6
- New `copystring` function HOT 13
- make `Base.@assume_effects :nothrow` mark throwing expressions as `unreachable` HOT 4
- Some uses of `@__DIR__` should be relocatable. HOT 4
- asr versus lsr HOT 1
- With the memory changes the UB surface of String(Vector{UInt8}) is larger HOT 1
- Views on arrays should become views on a slice of the Memory that was accssible at view construction HOT 1
- a compiler flag to ignore all uses of `@assume_effects`?
- Race Condition: `Test.@test_logs` is not thread safe. HOT 1
- Installation of DiffEqBase fails when not connected to power HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.