Skip to main content
33 votes
Accepted

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

Although LAPACK has some incredibly optimized code, it can still be worth it to write your own version in a few cases. The most important reason (and the reason they make you do it in your course). ...
Thijs Steel's user avatar
  • 1,723
11 votes
Accepted

Arbitrary Precision Optimization Libraries?

Optim.jl from Julia will work with the number types that you give it, so if you make it use BigFloats then it'll do that. Local derivative based, derivative-free, global, and integrates with automatic ...
Chris Rackauckas's user avatar
10 votes

How to properly calculate CPU and GPU FLOPS performance?

You can calculate GFLOP rates this way, but the numbers are pretty meaningless on today's hardware: Floating point operations require a variable number of clock cycles. An addition is generally ...
Wolfgang Bangerth's user avatar
9 votes

Fast, lightweight C++ tensor library for dimension-agnostic code

FTensor is a lightweight, header only, fully templated library that includes ergonomic summation notation. It has been tested extensively in 2, 3, and 4 dimensions, but should work fine for any ...
Damascus Steel's user avatar
8 votes
Accepted

Getting to know about various BLAS implementations

I'm the primary author of many Julia libraries geared toward "architecture-specific optimizations", including LoopVectorization.jl and Octavian.jl. For BLAS-like operations, one of the most ...
Chris Elrod's user avatar
8 votes

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

@ThiysSteel covers a lot, here is another perspective I find important: Even if you have available excellent implementations of any algorithm you might need, you still need to understand some of the ...
Simon's user avatar
  • 181
7 votes

Arbitrary Precision Optimization Libraries?

Chris code doesn't work on my machine, so here is my solution. ...
urojony's user avatar
  • 71
7 votes

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

To clarify @ThiysSteel's good answer: The point is not to attempt to surpass the optimization of code written by very experienced people, who'd wrangled with it for decades. The point is to acquaint ...
paul garrett's user avatar
7 votes

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

I used to try to optimize code via using assembly language (as opposed to C). I had some clear success, where a real-time microphone array worked with assembly language, but it would not work at all ...
JosephDoggie's user avatar
6 votes

Looking for Runge-Kutta 8th order in C/C++

summarizing some points: If it's a long-term integration of a non-dissapative model, a symplectic integrator is what you're looking for. Otherwise, since it's an equation of motion, Runge-Kutta ...
Chris Rackauckas's user avatar
6 votes

Fast, lightweight C++ tensor library for dimension-agnostic code

XTensor is a modern approach and is getting more and more popular. https://github.com/QuantStack/xtensor
Jingpeng Wu's user avatar
6 votes

Fast, lightweight C++ tensor library for dimension-agnostic code

I think this new taco lib is really good too. The Tensor Algebra Compiler (taco) is a C++ library that computes tensor algebra expressions on sparse and dense ...
Dhi Aurrahman's user avatar
6 votes
Accepted

Using GSL for basic operations

Of course it makes sense to use the GSL (or another library for that matter) for several reasons: Don't reinvent the wheel. The work has been done, you can spend your time on more useful things. If ...
GertVdE's user avatar
  • 6,159
6 votes

I've developed a derivative-free optimization method, looking for comments

I would like to hear comments from users that have some practical models (e.g. black-box hyperparameter optimization) which are still needed to be solved acceptably - whether this method works or not ...
GoHokies's user avatar
  • 2,216
6 votes

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

This might be tangent but i feel it worth adding. A common way for user code to beat libraries is to exploit structure the libraries are not aware of. Block diagonal matrices are easier to work in ...
worldsmithhelper's user avatar
6 votes

Solve a large-scale linear system of equations with millions of unknowns

You're going to need a large cluster or a supercomputer to solve this. Memory usage is like arc_lupus commented, a double-precision float takes 8 bytes and there will be 1e-6^2 entries. We store just ...
Neil Lindquist's user avatar
5 votes
Accepted

Does the IEEE-754 standard mandate that exp2 is rounded correctly?

According to [1]: "However, the IEEE-754 standard specifies nothing for elementary functions" and "Indeed, the mathematical libraries (libm) provided by operating systems do not guarantee correct ...
Ondřej Čertík's user avatar
5 votes

Profiling scientific computing codes on MacOS

One way to approach this would be to record the performance information on your machine (compile with -pg (gprof) compiler option), run your program like you normally would, and write that data to a ...
MPIchael's user avatar
  • 2,985
4 votes
Accepted

New releases of libraries

Lets assume typical versioning semantic as a.b.c, in that case: a - MAJOR version, where incompatibilities and API changes can occur, b - MINOR version, where new functionality can be added but in a ...
Krzysztof Bzowski's user avatar
4 votes
Accepted

C or fortran library to solve linear 2D/3D elliptic PDE

Most of the widely used finite element libraries are written in C++. If all you really care for -- and if all you will ever care for -- is solving an elliptic PDE on a rectangle, then it's probably ...
Wolfgang Bangerth's user avatar
4 votes

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

The point of learning how to write "the QR iteration algorithm" is not because eig will be slower. It is because "the QR iteration algorithm" ...
Yakk - Adam Nevraumont's user avatar
3 votes
Accepted

Performing 2d numerical integration with Boost Cpp

The reason you didn't find 2D quadrature is that we haven't implemented it yet. As to your compilation failure, this does the trick: ...
user14717's user avatar
  • 2,155
3 votes

Software that does naïve or formal simplification of mathematical expressions

What you are looking for is a Computer Algebra System. You should be able to do that in Mathematica, Maple, Maxima or SymPy. Particularly, I show an example in SymPy below. ...
nicoguaro's user avatar
  • 8,524
3 votes

Solve a very large linear system (question about a library linear algebra to do this)

LSQR uses only 4 N-vectors of MEMORY. It might be your choice if storage must be minimized. It is fairly good otherwise, too, but probably not the best one (unless your matrix is non-square; then the ...
Convexity's user avatar
  • 161
3 votes

Looking for Runge-Kutta 8th order in C/C++

I would like to add that while what Geoff Oxberry suggests for long-term integration (using symplectic integrators) is true, in some cases it won't work. More specifically, if you have dissipative ...
viiv's user avatar
  • 45
3 votes

Getting to know about various BLAS implementations

Abdullah, thank you for the plug for our materials. We have repackaged these as a Massive Open Online Course (MOOC) on edX titled "LAFF-On Programming for High Performance". It is free for ...
Robert van de Geijn's user avatar
3 votes

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

In some special cases it may be if you have a special case application that's very different for where the libraries are intended. I have written an optimization application that needs to do 80 ...
juhist's user avatar
  • 151
3 votes
Accepted

How to solve the following SDP with Python?

Edit: I looked at the paper you linked in the comment. I'm no expert in quantum computing, but it seems like a hot mess. The notation is certainly not clear to me, but if you can clear it up then I'll ...
Robert Bassett's user avatar
3 votes

AMR framework for efficient simulation of PDEs, potentially with boundary layers

Let me preface by saying you may have set on a path more adventurous than you had hoped... Mesh generation itself is often a bottleneck, let alone rigorous 4D adaptation of complex geometries powered ...
Sardine's user avatar
  • 378

Only top scored, non community-wiki answers of a minimum length are eligible