OpenRiver Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
duplexsystem@lemmy.blahaj.zone to Programming@programming.dev · 4 days ago

The Fastest (long) ilog10 in the West · duplexsystem

duplexsystem.org

external-link
message-square
12
link
fedilink
  • cross-posted to:
  • programming@beehaw.org
47
external-link

The Fastest (long) ilog10 in the West · duplexsystem

duplexsystem.org

duplexsystem@lemmy.blahaj.zone to Programming@programming.dev · 4 days ago
message-square
12
link
fedilink
  • cross-posted to:
  • programming@beehaw.org
A write-up of how I wrote the fastest (long) ilog10 I have been able to find.
alert-triangle
You must log in or register to comment.
  • draycs@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    15 hours ago

    How do you generate your charts? They’re very nice

  • palordrolap@fedia.io
    link
    fedilink
    arrow-up
    6
    ·
    4 days ago

    The repeated division trick has a quicker counterpart, which is to create a separate variable and repeatedly multiply that by 10, comparing to the original as it goes. Probably not as fast as anything beyond the repeated division trick, but I mention it because its rediscovery was likely missed by jumping right to clzl tricks.

    It also generalises a lot more readily to numbers in other bases. Kind of a “jack of all trades, master of none” solution.

  • duplexsystem@lemmy.blahaj.zoneOP
    link
    fedilink
    arrow-up
    11
    ·
    4 days ago

    Wrote my first real blog post. Let me know what you guys think!

  • a_non_monotonic_function@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    4 days ago

    Fun read.

  • adhocfungus@midwest.social
    link
    fedilink
    arrow-up
    5
    ·
    4 days ago

    Amazing. It’s so weird, I was just needing to do this same operation and was looking into some of the bithacks. Although I don’t have the ability in the language to fully utilize this, I am astounded by how lean you made it.

    • duplexsystem@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      How interesting! What language are you using? I’ve ported a couple of these ilog10 methods to different languages so perhaps I could be of some help! Thank you though! It was a long process to get it this fast and lean!

      • adhocfungus@midwest.social
        link
        fedilink
        arrow-up
        3
        ·
        4 days ago

        Java. I could certainly use a lot of what you wrote, but I don’t know nearly enough about the JVM to take it as far as you did.

        • duplexsystem@lemmy.blahaj.zoneOP
          link
          fedilink
          arrow-up
          3
          ·
          4 days ago

          I actually have ported the pre Lemire version to Java!

          https://github.com/PolyhedralDev/Seismic/blob/master/src/main/java/com/dfsek/seismic/math/integer/IntegerFunctions.java

          This should work for you, and I can probably port my most recent version to Java as well.

  • kamstrup@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    4 days ago

    Fun read, thanks for sharing ♥️

    • duplexsystem@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      4 days ago

      Ofc!! Thank you for reading!

  • Sibbo@sopuli.xyz
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    4 days ago

    So there is a faster one in Africa or Asia? Then why not use that?

    • duplexsystem@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      We’re still searching for those…

Programming@programming.dev

programming@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programming@programming.dev

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 347 users / day
  • 1.42K users / week
  • 3.29K users / month
  • 4.8K users / 6 months
  • 1 local subscriber
  • 29K subscribers
  • 673 Posts
  • 2.95K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • UlrikHD@programming.dev
  • bugsmith@programming.dev
  • Spyro@programming.dev
  • BE: 0.19.20
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org