# Setting ApproxFun Space , tried several tricks but still receive \*\*ERROR: LoadError: Cannot infer spaces\*\* – specifically when using GeneralizedGenerated.jl for Generalized generated functions

**URL:** <https://discourse.julialang.org/t/setting-approxfun-space-tried-several-tricks-but-still-receive-error-loaderror-cannot-infer-spaces-specifically-when-using-generalizedgenerated-jl-for-generalized-generated-functions/48909>\
**Category:** Numerics\
**Created:** [October 23, 2020, 8:46pm UTC](https://discourse.julialang.org/t/setting-approxfun-space-tried-several-tricks-but-still-receive-error-loaderror-cannot-infer-spaces-specifically-when-using-generalizedgenerated-jl-for-generalized-generated-functions/48909 "2020-10-23T20:46:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Marc.Cox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marc.cox/32/7514_2.png) [@Marc.Cox](https://discourse.julialang.org/u/Marc.Cox)\
**Post date:** [October 23, 2020, 11:36pm UTC](https://discourse.julialang.org/t/setting-approxfun-space-tried-several-tricks-but-still-receive-error-loaderror-cannot-infer-spaces-specifically-when-using-generalizedgenerated-jl-for-generalized-generated-functions/48909/3 "2020-10-23T23:36:04Z")

</div>

Thank You for putting together this wonderful package, and also for looking into this.  
Sorry if unclear, I’m new to ApproxFun and trying to intuitively feel my way around it  
by trying out things …

Re:

> - I’m a bit confused what you are trying to do: note that it is not a good idea to expand sqrt(x) times a polynomial in a Chebyshev (polynomial) expansion.

As for ? what you are trying to do ? Look in **folder** : … /.julia/dev/ApproxFun/test **file:** FractionalTest.jl , specifically this **Section:**

```julia
    ## Avazzadev et al
    # Example 1
    x=Fun(0..1)
    Q=gamma(0.5)*LeftIntegral(0.5)
    @time f=(2/105*sqrt(x)*(105-56x^2+48x^3))
    u=Q\f
    @test norm(u-(x^3-x^2+1))<100eps()

```

So I am trying adapt the code above plus using GeneralizedGenerated so that we can use ApproxFun to take the Fractional Derivative of any arbitrary function defined in parseable String – below is the

```julia
Pseudo Code for that >>
    using GeneralizedGenerated #
    using ApproxFun, Test
    import ApproxFunBase: testfunctional, testbandedoperator
    using SpecialFunctions

        ## Avazzadev et al # Example 1           
	    x=Fun(0..1)
        Q=gamma(0.5)*LeftIntegral(0.5)
   	    f=mk_function(
            Meta.parse( "x -> ApproxFun.Fun(2/105*sqrt(x)*(105-56x^2+48x^3))" )
                          )
    u=Q\f
    @test norm(u-(x^3-x^2+1))<100eps()

```

I think there was also some work done towards this here \>\> [Using ApproxFun for dynamic programming](https://discourse.julialang.org/t/using-approxfun-for-dynamic-programming/1754) \<\< but only with regards to limiting accuracy to save compute cycles during numerous iterations , but not so much about using ApproxFun to take the Fractional Derivative of **any arbitrary function defined in a parsable String,** by the way I’m also interested in any other symbolic equation function form you might suggest besides Strings.

Re:

- _That said the code seems to be broken as it is trying to use lgamma which is now called loggamma. Please file a GitHub issue._

As for “ … _Please file a GitHub issue … trying to use lgamma which is now called loggamma._ “ I’ll be glad to file a GitHub issue if I can help you out , but that doesn’t seem to be (at least not directly) related to my immediate issue of parsing in arbitrary functions to ApproxFun, possibly because I’m already `using SpecialFunctions` as a workaround ?

---

_[View the full topic](https://discourse.julialang.org/t/setting-approxfun-space-tried-several-tricks-but-still-receive-error-loaderror-cannot-infer-spaces-specifically-when-using-generalizedgenerated-jl-for-generalized-generated-functions/48909)._
