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)
- Julia REPL should show environment name inline
- `BoundsError` in type inference when abstract-evaluating OpaqueClosure HOT 1
- We should have no throw `setindex!` for existing indices. HOT 2
- whether `Core.checked_dims` decides to throw depends on dimension order (for empty arrays) HOT 2
- colonful `reshape` may spuriously throw `DivideError`
- GC and multithreading. Strange behaviour. HOT 3
- Update main entry-point docs to use lowercase `args` HOT 2
- Segmentation fault with Distributed when --threads is set HOT 2
- Julia is incorrectly passing arguments to C on Apple M1 HOT 11
- Strange code generation with `unsafe_trunc` and dynamic dispatch HOT 15
- Segfault during push!() if using a large struct in 1.10 due to elsize overflow HOT 7
- segfault in `jl_datatype_layout` while constructing `Memory` HOT 5
- Slow/delays in REPL upon start HOT 3
- Creating struct instances is slow when another inner constructor returns `undef` fields HOT 4
- Possible bug when constructing a string from an array of characters HOT 4
- Too long stack traces at the REPL shell mode HOT 1
- 'make test' fails for julia-1.11.0-beta1 HOT 6
- Identical calls to getindex not optimised out HOT 6
- 20x slowdown when using `Int32` instead of `Int16` HOT 2
- Segfault during `eval` HOT 6
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.