Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Slightly more precise like Ruby

Post any examples or modules that you want to share here

Slightly more precise like Ruby

Postby wlangfor@uoguelph.ca » Wed Jun 24, 2020 2:36 pm

It's really difficult to keep up with Ruby. Ruby's math is much more precise and here's a schematic that has an experiment showing that.

I've been trying to make something that is more accurate like Ruby with green; And in a small way I'm closer, but there's a margin of error.

Makes you want to study using sin and cosine with ruby:
https://www.geeksforgeeks.org/ruby-math-sin-function/#:~:text=The%20cos()%20is%20an,%5B-1%2C%20%2B1%5D.&text=Parameters%3A%20The%20function%20accepts%20one,Value%3A%20It%20returns%20the%20sine.

https://youtu.be/nQZNFPlxYeY

Download 1
https://vstplug.com/?download=1&kccpid=2033&kcccount=https://vstplug.com/wp-content/over%20precision%20V2.fsm

V3 has a fallback which falls back on the original sum if it cannot improve upon the figure's stability after math.

Download 2
https://vstplug.com/?download=1&kccpid=2033&kcccount=https://vstplug.com/wp-content/over%20precision%20V3%20-%20with%20fallback.fsm
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: Slightly more precise like Ruby

Postby MichaelBenjamin » Wed Jun 24, 2020 3:09 pm

i think the thing that your schematic shows, is that you get different small floating accumulation errors, depending on the chain of calculation. the things you compare do vastly different chains. the difference in accumulated error is totally normal and nothing to worry about. also remember everytime you connect two lines to the same thing, it will end up in a (invisible) addition.
what ruby uses as default floating numbertype i don't know, could be double unless otherwise specified.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: Slightly more precise like Ruby

Postby wlangfor@uoguelph.ca » Wed Jun 24, 2020 4:03 pm

It had been My rationale also; not to worry, about the discrepancy, and to that end that maybe multiplication was better due to the inevitable lack of precision.

But seeing it, rather than conceiving it is something that in My mind makes Ruby something that becomes much more appealing. We often think about it for redraw and imagery and for graphics, but I know Myco uses ruby a lot for math. I guess I wasn't a believer until seeing the difference.

But of course, it comes down to CPU use, if less with green; it's very tempting.

EDIT: there is one instance however, where this phenomenon becomes a real problem; and that is, in the case of boolean checks. Like in the sense of comparing one versus the other to compare some condition and to satisfy some clause which makes this idea necessary in some senses for the simpler math that's perhaps even for interfaces and graphical components, in such cases where pixels are situated. Is Ruby something that should be re-iterated forever for each little bit of code? Not sure, maybe yes, maybe no.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: Slightly more precise like Ruby

Postby trogluddite » Wed Jun 24, 2020 6:06 pm

wlangfor@uoguelph.ca wrote:It's really difficult to keep up with Ruby. Ruby's math is much more precise

Yes, Ruby uses double-precision floats throughout (as you have already been told).
Green uses single precision, and you can't add precision without adding bits (as you have already been told).

You are simply re-iterating the exact same nonsensical theories about numeric precision as you have been on your many other similar threads. There is nothing further to say about the topic which myself, Chris, Michael, and other haven't already pointed out to you. You have also been pointed in the direction of comprehensive learning resources on this topic - in particular the documents relating to the IEEE754 standard.

[moderation="trog"]
Thread locked. I will give you one last chance - reasonable questions to help you understand floating-point arithmetic may be taken, but if you create any more threads about your nonsensical "precision-and-a-half alchemy", the consequences outlined in your final formal warning will be invoked.
[/moderation]
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK


Return to User Examples

Who is online

Users browsing this forum: No registered users and 33 guests