# improve impl of \`\_\_sqrth\`, \`sqrtf\`, \`sqrt\`, \`\_\_sqrtx\` and \`sqrtq\` \(\#25416\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9bfd4c3017aa8ecc5e67e6432810af7457b51c0f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9bfd4c3017aa8ecc5e67e6432810af7457b51c0f

Requested commit: 9bfd4c3017aa8ecc5e67e6432810af7457b51c0f

Commit: 9bfd4c3017aa8ecc5e67e6432810af7457b51c0f

Tree: 4eac854e4c3628251736cc1c51531089684b7c17

Author: Zhenming Lin

Committer: GitHub

## Message

```
improve impl of `__sqrth`, `sqrtf`, `sqrt`, `__sqrtx` and `sqrtq` (#25416)

The previous version (ported from musl) used bit-by-bit calculations and was slow, but the current version (also ported from musl) uses lookup tables combined with Goldschmidt iterations to significantly improve the speed.
```

## Parents

- [851ae9bb43251950ddab9775df0310370a4e2301](https://git.cafe/gitcafe/zig/commit/851ae9bb43251950ddab9775df0310370a4e2301?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9bfd4c3017aa8ecc5e67e6432810af7457b51c0f?format=markdown)
