Sep 11, 2023 19:20
I've used stackexchange for long. I think that's a very generic answer, I wanted to see if someone knew terminology or to point in the right direction. but I see the chat is dead. Sad. Thanks and have a good day.
Sep 11, 2023 09:45
Hi, I'm asking here in case I just don't know the terms. We are receiving some numbers like 1034.900024 in which the number is 1034.9 but the extra numbers is being generated at the origin (external to us) and a result of flotaing point operations. They don't have fixed precision, so they could still be for example 1034.8134518999999993 (for which a good target could be 1034.8134519).

Anyone is familiar with some existing literature/algorithms to handle these kind of error corrections from operations on floating point numbers? I don't know where to start to read about it and see if someone
 

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Mar 29, 2021 22:19
Hi all, may be a few questions spinning something around the mRNA of some vaccines would be appropiate in this site :) Just saying...
 
Nov 26, 2019 11:46
@WGroleau just as evil seems like an overstatment, honestly.
 
Dec 26, 2018 09:26
@AndréC For me expandable is like juggling balls, you never put anything down, let's say you want to do something 10 times, a basic thing would be like defining \def\foo{dothis} and then append 9 times \appto\foo{dothis}, but “juggling” means you write dothis and pass that as an argument and then still without leaving anything from your hands get to have dothisdothis and still juggling until you have ten times dothis...dothis and at that moment you leave what you have.
Dec 26, 2018 09:26
@AndréC \edef\foo{\numexpr1+1\relax} doesn't calculate anything and stores \numexpr1+1\relax inside \foo. But \edef\foo{\the\numexpr1+1\relax} is the same as \def\foo{2}. In any case a list is not useful, what exactly do you need? You can assume nothing is expandable, and sometimes you will find something that is.
Dec 26, 2018 09:26
Anything that “stores” data is not (except in LuaTeX). If you have doubts about a particular macro \foo you can do \texttt{\meaning\foo} and see if there's any assignment (for example \def, or any command definition, or anything that stores something).
 
Jul 2, 2018 15:31
@egreg Yep, @DavidCarlisle this is not my idea, I was just a bit curious :)
Jul 2, 2018 14:57
@egreg Ok!
Jul 2, 2018 14:51
And also is there an intention behind allowing something like \def\macro#\bgroup\hbox}? I get that there might be a ned for #{ so that's ok, but why allow this other weird thing?
Jul 2, 2018 14:49
Is there an intended use case for that? Or a reason behind it? Or it just is that way?
Jul 2, 2018 14:47
@DavidCarlisle A bit weird but I guess okey :) I did not expect \hash1 or \hash# to even work.
Jul 2, 2018 14:43
@egreg It is :)
Jul 2, 2018 14:42
@DavidCarlisle It does. But why?
Jul 2, 2018 14:40
Any explanation for that last bit?
Jul 2, 2018 14:38
\let\hash#
\def\macro\hash1{(\hash1)} % equals \def\macro#1{(#1)}
\def\macro\hash1{\def\macro\hash\hash1{\hash\hash1}}
% does not equal \def\macro#1{\def\macro##1{##1}}
Jul 2, 2018 14:38
But I have a doubt about other thing
Jul 2, 2018 14:35
Hi, just for fun: I found that \def\macro#\bgroup\hbox} is the same in \ifx terms (and in practical terms) as \def\macrob\bgroup{\hbox\bgroup}, a bit unexpected.
Apr 23, 2018 14:53
@JosephWright I would like to see his version to see how he does his magic :) Thanks!
Apr 23, 2018 14:49
@JosephWright Ok, thanks. Trying by hand regarding the “shuffle” question, I think that mapping over the sequence to save to token lists each item is fastest, then shuffle the numbers saved in \fontdimens, and then output every variable shuffled in the same \edef and set the seq from the resulting list (comma separated, for instance).
Apr 23, 2018 14:12
@JosephWright Hi. A doubt I have about sequences in L3, how “efficient” is \seq_item:? For example, using 100 times \seq_item: compared to saving in different token lists 100 times \seq_pop_left:? And also, \seq_pop_left: vs. \seq_pop_right: in terms of efficiency?
Apr 6, 2018 11:03
It's been some time but I kind of feel the “weight” and the “work” of seeking characters as \futurelets rather than #1>> in a definition hehe
Apr 6, 2018 11:01
@JosephWright How does TikZ work? With \futurelet?
Apr 6, 2018 10:58
@JosephWright Ok, ok. No need for more. I understand that it's not intended to be inside xparse, but it's doable with the same code. And may be other code would be better suited.
Apr 6, 2018 10:54
That way we could process \foo begin this begin that end and this end and automatically get certain “virtual grouping”.
Apr 6, 2018 10:54
@JosephWright Yes, understood. So one would need to create a different package, but technically there are no limitations, right? I understand that you want to do it officially since you want to encourage good behaviour, but it's easy to program and with the same code of xparse, right? I thought more of d{begin}{end} for some sort of pseudocode for instance.
Apr 6, 2018 10:42
@JosephWright By that you mean that it actually only works for matched tokens? I imagined that it would work for d~~ or d k j and that \foo k k asdf j asdf k asdf j sadf j would work.
Apr 6, 2018 10:41
@JosephWright Hmmm... I don't mean that. I mean check [< together (that should not pose a problem, or if it does I'm interested in what happens). I mean that since in the end (unless I'm wrong) it's a \def\foo#1>{..} which checks for balance inside #1, it would be nice to have \def\foo#1>>{..} for instance which would leave the option for any delimiters.
Apr 6, 2018 10:29
Hi, one doubt about xparse: what are the main advantages of (or the disavantages of not) making d<> work only with single tokens as delimiters? For example, what would be the problem of enabling d{[<}{>]} as delimiters?
Sep 21, 2017 11:51
It's the first time ever that I try to “xii.tex”ify any TeX code and I don't even know how the idea came to me :P
Sep 21, 2017 11:50
    \def~#1x{{#1x_#1x^#1x}}$~~~~~x$\bye
7
 

 Mathematics

Associated with Math.SE; for both general discussion & math qu...
Apr 8, 2018 22:16
@orbit-stabilizer Thanks in any case, I will post a question in th site.
Apr 8, 2018 22:16
In case of two variables, just by checking the values increasing one and decreasing other one, you kind of see the whole variety of options.
Apr 8, 2018 22:14
@orbit-stabilizer Yep, that would be it. But the function is a “black box”, I mean, I need to map the entire space, so I would like to get some sort of “grid” to check the function at each point
Apr 8, 2018 22:13
What would be the method in case I had 6 variables? Anyone has a quick answer or should I post in the site?
Apr 8, 2018 22:12
If I have two variables which sum is 1 of which I want to optimize a function, usually a way is check for the value at x=1, y=0, x=.9, y=.1, x=.8 y=.2, ... x=.1, y=.9, x=0, y=1...
Apr 8, 2018 22:10
I have a small doubt and before opening a question I would like to see if there's an obvious thing I'm missing (I'm not advanced in mathematics).
Apr 8, 2018 22:08
Hi
 
Jan 25, 2018 06:52
@Pharap I mean as others have said there are studies, may be there are studies saying that one should stop reading before bed (I don't think it's the same, but I'm not an expert). I did not actually said that out of the blue, just because I don't like it @corsiKa; first, of course I don't like myself, and I see myself and my surroundings, being addicted; but I wanted to mention it because there's a growing concern regarding the use of technology related to sleep in particular.
Jan 24, 2018 00:37
@corsiKa I mean not as an official rule. Me, as everyone else, have ways to evade those official rules. I did use technology when I shouldn't (even though I didn't have a “rule”, but I knew I shouldn't). As I say, I'm not saying this as black and white. But yes, I think that children with displays is an epidemic thing and should be avoided. Not through strict rules, but yes, discouraged. We will have bans in the future similar to the current bans we have with smoking in closed spaces.
Jan 24, 2018 00:37
@corsiKa It's not something I'm saying with full control, but yes, I think technology is bad for myself, and I'm truly saddened when I see children looking at displays in tablets or mobile phones. I think that children should live with the least possible “technologies” around. What I meant with that, is that if he doesn't feel like going to bed, at least it's not because he's watching something in youtube or netflix. That I consider a problem, even for myself and many other adults. If he want's to draw, to read, to do whatever, okey, but consuming media on a display I hope they do the least.
Jan 24, 2018 00:37
And ensure a time where technology use ends. Even if she goes to sleep at 01:00, may be technology use (computer, tablet, phone, etc.) should stop at 09:30 for example.
 
Nov 21, 2017 14:47
I believe the line in this answer like “America's core values remain [...]” do not reflect reality; it's much more similar to “America's core values have been kept [...]” in a sense. Those core values do not evolve by themselves, it's people, mostly powerful people, that move and change them. It's just that I wouldn't remove / ignore active intentions behind the evolution of “values” or “way of being”. Not sure if I've expressed myself ok. +1 in any case.
 
Oct 17, 2017 08:41
@EvanAad I meant about \function:Nn vs. \function:Vx. That name change may not mean much (although that \l_ bit is the designed way of coping with local variables, rather than your newly invented _clear_new: :P). About your penultimate comment, are you sure you can't \cs_set_eq:NN \f \whateverundefined?
Oct 17, 2017 08:41
@EvanAad How do you cope with the expansion control in your naming convention?
Oct 17, 2017 08:41
@JosephWright I meant in classic (La)TeX that I remember here assignments like \newcount inside of other macros leading to the document not compiling. But thanks, that's of course a good thing of expl3 :)
Oct 17, 2017 08:41
The naming guidelines are something made for everyone, but if you don't follow them, doesn't matter to the system because it's just a convention. But declaring _new: inside functions is not a convention, it's that TeX doesn't work that way (and you can be probably shown example documents that don't compile due to a lot of repeated assignments inside functions; there are probably a bunch of questions on this site due to that).
Oct 17, 2017 08:41
I don't think that's what token is for (I guess there \cs_set_eq:NN and \cs_if_exist:NTF is the logical answer), but I'm not capable of answering with security. In any case, I remember that you have been told that the declarations _new: should not be inside of a function; and I see that you keep writing _new: statements inside of functions, why?
 
Oct 10, 2017 11:21
@EvanAad In TeX, you don't declare new things inside macros. You have to put \int_zero_new:N and \tl_clear_new:N outside the function. And if you feel safer, \cs_undefine:N \aad_cs:. And then inside the function you can do \int_set_eq:NN, \tl_set_eq:NN and \cs_set_eq:NN.
Oct 10, 2017 11:21
\cs_set_eq:NN \cs_initialize:N \cs_undefine:N and then use \cs_initialize:N \__aad:w and to set \cs_set:Npn \__aad:w #1 { ... }. But as Joseph and egreg said, not sure where you are going with it.