# Symbolic sqrt(2) and sin(pi)

**URL:** <https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633>\
**Category:** Specific Domains\
**Tags:** symbolic\
**Created:** [April 4, 2021, 7:03pm UTC](https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633 "2021-04-04T19:03:25Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 5, 2021, 4:44pm UTC](https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633/15 "2021-04-05T16:44:16Z")

</div>

> [@antoine-levitt](#):
>
> Wouldn’t help since 2pi is a float64 (which is pretty annoying when writing generic code). We’d need a “taking irrationals seriously” thing where n\*pi would also be an irrational, but it would probably lead to madness pretty soon.

Yeah, the bigger thing to do would probably be to handle it in the switch to SymbolicTracing.jl.

> [@CAS Best Practices](https://discourse.julialang.org/t/cas-best-practices/58092/82):
>
> If I may ask: What is the purpose of wrapping the inputs in `[]` ? Why not just `Term(sqrt, 2)` , which seems to give the same results, but is dramatically faster?

I’m actually surprised that works. It should be very simpler to the Expr object which has an op and arguments. I guess the analysis code is now generic enough that it just iterates through the latter argument, and numbers are iterable so it works? @shashi

> [@CAS Best Practices](https://discourse.julialang.org/t/cas-best-practices/58092/83):
>
> What I expected to happen is that `expr1` and `expr3` would be the same but instead `expr3` does not seem to be a symbolic object. You describe it as exact but the printed representation looks more like a high-precision approximation. In an exact representation I would expect to be able to query the object in some way to discover that it represents `sqrt(2)` symbolically but I don’t see a way to do that with `expr3` .

We should probably handle that in SymbolicTracing.jl as mentioned above.

---

_[View the full topic](https://discourse.julialang.org/t/symbolic-sqrt-2-and-sin-pi/58633)._
