Hacker News new | past | comments | ask | show | jobs | submit | hurrrrrrrr's comments login

Looks like angle sum identity.

    cos(x+y) = cos(x)*cos(y) - sin(x)*sin(y)     (always)
             ~ cos(x)*1      - sin(x)*y          (if y small)
Can't speak for the validity of small angle assumptions though.


Polynomials with the coefficients defined in the sin and cos arrays (and likely in the referenced literature).


It's an easy way to return nan and set FE_INVALID. If you're not worried about floating point exceptions you can just return NaN directly. Idk how much C# even guarantees about the floating point operations and if it's applicable there.

https://en.cppreference.com/w/cpp/numeric/fenv/FE_exceptions


>Certainly do not use finite-math-only when dealing with external data.

so... never?


let me rephrase: data which you cannot guarantee meet the preconditions. Either the input is known good data or you sanitize it through some code path not compiled with fast-math.


Because the danger of fume is negligible. It's a thing if you put it in a 2m^2 storeroom and sniff the exhaust for 8 hours straight but in any other case it doesn't come close to concentrations you get on the street anyway.


In isolation, no. You could instead spend your time optimizing something else that's currently slower and speed that up instead.


The compiler is not beholden to the standard library but the standard. So all modern compilers come with a bit of knowledge of how standard library functions like memcpy are supposed to behave and as long as the visible effect is the same it's allowed to do anything it wants. So instead of calling the function memcpy for a size of 4, it can e.g. just use a mov instruction to move the value from a float to an integer register. [1] It does additional analysis on how the values are used and maybe it doesn't even need to move the value at all, but that's the gist of it.

[1] https://gcc.godbolt.org/z/x4P7jE


A good example of this is the string functions in the C stdlib. I’ve reverse engineered some programs where the compiler used x86’s built-in “string” instructions instead of calling out to, say, `strlen`.


I think he has that correct. Ime it's split on east/north vs. north/east but wgs84 is very dominant with lat/lon.


Huh, thanks. Researching this more, I think you're right.

I thought the Open Geospatial Consortium's standards would reflect dominant practice, that turns out to have been the wrong assumption [1]

The only geospatial software I've used is Proj4J, which normalizes with a function called toENU.

I guess I've only encountered weird stuff then.

[1]: https://lists.opengeospatial.org/pipermail/coordtran.wg/2006...


> I think the only reason people enjoy it is the fact that they have not gotten a chance to really spend time in a good tiling window manager on X11/GNU/Linux.

I did and switched back to floating. AMA


And how much more do they cost in comparison with hooking a few copper wires to a simple copper plug manufactured in china?


$30-$40 wholesale in China, but...

1. Single mode fibre already costs less than high high frequency cabling.

2. A standard written from scratch can move all smart electronics, and even some passives from the transceiver into the device.

3. The moment a transceiver turns into a standardised single chip device, economies of scale turn enormous.

4. Optics can be simplified for direct attach devices.

5. Cheapest transceivers sets + cabling for single mode 10G ethernet already cost less than $10 wholesale.


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: