# Convert from abstract type to julia-type with cost

**URL:** <https://discourse.julialang.org/t/convert-from-abstract-type-to-julia-type-with-cost/73927>\
**Category:** General Usage\
**Tags:** nemo\
**Created:** [January 2, 2022, 1:17pm UTC](https://discourse.julialang.org/t/convert-from-abstract-type-to-julia-type-with-cost/73927 "2022-01-02T13:17:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qiu\_lin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiu_lin/32/30407_2.png) [@qiu\_lin](https://discourse.julialang.org/u/qiu_lin)\
**Post date:** [January 2, 2022, 1:17pm UTC](https://discourse.julialang.org/t/convert-from-abstract-type-to-julia-type-with-cost/73927/1 "2022-01-02T13:17:04Z")

</div>

I need to use hypergeometric function define on the whole complex-plane. And I find that Arblib.jl and Nemo.jl fit for me but the problem is that they use abitary types both and thus whatever math manipulation put on these variable, new variable of this type created and thus make extra memory-allocation. As I need millions times of calculations with hypergeometric-U function ,I have no idea how to deal with this. A simple question is how can I get the julia-type values from Arblib.Acb(z) with creating new Arblib.Acb() var .Thanks!

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [January 6, 2022, 8:47pm UTC](https://discourse.julialang.org/t/convert-from-abstract-type-to-julia-type-with-cost/73927/2 "2022-01-06T20:47:59Z")

</div>

Does this help?

```julia
julia> using ArbNumerics

julia> a = ArbComplex(1.0, 1.0)
1.0 + 1.0im
julia> b = ArbComplex(0.5, -0.5)
0.5 - 0.5im
julia> c = ArbComplex(-2.0, 1.5)
-2.0 + 1.5im
julia> d = ArbComplex(Complex(1.0, 0.5))
1.0 + 0.5im

julia> Complex{Float64}(F₀₁(a,b))
0.9209013181558816 - 0.5205859580294406im

julia> Complex{Float64}(F₁₁(a,b,c))
-0.23400524419732657 - 0.6099613128325408im

julia> Complex{Float64}(F₂₁(a,b,c,d))
-7.168618318134662 - 31.9121253862373im

```

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [January 6, 2022, 9:03pm UTC](https://discourse.julialang.org/t/convert-from-abstract-type-to-julia-type-with-cost/73927/3 "2022-01-06T21:03:24Z")

</div>

assuming a,b,z are **not integers** (e.g. 10.0 is an integer), and a,b,z are ArbComplexs (possibly with a zero imaginary part):

```julia
using ArbNumerics
using SpecialFunctions

 U(a,b,z) = (gamma(1-b)/gamma(a-b+1)) * F₁₁(a,b,z) + (gamma(b-1)/gamma(a)) * z^(1-b) * F₁₁(a-b+1,2-b,z)

```

ref: [Tricomi confluent hypergeometric function: Representations through equivalent functions (subsection 27/01)](https://functions.wolfram.com/HypergeometricFunctions/HypergeometricU/27/01/)

It is important that you check this for correctness with values for which you know U(a,b,z) – I cannot assure this is what you want.
