
(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.im))))
(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.im) t_0 (* x.re (* x.re (+ x.im x.im))))
(+ (+ x.im x.im) (* (+ x.re x.im) t_0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_re - 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_im), t_0, (x_46_re * (x_46_re * (x_46_im + x_46_im))));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * t_0);
}
return tmp;
}
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(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 + x_46_im), t_0, Float64(x_46_re * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * t_0)); end return tmp end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]}, 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 + x$46$im), $MachinePrecision] * t$95$0 + N[(x$46$re * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re - x.im\right)\\
\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 + x.im, t_0, x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot t_0\\
\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 91.5%
*-commutative91.5%
*-commutative91.5%
difference-of-squares91.5%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-lft-out99.8%
Simplified99.8%
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-def19.4%
*-commutative19.4%
distribute-lft-out19.4%
*-commutative19.4%
Simplified19.4%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+33.3%
distribute-lft-in33.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+38.9%
*-commutative38.9%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification99.8%
(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.im (* x.re 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_im * (x_46_re * 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_im * (x_46_re * 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_im * (x_46_re * 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_im * Float64(x_46_re * 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_im * (x_46_re * 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$im * N[(x$46$re * 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.im \cdot \left(x.re \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 91.5%
+-commutative91.5%
*-commutative91.5%
distribute-lft-out91.5%
associate-*l*91.5%
*-commutative91.5%
distribute-lft-out91.4%
associate-+r-91.4%
distribute-lft-out--90.1%
Simplified90.2%
sub-neg90.2%
associate-*l*90.2%
associate-*l*98.5%
Applied egg-rr98.5%
Taylor expanded in x.re around 0 98.4%
associate-*r*98.4%
*-commutative98.4%
Simplified98.4%
unsub-neg98.4%
*-commutative98.4%
Applied egg-rr98.4%
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-def19.4%
*-commutative19.4%
distribute-lft-out19.4%
*-commutative19.4%
Simplified19.4%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+33.3%
distribute-lft-in33.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+38.9%
*-commutative38.9%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification98.6%
(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 91.5%
+-commutative91.5%
*-commutative91.5%
distribute-lft-out91.5%
associate-*l*91.5%
*-commutative91.5%
distribute-lft-out91.4%
associate-+r-91.4%
distribute-lft-out--90.1%
Simplified90.2%
sub-neg90.2%
associate-*l*90.2%
associate-*l*98.5%
Applied egg-rr98.5%
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-def19.4%
*-commutative19.4%
distribute-lft-out19.4%
*-commutative19.4%
Simplified19.4%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+33.3%
distribute-lft-in33.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+38.9%
*-commutative38.9%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification98.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (- (* x.re x.re) (* x.im x.im)))
(t_1 (* x.re (+ (* x.re x.im) (* x.re x.im)))))
(if (<= (+ (* x.im t_0) t_1) 2e+286)
(+ t_1 (/ x.im (/ 1.0 t_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_re * x_46_re) - (x_46_im * x_46_im);
double t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double tmp;
if (((x_46_im * t_0) + t_1) <= 2e+286) {
tmp = t_1 + (x_46_im / (1.0 / t_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) :: t_1
real(8) :: tmp
t_0 = (x_46re * x_46re) - (x_46im * x_46im)
t_1 = x_46re * ((x_46re * x_46im) + (x_46re * x_46im))
if (((x_46im * t_0) + t_1) <= 2d+286) then
tmp = t_1 + (x_46im / (1.0d0 / t_0))
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_re * x_46_re) - (x_46_im * x_46_im);
double t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double tmp;
if (((x_46_im * t_0) + t_1) <= 2e+286) {
tmp = t_1 + (x_46_im / (1.0 / t_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_re * x_46_re) - (x_46_im * x_46_im) t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)) tmp = 0 if ((x_46_im * t_0) + t_1) <= 2e+286: tmp = t_1 + (x_46_im / (1.0 / t_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(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) t_1 = Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) tmp = 0.0 if (Float64(Float64(x_46_im * t_0) + t_1) <= 2e+286) tmp = Float64(t_1 + Float64(x_46_im / Float64(1.0 / t_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_re * x_46_re) - (x_46_im * x_46_im); t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)); tmp = 0.0; if (((x_46_im * t_0) + t_1) <= 2e+286) tmp = t_1 + (x_46_im / (1.0 / t_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[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x$46$im * t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision], 2e+286], N[(t$95$1 + N[(x$46$im / N[(1.0 / t$95$0), $MachinePrecision]), $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.re \cdot x.re - x.im \cdot x.im\\
t_1 := x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;x.im \cdot t_0 + t_1 \leq 2 \cdot 10^{+286}:\\
\;\;\;\;t_1 + \frac{x.im}{\frac{1}{t_0}}\\
\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)) < 2.00000000000000007e286Initial program 92.4%
difference-of-squares92.4%
flip-+92.4%
associate-*l/82.5%
Applied egg-rr82.5%
*-commutative82.5%
clear-num82.4%
un-div-inv82.5%
*-un-lft-identity82.5%
times-frac92.4%
*-inverses92.4%
Applied egg-rr92.4%
if 2.00000000000000007e286 < (+.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 49.9%
+-commutative49.9%
*-commutative49.9%
fma-def58.4%
*-commutative58.4%
distribute-lft-out58.4%
*-commutative58.4%
Simplified58.4%
fma-udef49.9%
distribute-lft-in49.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+64.4%
distribute-lft-in64.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+66.8%
*-commutative66.8%
difference-of-squares93.3%
associate-*r*94.1%
*-commutative94.1%
Applied egg-rr94.1%
Final simplification92.9%
(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))))))
(if (<= t_0 1e+262)
t_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 * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= 1e+262) {
tmp = t_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 * x_46im) + (x_46re * x_46im)))
if (t_0 <= 1d+262) then
tmp = t_0
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 * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= 1e+262) {
tmp = t_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 * x_46_im) + (x_46_re * x_46_im))) tmp = 0 if t_0 <= 1e+262: tmp = t_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(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)))) tmp = 0.0 if (t_0 <= 1e+262) tmp = t_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 * x_46_im) + (x_46_re * x_46_im))); tmp = 0.0; if (t_0 <= 1e+262) tmp = t_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[(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]}, If[LessEqual[t$95$0, 1e+262], t$95$0, 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(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)\\
\mathbf{if}\;t_0 \leq 10^{+262}:\\
\;\;\;\;t_0\\
\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)) < 1e262Initial program 92.3%
if 1e262 < (+.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 50.5%
+-commutative50.5%
*-commutative50.5%
fma-def58.8%
*-commutative58.8%
distribute-lft-out58.8%
*-commutative58.8%
Simplified58.8%
fma-udef50.5%
distribute-lft-in50.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+64.8%
distribute-lft-in64.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+67.2%
*-commutative67.2%
difference-of-squares93.4%
associate-*r*94.1%
*-commutative94.1%
Applied egg-rr94.1%
Final simplification92.9%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* 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)))))
(t_2 (- (* x.re x.re) (* x.im x.im))))
(if (<= x.im -1e+139)
t_1
(if (<= x.im -2.8e-104)
(+ t_0 (/ x.im (/ 1.0 t_2)))
(if (<= x.im 4e-110)
(* 3.0 (* x.re (* x.re x.im)))
(if (<= x.im 4e+41) (+ (* x.im t_2) t_0) t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = 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 t_2 = (x_46_re * x_46_re) - (x_46_im * x_46_im);
double tmp;
if (x_46_im <= -1e+139) {
tmp = t_1;
} else if (x_46_im <= -2.8e-104) {
tmp = t_0 + (x_46_im / (1.0 / t_2));
} else if (x_46_im <= 4e-110) {
tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 4e+41) {
tmp = (x_46_im * t_2) + 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) :: t_2
real(8) :: tmp
t_0 = 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)))
t_2 = (x_46re * x_46re) - (x_46im * x_46im)
if (x_46im <= (-1d+139)) then
tmp = t_1
else if (x_46im <= (-2.8d-104)) then
tmp = t_0 + (x_46im / (1.0d0 / t_2))
else if (x_46im <= 4d-110) then
tmp = 3.0d0 * (x_46re * (x_46re * x_46im))
else if (x_46im <= 4d+41) then
tmp = (x_46im * t_2) + 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_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 t_2 = (x_46_re * x_46_re) - (x_46_im * x_46_im);
double tmp;
if (x_46_im <= -1e+139) {
tmp = t_1;
} else if (x_46_im <= -2.8e-104) {
tmp = t_0 + (x_46_im / (1.0 / t_2));
} else if (x_46_im <= 4e-110) {
tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 4e+41) {
tmp = (x_46_im * t_2) + t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = 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))) t_2 = (x_46_re * x_46_re) - (x_46_im * x_46_im) tmp = 0 if x_46_im <= -1e+139: tmp = t_1 elif x_46_im <= -2.8e-104: tmp = t_0 + (x_46_im / (1.0 / t_2)) elif x_46_im <= 4e-110: tmp = 3.0 * (x_46_re * (x_46_re * x_46_im)) elif x_46_im <= 4e+41: tmp = (x_46_im * t_2) + t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = 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)))) t_2 = Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) tmp = 0.0 if (x_46_im <= -1e+139) tmp = t_1; elseif (x_46_im <= -2.8e-104) tmp = Float64(t_0 + Float64(x_46_im / Float64(1.0 / t_2))); elseif (x_46_im <= 4e-110) tmp = Float64(3.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); elseif (x_46_im <= 4e+41) tmp = Float64(Float64(x_46_im * t_2) + t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = 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))); t_2 = (x_46_re * x_46_re) - (x_46_im * x_46_im); tmp = 0.0; if (x_46_im <= -1e+139) tmp = t_1; elseif (x_46_im <= -2.8e-104) tmp = t_0 + (x_46_im / (1.0 / t_2)); elseif (x_46_im <= 4e-110) tmp = 3.0 * (x_46_re * (x_46_re * x_46_im)); elseif (x_46_im <= 4e+41) tmp = (x_46_im * t_2) + t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $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]}, Block[{t$95$2 = N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1e+139], t$95$1, If[LessEqual[x$46$im, -2.8e-104], N[(t$95$0 + N[(x$46$im / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4e-110], N[(3.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4e+41], N[(N[(x$46$im * t$95$2), $MachinePrecision] + t$95$0), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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)\\
t_2 := x.re \cdot x.re - x.im \cdot x.im\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -2.8 \cdot 10^{-104}:\\
\;\;\;\;t_0 + \frac{x.im}{\frac{1}{t_2}}\\
\mathbf{elif}\;x.im \leq 4 \cdot 10^{-110}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 4 \cdot 10^{+41}:\\
\;\;\;\;x.im \cdot t_2 + t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -1.00000000000000003e139 or 4.00000000000000002e41 < x.im Initial program 59.1%
+-commutative59.1%
*-commutative59.1%
fma-def67.0%
*-commutative67.0%
distribute-lft-out67.0%
*-commutative67.0%
Simplified67.0%
fma-udef59.1%
distribute-lft-in59.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.7%
distribute-lft-in72.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+75.0%
*-commutative75.0%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -1.00000000000000003e139 < x.im < -2.8e-104Initial program 93.2%
difference-of-squares93.2%
flip-+93.2%
associate-*l/86.6%
Applied egg-rr86.6%
*-commutative86.6%
clear-num86.4%
un-div-inv86.5%
*-un-lft-identity86.5%
times-frac93.3%
*-inverses93.3%
Applied egg-rr93.3%
if -2.8e-104 < x.im < 4.0000000000000002e-110Initial program 82.0%
+-commutative82.0%
*-commutative82.0%
distribute-lft-out82.0%
associate-*l*82.0%
*-commutative82.0%
distribute-lft-out82.0%
associate-+r-82.0%
distribute-lft-out--82.0%
Simplified82.0%
Taylor expanded in x.re around inf 82.0%
pow182.0%
pow282.0%
associate-*l*99.7%
Applied egg-rr99.7%
if 4.0000000000000002e-110 < x.im < 4.00000000000000002e41Initial program 97.2%
Final simplification98.1%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (/ x.im (/ 1.0 (- (* x.re x.re) (* x.im x.im)))) (* x.re 0.0)))
(t_1 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -6.2e+173)
t_1
(if (<= x.im -4.3e-101)
t_0
(if (<= x.im 3.5e-103)
(+ (* x.re (+ (* x.re x.im) (* x.re x.im))) (* (* x.re x.re) x.im))
(if (<= x.im 10.0) t_0 t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im / (1.0 / ((x_46_re * x_46_re) - (x_46_im * x_46_im)))) + (x_46_re * 0.0);
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 <= -6.2e+173) {
tmp = t_1;
} else if (x_46_im <= -4.3e-101) {
tmp = t_0;
} else if (x_46_im <= 3.5e-103) {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((x_46_re * x_46_re) * x_46_im);
} else if (x_46_im <= 10.0) {
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 / (1.0d0 / ((x_46re * x_46re) - (x_46im * x_46im)))) + (x_46re * 0.0d0)
t_1 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-6.2d+173)) then
tmp = t_1
else if (x_46im <= (-4.3d-101)) then
tmp = t_0
else if (x_46im <= 3.5d-103) then
tmp = (x_46re * ((x_46re * x_46im) + (x_46re * x_46im))) + ((x_46re * x_46re) * x_46im)
else if (x_46im <= 10.0d0) 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 / (1.0 / ((x_46_re * x_46_re) - (x_46_im * x_46_im)))) + (x_46_re * 0.0);
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 <= -6.2e+173) {
tmp = t_1;
} else if (x_46_im <= -4.3e-101) {
tmp = t_0;
} else if (x_46_im <= 3.5e-103) {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((x_46_re * x_46_re) * x_46_im);
} else if (x_46_im <= 10.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im / (1.0 / ((x_46_re * x_46_re) - (x_46_im * x_46_im)))) + (x_46_re * 0.0) 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 <= -6.2e+173: tmp = t_1 elif x_46_im <= -4.3e-101: tmp = t_0 elif x_46_im <= 3.5e-103: tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((x_46_re * x_46_re) * x_46_im) elif x_46_im <= 10.0: 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(1.0 / Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)))) + Float64(x_46_re * 0.0)) 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 <= -6.2e+173) tmp = t_1; elseif (x_46_im <= -4.3e-101) tmp = t_0; elseif (x_46_im <= 3.5e-103) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) + Float64(Float64(x_46_re * x_46_re) * x_46_im)); elseif (x_46_im <= 10.0) 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 / (1.0 / ((x_46_re * x_46_re) - (x_46_im * x_46_im)))) + (x_46_re * 0.0); 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 <= -6.2e+173) tmp = t_1; elseif (x_46_im <= -4.3e-101) tmp = t_0; elseif (x_46_im <= 3.5e-103) tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((x_46_re * x_46_re) * x_46_im); elseif (x_46_im <= 10.0) 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[(1.0 / N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * 0.0), $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, -6.2e+173], t$95$1, If[LessEqual[x$46$im, -4.3e-101], t$95$0, If[LessEqual[x$46$im, 3.5e-103], N[(N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 10.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\frac{1}{x.re \cdot x.re - x.im \cdot x.im}} + x.re \cdot 0\\
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 -6.2 \cdot 10^{+173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -4.3 \cdot 10^{-101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 3.5 \cdot 10^{-103}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) + \left(x.re \cdot x.re\right) \cdot x.im\\
\mathbf{elif}\;x.im \leq 10:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -6.2e173 or 10 < x.im Initial program 59.0%
+-commutative59.0%
*-commutative59.0%
fma-def65.0%
*-commutative65.0%
distribute-lft-out65.0%
*-commutative65.0%
Simplified65.0%
fma-udef59.0%
distribute-lft-in59.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+70.1%
distribute-lft-in70.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.5%
*-commutative72.5%
difference-of-squares99.0%
associate-*r*99.0%
*-commutative99.0%
Applied egg-rr99.0%
if -6.2e173 < x.im < -4.2999999999999997e-101 or 3.50000000000000016e-103 < x.im < 10Initial program 92.7%
difference-of-squares92.7%
flip-+92.7%
associate-*l/84.7%
Applied egg-rr84.7%
*-commutative84.7%
clear-num84.5%
un-div-inv84.6%
*-un-lft-identity84.6%
times-frac92.8%
*-inverses92.8%
Applied egg-rr92.8%
*-commutative92.8%
rem-cbrt-cube79.7%
add-sqr-sqrt29.4%
sqrt-unprod68.3%
sqr-neg68.3%
sqrt-unprod46.8%
add-sqr-sqrt70.0%
neg-mul-170.0%
cbrt-prod70.0%
metadata-eval70.0%
metadata-eval70.0%
add-cbrt-cube70.0%
rem-cbrt-cube74.4%
neg-mul-174.4%
cancel-sign-sub-inv74.4%
+-inverses79.8%
Applied egg-rr79.8%
if -4.2999999999999997e-101 < x.im < 3.50000000000000016e-103Initial program 82.7%
difference-of-squares82.7%
flip-+82.7%
associate-*l/70.8%
Applied egg-rr70.8%
Taylor expanded in x.re around inf 82.7%
Simplified82.7%
Final simplification86.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -49000000.0) (not (<= x.im 0.001))) (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im)))) (+ (* x.re (+ (* x.re x.im) (* 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 <= -49000000.0) || !(x_46_im <= 0.001)) {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((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 <= (-49000000.0d0)) .or. (.not. (x_46im <= 0.001d0))) then
tmp = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
else
tmp = (x_46re * ((x_46re * x_46im) + (x_46re * x_46im))) + ((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 <= -49000000.0) || !(x_46_im <= 0.001)) {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((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 <= -49000000.0) or not (x_46_im <= 0.001): tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) else: tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((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 <= -49000000.0) || !(x_46_im <= 0.001)) 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)))); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) + 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 <= -49000000.0) || ~((x_46_im <= 0.001))) tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); else tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + ((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, -49000000.0], N[Not[LessEqual[x$46$im, 0.001]], $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], N[(N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -49000000 \lor \neg \left(x.im \leq 0.001\right):\\
\;\;\;\;\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{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) + \left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.im < -4.9e7 or 1e-3 < x.im Initial program 69.9%
+-commutative69.9%
*-commutative69.9%
fma-def75.8%
*-commutative75.8%
distribute-lft-out75.8%
*-commutative75.8%
Simplified75.8%
fma-udef69.9%
distribute-lft-in69.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+75.4%
distribute-lft-in75.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+78.9%
*-commutative78.9%
difference-of-squares97.2%
associate-*r*97.2%
*-commutative97.2%
Applied egg-rr97.2%
if -4.9e7 < x.im < 1e-3Initial program 86.3%
difference-of-squares86.3%
flip-+86.3%
associate-*l/75.1%
Applied egg-rr75.1%
Taylor expanded in x.re around inf 70.3%
Simplified70.3%
Final simplification82.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -50000000.0) (not (<= x.im 0.001))) (+ (* x.im (- (* x.re x.re) (* x.im x.im))) (+ x.im x.im)) (* 3.0 (* (* x.re x.re) x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -50000000.0) || !(x_46_im <= 0.001)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im + x_46_im);
} else {
tmp = 3.0 * ((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 <= (-50000000.0d0)) .or. (.not. (x_46im <= 0.001d0))) then
tmp = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (x_46im + x_46im)
else
tmp = 3.0d0 * ((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 <= -50000000.0) || !(x_46_im <= 0.001)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im + x_46_im);
} else {
tmp = 3.0 * ((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 <= -50000000.0) or not (x_46_im <= 0.001): tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im + x_46_im) else: tmp = 3.0 * ((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 <= -50000000.0) || !(x_46_im <= 0.001)) tmp = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_im + x_46_im)); else tmp = Float64(3.0 * 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 <= -50000000.0) || ~((x_46_im <= 0.001))) tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im + x_46_im); else tmp = 3.0 * ((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, -50000000.0], N[Not[LessEqual[x$46$im, 0.001]], $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] + N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -50000000 \lor \neg \left(x.im \leq 0.001\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + \left(x.im + x.im\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -5e7 or 1e-3 < x.im Initial program 69.9%
*-commutative69.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+75.4%
*-commutative75.4%
distribute-lft-in75.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+78.9%
Applied egg-rr78.9%
if -5e7 < x.im < 1e-3Initial program 86.3%
+-commutative86.3%
*-commutative86.3%
distribute-lft-out86.3%
associate-*l*86.3%
*-commutative86.3%
distribute-lft-out86.2%
associate-+r-86.2%
distribute-lft-out--86.2%
Simplified86.3%
sub-neg86.3%
associate-*l*86.3%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around inf 70.2%
*-commutative70.2%
unpow270.2%
Simplified70.2%
Final simplification74.3%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -59000000.0) (not (<= x.im 0.001))) (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im)))) (* 3.0 (* (* x.re x.re) x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -59000000.0) || !(x_46_im <= 0.001)) {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = 3.0 * ((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 <= (-59000000.0d0)) .or. (.not. (x_46im <= 0.001d0))) then
tmp = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
else
tmp = 3.0d0 * ((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 <= -59000000.0) || !(x_46_im <= 0.001)) {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = 3.0 * ((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 <= -59000000.0) or not (x_46_im <= 0.001): tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) else: tmp = 3.0 * ((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 <= -59000000.0) || !(x_46_im <= 0.001)) 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)))); else tmp = Float64(3.0 * 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 <= -59000000.0) || ~((x_46_im <= 0.001))) tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); else tmp = 3.0 * ((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, -59000000.0], N[Not[LessEqual[x$46$im, 0.001]], $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], N[(3.0 * N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -59000000 \lor \neg \left(x.im \leq 0.001\right):\\
\;\;\;\;\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{else}:\\
\;\;\;\;3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -5.9e7 or 1e-3 < x.im Initial program 69.9%
+-commutative69.9%
*-commutative69.9%
fma-def75.8%
*-commutative75.8%
distribute-lft-out75.8%
*-commutative75.8%
Simplified75.8%
fma-udef69.9%
distribute-lft-in69.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+75.4%
distribute-lft-in75.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+78.9%
*-commutative78.9%
difference-of-squares97.2%
associate-*r*97.2%
*-commutative97.2%
Applied egg-rr97.2%
if -5.9e7 < x.im < 1e-3Initial program 86.3%
+-commutative86.3%
*-commutative86.3%
distribute-lft-out86.3%
associate-*l*86.3%
*-commutative86.3%
distribute-lft-out86.2%
associate-+r-86.2%
distribute-lft-out--86.2%
Simplified86.3%
sub-neg86.3%
associate-*l*86.3%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around inf 70.2%
*-commutative70.2%
unpow270.2%
Simplified70.2%
Final simplification82.9%
(FPCore (x.re x.im) :precision binary64 (* 3.0 (* (* x.re x.re) x.im)))
double code(double x_46_re, double x_46_im) {
return 3.0 * ((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 = 3.0d0 * ((x_46re * x_46re) * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return 3.0 * ((x_46_re * x_46_re) * x_46_im);
}
def code(x_46_re, x_46_im): return 3.0 * ((x_46_re * x_46_re) * x_46_im)
function code(x_46_re, x_46_im) return Float64(3.0 * Float64(Float64(x_46_re * x_46_re) * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = 3.0 * ((x_46_re * x_46_re) * x_46_im); end
code[x$46$re_, x$46$im_] := N[(3.0 * N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right)
\end{array}
Initial program 78.6%
+-commutative78.6%
*-commutative78.6%
distribute-lft-out78.6%
associate-*l*78.6%
*-commutative78.6%
distribute-lft-out84.0%
associate-+r-84.0%
distribute-lft-out--77.4%
Simplified77.5%
sub-neg77.5%
associate-*l*77.5%
associate-*l*84.6%
Applied egg-rr84.6%
Taylor expanded in x.re around inf 48.5%
*-commutative48.5%
unpow248.5%
Simplified48.5%
Final simplification48.5%
(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 78.6%
*-commutative78.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+61.6%
*-commutative61.6%
distribute-rgt-in61.6%
*-commutative61.6%
flip-+0.0%
clear-num0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
flip-+46.8%
Applied egg-rr46.8%
Taylor expanded in x.re around inf 33.2%
Simplified33.2%
Final simplification33.2%
(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 78.6%
Taylor expanded in x.re around 0 57.9%
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 2023279
(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)))