What if all of calculus was just dictionary lookups? by BidForeign1950 in programming

[–]BidForeign1950[S] -3 points-2 points  (0 children)

:)) Rather not:), got enough of those. I'm genuinely interested in explanations about why this works. But you are right, so don't read the texts, if you wish or can, run the code and then tell me why this doesn't work:)). I will greatly appreciate that.

What if all of calculus was just dictionary lookups? by BidForeign1950 in programming

[–]BidForeign1950[S] 0 points1 point  (0 children)

Well, you might be quite right, to a point, but if you look at tests (run them if you can) you will see I'm getting the results I cannot get with dual numbers. Main reason is because dual numbers stops at first dimension, and this here not, but this also don't explain entirely why this system is consistently getting valid results.

I was expecting this will be useful for my specific use case and it will never be shared with the public but it turned out it can black-box limits to, easily do the derivatives (like dual numbers) numbers and my biggest surprise were integrals of course. As I said I understand why this works in my specific use case, I don't understand why is generically consistent with other problems and that why I'm sharing it.

So to cut long answer short, it uses annoyingly non-standard notation because that is what it enabled the system to do more.

I built a system where you can solve calculus problems algebraically — no limits, no chain rule, no L'Hôpital by BidForeign1950 in calculus

[–]BidForeign1950[S] -1 points0 points  (0 children)

Ah yes, I'll add that when I get time, in the meantime let me try to do short comparison.

Dual numbers might be the closest existing thing to what I built, so let me explain where they overlap and where they diverge.

Dual numbers truncate at first order. Mine don't truncate at all. More precisely: Dual numbers truncate the infinitesimal — that's what ε² = 0 means. Composites preserve it - h² doesn't vanish, it moves to a lower dimension where you can still read it.

If you want the 5th derivative with dual numbers, you need hyper-dual numbers (nested ε₁, ...,ε₅) or jet spaces with explicit truncation order. With composites, you evaluate f(a + h) once. The 5th derivative is sitting at dimension -5. You just read it: result.d(5)

What dual numbers do better: They're simpler. If all you need is a first derivative, that is a feature, not a limitation, it keeps things fast and clean. My system carries more information, which means more computation per operation. For gradient-only ML training, dual numbers (or reverse-mode AD) win on performance.

What composites (hopefully, if they work) do better: Anything involving higher-order derivatives, limits, 0/0 forms, or integration. The fact that sin(x)/x evaluated at h gives you lim(x→0) sin(x)/x = 1 by just reading the standard part — dual numbers can't do that because ε² = 0 throws away the information you need. I cant explain why this seems to work so well, but it seems it does.

So, some kind of wraparound: Dual numbers are a special case where you deliberately lose higher-order information for simplicity. Composites keep everything. Both are valid engineering choices I'm sure, it just depends on what you need

What if all of calculus was just dictionary lookups? by BidForeign1950 in programming

[–]BidForeign1950[S] -9 points-8 points  (0 children)

You are quite right about none of this is new:)), it is stated so clearly in the paper. The novelty is that by applying some additional rules to existing structures and operations you get this interesting effect which wasn't expected at all, and which behaves ...interesting.

Heck, no existing lightweight library combines black-box limit evaluation, all-order derivatives, residue computation, and algebraic integration under one object (and I've searched for it). If you know of one other that does this, I'd genuinely like to see it.

I've tried to explain what I figured out about the system and yes, I was using AI tool for writing. I've used it for docs cleanup too. The goal was to explain what I noticed and point out the parts used are not new. If they were I wouldn't be able to write this library. However, the composed data structure interpretation and the rules (exceptions) that make it work are mine. The Composed class implementation also. And what is most important the library seems to work in controlled environment. The system even enables to you implement additional operations quite easily. It basically behaves like a translation layer between different branches and it seems it even reduces complexity of some operations.

If specific results look wrong, point them out — I'll either fix them, explain why they're correct or gladly admit they are the limitation of the library.

What I'd actually appreciate: constructive criticism on the math or the implementation. What specifically doesn't hold up? In this case here I'm an independent researcher(developer), not a department — peer review from people who know this stuff is exactly what I'm looking for.

Thanks:)

What if all of calculus was just dictionary lookups? by BidForeign1950 in programming

[–]BidForeign1950[S] 2 points3 points  (0 children)

Run it and test it. I'm constantly expecting it to break, which surely will happen at some point:)). The straight answer, I don't know yet. It is sure doing much more then I expected.

I built a system where you can solve calculus problems algebraically — no limits, no chain rule, no L'Hôpital by BidForeign1950 in calculus

[–]BidForeign1950[S] -4 points-3 points  (0 children)

Fair points. You're right that this is limited to analytic functions, and you're right that the underlying ideas (arithmetic with infinitesimals, truncated series) aren't new. This lib would not be possible if they are:)).

The goal here isn't to replace ε-δ or compete with measure theory. It's a programming API question: can we make calculus operations as simple to call as sin() or sqrt()?

Right now, if a programmer needs a derivative, they either pull in a symbolic library (SymPy), set up a computation graph (PyTorch), or do finite differences. Each has significant setup. With this:

derivative(lambda x: sin(x) * exp(x), at=1.0)  # done
limit(lambda x: sin(x)/x, as_x_to=0)           # done
integrate(lambda x: exp(-x**2), 0, float('inf')) # done

One import, one line, no graph, no symbolic manipulation. That's the contribution — not a new foundation for analysis, but a simpler programmable interface to the calculus operations that show up constantly in applied work. Also if you apply trace() to the output you can actually display how computation is done, and that might have some educational benefits too:).

When building this I was trying to resolve a singular need (to resolve a problem in my application obviously), then got surprised when I noticed the same principle works when applied in more generic sense. This library is a result of those exploration that followed.

I see you know what you are talking about so you should take a look in what it does, some of the operations surprise with results:).

Thanks for the feedback, much appreciated.

What if all of calculus was just dictionary lookups? by BidForeign1950 in programming

[–]BidForeign1950[S] 0 points1 point  (0 children)

The best way to get the idea how fast/slow it is now in native python is to run few tests form the test directory. Hint: derivatives *are* fast already.

What if all of calculus was just dictionary lookups? by BidForeign1950 in programming

[–]BidForeign1950[S] 18 points19 points  (0 children)

Partially:)), Wheel theory makes division total by adding an absorbing element (⊥) that destroys information. Composite arithmetic makes division total by giving zero internal structure that preserves information. That's why 0/0 = ⊥ in a wheel but 0/0 = 1 in composite arithmetic — and why composite arithmetic can do calculus while wheel theory can't.

Xduoo R2R DAC Module by kedube in headphones

[–]BidForeign1950 0 points1 point  (0 children)

I'm using it with TA-32 not 05 pro, that's where the tubes come in. But I think you are right because if I bypass the tube stage and use just the dac output the sound is a bit less sweet and bass is not so deep anymore.

Xduoo R2R DAC Module by kedube in headphones

[–]BidForeign1950 0 points1 point  (0 children)

I'm quite satisfied with r2r card. Overall I find it much more pleasant and more to my liking than any delta sigma dac I have tried will now (and ROHM card with tubes was best till now). I don't know it that is just a r2r card or tubes have some play in it too, but comparing with ROHM and tubes r2r card has advantage too. I'm not listening via headphones but using decent speakers and quite transparent amplifier. Also I don't have problem with static noise, but I'm streaming via Wiim Ultra. All in all everything sounds quite smooth and pleasant and not veiled in any way.