Comments (4)
Having symbolic computation on mathematical expressions would certainly by very interesting... The thing is that the question (in general...) seems quite large:
-
do we only need a limited subset of simplifications? Only trigonometric simplifications ? Or a larger class of expressions?
-
what would be the criteria of simplifications ? I guess the "computation cost" of the resulting expression. Or "expression complexity " ? So we would have to characterize that. Is it enough? Do we need to think about other criteria like "calculation precision" (since we are using approximation of numbers when we compute with floats...) ?
-
can we develop something ourself? Or the problem is difficult enough to use an already existing system like for instance: GiNaC (https://www.ginac.de/tutorial/) or Simply (http://docs.sympy.org/latest/index.html) ?
Any insight would be welcome..
from faust.
For my applications, the first criterion for simplification is the lowest computation cost. I guess it associated with the simplest mathematical expression.
In fact, some algorithms never compiles because of too complex expressions and high computation cost. If it compiles it is often very CPU consuming while a lot of terms could be computed with simpler mathematical expressions or are even 0 ('cos(ma.PI/2)', 'sin(ma.PI)', ...).
I have no idea how a symbolic computation system is integrable in Faust and at which point. But as for factorization, the compiler could maybe at least recognize some mathematical identities ..?
About precision, my thought is that symbolic form could help to gain a lot computation cost, especially with trigonometry.
For example with the number 'PI'. If 'cos(ma.PI/2)' gives a true '0' (and not '6.123233995736766e-17' in double precision), it could simplify the output at compilation time, or if use in association with some sliders, it could be associated with the primitives ‘control' or ‘enable’ and save a some computations at execution time.
from faust.
from faust.
Picking up this old issue, I second the idea of more advanced term rewriting for mathematical expressions. The extent to which you can do static optimization is one of the things I really like about functional language compilers and Faust use cases often require optimization of CPU cycles.
One particular thing I needed was the simplification of exp(log(x))
(resp. pow(a, log10(x))
) so I can normalize a frequency parameter given in Hz for va.moogLadder
without having to worry about precision loss and unnecessary calculations. But I can imagine other use cases that would benefit from this.
from faust.
Related Issues (20)
- Rust's F{32,64}::rem_euclid behaves differently from C/C++ remainder HOT 4
- Rust allocation HOT 2
- Need libfaust distribution for linux aarch64 HOT 5
- bagpipes model HOT 1
- Issue with process = (1.0 + ma.EPSILON/2.0) > 1.0 HOT 7
- Missing 'bitwise not' in the language HOT 1
- Creation of Windows LV2 bundles?
- basic Interpreter test failing for make libsall option HOT 4
- How to set the path to Faust libraries programmatically? HOT 8
- Current version of rtaudio doesn't use exceptions (fix included) HOT 6
- libfaustwithllvm.a has bogus symbols on arm64 HOT 1
- mesh2faust failing to build on Ubuntu 22.04 (Win 11 WSL) HOT 6
- Interpreter: Bad performance for this instrument HOT 7
- faust2lv2: -gui not working
- Compiler crash when slider name is a keyword. HOT 1
- Mesh2faust error with material density higher than 4019
- (IMPORTANT) need help bypassing an error HOT 2
- Compilation assertion failure using waveform primitive with LLVM HOT 1
- Generated synth LV2 plugin crashes very often on Windows HOT 3
- Rust backend does not support -double. 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 faust.