reciprocal of a complex number
Posted: Mon Sep 19, 2011 2:31 pm
In Dyalog 13.0
I think that it is a overflow pitfall.
I suggest to change the implementation of "reciprocal" into the interpreter.
For example you could do something like :
In fact:
Code: Select all
÷ .5E160J.5e160
DOMAIN ERROR
÷5E159J5E159
∧
I think that it is a overflow pitfall.
I suggest to change the implementation of "reciprocal" into the interpreter.
For example you could do something like :
Code: Select all
Reci←{
ReIm←{9 11○⍵}⍵
recip←{>/|⍵:{q←÷/⌽⍵ ⋄ 1(-q)÷+/⍵×1 q}⍵
{q←÷/⍵ ⋄ q ¯1÷+/⍵×q 1}⍵}ReIm ⍝(avoiding overflow)
{+/1 0J1×⍵}recip
}
In fact:
Code: Select all
Reci .5E160J.5e160
1E¯160J¯1E¯160