
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im)))))
(t_1 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -1e+119)
t_1
(if (<= x.im -1.5e-109)
t_0
(if (<= x.im 6e-145)
(* (* x.re (* x.re x.im)) 3.0)
(if (<= x.im 9e+33) t_0 t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -1e+119) {
tmp = t_1;
} else if (x_46_im <= -1.5e-109) {
tmp = t_0;
} else if (x_46_im <= 6e-145) {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
} else if (x_46_im <= 9e+33) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (x_46re * ((x_46re * x_46im) + (x_46re * x_46im)))
t_1 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-1d+119)) then
tmp = t_1
else if (x_46im <= (-1.5d-109)) then
tmp = t_0
else if (x_46im <= 6d-145) then
tmp = (x_46re * (x_46re * x_46im)) * 3.0d0
else if (x_46im <= 9d+33) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -1e+119) {
tmp = t_1;
} else if (x_46_im <= -1.5e-109) {
tmp = t_0;
} else if (x_46_im <= 6e-145) {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
} else if (x_46_im <= 9e+33) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) tmp = 0 if x_46_im <= -1e+119: tmp = t_1 elif x_46_im <= -1.5e-109: tmp = t_0 elif x_46_im <= 6e-145: tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0 elif x_46_im <= 9e+33: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) t_1 = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - x_46_im)))) tmp = 0.0 if (x_46_im <= -1e+119) tmp = t_1; elseif (x_46_im <= -1.5e-109) tmp = t_0; elseif (x_46_im <= 6e-145) tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_im)) * 3.0); elseif (x_46_im <= 9e+33) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); tmp = 0.0; if (x_46_im <= -1e+119) tmp = t_1; elseif (x_46_im <= -1.5e-109) tmp = t_0; elseif (x_46_im <= 6e-145) tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0; elseif (x_46_im <= 9e+33) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1e+119], t$95$1, If[LessEqual[x$46$im, -1.5e-109], t$95$0, If[LessEqual[x$46$im, 6e-145], N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision], If[LessEqual[x$46$im, 9e+33], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
t_1 := \left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -1.5 \cdot 10^{-109}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 6 \cdot 10^{-145}:\\
\;\;\;\;\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\\
\mathbf{elif}\;x.im \leq 9 \cdot 10^{+33}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -9.99999999999999944e118 or 9.0000000000000001e33 < x.im Initial program 61.9%
+-commutative61.9%
*-commutative61.9%
fma-def75.0%
*-commutative75.0%
distribute-rgt-out75.0%
*-commutative75.0%
Simplified75.0%
*-commutative75.0%
fma-def61.9%
distribute-lft-in61.9%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+84.8%
difference-of-squares100.0%
associate-*l*100.0%
Applied egg-rr100.0%
if -9.99999999999999944e118 < x.im < -1.50000000000000011e-109 or 5.99999999999999985e-145 < x.im < 9.0000000000000001e33Initial program 98.5%
if -1.50000000000000011e-109 < x.im < 5.99999999999999985e-145Initial program 80.5%
Taylor expanded in x.re around inf 80.5%
Simplified80.5%
*-commutative80.5%
*-commutative80.5%
distribute-lft-out80.5%
add-log-exp56.8%
add-log-exp56.1%
sum-log56.1%
exp-lft-sqr56.1%
*-commutative56.1%
add-log-exp80.5%
associate-*l*80.5%
distribute-lft-in80.6%
*-un-lft-identity80.6%
distribute-rgt-out80.6%
metadata-eval80.6%
associate-*l*80.4%
associate-*r*99.8%
Applied egg-rr99.8%
Final simplification99.4%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(fma (* x.re (* x.re x.im)) 3.0 (- (pow x.im 3.0)))
(+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = fma((x_46_re * (x_46_re * x_46_im)), 3.0, -pow(x_46_im, 3.0));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = fma(Float64(x_46_re * Float64(x_46_re * x_46_im)), 3.0, Float64(-(x_46_im ^ 3.0))); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] * 3.0 + (-N[Power[x$46$im, 3.0], $MachinePrecision])), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x.re \cdot \left(x.re \cdot x.im\right), 3, -{x.im}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 92.1%
+-commutative92.1%
*-commutative92.1%
sub-neg92.1%
distribute-lft-in90.3%
associate-+r+90.3%
distribute-rgt-neg-out90.3%
unsub-neg90.3%
associate-*r*97.9%
distribute-rgt-out97.9%
*-commutative97.9%
count-297.9%
distribute-lft1-in97.9%
metadata-eval97.9%
*-commutative97.9%
*-commutative97.9%
associate-*r*97.9%
cube-unmult98.0%
Simplified98.0%
associate-*r*98.0%
associate-*l*98.0%
fma-neg98.0%
Applied egg-rr98.0%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
fma-def34.3%
*-commutative34.3%
distribute-rgt-out34.3%
*-commutative34.3%
Simplified34.3%
*-commutative34.3%
fma-def0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+60.0%
difference-of-squares100.0%
associate-*l*100.0%
Applied egg-rr100.0%
Final simplification98.3%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(- (* x.re (* x.re (* x.im 3.0))) (pow x.im 3.0))
(+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - pow(x_46_im, 3.0);
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Double.POSITIVE_INFINITY) {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - Math.pow(x_46_im, 3.0);
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if ((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= math.inf: tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - math.pow(x_46_im, 3.0) else: tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_im * 3.0))) - (x_46_im ^ 3.0)); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Inf) tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - (x_46_im ^ 3.0); else tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x$46$re * N[(x$46$re * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3}\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 92.1%
+-commutative92.1%
*-commutative92.1%
sub-neg92.1%
distribute-lft-in90.3%
associate-+r+90.3%
distribute-rgt-neg-out90.3%
unsub-neg90.3%
associate-*r*97.9%
distribute-rgt-out97.9%
*-commutative97.9%
count-297.9%
distribute-lft1-in97.9%
metadata-eval97.9%
*-commutative97.9%
*-commutative97.9%
associate-*r*97.9%
cube-unmult98.0%
Simplified98.0%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
fma-def34.3%
*-commutative34.3%
distribute-rgt-out34.3%
*-commutative34.3%
Simplified34.3%
*-commutative34.3%
fma-def0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+60.0%
difference-of-squares100.0%
associate-*l*100.0%
Applied egg-rr100.0%
Final simplification98.3%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (+ (- (* x.re x.re) (* x.im x.im)) (+ x.re x.re)))))
(if (<= x.im -5.8e-53)
t_0
(if (<= x.im 5.5e-82)
(* (* x.re (* x.re x.im)) 3.0)
(if (<= x.im 1.32e-11)
t_0
(if (<= x.im 1e-7)
(* (* x.re x.im) (* x.re 3.0))
(+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re));
double tmp;
if (x_46_im <= -5.8e-53) {
tmp = t_0;
} else if (x_46_im <= 5.5e-82) {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
} else if (x_46_im <= 1.32e-11) {
tmp = t_0;
} else if (x_46_im <= 1e-7) {
tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im * (((x_46re * x_46re) - (x_46im * x_46im)) + (x_46re + x_46re))
if (x_46im <= (-5.8d-53)) then
tmp = t_0
else if (x_46im <= 5.5d-82) then
tmp = (x_46re * (x_46re * x_46im)) * 3.0d0
else if (x_46im <= 1.32d-11) then
tmp = t_0
else if (x_46im <= 1d-7) then
tmp = (x_46re * x_46im) * (x_46re * 3.0d0)
else
tmp = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re));
double tmp;
if (x_46_im <= -5.8e-53) {
tmp = t_0;
} else if (x_46_im <= 5.5e-82) {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
} else if (x_46_im <= 1.32e-11) {
tmp = t_0;
} else if (x_46_im <= 1e-7) {
tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re)) tmp = 0 if x_46_im <= -5.8e-53: tmp = t_0 elif x_46_im <= 5.5e-82: tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0 elif x_46_im <= 1.32e-11: tmp = t_0 elif x_46_im <= 1e-7: tmp = (x_46_re * x_46_im) * (x_46_re * 3.0) else: tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) + Float64(x_46_re + x_46_re))) tmp = 0.0 if (x_46_im <= -5.8e-53) tmp = t_0; elseif (x_46_im <= 5.5e-82) tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_im)) * 3.0); elseif (x_46_im <= 1.32e-11) tmp = t_0; elseif (x_46_im <= 1e-7) tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0)); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re)); tmp = 0.0; if (x_46_im <= -5.8e-53) tmp = t_0; elseif (x_46_im <= 5.5e-82) tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0; elseif (x_46_im <= 1.32e-11) tmp = t_0; elseif (x_46_im <= 1e-7) tmp = (x_46_re * x_46_im) * (x_46_re * 3.0); else tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -5.8e-53], t$95$0, If[LessEqual[x$46$im, 5.5e-82], N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision], If[LessEqual[x$46$im, 1.32e-11], t$95$0, If[LessEqual[x$46$im, 1e-7], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(\left(x.re \cdot x.re - x.im \cdot x.im\right) + \left(x.re + x.re\right)\right)\\
\mathbf{if}\;x.im \leq -5.8 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 5.5 \cdot 10^{-82}:\\
\;\;\;\;\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\\
\mathbf{elif}\;x.im \leq 1.32 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 10^{-7}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -5.7999999999999996e-53 or 5.4999999999999998e-82 < x.im < 1.32e-11Initial program 81.5%
*-commutative81.5%
*-commutative81.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+78.6%
Applied egg-rr78.6%
*-commutative78.6%
distribute-rgt-out78.6%
distribute-lft-out85.5%
Applied egg-rr85.5%
if -5.7999999999999996e-53 < x.im < 5.4999999999999998e-82Initial program 84.1%
Taylor expanded in x.re around inf 80.1%
Simplified80.1%
*-commutative80.1%
*-commutative80.1%
distribute-lft-out80.1%
add-log-exp53.8%
add-log-exp53.1%
sum-log53.1%
exp-lft-sqr53.1%
*-commutative53.1%
add-log-exp80.1%
associate-*l*80.1%
distribute-lft-in80.2%
*-un-lft-identity80.2%
distribute-rgt-out80.2%
metadata-eval80.2%
associate-*l*80.1%
associate-*r*95.8%
Applied egg-rr95.8%
if 1.32e-11 < x.im < 9.9999999999999995e-8Initial program 99.2%
Taylor expanded in x.re around inf 99.2%
Simplified99.2%
*-commutative99.2%
*-commutative99.2%
distribute-lft-out99.2%
add-log-exp51.6%
add-log-exp50.1%
sum-log50.1%
exp-lft-sqr52.3%
*-commutative52.3%
add-log-exp99.2%
associate-*l*98.4%
distribute-lft-in98.0%
*-un-lft-identity98.0%
distribute-rgt-out98.0%
metadata-eval98.0%
associate-*l*98.4%
associate-*r*99.2%
*-commutative99.2%
*-commutative99.2%
associate-*l*99.2%
*-commutative99.2%
Applied egg-rr99.2%
if 9.9999999999999995e-8 < x.im Initial program 69.2%
+-commutative69.2%
*-commutative69.2%
fma-def75.3%
*-commutative75.3%
distribute-rgt-out75.3%
*-commutative75.3%
Simplified75.3%
*-commutative75.3%
fma-def69.2%
distribute-lft-in69.2%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+80.2%
difference-of-squares98.7%
associate-*l*98.7%
Applied egg-rr98.7%
Final simplification93.0%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -8.2e-53) (not (<= x.im 2.9e-79))) (* x.im (+ (- (* x.re x.re) (* x.im x.im)) (+ x.re x.re))) (* (* x.re (* x.re x.im)) 3.0)))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -8.2e-53) || !(x_46_im <= 2.9e-79)) {
tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-8.2d-53)) .or. (.not. (x_46im <= 2.9d-79))) then
tmp = x_46im * (((x_46re * x_46re) - (x_46im * x_46im)) + (x_46re + x_46re))
else
tmp = (x_46re * (x_46re * x_46im)) * 3.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -8.2e-53) || !(x_46_im <= 2.9e-79)) {
tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -8.2e-53) or not (x_46_im <= 2.9e-79): tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re)) else: tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0 return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -8.2e-53) || !(x_46_im <= 2.9e-79)) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) + Float64(x_46_re + x_46_re))); else tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_im)) * 3.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -8.2e-53) || ~((x_46_im <= 2.9e-79))) tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re)); else tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -8.2e-53], N[Not[LessEqual[x$46$im, 2.9e-79]], $MachinePrecision]], N[(x$46$im * N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -8.2 \cdot 10^{-53} \lor \neg \left(x.im \leq 2.9 \cdot 10^{-79}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re - x.im \cdot x.im\right) + \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\\
\end{array}
\end{array}
if x.im < -8.2000000000000001e-53 or 2.9000000000000001e-79 < x.im Initial program 76.5%
*-commutative76.5%
*-commutative76.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+74.6%
Applied egg-rr74.6%
*-commutative74.6%
distribute-rgt-out74.6%
distribute-lft-out82.4%
Applied egg-rr82.4%
if -8.2000000000000001e-53 < x.im < 2.9000000000000001e-79Initial program 84.1%
Taylor expanded in x.re around inf 80.1%
Simplified80.1%
*-commutative80.1%
*-commutative80.1%
distribute-lft-out80.1%
add-log-exp53.8%
add-log-exp53.1%
sum-log53.1%
exp-lft-sqr53.1%
*-commutative53.1%
add-log-exp80.1%
associate-*l*80.1%
distribute-lft-in80.2%
*-un-lft-identity80.2%
distribute-rgt-out80.2%
metadata-eval80.2%
associate-*l*80.1%
associate-*r*95.8%
Applied egg-rr95.8%
Final simplification87.7%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -170000000.0) (not (<= x.im 1e-7))) (+ (* x.im (- (* x.re x.re) (* x.im x.im))) -2.0) (* (* x.re (* x.re x.im)) 3.0)))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -170000000.0) || !(x_46_im <= 1e-7)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -2.0;
} else {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-170000000.0d0)) .or. (.not. (x_46im <= 1d-7))) then
tmp = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (-2.0d0)
else
tmp = (x_46re * (x_46re * x_46im)) * 3.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -170000000.0) || !(x_46_im <= 1e-7)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -2.0;
} else {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -170000000.0) or not (x_46_im <= 1e-7): tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -2.0 else: tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0 return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -170000000.0) || !(x_46_im <= 1e-7)) tmp = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + -2.0); else tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_im)) * 3.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -170000000.0) || ~((x_46_im <= 1e-7))) tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -2.0; else tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -170000000.0], N[Not[LessEqual[x$46$im, 1e-7]], $MachinePrecision]], N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -170000000 \lor \neg \left(x.im \leq 10^{-7}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + -2\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\\
\end{array}
\end{array}
if x.im < -1.7e8 or 9.9999999999999995e-8 < x.im Initial program 71.5%
*-commutative71.5%
*-commutative71.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+75.5%
Applied egg-rr75.5%
expm1-log1p-u44.2%
expm1-udef44.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified85.3%
if -1.7e8 < x.im < 9.9999999999999995e-8Initial program 87.0%
Taylor expanded in x.re around inf 71.8%
Simplified71.8%
*-commutative71.8%
*-commutative71.8%
distribute-lft-out71.8%
add-log-exp47.3%
add-log-exp46.6%
sum-log46.6%
exp-lft-sqr46.7%
*-commutative46.7%
add-log-exp71.8%
associate-*l*71.7%
distribute-lft-in71.8%
*-un-lft-identity71.8%
distribute-rgt-out71.8%
metadata-eval71.8%
associate-*l*71.7%
associate-*r*84.5%
Applied egg-rr84.5%
Final simplification84.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -8.5e+118) (not (<= x.im 6e+167))) (* x.re (* x.re (- x.im))) (* (* x.re x.im) (* x.re 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -8.5e+118) || !(x_46_im <= 6e+167)) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else {
tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-8.5d+118)) .or. (.not. (x_46im <= 6d+167))) then
tmp = x_46re * (x_46re * -x_46im)
else
tmp = (x_46re * x_46im) * (x_46re * 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -8.5e+118) || !(x_46_im <= 6e+167)) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else {
tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -8.5e+118) or not (x_46_im <= 6e+167): tmp = x_46_re * (x_46_re * -x_46_im) else: tmp = (x_46_re * x_46_im) * (x_46_re * 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -8.5e+118) || !(x_46_im <= 6e+167)) tmp = Float64(x_46_re * Float64(x_46_re * Float64(-x_46_im))); else tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -8.5e+118) || ~((x_46_im <= 6e+167))) tmp = x_46_re * (x_46_re * -x_46_im); else tmp = (x_46_re * x_46_im) * (x_46_re * 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -8.5e+118], N[Not[LessEqual[x$46$im, 6e+167]], $MachinePrecision]], N[(x$46$re * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -8.5 \cdot 10^{+118} \lor \neg \left(x.im \leq 6 \cdot 10^{+167}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -8.50000000000000033e118 or 6.00000000000000023e167 < x.im Initial program 56.2%
+-commutative56.2%
*-commutative56.2%
sub-neg56.2%
distribute-lft-in54.8%
associate-+r+54.8%
distribute-rgt-neg-out54.8%
unsub-neg54.8%
associate-*r*54.8%
distribute-rgt-out54.8%
*-commutative54.8%
count-254.8%
distribute-lft1-in54.8%
metadata-eval54.8%
*-commutative54.8%
*-commutative54.8%
associate-*r*54.8%
cube-unmult54.8%
Simplified54.8%
associate-*r*54.8%
associate-*l*54.8%
fma-neg54.8%
Applied egg-rr54.8%
Taylor expanded in x.re around inf 10.1%
Simplified37.4%
distribute-rgt-neg-out37.4%
*-commutative37.4%
associate-*l*37.4%
Applied egg-rr37.4%
if -8.50000000000000033e118 < x.im < 6.00000000000000023e167Initial program 88.9%
Taylor expanded in x.re around inf 63.3%
Simplified63.3%
*-commutative63.3%
*-commutative63.3%
distribute-lft-out63.3%
add-log-exp43.3%
add-log-exp42.8%
sum-log42.8%
exp-lft-sqr42.8%
*-commutative42.8%
add-log-exp63.3%
associate-*l*63.3%
distribute-lft-in63.4%
*-un-lft-identity63.4%
distribute-rgt-out63.4%
metadata-eval63.4%
associate-*l*63.3%
associate-*r*72.5%
*-commutative72.5%
*-commutative72.5%
associate-*l*72.5%
*-commutative72.5%
Applied egg-rr72.5%
Final simplification62.5%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -8e+118) (not (<= x.im 3.4e+167))) (* x.re (* x.re (- x.im))) (* (* x.re (* x.re x.im)) 3.0)))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -8e+118) || !(x_46_im <= 3.4e+167)) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-8d+118)) .or. (.not. (x_46im <= 3.4d+167))) then
tmp = x_46re * (x_46re * -x_46im)
else
tmp = (x_46re * (x_46re * x_46im)) * 3.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -8e+118) || !(x_46_im <= 3.4e+167)) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else {
tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -8e+118) or not (x_46_im <= 3.4e+167): tmp = x_46_re * (x_46_re * -x_46_im) else: tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0 return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -8e+118) || !(x_46_im <= 3.4e+167)) tmp = Float64(x_46_re * Float64(x_46_re * Float64(-x_46_im))); else tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_im)) * 3.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -8e+118) || ~((x_46_im <= 3.4e+167))) tmp = x_46_re * (x_46_re * -x_46_im); else tmp = (x_46_re * (x_46_re * x_46_im)) * 3.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -8e+118], N[Not[LessEqual[x$46$im, 3.4e+167]], $MachinePrecision]], N[(x$46$re * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -8 \cdot 10^{+118} \lor \neg \left(x.im \leq 3.4 \cdot 10^{+167}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\\
\end{array}
\end{array}
if x.im < -7.99999999999999973e118 or 3.4e167 < x.im Initial program 56.2%
+-commutative56.2%
*-commutative56.2%
sub-neg56.2%
distribute-lft-in54.8%
associate-+r+54.8%
distribute-rgt-neg-out54.8%
unsub-neg54.8%
associate-*r*54.8%
distribute-rgt-out54.8%
*-commutative54.8%
count-254.8%
distribute-lft1-in54.8%
metadata-eval54.8%
*-commutative54.8%
*-commutative54.8%
associate-*r*54.8%
cube-unmult54.8%
Simplified54.8%
associate-*r*54.8%
associate-*l*54.8%
fma-neg54.8%
Applied egg-rr54.8%
Taylor expanded in x.re around inf 10.1%
Simplified37.4%
distribute-rgt-neg-out37.4%
*-commutative37.4%
associate-*l*37.4%
Applied egg-rr37.4%
if -7.99999999999999973e118 < x.im < 3.4e167Initial program 88.9%
Taylor expanded in x.re around inf 63.3%
Simplified63.3%
*-commutative63.3%
*-commutative63.3%
distribute-lft-out63.3%
add-log-exp43.3%
add-log-exp42.8%
sum-log42.8%
exp-lft-sqr42.8%
*-commutative42.8%
add-log-exp63.3%
associate-*l*63.3%
distribute-lft-in63.4%
*-un-lft-identity63.4%
distribute-rgt-out63.4%
metadata-eval63.4%
associate-*l*63.3%
associate-*r*72.5%
Applied egg-rr72.5%
Final simplification62.5%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -9e+118) (not (<= x.im 2.35e+169))) (* x.re (* x.re (- x.im))) (* (* x.re x.re) x.im)))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -9e+118) || !(x_46_im <= 2.35e+169)) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-9d+118)) .or. (.not. (x_46im <= 2.35d+169))) then
tmp = x_46re * (x_46re * -x_46im)
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -9e+118) || !(x_46_im <= 2.35e+169)) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -9e+118) or not (x_46_im <= 2.35e+169): tmp = x_46_re * (x_46_re * -x_46_im) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -9e+118) || !(x_46_im <= 2.35e+169)) tmp = Float64(x_46_re * Float64(x_46_re * Float64(-x_46_im))); else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -9e+118) || ~((x_46_im <= 2.35e+169))) tmp = x_46_re * (x_46_re * -x_46_im); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -9e+118], N[Not[LessEqual[x$46$im, 2.35e+169]], $MachinePrecision]], N[(x$46$re * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -9 \cdot 10^{+118} \lor \neg \left(x.im \leq 2.35 \cdot 10^{+169}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.im < -9.00000000000000004e118 or 2.3499999999999999e169 < x.im Initial program 56.2%
+-commutative56.2%
*-commutative56.2%
sub-neg56.2%
distribute-lft-in54.8%
associate-+r+54.8%
distribute-rgt-neg-out54.8%
unsub-neg54.8%
associate-*r*54.8%
distribute-rgt-out54.8%
*-commutative54.8%
count-254.8%
distribute-lft1-in54.8%
metadata-eval54.8%
*-commutative54.8%
*-commutative54.8%
associate-*r*54.8%
cube-unmult54.8%
Simplified54.8%
associate-*r*54.8%
associate-*l*54.8%
fma-neg54.8%
Applied egg-rr54.8%
Taylor expanded in x.re around inf 10.1%
Simplified37.4%
distribute-rgt-neg-out37.4%
*-commutative37.4%
associate-*l*37.4%
Applied egg-rr37.4%
if -9.00000000000000004e118 < x.im < 2.3499999999999999e169Initial program 88.9%
*-commutative88.9%
*-commutative88.9%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+60.3%
Applied egg-rr60.3%
Taylor expanded in x.re around inf 42.9%
Simplified42.9%
Final simplification41.3%
(FPCore (x.re x.im) :precision binary64 (* (* x.re x.re) x.im))
double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (x_46re * x_46re) * x_46im
end function
public static double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
def code(x_46_re, x_46_im): return (x_46_re * x_46_re) * x_46_im
function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * x_46_re) * x_46_im) end
function tmp = code(x_46_re, x_46_im) tmp = (x_46_re * x_46_re) * x_46_im; end
code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re\right) \cdot x.im
\end{array}
Initial program 79.5%
*-commutative79.5%
*-commutative79.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
flip-+63.4%
Applied egg-rr63.4%
Taylor expanded in x.re around inf 33.5%
Simplified33.5%
Final simplification33.5%
(FPCore (x.re x.im) :precision binary64 (* x.re -3.0))
double code(double x_46_re, double x_46_im) {
return x_46_re * -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46re * (-3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_re * -3.0;
}
def code(x_46_re, x_46_im): return x_46_re * -3.0
function code(x_46_re, x_46_im) return Float64(x_46_re * -3.0) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_re * -3.0; end
code[x$46$re_, x$46$im_] := N[(x$46$re * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot -3
\end{array}
Initial program 79.5%
Taylor expanded in x.re around inf 48.1%
Simplified48.1%
expm1-log1p-u37.3%
expm1-udef27.8%
*-commutative27.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified17.6%
Taylor expanded in x.re around 0 3.7%
Final simplification3.7%
(FPCore (x.re x.im) :precision binary64 -3.0)
double code(double x_46_re, double x_46_im) {
return -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -3.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -3.0;
}
def code(x_46_re, x_46_im): return -3.0
function code(x_46_re, x_46_im) return -3.0 end
function tmp = code(x_46_re, x_46_im) tmp = -3.0; end
code[x$46$re_, x$46$im_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 79.5%
+-commutative79.5%
*-commutative79.5%
sub-neg79.5%
distribute-lft-in78.0%
associate-+r+78.0%
distribute-rgt-neg-out78.0%
unsub-neg78.0%
associate-*r*84.6%
distribute-rgt-out84.5%
*-commutative84.5%
count-284.5%
distribute-lft1-in84.5%
metadata-eval84.5%
*-commutative84.5%
*-commutative84.5%
associate-*r*84.5%
cube-unmult84.6%
Simplified84.6%
Taylor expanded in x.re around 0 61.7%
Simplified2.7%
Final simplification2.7%
(FPCore (x.re x.im) :precision binary64 0.1)
double code(double x_46_re, double x_46_im) {
return 0.1;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 0.1d0
end function
public static double code(double x_46_re, double x_46_im) {
return 0.1;
}
def code(x_46_re, x_46_im): return 0.1
function code(x_46_re, x_46_im) return 0.1 end
function tmp = code(x_46_re, x_46_im) tmp = 0.1; end
code[x$46$re_, x$46$im_] := 0.1
\begin{array}{l}
\\
0.1
\end{array}
Initial program 79.5%
+-commutative79.5%
*-commutative79.5%
sub-neg79.5%
distribute-lft-in78.0%
associate-+r+78.0%
distribute-rgt-neg-out78.0%
unsub-neg78.0%
associate-*r*84.6%
distribute-rgt-out84.5%
*-commutative84.5%
count-284.5%
distribute-lft1-in84.5%
metadata-eval84.5%
*-commutative84.5%
*-commutative84.5%
associate-*r*84.5%
cube-unmult84.6%
Simplified84.6%
sub-neg84.6%
associate-*r*84.6%
associate-*l*84.6%
flip3-+12.4%
associate-*r*11.3%
associate-*r*11.3%
unpow-prod-down8.0%
pow28.0%
pow-pow8.0%
metadata-eval8.0%
Applied egg-rr8.0%
Simplified2.7%
Final simplification2.7%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = ((x_46re * x_46im) * (2.0d0 * x_46re)) + ((x_46im * (x_46re - x_46im)) * (x_46re + x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_im) * Float64(2.0 * x_46_re)) + Float64(Float64(x_46_im * Float64(x_46_re - x_46_im)) * Float64(x_46_re + x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im)); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(2.0 * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.im\right) \cdot \left(2 \cdot x.re\right) + \left(x.im \cdot \left(x.re - x.im\right)\right) \cdot \left(x.re + x.im\right)
\end{array}
herbie shell --seed 2023188
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:herbie-target
(+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im)))
(+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))