{"body":"8:57 AM <+devsnek> what's the best way to implement exponentiation\n8:57 AM <+devsnek> like what algorithm\n8:58 AM <+devsnek> V8 is using fdlibm and it really really sucks\n9:56 AM <+rkirsling> that's what JSC has too but I'm not familiar with what that is versus other options\n9:59 AM <+devsnek> jsc calls std::pow iirc\n9:59 AM <+devsnek> other fdlibm stuff works well, like sin and cos and exp\n10:02 AM <+rkirsling> oh oops the fdlibm is copy-pasted in for iOS and ARM Thumb-2 while std::pow is default, you're right\n10:03 AM ⇐ Ms2ger quit (~Ms2ger@ptr-g1wjcuh999hln6zoxci.18120a2.ip6.access.telenet.be) Quit: Ex-Chat\n10:03 AM <+rkirsling> (there's also some JIT fast-pathing but yeah)\n10:33 AM <+devsnek> sm uses std::pow too i think\n10:34 AM <+devsnek> but V8 doesn't want to use it cuz it could be different across platforms\n2:45 PM <+devsnek> rkirsling: do you know if there are any bugs for jsc about inaccurate exponentiation results?\n2:46 PM <+rkirsling> I don't believe so\n2:47 PM <+rkirsling> I see https://bugs.webkit.org/show_bug.cgi?id=157787\nTuesday, October 29th, 2019\n1:05 AM → Ms2ger joined (~Ms2ger@ptr-g1wjcuh999hln6zoxci.18120a2.ip6.access.telenet.be)\n2:26 AM <littledan> devsnek: There were other libraries historically used that were faster and less accurate\n2:26 AM <littledan> IMO accuracy is an important goal here\n4:21 AM ⇐ Ms2ger quit (~Ms2ger@ptr-g1wjcuh999hln6zoxci.18120a2.ip6.access.telenet.be) Ping timeout: 276 seconds\n7:05 AM → Ms2ger joined  \n8:39 AM <+devsnek> littledan: my goal here is accuracy, yes\n8:39 AM <+devsnek> v8 originally had some optimizations that really killed the accuracy, i replaced those with fdlibm\n8:40 AM <+devsnek> but then it turns out fdlibm isn't doing so great either\n8:58 AM <littledan> *facepalm emoji*\n8:59 AM <+rkirsling> you can just type 🤦 if you're on IRCCloud ;)\n9:00 AM <+devsnek> right now v8 says 10 ** -5 is 0.000009999999999999999\n9:03 AM <Ms2ger> Eh, close enough\n9:04 AM <+devsnek> :(\n9:07 AM <bradleymeck> how good is the ieee rep for 0.000001 ?\n9:07 AM <bradleymeck> awww e-15 error on that one, so it stores it pretty well\n9:09 AM <+devsnek> https://gc.gy/40070350.png\n9:11 AM <+rkirsling> that's fdlibm's fault? huh, you'd think it'd be of broader concern than just implementing JS then...\n9:12 AM <+devsnek> well it turns out everything uses std::pow\n9:12 AM <+devsnek> not fdlibm\n9:12 AM <+devsnek> in this one case\n9:12 AM <+rkirsling> ah\n9:13 AM <+devsnek> but v8 wants the algo to be explicit in codebase\n9:13 AM <+devsnek> since you could in theory compile v8 with a version of libstdc++ where std::pow is just \"return 42\"\n9:14 AM <+devsnek> so then i tried to find one of these algorithms powering std::pow\n9:14 AM <+devsnek> but i couldn't find any\n9:14 AM <+devsnek> so i asked here\n9:15 AM <+rkirsling> is that a general Chromium worry?\n9:15 AM <+devsnek> 🤷🏻\n9:15 AM <+devsnek> i hadn't really heard of it as a concern before\n9:16 AM <+devsnek> assumedly more than just std::pow would break with a bad libstdc++\n9:16 AM <+rkirsling> yeah.\n9:16 AM <+rkirsling> seems like the answer to that is just \"then they would have a very odd V8 build, but intentionally\"\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/4Ff0SKWm","modified":1573512189,"id":"4Ff0SKWm","size":3169,"lines":47,"own_paste":false,"theme":"","date":1573512189}