Closed crowlogic closed 5 months ago
that rule was too strict
[crow@c17 20240324-05:44:14PM]~/a$ decompile factorℝ2.class
INFO: JVM info: Oracle Corporation - 21.0.2 - 21.0.2+13-LTS-58
INFO: Scanning classes from file factorℝ2.class
INFO: Loading Class: factorℝ2 from file factorℝ2.class
INFO: Preprocessing class factorℝ2
INFO: ... done
INFO: Decompiling class factorℝ2
INFO: ... done
import arb.Integer;
import arb.Real;
import arb.RealPolynomial;
import arb.functions.Function;
public class factorℝ2 implements Function<Integer, Real> {
private boolean isInitialized;
public Integer n;
public Integer p;
public Integer q;
public Real α;
public Real β;
public Integer N;
public Real evaluate(Integer in, int order, int bits, Real result) {
if (!isInitialized) {
initialize();
}
return β.get(in).ascendingFactorial((result).identity(), bits, result);
}
public void initialize() {
if (isInitialized) {
throw new AssertionError("Already initialized");
} else if (β == null) {
throw new AssertionError("β is null");
} else {
isInitialized = true;
}
}
public String toString() {
return "factorℝ2:k➔β[k]₍ₙ₎";
}
}
[crow@c17 20240324-05:45:29PM]~/a$
this should be using n as the second argumen to the ascending factorial instead of n is the independent variable of a polynomial.. most likely cause it ssees that its parent exxpression has a polynomial output but it forgot that it needs to output the scalar downcast type of the real polynomial which is real
cause of this
Summation.loadResultvariable( resultVariable= sumP1, generatedType=class arb.Real )
cool
java.lang.ClassCastException: class arb.Real cannot be cast to class arb.RealPolynomial (arb.Real and arb.RealPolynomial are in module arb4j@0.89 of loader 'app')
at factorℝ1.evaluate(Unknown Source)
at arb4j@0.89/arb.functions.Function.evaluate(Function.java:201)
at factorP1.evaluate(Unknown Source)
at arb4j@0.89/arb.functions.Function.evaluate(Function.java:201)
at F.evaluate(Unknown Source)
at arb4j@0.89/arb.functions.polynomials.HypergeometricPolynomial.evaluate(HypergeometricPolynomial.java:73)
at arb4j@0.89/arb.functions.polynomials.HypergeometricPolynomial.evaluate(HypergeometricPolynomial.java:14)
at arb4j@0.89/arb.functions.Function.evaluate(Function.java:201)
at arb4j@0.89/arb.functions.polynomials.HypergeometricPolynomialTest.testSum(HypergeometricPolynomialTest.java:78)
at
N should not be propagated to factorR1 because it does not appear in that subexpression
package arb.functions.real;
import arb.Integer;
import arb.Real;
import arb.RealPolynomial;
import arb.functions.Function;
public class factorP1 implements
Function<Integer, RealPolynomial>
{
private boolean isInitialized;
Integer c1;
public Integer p;
public Integer q;
public Real α;
public Real β;
public Integer N;
public RealPolynomial P1;
public Real valueℝ1;
public Integer k;
public Real prodℝ1;
public Integer endIndexℤ1;
public RealPolynomial P2;
public Integer ℤ1;
public Real valueℝ2;
public Real prodℝ2;
public Integer endIndexℤ2;
public Real ℝ1;
public final factorℝ2 factorℝ2 = new factorℝ2();
public final factorℝ1 factorℝ1 = new factorℝ1();
public RealPolynomial evaluate(Integer in, int order, int bits, RealPolynomial result)
{
if (!isInitialized)
{
initialize();
}
RealPolynomial var10000 = result.identity().pow(in, bits, P1);
factorℝ1.n = in;
prodℝ1.multiplicativeIdentity();
k.set(c1);
endIndexℤ1.set(p);
do
{
prodℝ1.mul(factorℝ1.evaluate(k, bits, valueℝ1), bits);
}
while (k.increment().compareTo(endIndexℤ1) <= 0);
var10000 = var10000.mul(prodℝ1, bits, P2);
Integer var10001 = in.factorial(bits, ℤ1);
factorℝ2.n = in;
prodℝ2.multiplicativeIdentity();
k.set(c1);
endIndexℤ2.set(q);
do
{
prodℝ2.mul(factorℝ2.evaluate(k, bits, valueℝ2), bits);
}
while (k.increment().compareTo(endIndexℤ2) <= 0);
return var10000.div(var10001.mul(prodℝ2, bits, ℝ1), bits, result);
}
public factorP1()
{
c1 = new Integer("1");
P1 = new RealPolynomial();
valueℝ1 = new Real();
k = new Integer();
prodℝ1 = new Real();
endIndexℤ1 = new Integer();
P2 = new RealPolynomial();
ℤ1 = new Integer();
valueℝ2 = new Real();
prodℝ2 = new Real();
endIndexℤ2 = new Integer();
ℝ1 = new Real();
}
public void initialize()
{
if (isInitialized)
{
throw new AssertionError("Already initialized");
}
else if (p == null)
{
throw new AssertionError("p is null");
}
else if (q == null)
{
throw new AssertionError("q is null");
}
else
{
factorℝ2.p = p;
factorℝ2.q = q;
factorℝ2.α = α;
factorℝ2.β = β;
// factorℝ2.N = N;
factorℝ1.p = p;
factorℝ1.q = q;
factorℝ1.α = α;
factorℝ1.β = β;
// factorℝ1.N = N;
isInitialized = true;
}
}
public void close()
{
c1.close();
P1.close();
valueℝ1.close();
k.close();
prodℝ1.close();
endIndexℤ1.close();
P2.close();
ℤ1.close();
valueℝ2.close();
prodℝ2.close();
endIndexℤ2.close();
ℝ1.close();
}
public String toString()
{
return "factorP1:n➔z^n*∏k➔α[k]₍ₙ₎{k=1…p}/(n!*∏k➔β[k]₍ₙ₎{k=1…q})";
}
}```
java.lang.ClassCastException: class arb.Real cannot be cast to class arb.RealPolynomial (arb.Real and arb.RealPolynomial are in module arb4j@0.89 of loader 'app')
at factorℝ1.evaluate(Unknown Source)
at arb4j@0.89/arb.functions.Function.evaluate(Function.java:201)
at factorP1.evaluate(Unknown Source)
at arb4j@0.89/arb.functions.Function.evaluate(Function.java:201)
at F.evaluate(Unknown Source)
at arb4j@0.89/arb.functions.polynomials.HypergeometricPolynomial.evaluate(HypergeometricPolynomial.java:73)
at arb4j@0.89/arb.functions.polynomials.HypergeometricPolynomial.evaluate(HypergeometricPolynomial.java:14)
at arb4j@0.89/arb.functions.Function.evaluate(Function.java:201)
at arb4j@0.89/arb.functions.polynomials.HypergeometricPolynomialTest.testSum(HypergeometricPolynomialTest.java:78)
its due to this part [33m 33:[m checkcast #26 [31m// class arb/Real[m
in factorℝ1
dentity:()Larb/RealPolynomial;[m
[33m 30:[m iload_3
[33m 31:[m aload 4
[33m 33:[m checkcast #26 [31m// class arb/Real[m
[33m 36:[m invokevirtual #40 [31m// Method arb/Real.ascendingFactorial:(Larb/RealPolynomial;ILarb/Real;)Larb/Real;[m
[33m 39:[m areturn
StackMapTable: number_of_entries = 1
frame_type = 11 /* same */
LocalVariableTable:
Start Length Slot Name Signature
no it was the other one.. most likely in the indexed acccess generation code in the Variable class
[33m 12:[m getfield #22 [31m// Field α:Larb/Real;[m
[33m 15:[m aload_1
[33m 16:[m checkcast #24 [31m// class arb/Integer[m
[33m 19:[m invokevirtual #30 [31m// Method arb/Real.get:(Larb/Integer;)Larb/Real;[m
[33m 22:[m aload 4
[33m 24:[m checkcast #32 [31m// class arb/RealPolynomial[m
[33m 27:[m invokevirtual #36 [31m// Method arb/RealPolynomial.identity:()Larb/RealPolynomial;[m
[33m 30:[m iload_3
[33m 31:[m aload 4
[33m 33:[m checkcast #26 [31m// class arb/Real[m
[33m 36:[m invokevirtual #40 [31m// Method arb/Real.ascendingFactorial:(Larb/RealPolynomial;ILarb/Real;)Larb/Real;[m
[33m 39:[m areturn
there shouldnt be any RealPolynomial access in the factor expression of the product