
(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 15 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.re x.im) (* 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)
(+ t_0 (* x.re (* x.re (+ x.im x.im))))
(+ t_0 (* x.re 0.0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re - x_46_im) * (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 = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im)));
} else {
tmp = t_0 + (x_46_re * 0.0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re - x_46_im) * (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.POSITIVE_INFINITY) {
tmp = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im)));
} else {
tmp = t_0 + (x_46_re * 0.0);
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_re - x_46_im) * (x_46_im * (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 = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im))) else: tmp = t_0 + (x_46_re * 0.0) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_re - x_46_im) * 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 = Float64(t_0 + Float64(x_46_re * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(t_0 + Float64(x_46_re * 0.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_re - x_46_im) * (x_46_im * (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 = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im))); else tmp = t_0 + (x_46_re * 0.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re + x$46$im), $MachinePrecision]), $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[(t$95$0 + N[(x$46$re * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(x$46$re * 0.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\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:\\
\;\;\;\;t_0 + x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + x.re \cdot 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.8%
add-cube-cbrt91.4%
pow391.5%
*-commutative91.5%
difference-of-squares91.5%
associate-*r*99.4%
Applied egg-rr99.4%
unpow399.4%
add-cube-cbrt99.7%
*-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
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%
add-cube-cbrt0.0%
pow30.0%
*-commutative0.0%
difference-of-squares11.8%
associate-*r*11.8%
Applied egg-rr11.8%
unpow311.8%
add-cube-cbrt11.8%
*-commutative11.8%
+-commutative11.8%
Applied egg-rr11.8%
*-commutative11.8%
flip-+0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.25e-105) (not (<= x.im 3.1e-79))) (+ (* (- x.re x.im) (* x.im (+ x.re x.im))) (* x.re 0.0)) (* (* x.re x.im) (* x.re 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.25e-105) || !(x_46_im <= 3.1e-79)) {
tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.0);
} 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 <= (-1.25d-105)) .or. (.not. (x_46im <= 3.1d-79))) then
tmp = ((x_46re - x_46im) * (x_46im * (x_46re + x_46im))) + (x_46re * 0.0d0)
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 <= -1.25e-105) || !(x_46_im <= 3.1e-79)) {
tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.0);
} 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 <= -1.25e-105) or not (x_46_im <= 3.1e-79): tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.0) 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 <= -1.25e-105) || !(x_46_im <= 3.1e-79)) tmp = Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_re + x_46_im))) + Float64(x_46_re * 0.0)); 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 <= -1.25e-105) || ~((x_46_im <= 3.1e-79))) tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.0); 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, -1.25e-105], N[Not[LessEqual[x$46$im, 3.1e-79]], $MachinePrecision]], N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * 0.0), $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 -1.25 \cdot 10^{-105} \lor \neg \left(x.im \leq 3.1 \cdot 10^{-79}\right):\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + x.re \cdot 0\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -1.24999999999999991e-105 or 3.0999999999999999e-79 < x.im Initial program 78.7%
add-cube-cbrt78.3%
pow378.4%
*-commutative78.4%
difference-of-squares80.9%
associate-*r*80.9%
Applied egg-rr80.9%
unpow380.8%
add-cube-cbrt81.2%
*-commutative81.2%
+-commutative81.2%
Applied egg-rr81.2%
*-commutative81.2%
flip-+0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses92.7%
Simplified92.7%
if -1.24999999999999991e-105 < x.im < 3.0999999999999999e-79Initial program 81.2%
add-cube-cbrt80.8%
pow380.9%
*-commutative80.9%
difference-of-squares80.9%
associate-*r*99.4%
Applied egg-rr99.4%
unpow399.4%
add-cube-cbrt99.7%
*-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around inf 79.2%
distribute-rgt1-in79.2%
metadata-eval79.2%
associate-*r*79.3%
unpow279.3%
associate-*r*79.3%
*-commutative79.3%
associate-*r*97.8%
*-commutative97.8%
Simplified97.8%
Final simplification94.6%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -3.4e+39) (not (<= x.im 7.5e-56))) (+ (* x.re 0.0) (* (* x.im x.im) (- 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 <= -3.4e+39) || !(x_46_im <= 7.5e-56)) {
tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (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 <= (-3.4d+39)) .or. (.not. (x_46im <= 7.5d-56))) then
tmp = (x_46re * 0.0d0) + ((x_46im * x_46im) * (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 <= -3.4e+39) || !(x_46_im <= 7.5e-56)) {
tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (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 <= -3.4e+39) or not (x_46_im <= 7.5e-56): tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (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 <= -3.4e+39) || !(x_46_im <= 7.5e-56)) tmp = Float64(Float64(x_46_re * 0.0) + Float64(Float64(x_46_im * x_46_im) * Float64(x_46_re - 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 <= -3.4e+39) || ~((x_46_im <= 7.5e-56))) tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (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, -3.4e+39], N[Not[LessEqual[x$46$im, 7.5e-56]], $MachinePrecision]], N[(N[(x$46$re * 0.0), $MachinePrecision] + N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $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 -3.4 \cdot 10^{+39} \lor \neg \left(x.im \leq 7.5 \cdot 10^{-56}\right):\\
\;\;\;\;x.re \cdot 0 + \left(x.im \cdot x.im\right) \cdot \left(x.re - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -3.3999999999999999e39 or 7.50000000000000041e-56 < x.im Initial program 73.5%
add-cube-cbrt73.2%
pow373.3%
*-commutative73.3%
difference-of-squares76.4%
associate-*r*76.4%
Applied egg-rr76.4%
unpow376.3%
add-cube-cbrt76.6%
*-commutative76.6%
+-commutative76.6%
Applied egg-rr76.6%
*-commutative76.6%
flip-+0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses97.3%
Simplified97.3%
Taylor expanded in x.im around inf 86.9%
unpow286.9%
Simplified86.9%
if -3.3999999999999999e39 < x.im < 7.50000000000000041e-56Initial program 85.9%
add-cube-cbrt85.4%
pow385.5%
*-commutative85.5%
difference-of-squares85.5%
associate-*r*99.4%
Applied egg-rr99.4%
unpow399.3%
add-cube-cbrt99.7%
*-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
*-commutative99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around inf 74.6%
distribute-rgt1-in74.6%
metadata-eval74.6%
associate-*r*74.6%
unpow274.6%
associate-*r*74.6%
*-commutative74.6%
associate-*r*88.5%
*-commutative88.5%
Simplified88.5%
Final simplification87.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (+ x.im x.im))))
(if (<= x.im -3.8e+130)
(+ t_0 t_0)
(if (<= x.im 8e+149)
(* (* x.re x.im) (* x.re 3.0))
(- (+ x.im x.im) (* x.re (* x.im x.im)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_im + x_46_im);
double tmp;
if (x_46_im <= -3.8e+130) {
tmp = t_0 + t_0;
} else if (x_46_im <= 8e+149) {
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));
}
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_46im + x_46im)
if (x_46im <= (-3.8d+130)) then
tmp = t_0 + t_0
else if (x_46im <= 8d+149) then
tmp = (x_46re * x_46im) * (x_46re * 3.0d0)
else
tmp = (x_46im + x_46im) - (x_46re * (x_46im * 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_im + x_46_im);
double tmp;
if (x_46_im <= -3.8e+130) {
tmp = t_0 + t_0;
} else if (x_46_im <= 8e+149) {
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));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * (x_46_im + x_46_im) tmp = 0 if x_46_im <= -3.8e+130: tmp = t_0 + t_0 elif x_46_im <= 8e+149: 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)) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(x_46_im + x_46_im)) tmp = 0.0 if (x_46_im <= -3.8e+130) tmp = Float64(t_0 + t_0); elseif (x_46_im <= 8e+149) 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(x_46_re * Float64(x_46_im * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_im * (x_46_im + x_46_im); tmp = 0.0; if (x_46_im <= -3.8e+130) tmp = t_0 + t_0; elseif (x_46_im <= 8e+149) 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)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.8e+130], N[(t$95$0 + t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 8e+149], 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[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.im + x.im\right)\\
\mathbf{if}\;x.im \leq -3.8 \cdot 10^{+130}:\\
\;\;\;\;t_0 + t_0\\
\mathbf{elif}\;x.im \leq 8 \cdot 10^{+149}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) - x.re \cdot \left(x.im \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -3.8000000000000002e130Initial program 58.5%
add-cube-cbrt58.5%
pow358.5%
*-commutative58.5%
difference-of-squares61.0%
associate-*r*61.0%
Applied egg-rr61.0%
Taylor expanded in x.im around 0 3.0%
*-commutative3.0%
unpow23.0%
associate-*r*2.9%
Simplified2.9%
*-commutative2.9%
*-commutative2.9%
associate-*l*2.9%
*-commutative2.9%
count-22.9%
flip-+0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
*-commutative0.0%
associate-*r/0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
*-commutative0.0%
Applied egg-rr86.6%
if -3.8000000000000002e130 < x.im < 8.00000000000000039e149Initial program 89.7%
add-cube-cbrt89.1%
pow389.2%
*-commutative89.2%
difference-of-squares89.2%
associate-*r*98.8%
Applied egg-rr98.8%
unpow398.7%
add-cube-cbrt99.1%
*-commutative99.1%
+-commutative99.1%
Applied egg-rr99.1%
*-commutative99.1%
distribute-lft-out99.1%
Applied egg-rr99.1%
Taylor expanded in x.re around inf 61.8%
distribute-rgt1-in61.8%
metadata-eval61.8%
associate-*r*61.8%
unpow261.8%
associate-*r*61.9%
*-commutative61.9%
associate-*r*71.4%
*-commutative71.4%
Simplified71.4%
if 8.00000000000000039e149 < x.im Initial program 46.7%
+-commutative46.7%
*-commutative46.7%
fma-def50.0%
*-commutative50.0%
distribute-rgt-out50.0%
*-commutative50.0%
Simplified50.0%
fma-udef46.7%
distribute-lft-in46.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+56.7%
distribute-lft-in56.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.3%
difference-of-squares100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in x.im around 0 47.2%
Taylor expanded in x.re around 0 53.3%
unpow253.3%
associate-*r*53.3%
mul-1-neg53.3%
Simplified53.3%
Final simplification71.7%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 4.4e+154) (* (* x.re x.im) (* x.re 3.0)) (- (+ x.im x.im) (* x.im (* x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 4.4e+154) {
tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
} else {
tmp = (x_46_im + 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) :: tmp
if (x_46im <= 4.4d+154) then
tmp = (x_46re * x_46im) * (x_46re * 3.0d0)
else
tmp = (x_46im + 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 tmp;
if (x_46_im <= 4.4e+154) {
tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
} else {
tmp = (x_46_im + 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 <= 4.4e+154: tmp = (x_46_re * x_46_im) * (x_46_re * 3.0) else: tmp = (x_46_im + 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 (x_46_im <= 4.4e+154) 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(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 <= 4.4e+154) tmp = (x_46_re * x_46_im) * (x_46_re * 3.0); else tmp = (x_46_im + 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[x$46$im, 4.4e+154], 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[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 4.4 \cdot 10^{+154}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) - x.im \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 4.4000000000000002e154Initial program 84.0%
add-cube-cbrt83.6%
pow383.7%
*-commutative83.7%
difference-of-squares84.1%
associate-*r*91.9%
Applied egg-rr91.9%
unpow391.9%
add-cube-cbrt92.2%
*-commutative92.2%
+-commutative92.2%
Applied egg-rr92.2%
*-commutative92.2%
distribute-lft-out92.2%
Applied egg-rr92.2%
Taylor expanded in x.re around inf 51.2%
distribute-rgt1-in51.2%
metadata-eval51.2%
associate-*r*51.2%
unpow251.2%
associate-*r*51.2%
*-commutative51.2%
associate-*r*59.0%
*-commutative59.0%
Simplified59.0%
if 4.4000000000000002e154 < x.im Initial program 46.7%
+-commutative46.7%
*-commutative46.7%
fma-def50.0%
*-commutative50.0%
distribute-rgt-out50.0%
*-commutative50.0%
Simplified50.0%
fma-udef46.7%
distribute-lft-in46.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+56.7%
distribute-lft-in56.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.3%
difference-of-squares100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in x.im around 0 47.2%
Taylor expanded in x.re around 0 53.3%
mul-1-neg53.3%
unpow253.3%
associate-*r*43.9%
*-commutative43.9%
distribute-rgt-neg-in43.9%
*-commutative43.9%
distribute-rgt-neg-in43.9%
Simplified43.9%
Final simplification57.2%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.5e+150) (* (* x.re x.im) (* x.re 3.0)) (- (+ x.im x.im) (* x.re (* x.im x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.5e+150) {
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));
}
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 <= 1.5d+150) then
tmp = (x_46re * x_46im) * (x_46re * 3.0d0)
else
tmp = (x_46im + x_46im) - (x_46re * (x_46im * 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 <= 1.5e+150) {
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));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 1.5e+150: 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)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 1.5e+150) 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(x_46_re * Float64(x_46_im * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 1.5e+150) 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)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 1.5e+150], 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[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.5 \cdot 10^{+150}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) - x.re \cdot \left(x.im \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 1.50000000000000006e150Initial program 84.0%
add-cube-cbrt83.6%
pow383.7%
*-commutative83.7%
difference-of-squares84.1%
associate-*r*91.9%
Applied egg-rr91.9%
unpow391.9%
add-cube-cbrt92.2%
*-commutative92.2%
+-commutative92.2%
Applied egg-rr92.2%
*-commutative92.2%
distribute-lft-out92.2%
Applied egg-rr92.2%
Taylor expanded in x.re around inf 51.2%
distribute-rgt1-in51.2%
metadata-eval51.2%
associate-*r*51.2%
unpow251.2%
associate-*r*51.2%
*-commutative51.2%
associate-*r*59.0%
*-commutative59.0%
Simplified59.0%
if 1.50000000000000006e150 < x.im Initial program 46.7%
+-commutative46.7%
*-commutative46.7%
fma-def50.0%
*-commutative50.0%
distribute-rgt-out50.0%
*-commutative50.0%
Simplified50.0%
fma-udef46.7%
distribute-lft-in46.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+56.7%
distribute-lft-in56.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.3%
difference-of-squares100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Taylor expanded in x.im around 0 47.2%
Taylor expanded in x.re around 0 53.3%
unpow253.3%
associate-*r*53.3%
mul-1-neg53.3%
Simplified53.3%
Final simplification58.3%
(FPCore (x.re x.im) :precision binary64 (* 2.0 (* x.re (* x.re x.im))))
double code(double x_46_re, double x_46_im) {
return 2.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 = 2.0d0 * (x_46re * (x_46re * x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
return 2.0 * (x_46_re * (x_46_re * x_46_im));
}
def code(x_46_re, x_46_im): return 2.0 * (x_46_re * (x_46_re * x_46_im))
function code(x_46_re, x_46_im) return Float64(2.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = 2.0 * (x_46_re * (x_46_re * x_46_im)); end
code[x$46$re_, x$46$im_] := N[(2.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)
\end{array}
Initial program 79.6%
add-cube-cbrt79.3%
pow379.3%
*-commutative79.3%
difference-of-squares80.9%
associate-*r*87.8%
Applied egg-rr87.8%
Taylor expanded in x.im around 0 31.9%
*-commutative31.9%
unpow231.9%
associate-*r*32.9%
Simplified32.9%
Final simplification32.9%
(FPCore (x.re x.im) :precision binary64 (* x.im (* (* x.re x.re) 3.0)))
double code(double x_46_re, double x_46_im) {
return x_46_im * ((x_46_re * 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_46im * ((x_46re * x_46re) * 3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * ((x_46_re * x_46_re) * 3.0);
}
def code(x_46_re, x_46_im): return x_46_im * ((x_46_re * x_46_re) * 3.0)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) * 3.0)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * ((x_46_re * x_46_re) * 3.0); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right)
\end{array}
Initial program 79.6%
Taylor expanded in x.re around inf 46.4%
Simplified46.4%
Taylor expanded in x.im around 0 46.4%
*-commutative46.4%
distribute-lft1-in46.4%
metadata-eval46.4%
unpow246.4%
Simplified46.4%
Final simplification46.4%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.re (* x.re 3.0))))
double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * (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_46im * (x_46re * (x_46re * 3.0d0))
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * (x_46_re * 3.0));
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_re * (x_46_re * 3.0))
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_re * Float64(x_46_re * 3.0))) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_re * (x_46_re * 3.0)); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)
\end{array}
Initial program 79.6%
add-cube-cbrt79.3%
pow379.3%
*-commutative79.3%
difference-of-squares80.9%
associate-*r*87.8%
Applied egg-rr87.8%
unpow387.7%
add-cube-cbrt88.1%
*-commutative88.1%
+-commutative88.1%
Applied egg-rr88.1%
*-commutative88.1%
distribute-lft-out88.1%
Applied egg-rr88.1%
Taylor expanded in x.re around inf 46.4%
distribute-rgt1-in46.4%
metadata-eval46.4%
associate-*r*46.4%
unpow246.4%
associate-*r*46.4%
*-commutative46.4%
*-commutative46.4%
Simplified46.4%
Final simplification46.4%
(FPCore (x.re x.im) :precision binary64 (* (* x.re x.im) (* x.re 3.0)))
double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_im) * (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 * x_46im) * (x_46re * 3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_im) * (x_46_re * 3.0);
}
def code(x_46_re, x_46_im): return (x_46_re * x_46_im) * (x_46_re * 3.0)
function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0)) end
function tmp = code(x_46_re, x_46_im) tmp = (x_46_re * x_46_im) * (x_46_re * 3.0); end
code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)
\end{array}
Initial program 79.6%
add-cube-cbrt79.3%
pow379.3%
*-commutative79.3%
difference-of-squares80.9%
associate-*r*87.8%
Applied egg-rr87.8%
unpow387.7%
add-cube-cbrt88.1%
*-commutative88.1%
+-commutative88.1%
Applied egg-rr88.1%
*-commutative88.1%
distribute-lft-out88.1%
Applied egg-rr88.1%
Taylor expanded in x.re around inf 46.4%
distribute-rgt1-in46.4%
metadata-eval46.4%
associate-*r*46.4%
unpow246.4%
associate-*r*46.4%
*-commutative46.4%
associate-*r*53.3%
*-commutative53.3%
Simplified53.3%
Final simplification53.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.6%
*-commutative79.6%
*-commutative79.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+62.0%
distribute-lft-in62.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+49.4%
Applied egg-rr49.4%
Taylor expanded in x.re around inf 31.5%
*-commutative31.5%
unpow231.5%
Simplified31.5%
Final simplification31.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(x_46_re * Float64(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[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot \left(x.re \cdot x.im\right)
\end{array}
Initial program 79.6%
*-commutative79.6%
*-commutative79.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+62.0%
distribute-lft-in62.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+49.4%
Applied egg-rr49.4%
Taylor expanded in x.re around inf 31.5%
*-commutative31.5%
unpow231.5%
associate-*r*32.3%
Simplified32.3%
Final simplification32.3%
(FPCore (x.re x.im) :precision binary64 (+ x.im x.im))
double code(double x_46_re, double x_46_im) {
return x_46_im + 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_46im + x_46im
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im + x_46_im;
}
def code(x_46_re, x_46_im): return x_46_im + x_46_im
function code(x_46_re, x_46_im) return Float64(x_46_im + x_46_im) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im + x_46_im; end
code[x$46$re_, x$46$im_] := N[(x$46$im + x$46$im), $MachinePrecision]
\begin{array}{l}
\\
x.im + x.im
\end{array}
Initial program 79.6%
add-cube-cbrt79.3%
pow379.3%
*-commutative79.3%
difference-of-squares80.9%
associate-*r*87.8%
Applied egg-rr87.8%
Taylor expanded in x.im around 0 31.9%
*-commutative31.9%
unpow231.9%
associate-*r*32.9%
Simplified32.9%
associate-*r*32.9%
count-232.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+20.2%
count-220.2%
associate-*r*20.2%
count-220.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+3.0%
Applied egg-rr3.0%
Final simplification3.0%
(FPCore (x.re x.im) :precision binary64 -10.0)
double code(double x_46_re, double x_46_im) {
return -10.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -10.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -10.0;
}
def code(x_46_re, x_46_im): return -10.0
function code(x_46_re, x_46_im) return -10.0 end
function tmp = code(x_46_re, x_46_im) tmp = -10.0; end
code[x$46$re_, x$46$im_] := -10.0
\begin{array}{l}
\\
-10
\end{array}
Initial program 79.6%
+-commutative79.6%
*-commutative79.6%
sub-neg79.6%
distribute-lft-in78.1%
associate-+r+78.1%
distribute-rgt-neg-out78.1%
unsub-neg78.1%
associate-*r*84.9%
distribute-rgt-out84.9%
*-commutative84.9%
count-284.9%
distribute-lft1-in84.9%
metadata-eval84.9%
*-commutative84.9%
*-commutative84.9%
associate-*r*85.0%
cube-unmult85.0%
Simplified85.0%
associate-*r*85.0%
associate-*l*85.0%
flip--26.1%
div-inv25.4%
swap-sqr25.4%
pow225.4%
metadata-eval25.4%
pow-prod-up25.4%
metadata-eval25.4%
associate-*l*25.3%
associate-*r*25.3%
fma-def25.3%
Applied egg-rr25.3%
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.6%
+-commutative79.6%
*-commutative79.6%
sub-neg79.6%
distribute-lft-in78.1%
associate-+r+78.1%
distribute-rgt-neg-out78.1%
unsub-neg78.1%
associate-*r*84.9%
distribute-rgt-out84.9%
*-commutative84.9%
count-284.9%
distribute-lft1-in84.9%
metadata-eval84.9%
*-commutative84.9%
*-commutative84.9%
associate-*r*85.0%
cube-unmult85.0%
Simplified85.0%
sub-neg85.0%
associate-*r*85.0%
associate-*l*85.0%
flip3-+18.9%
associate-*r*17.0%
associate-*r*16.9%
unpow-prod-down8.8%
pow28.8%
pow-pow8.8%
metadata-eval8.8%
Applied egg-rr8.8%
Simplified2.8%
Final simplification2.8%
(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 2023224
(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)))