egg|nomz|egg changed the topic of #kspacademia to: https://gist.github.com/pdn4kd/164b9b85435d87afbec0c3a7e69d3e6d | Dogs are cats. Spiders are cat interferometers. | Космизм сегодня! | Document well, for tomorrow you may get mauled by a ネコバス. | <UmbralRaptor> egg|nomz|egg: generally if your eyes are dewing over, that's not the weather. | <ferram4> I shall beat my problems to death with an engineer.
<egg>
bofh: so I wonder whether there are higher-order methods that have an effect on the relative error whose derivative does not vanish except at 0
<bofh>
I don't think so, why would that be the case?
<egg>
bofh: well it's the case of Newton and Halley
<egg>
so maybe one can craft other methods like that?
<bofh>
Hmm. Point. Hm. Not sure. Still poring over the result from approximate_rootn.pdf in the hopes of trying to figure out why the magic constants are linear to a huge degree
<egg>
if it's the case it means that the singular points of the relative error after iteration are at the same places as the extrema of the relative error before iterating, which makes it easy to do a γ optimization
<Qboid>
UmbralRaptor: Your options are: paperwork, research, study, other. My choice: research
* UmbralRaptor
chooses paperwork.
<UmbralRaptor>
With physical paper, because it's somehow still the XXth century.
<Majiir>
!wpn egg|cell|egg
* Qboid
gives egg|cell|egg a stern resistor
<Majiir>
Not a weapon, but a neat item. "You may *not* pass through here with such high voltage. Simmer down, young electron."
<UmbralRaptor>
whitequark: so, I had to close a checking account. This entailed typing up a "formal statement" (no, they didn't have templates), printing it out, signing, and mailing the statement to their office. They then mailed me a check with the remaining funds.
Majiir is now known as Snoozee
UmbralRaptor has quit [Remote host closed the connection]
UmbralRaptop has joined #kspacademia
<UmbralRaptop>
;c 3500/10672
<kmath>
UmbralRaptop: 0.327961019490255
<UmbralRaptop>
;c 3500/18e3
<kmath>
UmbralRaptop: 0.194444444444444
<UmbralRaptop>
;c 4500/18e3
<kmath>
UmbralRaptop: 0.25
<whitequark>
UmbralRaptop: lol
<whitequark>
I bet convincing my bank that my name and gender have changed will be "fun"
<whitequark>
especially doing that cross-country
<UmbralRaptop>
Yeah, that'll be Fun.
<UmbralRaptop>
Bonus Fun if your name breaks assumptions about how many a person has (mine do). Also, orthography and/or unicode shenanigans?
<whitequark>
oh lol no
<whitequark>
I'm selecting my new name algorithmically specifically to avoid that
* UmbralRaptop
imagines the new name looking like a password for some reason.
<egg>
bofh: so, ran some benchmarks, predictably the cat's cbrt (or rather the arm one which is written in C but uses the cat's polynomial) is much faster than Kahan's default approach which assumes division isn't much costlier
<egg>
bofh: Kahan does mention computing rootn(y, -3), but doesn't do the error analysis for it and only suggests a 2nd order iteration
<egg>
bofh: but I would guess the z * z * y would screw with any attempt at getting the last few ULPs?
<egg>
yeah Halley involves a division so that's a mess
<egg>
bofh: and since you need four rounds of Newton in binary64 it ends up being slower than the method with divisions, let alone the cat's polynomial
<egg>
bofh: phl tells me that back when he was writing Sqrt for Apex's Ada.Numerics the tradeoff was the same so he went with remezed polynomials (apparently he managed to find magic endpoints for his polynomials so that the error was 0,501 ULPs or so)
<kmath>
<stephentyrone> @kittenpies3 mostly went out of fashion when HW multiplication became fast. Expect them to be more widely used agai… https://t.co/aFtKyzvDAz
<kmath>
<sigfig> u ever spend a few hours calculating a quantity you know to be zero by definition just to make sure the world hasnt collapsed beneath u
<awang>
egg: I vote we split RealWhatever into three parts, and release on the full moon and quarter moons too :P
tawny- has joined #kspacademia
<UmbralRaptop>
full/new, and apogee/perigee
<egg>
UmbralRaptop: aaaaaa
<egg>
UmbralRaptop: what about the nodes,
<egg>
!wpn UmbralRaptop
* Qboid
gives UmbralRaptop a split sturgeon
<egg>
!wpn awang
* Qboid
gives awang a furious-sounding csh-compatible abstraction
<egg>
!wpn ferram4
* Qboid
gives ferram4 a mu tesseract
<egg>
!wpn whitequark
* Qboid
gives whitequark a metabotropic squirrel/king hybrid
<awang>
!u ï
<Qboid>
U+00EF LATIN SMALL LETTER I WITH DIAERESIS (ï)
<egg>
all hail the metabotropic squirrel king
<UmbralRaptop>
egg: add those once the project is split into more parts?
<egg>
awang: I'm really impressed at how promptly the MSVC devs react to our bug reports
<awang>
UmbralRaptop: Does that mean major releases fall on supermoons?
<egg>
nah principia has no concept of major of minor releases
<awang>
egg: But the other ones do
<egg>
awang: hm
<egg>
clearly they will lose that concept and only have lunatic releases
<UmbralRaptop>
Drop version support on blood moons?
<egg>
!csharp bofhtime()
<Qboid>
2018-04-02T08:51:59,607
<awang>
egg: I mean, compiler weirdness is pretty important
<awang>
And the reports are probably better than most of the stuff they get
<egg>
awang: now it's very usable
<awang>
UmbralRaptop: What should happen for blue moons?
<egg>
we still have moar bug reports coming up though
<egg>
we have an issue with template variables
<awang>
egg: If I ever try making a compiler, I'm using Principia in the test suite :P
<egg>
translate principia to whatever language and use it as the test suite*
<egg>
*: language must have a Turing-complete type system
<awang>
s/translate/cross-compile
<Qboid>
awang meant to say: I like how Chrome asked to cross-compile that fortran file
<awang>
Um
<awang>
...That was definitely not what I expected
<Qboid>
[#2444] title: curl: add support for a "--rootme" command line parameter | Passing this parameter will download the specified URLs and execute them via `sudo(8)` using `sh(1)`, saving countless keystrokes when installing modern software.... | https://github.com/curl/curl/issues/2444
<APlayer>
It's not the Hardware, because I am certain it works, including the connections. But the sensor is not responding at all to I2C and I am not sure how to proceed looking for the error
UmbralRaptop has quit [Quit: Bye]
<APlayer>
Also, I have an Oscilloscope on hand, if I can use it in any way
<Ellied>
hrm, I haven't actually used I2C before but I have a basic understanding of how it works
<Ellied>
APlayer: first thing to try would be to make sure that the clock line (SCL) is actually producing a clock and the data line (SDA) is actually showing data
<APlayer>
Here is what I asked initially, because it has more information: "So, I have an Arduino Pro Mini and a GY-91 sensor (https://i.ebayimg.com/images/g/UJ4AAOSwjkVZg4DO/s-l1600.jpg). They should communicate via I2C, but they don't. In tracking down the problem, I found out that Arduino's Wire library hangs the script on calling Wire.endTransmission().
<APlayer>
Inspecting the hardware, it seems to be fine, both components have lit LEDs (I guess they are powered properly and not fried, then), SCL is connected to Arduino pin A5, SDA is connected to Arduino pin A4 and both lines have a 4.7 kOhm pull-up to 5V. And that's basically where I am stuck, because I have no idea what to do next - how can I troubleshoot this? Or do you already have an idea of what might be going
<APlayer>
on?"
<Ellied>
what is this sensor measuring?
<APlayer>
Gyroscope, Accelerometer, Magnetometer
<APlayer>
But it's not only sending no data, it's not responding to any calls at its adress at all
<APlayer>
Let me see with the oscilloscope (let me also see if I can use the scope at all, heh)
<APlayer>
Well, dammit
<APlayer>
I am stupid
<APlayer>
I found an I2C scan script which would scan for all possible I2C addresses and see if they respond
<APlayer>
I forgot that the sensor is powered from a pin which I have to set high first and of course it did not respond. Setting the pin to high made it find them (the same board also has a barometer on it)
<APlayer>
But I can't get the scope to show anything useful
<Ellied>
ah yeah sensors need power
<Ellied>
generally speaking anyway
<Ellied>
what kind of scope are we talking about here? brand name/model number?
UmbralRaptop has quit [Remote host closed the connection]
<Ellied>
ah, very minimal
<APlayer>
I can see some sort of signal when the V/div is set to 0.1V, weirdly
<Ellied>
probably noise
<Ellied>
brb, gotta go between buildings
<APlayer>
Not even
<APlayer>
The noise is smaller
<APlayer>
It's a clear, occasional drop to 0 V
UmbralRaptop has joined #kspacademia
<APlayer>
Voltmeter says the line is at 4V rather than 5 (as opposed to 3.5 or so V shown by the scope, if I read that correctly
<APlayer>
https://i.imgur.com/Qe6qGxF.jpg ignore the current Sec/div, the signal arrived at a setting of 2 sec/div and did not scale when I changed that
<APlayer>
Well, forget the scope, I can't get it to work
<APlayer>
The sensor does seem to report things, though
<APlayer>
Not that those things are terribly correct, but it's something
<APlayer>
(I removed the communication checks from the sketch)
<APlayer>
The arduino tried to read some sort of "WHO_AM_I" register and would use its value to check if the communication was good. The value was incorrect, but the communication seems to work
<rqou>
Ellied are you diodelass on Twitter?
<APlayer>
Yes
<bofh>
11:44:19 <@egg> bofh: but I would guess the z * z * y would screw with any attempt at getting the last few ULPs?
<bofh>
you'd need to do the last iteration I think in double-double (or at least part of the expression)
<kmath>
<stephentyrone> @kittenpies3 mostly went out of fashion when HW multiplication became fast. Expect them to be more widely used agai… https://t.co/aFtKyzvDAz
<bofh>
I doubt it ever will, there's a reason I avoid using Padé Approximants unless I'm working in the neighbourhood of a pole or a critical point (i.e. the Padé Approximant of Gamma(1+x), |x| < ~0.5 is much easier to get accurate than the minimax polynomial)
<bofh>
11:41:21 <@egg> bofh: so, ran some benchmarks, predictably the cat's cbrt (or rather the arm one which is written in C but uses the cat's polynomial)
<bofh>
I am curious if there was a way to combine these two approaches, so you didn't need the gigantic table of mantissa values.
<bofh>
(The division in Halley's won't go away since in Halley you're finding roots of a linear/linear Padé Approximation to the function)
<bofh>
That's the annoying bit, if it used *two* points it'd be perfect since you'd use initial and one round of Newton.
<bofh>
But for three it'd be too slow in the binary64 case over 4x Newton to matter.
<bofh>
Hm.
<egg|cell|egg>
Clearly this just means we're back to the age of remezing all the things
<egg|cell|egg>
And tweaking nodes to find ones that give you moar bits
<egg|cell|egg>
!Wpn -add:adj Remez
<Qboid>
egg|cell|egg: Adjective added!
<egg|cell|egg>
Bofh: no news from the cat?
<bofh>
I'm not *yet* convinced minimax polynomials alone are optimal, but I still need to look at some things. First I really want to actually find out what the periodicity in the Approximate rootn constant order graph is.
<kmath>
<stephentyrone> Current status: cooking Riley’s lunches for the week before leaving on a business trip tomorrow. ⏎ ⏎ Respect for singl… https://t.co/lCrYcJUsif
<egg|cell|egg>
Hmmm but that's the human cooking, should leave free time to the cat
tawny- has joined #kspacademia
<UmbralRaptop>
Presumably one measures food in gULPs?
<kmath>
<Zaikarion> @bofh453 Why do I have the sudden urge to write code with comments in Akkadian?
<bofh>
egg: my Akkadian isn't good enough for that yet, sadly. I'll have to poke Zaikarion :P
<egg>
bofh: have you managed to reproduce the γ(n) graph or should I add more details to that pdf
StCypher has joined #kspacademia
<bofh>
egg: haven't yet tried, attempting now
<egg>
bofh: so fwiw, all of the implementations mentioned above are better than the microsoft std::cbrt (probably not a fair comparison, I'm running the Kahan stuff without branches for rescaling and denormals)
<bofh>
ehh, those branches will be (hopefully) marked with unlikely branch hints, so should have negligible effect. I think. Still, am not surprised, MSVCRT's libm is far from fast (or in some cases, even accurate).
<egg>
yeah true
<egg>
bofh: also the cat is good as Fiora has told us many times
<bofh>
Indeed, not surprised.
<awang>
!u Θ
<Qboid>
U+0398 GREEK CAPITAL LETTER THETA (Θ)
<egg>
bofh: also, those are latency benchmarks (x = cbrt(x)), for 1000 cbrt + one FP add and one integer increment
<bofh>
!u ᘛ⁐̤ᕐᐷ
<Qboid>
U+161B CANADIAN SYLLABICS CARRIER JA (ᘛ)
<Qboid>
U+2050 CLOSE UP (⁐)
<Qboid>
U+0324 COMBINING DIAERESIS BELOW (◌̤)
<Qboid>
U+1550 CANADIAN SYLLABICS R (ᕐ)
<Qboid>
U+1437 CANADIAN SYLLABICS CARRIER HI (ᐷ)
<bofh>
egg: interesting, I wonder how y = cbrt(x) with y not having a dependency chain on x (i.e. x is for instance rand() / (double)RAND_MAX) compares.
<egg>
bofh: so fwiw the 10th order Householder method for cbrt maxes out the precision and the 9th order one comes close
<egg>
(on the guess using the approximate rootn thing)
<bofh>
How does the 9th order method compare with 4 Newton rounds in terms of perf?
<egg>
well I'd have to do common subeggspression elimination on it
<egg>
also I'm afraid to ask :-p
<bofh>
why? :P
<bofh>
(like the eggspression is so godawfully complicated iirc that I'd be *extremely* surprised if it's faster in any capacity)
<egg>
yeah it's probably going to be silly slow
<egg>
bofh: also it's not 4 rounds of newton, I'm doing it for the cbrt approach not the inverse cbrt
<bofh>
oh, does cbrt require *less* rounds?
<egg>
bofh: well it's more that if you're doing a division anyway there's no point going through the inverse cbrt path
<bofh>
what? I was simply wondering how starting Kahan guess + enough order-2 Householder iterations to get 1ULP or better (which I think will be still 4) compares perf-wise to starting Kahan guess + 1 iteration of the order-9 or order-10 Householder method.
<bofh>
:P
<bofh>
...WE JUST GOT ELEVEN CENTIMETERS OF SNOW WHY ARE WE ON TORNADO WATCH
<egg>
bofh: if you go the inverse cbrt path you need to do your x * x * y at the end, losing ULPs; if you're paying the price of the expensive householder you might as well do it directly
<egg>
also how do I horner/estrin a polynomial in 2 variables D:
<bofh>
Yuck. Wait, what 2-var polynomial?
<egg>
Ideally estrin we're dealing with high degree
<egg>
bofh: so you have a giant rational function
<egg>
3 15 12 9 2 6 3 3 4 5
<egg>
9 x (x - y) (5 x + 98 x y + 323 x y + 256 x y + 46 x y + y )
<kmath>
<SerhiyStorchaka> Empty set literal: {*()} ⏎ #python
tawny- has quit [Quit: 「Roundabout」 - To Be Continued]
tawny has joined #kspacademia
<egg>
!wpn bofh
* Qboid
gives bofh a Молния woomera
* egg
pokes bofh with benchmarks
UmbralRaptor has joined #kspacademia
<egg>
!wpn UmbralRaptop
* Qboid
gives UmbralRaptop a snub woomera
<bofh>
egg: yeah, I just got back, and like, I'm amazed since for me this is *un*intuitive. like, high-order integration techniques are useful, but I'm shocked high-order root finders can be as well.
<egg>
bofh: high-order *everything* is good actually
<kmath>
<whitequark> OH: "at which point I have to ask why [are you] evaluating 11th-order polynomials in your critical path?"
<egg>
bofh: also Estrin is magic
<egg>
bofh: also should I tweet those benchmark results
<egg>
s/tweet/publish/ or something
<whitequark>
egg: yeah, котя was outside and got a few scratches
<egg>
whitequark: ow, is she OK?
<whitequark>
sure
<whitequark>
котя is an outside cat, I would personally be scared for whatever creature decided to attack her
UmbralRaptop has quit [Ping timeout: 190 seconds]
<egg>
whitequark: :D
<bofh>
22:53:22 <@egg> bofh: high-order *everything* is good actually
<whitequark>
the gray kitten isn't very smart
<whitequark>
the котя-colored kitten is almost exactly like котя
<bofh>
which both surprises me and goes against what my intuition used to say
<egg>
whitequark: well it's a kitten, I think you've observed that they're very dumb initially?
<whitequark>
but the котя-colored kitten is much smarter.
<egg>
oh the котяkitten has inherited the smarts?!
<bofh>
egg: and yes you prolly should post those benchmark results somewhere at some point
<egg>
is there a gene that controls both the colour and the smarts
<whitequark>
the latter is already eating kitten food and exploring everything
<whitequark>
the former is just sucking milk and sleeping
<egg>
bofh: as we said, those tradeoffs change all the time
<whitequark>
also it might be related to gender
<whitequark>
we originally intended to keep only the котя-colored kitten (the initial size of litter was five but no way in hell we were gonna raise five kittens)
<whitequark>
but then printer decided to keep the (male) gray kitten too
<kmath>
<eggleroy> Interesting ∛ benchmark results: Kahan’s 2-div method from “Computing a Real Cube Root” is soundly beaten by… https://t.co/XewMX49eX3
UmbralRaptor has quit [Client Quit]
UmbralRaptor has joined #kspacademia
UmbralRaptop has quit [Ping timeout: 182 seconds]
<bofh>
egg: heh.
UmbralRaptop has joined #kspacademia
UmbralRaptop has quit [Client Quit]
UmbralRaptor has quit [Read error: -0x1: UNKNOWN ERROR CODE (0001)]
UmbralRaptop has joined #kspacademia
<egg>
bofh: now optimizing γ for 10th order Householder might actually be hard
UmbralRaptor has joined #kspacademia
<egg>
because its effect on the relative error will have singular points outside 0, which may become extrema of the error; you'd have to either prove that they're not global extrema or to find them (and finding them entails computing roots of high degree polynomials)
UmbralRaptop has quit [Ping timeout: 190 seconds]
<egg>
I mean you can just compute those roots numerically, invert the error function to find the value, and check the error there but that seems really annoying (and doing the error analysis on that process seems even worse)
<egg>
(although I guess since it's offline you can throw 100 sig. dec. at it and say that the result will be good enough :-p)
<bofh>
Yeah, also I question if it matters since unoptimized γ looks to be good enough and I don't think optimizing γ will make the 9th-order one good enough.
<bofh>
I'm curious what order is sufficient for single precision. I want to say 5th?
<egg>
bofh: yeah it doesn't matter at all
<egg>
bofh: for single precision, let me see
<bofh>
sec, brb again
StCypher has joined #kspacademia
<egg>
bofh: yeah 5th order will do in single precision
<egg>
bofh: .... which means that if the error is decent with this method (caveat, it might not be, atlas's method is correctly rounded in binary32), that would give you a cbrtf faster than the cat's