# Math log SIMD issue with Mojo Mojo 0.26.1.0

**URL:** <https://forum.modular.com/t/math-log-simd-issue-with-mojo-mojo-0-26-1-0/2700>\
**Category:** Mojo\
**Created:** [February 7, 2026, 12:32pm UTC](https://forum.modular.com/t/math-log-simd-issue-with-mojo-mojo-0-26-1-0/2700 "2026-02-07T12:32:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratulb](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@ratulb](https://forum.modular.com/u/ratulb)\
**Post date:** [February 7, 2026, 12:32pm UTC](https://forum.modular.com/t/math-log-simd-issue-with-mojo-mojo-0-26-1-0/2700/1 "2026-02-07T12:32:49Z")

</div>

If I uncomment the commented out lines - mojo complains with the messages shown at end! Please help. The same used to work in Mojo 0.25.7.

```mojo
from math import iota, log, log10
from sys import simd_width_of

fn check_log[
    dtype: DType, width: Int, //, simd_width: Int = simd_width_of[dtype]()
](var vector: SIMD[dtype, width],):
    var size = len(vector)
    var orig = vector

    var chunks = size // simd_width
    var start_rest = chunks * simd_width
    for _ in range(chunks):
        var chunk = vector.slice[simd_width]()
        vector = vector.rotate_left[simd_width]()
        # print("chunk log: ", log(chunk))
        print("chunk log: ", log10(chunk) * 2.3025850929)

    for i in range(start_rest, size):
        var val = orig[i]
        # print("Elem log: ", log(val))
        print("Elem log: ", log10(val) * 2.3025850929)

fn main() raises:
    comptime dtype = DType.float16
    var vector = iota[dtype, 24]()
    check_log(vector)
    print(log(Scalar[dtype](10)))
    

```

Snippet from errors:

error: invalid call to ‘log’: lacking evidence to prove correctness  
print("chunk log: ", log(chunk))  
^~~  
note: cannot prove constraint for candidate

---

<div class="post-metadata">

**Author:** ![Photon](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@Photon](https://forum.modular.com/u/Photon)\
**Post date:** [February 7, 2026, 2:05pm UTC](https://forum.modular.com/t/math-log-simd-issue-with-mojo-mojo-0-26-1-0/2700/2 "2026-02-07T14:05:13Z")

</div>

In the recent mojo update, they have added the `where` clause constraint to many of these math functions. So you’ll have to prove that for `log` function by adding the following,

```mojo
fn check_log[
    dtype: DType, width: Int, //, simd_width: Int = simd_width_of[dtype]()
](var vector: SIMD[dtype, width],) where dtype.is_floating_point():

```

---

<div class="post-metadata">

**Author:** ![ratulb](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@ratulb](https://forum.modular.com/u/ratulb)\
**Post date:** [February 8, 2026, 7:12am UTC](https://forum.modular.com/t/math-log-simd-issue-with-mojo-mojo-0-26-1-0/2700/3 "2026-02-08T07:12:09Z")

</div>

Thank you. That solves it. “constrained” does not catch it!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [August 7, 2026, 7:12am UTC](https://forum.modular.com/t/math-log-simd-issue-with-mojo-mojo-0-26-1-0/2700/4 "2026-08-07T07:12:38Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
