
(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 (if (or (<= x.im -2.6e+121) (not (<= x.im 1e+86))) (* (- x.re x.im) (* x.im (+ x.im x.re))) (- (* x.re (* x.re (* x.im 3.0))) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2.6e+121) || !(x_46_im <= 1e+86)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-2.6d+121)) .or. (.not. (x_46im <= 1d+86))) then
tmp = (x_46re - x_46im) * (x_46im * (x_46im + x_46re))
else
tmp = (x_46re * (x_46re * (x_46im * 3.0d0))) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2.6e+121) || !(x_46_im <= 1e+86)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -2.6e+121) or not (x_46_im <= 1e+86): tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)) else: tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -2.6e+121) || !(x_46_im <= 1e+86)) tmp = Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_im + x_46_re))); else tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_im * 3.0))) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -2.6e+121) || ~((x_46_im <= 1e+86))) tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)); else tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -2.6e+121], N[Not[LessEqual[x$46$im, 1e+86]], $MachinePrecision]], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.6 \cdot 10^{+121} \lor \neg \left(x.im \leq 10^{+86}\right):\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -2.5999999999999999e121 or 1e86 < x.im Initial program 61.4%
difference-of-squares71.1%
*-commutative71.1%
Applied egg-rr71.1%
*-commutative71.1%
distribute-rgt-out71.1%
Applied egg-rr71.1%
Applied egg-rr100.0%
if -2.5999999999999999e121 < x.im < 1e86Initial program 91.7%
+-commutative91.7%
*-commutative91.7%
sub-neg91.7%
distribute-lft-in91.7%
associate-+r+91.6%
distribute-rgt-neg-out91.6%
unsub-neg91.6%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -2.6e+121) (not (<= x.im 1.5e+87))) (* (- x.re x.im) (* x.im (+ x.im x.re))) (- (* x.re (* 3.0 (* x.im x.re))) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2.6e+121) || !(x_46_im <= 1.5e+87)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-2.6d+121)) .or. (.not. (x_46im <= 1.5d+87))) then
tmp = (x_46re - x_46im) * (x_46im * (x_46im + x_46re))
else
tmp = (x_46re * (3.0d0 * (x_46im * x_46re))) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2.6e+121) || !(x_46_im <= 1.5e+87)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -2.6e+121) or not (x_46_im <= 1.5e+87): tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)) else: tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -2.6e+121) || !(x_46_im <= 1.5e+87)) tmp = Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_im + x_46_re))); else tmp = Float64(Float64(x_46_re * Float64(3.0 * Float64(x_46_im * x_46_re))) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -2.6e+121) || ~((x_46_im <= 1.5e+87))) tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)); else tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -2.6e+121], N[Not[LessEqual[x$46$im, 1.5e+87]], $MachinePrecision]], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(3.0 * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.6 \cdot 10^{+121} \lor \neg \left(x.im \leq 1.5 \cdot 10^{+87}\right):\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.im \cdot x.re\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -2.5999999999999999e121 or 1.4999999999999999e87 < x.im Initial program 61.4%
difference-of-squares71.1%
*-commutative71.1%
Applied egg-rr71.1%
*-commutative71.1%
distribute-rgt-out71.1%
Applied egg-rr71.1%
Applied egg-rr100.0%
if -2.5999999999999999e121 < x.im < 1.4999999999999999e87Initial program 91.7%
+-commutative91.7%
*-commutative91.7%
sub-neg91.7%
distribute-lft-in91.7%
associate-+r+91.6%
distribute-rgt-neg-out91.6%
unsub-neg91.6%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.8%
Final simplification99.9%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* (- x.re x.im) (* x.im (+ x.im x.re))))
(t_1
(+
(* x.re (* x.im (+ x.re x.re)))
(* x.im (* (- x.re x.im) (+ x.im x.re))))))
(if (<= x.im -2.5e+90)
t_0
(if (<= x.im -5.8e-170)
t_1
(if (<= x.im 1.3e-122)
(* (* x.re 3.0) (* x.im x.re))
(if (<= x.im 2e+58) t_1 t_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_im + x_46_re));
double t_1 = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
double tmp;
if (x_46_im <= -2.5e+90) {
tmp = t_0;
} else if (x_46_im <= -5.8e-170) {
tmp = t_1;
} else if (x_46_im <= 1.3e-122) {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
} else if (x_46_im <= 2e+58) {
tmp = t_1;
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46re - x_46im) * (x_46im * (x_46im + x_46re))
t_1 = (x_46re * (x_46im * (x_46re + x_46re))) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
if (x_46im <= (-2.5d+90)) then
tmp = t_0
else if (x_46im <= (-5.8d-170)) then
tmp = t_1
else if (x_46im <= 1.3d-122) then
tmp = (x_46re * 3.0d0) * (x_46im * x_46re)
else if (x_46im <= 2d+58) then
tmp = t_1
else
tmp = t_0
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_im) * (x_46_im * (x_46_im + x_46_re));
double t_1 = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
double tmp;
if (x_46_im <= -2.5e+90) {
tmp = t_0;
} else if (x_46_im <= -5.8e-170) {
tmp = t_1;
} else if (x_46_im <= 1.3e-122) {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
} else if (x_46_im <= 2e+58) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)) t_1 = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) tmp = 0 if x_46_im <= -2.5e+90: tmp = t_0 elif x_46_im <= -5.8e-170: tmp = t_1 elif x_46_im <= 1.3e-122: tmp = (x_46_re * 3.0) * (x_46_im * x_46_re) elif x_46_im <= 2e+58: tmp = t_1 else: tmp = t_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_im + x_46_re))) t_1 = Float64(Float64(x_46_re * Float64(x_46_im * Float64(x_46_re + x_46_re))) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))) tmp = 0.0 if (x_46_im <= -2.5e+90) tmp = t_0; elseif (x_46_im <= -5.8e-170) tmp = t_1; elseif (x_46_im <= 1.3e-122) tmp = Float64(Float64(x_46_re * 3.0) * Float64(x_46_im * x_46_re)); elseif (x_46_im <= 2e+58) tmp = t_1; else tmp = t_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_im + x_46_re)); t_1 = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); tmp = 0.0; if (x_46_im <= -2.5e+90) tmp = t_0; elseif (x_46_im <= -5.8e-170) tmp = t_1; elseif (x_46_im <= 1.3e-122) tmp = (x_46_re * 3.0) * (x_46_im * x_46_re); elseif (x_46_im <= 2e+58) tmp = t_1; else tmp = t_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$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$re * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.5e+90], t$95$0, If[LessEqual[x$46$im, -5.8e-170], t$95$1, If[LessEqual[x$46$im, 1.3e-122], N[(N[(x$46$re * 3.0), $MachinePrecision] * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2e+58], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)\\
t_1 := x.re \cdot \left(x.im \cdot \left(x.re + x.re\right)\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{if}\;x.im \leq -2.5 \cdot 10^{+90}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq -5.8 \cdot 10^{-170}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 1.3 \cdot 10^{-122}:\\
\;\;\;\;\left(x.re \cdot 3\right) \cdot \left(x.im \cdot x.re\right)\\
\mathbf{elif}\;x.im \leq 2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -2.5000000000000002e90 or 1.99999999999999989e58 < x.im Initial program 67.0%
difference-of-squares75.2%
*-commutative75.2%
Applied egg-rr75.2%
*-commutative75.2%
distribute-rgt-out75.2%
Applied egg-rr75.2%
Applied egg-rr100.0%
if -2.5000000000000002e90 < x.im < -5.8000000000000001e-170 or 1.29999999999999988e-122 < x.im < 1.99999999999999989e58Initial program 98.7%
difference-of-squares98.7%
*-commutative98.7%
Applied egg-rr98.7%
*-commutative98.7%
distribute-rgt-out98.7%
Applied egg-rr98.7%
if -5.8000000000000001e-170 < x.im < 1.29999999999999988e-122Initial program 81.3%
+-commutative81.3%
*-commutative81.3%
sub-neg81.3%
distribute-lft-in81.3%
associate-+r+81.3%
distribute-rgt-neg-out81.3%
unsub-neg81.3%
associate-*r*99.7%
distribute-rgt-out99.6%
*-commutative99.6%
count-299.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.7%
cube-unmult99.7%
Simplified99.7%
Taylor expanded in x.re around 0 99.6%
Taylor expanded in x.re around inf 81.2%
unpow281.2%
associate-*r*99.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.5%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.im -2e+90) (not (<= x.im 1e+59)))
(* (- x.re x.im) (* x.im (+ x.im x.re)))
(+
(- (* x.re (* x.im x.re)) (* x.im (* x.im x.im)))
(* x.re (* x.im (+ x.re x.re))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2e+90) || !(x_46_im <= 1e+59)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = ((x_46_re * (x_46_im * x_46_re)) - (x_46_im * (x_46_im * x_46_im))) + (x_46_re * (x_46_im * (x_46_re + x_46_re)));
}
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 <= (-2d+90)) .or. (.not. (x_46im <= 1d+59))) then
tmp = (x_46re - x_46im) * (x_46im * (x_46im + x_46re))
else
tmp = ((x_46re * (x_46im * x_46re)) - (x_46im * (x_46im * x_46im))) + (x_46re * (x_46im * (x_46re + x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2e+90) || !(x_46_im <= 1e+59)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = ((x_46_re * (x_46_im * x_46_re)) - (x_46_im * (x_46_im * x_46_im))) + (x_46_re * (x_46_im * (x_46_re + x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -2e+90) or not (x_46_im <= 1e+59): tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)) else: tmp = ((x_46_re * (x_46_im * x_46_re)) - (x_46_im * (x_46_im * x_46_im))) + (x_46_re * (x_46_im * (x_46_re + x_46_re))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -2e+90) || !(x_46_im <= 1e+59)) tmp = Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_im + x_46_re))); else tmp = Float64(Float64(Float64(x_46_re * Float64(x_46_im * x_46_re)) - Float64(x_46_im * Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(x_46_im * Float64(x_46_re + x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -2e+90) || ~((x_46_im <= 1e+59))) tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)); else tmp = ((x_46_re * (x_46_im * x_46_re)) - (x_46_im * (x_46_im * x_46_im))) + (x_46_re * (x_46_im * (x_46_re + x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -2e+90], N[Not[LessEqual[x$46$im, 1e+59]], $MachinePrecision]], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2 \cdot 10^{+90} \lor \neg \left(x.im \leq 10^{+59}\right):\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot \left(x.im \cdot x.re\right) - x.im \cdot \left(x.im \cdot x.im\right)\right) + x.re \cdot \left(x.im \cdot \left(x.re + x.re\right)\right)\\
\end{array}
\end{array}
if x.im < -1.99999999999999993e90 or 9.99999999999999972e58 < x.im Initial program 67.0%
difference-of-squares75.2%
*-commutative75.2%
Applied egg-rr75.2%
*-commutative75.2%
distribute-rgt-out75.2%
Applied egg-rr75.2%
Applied egg-rr100.0%
if -1.99999999999999993e90 < x.im < 9.99999999999999972e58Initial program 90.9%
difference-of-squares90.9%
*-commutative90.9%
Applied egg-rr90.9%
*-commutative90.9%
distribute-rgt-out90.9%
Applied egg-rr90.9%
*-commutative90.9%
difference-of-squares90.9%
*-commutative90.9%
sub-neg90.9%
distribute-rgt-in90.9%
associate-*l*99.7%
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -3.8e-58) (not (<= x.im 5e-84))) (* (- x.re x.im) (* x.im (+ x.im x.re))) (* (* x.re 3.0) (* x.im x.re))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -3.8e-58) || !(x_46_im <= 5e-84)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
}
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.8d-58)) .or. (.not. (x_46im <= 5d-84))) then
tmp = (x_46re - x_46im) * (x_46im * (x_46im + x_46re))
else
tmp = (x_46re * 3.0d0) * (x_46im * x_46re)
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.8e-58) || !(x_46_im <= 5e-84)) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -3.8e-58) or not (x_46_im <= 5e-84): tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)) else: tmp = (x_46_re * 3.0) * (x_46_im * x_46_re) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -3.8e-58) || !(x_46_im <= 5e-84)) tmp = Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_im + x_46_re))); else tmp = Float64(Float64(x_46_re * 3.0) * Float64(x_46_im * x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -3.8e-58) || ~((x_46_im <= 5e-84))) tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)); else tmp = (x_46_re * 3.0) * (x_46_im * x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -3.8e-58], N[Not[LessEqual[x$46$im, 5e-84]], $MachinePrecision]], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * 3.0), $MachinePrecision] * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.8 \cdot 10^{-58} \lor \neg \left(x.im \leq 5 \cdot 10^{-84}\right):\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot 3\right) \cdot \left(x.im \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < -3.7999999999999997e-58 or 5.0000000000000002e-84 < x.im Initial program 79.4%
difference-of-squares84.5%
*-commutative84.5%
Applied egg-rr84.5%
*-commutative84.5%
distribute-rgt-out84.5%
Applied egg-rr84.5%
Applied egg-rr93.7%
if -3.7999999999999997e-58 < x.im < 5.0000000000000002e-84Initial program 85.7%
+-commutative85.7%
*-commutative85.7%
sub-neg85.7%
distribute-lft-in85.7%
associate-+r+85.7%
distribute-rgt-neg-out85.7%
unsub-neg85.7%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.8%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.7%
Taylor expanded in x.re around inf 82.6%
unpow282.6%
associate-*r*96.6%
associate-*r*96.6%
*-commutative96.6%
Simplified96.6%
Final simplification94.8%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -6.5e-58)
(* (- x.re x.im) (* x.im (+ x.im x.re)))
(if (<= x.im 6.8e-84)
(* (* x.re 3.0) (* x.im x.re))
(* x.im (* (- x.re x.im) (+ x.im x.re))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -6.5e-58) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else if (x_46_im <= 6.8e-84) {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
} else {
tmp = x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re));
}
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 <= (-6.5d-58)) then
tmp = (x_46re - x_46im) * (x_46im * (x_46im + x_46re))
else if (x_46im <= 6.8d-84) then
tmp = (x_46re * 3.0d0) * (x_46im * x_46re)
else
tmp = x_46im * ((x_46re - x_46im) * (x_46im + x_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -6.5e-58) {
tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re));
} else if (x_46_im <= 6.8e-84) {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
} else {
tmp = x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -6.5e-58: tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)) elif x_46_im <= 6.8e-84: tmp = (x_46_re * 3.0) * (x_46_im * x_46_re) else: tmp = x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -6.5e-58) tmp = Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_im + x_46_re))); elseif (x_46_im <= 6.8e-84) tmp = Float64(Float64(x_46_re * 3.0) * Float64(x_46_im * x_46_re)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -6.5e-58) tmp = (x_46_re - x_46_im) * (x_46_im * (x_46_im + x_46_re)); elseif (x_46_im <= 6.8e-84) tmp = (x_46_re * 3.0) * (x_46_im * x_46_re); else tmp = x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -6.5e-58], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6.8e-84], N[(N[(x$46$re * 3.0), $MachinePrecision] * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -6.5 \cdot 10^{-58}:\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)\\
\mathbf{elif}\;x.im \leq 6.8 \cdot 10^{-84}:\\
\;\;\;\;\left(x.re \cdot 3\right) \cdot \left(x.im \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\end{array}
\end{array}
if x.im < -6.49999999999999964e-58Initial program 83.1%
difference-of-squares86.5%
*-commutative86.5%
Applied egg-rr86.5%
*-commutative86.5%
distribute-rgt-out86.5%
Applied egg-rr86.5%
Applied egg-rr90.2%
if -6.49999999999999964e-58 < x.im < 6.80000000000000042e-84Initial program 85.7%
+-commutative85.7%
*-commutative85.7%
sub-neg85.7%
distribute-lft-in85.7%
associate-+r+85.7%
distribute-rgt-neg-out85.7%
unsub-neg85.7%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.8%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.7%
Taylor expanded in x.re around inf 82.6%
unpow282.6%
associate-*r*96.6%
associate-*r*96.6%
*-commutative96.6%
Simplified96.6%
if 6.80000000000000042e-84 < x.im Initial program 77.0%
difference-of-squares83.3%
*-commutative83.3%
Applied egg-rr83.3%
*-commutative83.3%
distribute-rgt-out83.3%
Applied egg-rr83.3%
*-commutative83.3%
distribute-rgt-in83.3%
distribute-rgt-in83.3%
add-sqr-sqrt40.6%
sqrt-prod78.3%
sqr-neg78.3%
sqrt-unprod45.0%
add-sqr-sqrt95.8%
sub-neg95.8%
+-inverses95.8%
+-inverses95.8%
distribute-lft-out--55.2%
+-inverses95.8%
+-inverses95.8%
distribute-lft-out--65.6%
+-inverses95.8%
Applied egg-rr95.8%
Final simplification94.8%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -3.7e+147) (* x.re (* x.im (- x.re))) (if (<= x.im 5e+132) (* x.im (* x.re (* x.re 3.0))) (* x.im (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -3.7e+147) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = x_46_im * (x_46_re * (x_46_re * 3.0));
} else {
tmp = 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 <= (-3.7d+147)) then
tmp = x_46re * (x_46im * -x_46re)
else if (x_46im <= 5d+132) then
tmp = x_46im * (x_46re * (x_46re * 3.0d0))
else
tmp = 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 <= -3.7e+147) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = x_46_im * (x_46_re * (x_46_re * 3.0));
} else {
tmp = x_46_im * -x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -3.7e+147: tmp = x_46_re * (x_46_im * -x_46_re) elif x_46_im <= 5e+132: tmp = x_46_im * (x_46_re * (x_46_re * 3.0)) else: tmp = x_46_im * -x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -3.7e+147) tmp = Float64(x_46_re * Float64(x_46_im * Float64(-x_46_re))); elseif (x_46_im <= 5e+132) tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_re * 3.0))); else tmp = Float64(x_46_im * Float64(-x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -3.7e+147) tmp = x_46_re * (x_46_im * -x_46_re); elseif (x_46_im <= 5e+132) tmp = x_46_im * (x_46_re * (x_46_re * 3.0)); else tmp = x_46_im * -x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -3.7e+147], N[(x$46$re * N[(x$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5e+132], N[(x$46$im * N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * (-x$46$im)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.7 \cdot 10^{+147}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{+132}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-x.im\right)\\
\end{array}
\end{array}
if x.im < -3.7e147Initial program 56.5%
+-commutative56.5%
*-commutative56.5%
sub-neg56.5%
distribute-lft-in56.5%
associate-+r+56.5%
distribute-rgt-neg-out56.5%
unsub-neg56.5%
associate-*r*56.5%
distribute-rgt-out56.5%
*-commutative56.5%
count-256.5%
distribute-lft1-in56.5%
metadata-eval56.5%
*-commutative56.5%
*-commutative56.5%
associate-*r*56.5%
cube-unmult56.5%
Simplified56.5%
Taylor expanded in x.re around inf 9.1%
expm1-log1p-u0.4%
expm1-udef0.4%
*-commutative0.4%
pow20.4%
associate-*l*0.4%
Applied egg-rr0.4%
Simplified36.8%
if -3.7e147 < x.im < 5.0000000000000001e132Initial program 92.4%
difference-of-squares92.4%
*-commutative92.4%
Applied egg-rr92.4%
*-commutative92.4%
distribute-rgt-out92.4%
Applied egg-rr92.4%
Taylor expanded in x.re around inf 61.3%
unpow261.3%
*-commutative61.3%
distribute-rgt1-in61.3%
metadata-eval61.3%
*-commutative61.3%
associate-*r*61.3%
associate-*r*61.2%
Simplified61.2%
if 5.0000000000000001e132 < x.im Initial program 50.0%
difference-of-squares63.6%
*-commutative63.6%
Applied egg-rr63.6%
Taylor expanded in x.re around 0 86.4%
Simplified76.4%
Final simplification61.6%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -2.6e+148) (* x.re (* x.im (- x.re))) (if (<= x.im 5e+132) (* (* x.im 3.0) (* x.re x.re)) (* x.im (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -2.6e+148) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = (x_46_im * 3.0) * (x_46_re * x_46_re);
} else {
tmp = 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 <= (-2.6d+148)) then
tmp = x_46re * (x_46im * -x_46re)
else if (x_46im <= 5d+132) then
tmp = (x_46im * 3.0d0) * (x_46re * x_46re)
else
tmp = 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 <= -2.6e+148) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = (x_46_im * 3.0) * (x_46_re * x_46_re);
} else {
tmp = x_46_im * -x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -2.6e+148: tmp = x_46_re * (x_46_im * -x_46_re) elif x_46_im <= 5e+132: tmp = (x_46_im * 3.0) * (x_46_re * x_46_re) else: tmp = x_46_im * -x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -2.6e+148) tmp = Float64(x_46_re * Float64(x_46_im * Float64(-x_46_re))); elseif (x_46_im <= 5e+132) tmp = Float64(Float64(x_46_im * 3.0) * Float64(x_46_re * x_46_re)); else tmp = Float64(x_46_im * Float64(-x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -2.6e+148) tmp = x_46_re * (x_46_im * -x_46_re); elseif (x_46_im <= 5e+132) tmp = (x_46_im * 3.0) * (x_46_re * x_46_re); else tmp = x_46_im * -x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -2.6e+148], N[(x$46$re * N[(x$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5e+132], N[(N[(x$46$im * 3.0), $MachinePrecision] * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * (-x$46$im)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.6 \cdot 10^{+148}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{+132}:\\
\;\;\;\;\left(x.im \cdot 3\right) \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-x.im\right)\\
\end{array}
\end{array}
if x.im < -2.6e148Initial program 56.5%
+-commutative56.5%
*-commutative56.5%
sub-neg56.5%
distribute-lft-in56.5%
associate-+r+56.5%
distribute-rgt-neg-out56.5%
unsub-neg56.5%
associate-*r*56.5%
distribute-rgt-out56.5%
*-commutative56.5%
count-256.5%
distribute-lft1-in56.5%
metadata-eval56.5%
*-commutative56.5%
*-commutative56.5%
associate-*r*56.5%
cube-unmult56.5%
Simplified56.5%
Taylor expanded in x.re around inf 9.1%
expm1-log1p-u0.4%
expm1-udef0.4%
*-commutative0.4%
pow20.4%
associate-*l*0.4%
Applied egg-rr0.4%
Simplified36.8%
if -2.6e148 < x.im < 5.0000000000000001e132Initial program 92.4%
difference-of-squares92.4%
*-commutative92.4%
Applied egg-rr92.4%
*-commutative92.4%
distribute-rgt-out92.4%
Applied egg-rr92.4%
Taylor expanded in x.re around inf 61.3%
unpow261.3%
*-commutative61.3%
distribute-rgt1-in61.3%
metadata-eval61.3%
Simplified61.3%
if 5.0000000000000001e132 < x.im Initial program 50.0%
difference-of-squares63.6%
*-commutative63.6%
Applied egg-rr63.6%
Taylor expanded in x.re around 0 86.4%
Simplified76.4%
Final simplification61.7%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -2.8e+148) (* x.re (* x.im (- x.re))) (if (<= x.im 5e+132) (* (* x.re 3.0) (* x.im x.re)) (* x.im (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -2.8e+148) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
} else {
tmp = 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 <= (-2.8d+148)) then
tmp = x_46re * (x_46im * -x_46re)
else if (x_46im <= 5d+132) then
tmp = (x_46re * 3.0d0) * (x_46im * x_46re)
else
tmp = 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 <= -2.8e+148) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = (x_46_re * 3.0) * (x_46_im * x_46_re);
} else {
tmp = x_46_im * -x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -2.8e+148: tmp = x_46_re * (x_46_im * -x_46_re) elif x_46_im <= 5e+132: tmp = (x_46_re * 3.0) * (x_46_im * x_46_re) else: tmp = x_46_im * -x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -2.8e+148) tmp = Float64(x_46_re * Float64(x_46_im * Float64(-x_46_re))); elseif (x_46_im <= 5e+132) tmp = Float64(Float64(x_46_re * 3.0) * Float64(x_46_im * x_46_re)); else tmp = Float64(x_46_im * Float64(-x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -2.8e+148) tmp = x_46_re * (x_46_im * -x_46_re); elseif (x_46_im <= 5e+132) tmp = (x_46_re * 3.0) * (x_46_im * x_46_re); else tmp = x_46_im * -x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -2.8e+148], N[(x$46$re * N[(x$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5e+132], N[(N[(x$46$re * 3.0), $MachinePrecision] * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * (-x$46$im)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.8 \cdot 10^{+148}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{+132}:\\
\;\;\;\;\left(x.re \cdot 3\right) \cdot \left(x.im \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-x.im\right)\\
\end{array}
\end{array}
if x.im < -2.7999999999999998e148Initial program 56.5%
+-commutative56.5%
*-commutative56.5%
sub-neg56.5%
distribute-lft-in56.5%
associate-+r+56.5%
distribute-rgt-neg-out56.5%
unsub-neg56.5%
associate-*r*56.5%
distribute-rgt-out56.5%
*-commutative56.5%
count-256.5%
distribute-lft1-in56.5%
metadata-eval56.5%
*-commutative56.5%
*-commutative56.5%
associate-*r*56.5%
cube-unmult56.5%
Simplified56.5%
Taylor expanded in x.re around inf 9.1%
expm1-log1p-u0.4%
expm1-udef0.4%
*-commutative0.4%
pow20.4%
associate-*l*0.4%
Applied egg-rr0.4%
Simplified36.8%
if -2.7999999999999998e148 < x.im < 5.0000000000000001e132Initial program 92.4%
+-commutative92.4%
*-commutative92.4%
sub-neg92.4%
distribute-lft-in88.7%
associate-+r+88.6%
distribute-rgt-neg-out88.6%
unsub-neg88.6%
associate-*r*96.0%
distribute-rgt-out96.0%
*-commutative96.0%
count-296.0%
distribute-lft1-in96.0%
metadata-eval96.0%
*-commutative96.0%
*-commutative96.0%
associate-*r*96.1%
cube-unmult96.1%
Simplified96.1%
Taylor expanded in x.re around 0 96.1%
Taylor expanded in x.re around inf 61.3%
unpow261.3%
associate-*r*68.7%
associate-*r*68.6%
*-commutative68.6%
Simplified68.6%
if 5.0000000000000001e132 < x.im Initial program 50.0%
difference-of-squares63.6%
*-commutative63.6%
Applied egg-rr63.6%
Taylor expanded in x.re around 0 86.4%
Simplified76.4%
Final simplification67.1%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -1.05e+148) (* x.re (* x.im (- x.re))) (if (<= x.im 5e+132) (* x.re (* 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.05e+148) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = 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.05d+148)) then
tmp = x_46re * (x_46im * -x_46re)
else if (x_46im <= 5d+132) then
tmp = x_46re * (x_46im * x_46re)
else
tmp = 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.05e+148) {
tmp = x_46_re * (x_46_im * -x_46_re);
} else if (x_46_im <= 5e+132) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = x_46_im * -x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -1.05e+148: tmp = x_46_re * (x_46_im * -x_46_re) elif x_46_im <= 5e+132: tmp = x_46_re * (x_46_im * x_46_re) else: tmp = x_46_im * -x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -1.05e+148) tmp = Float64(x_46_re * Float64(x_46_im * Float64(-x_46_re))); elseif (x_46_im <= 5e+132) tmp = Float64(x_46_re * Float64(x_46_im * x_46_re)); else tmp = Float64(x_46_im * Float64(-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.05e+148) tmp = x_46_re * (x_46_im * -x_46_re); elseif (x_46_im <= 5e+132) tmp = x_46_re * (x_46_im * x_46_re); else tmp = x_46_im * -x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -1.05e+148], N[(x$46$re * N[(x$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5e+132], N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * (-x$46$im)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.05 \cdot 10^{+148}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{+132}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-x.im\right)\\
\end{array}
\end{array}
if x.im < -1.04999999999999999e148Initial program 56.5%
+-commutative56.5%
*-commutative56.5%
sub-neg56.5%
distribute-lft-in56.5%
associate-+r+56.5%
distribute-rgt-neg-out56.5%
unsub-neg56.5%
associate-*r*56.5%
distribute-rgt-out56.5%
*-commutative56.5%
count-256.5%
distribute-lft1-in56.5%
metadata-eval56.5%
*-commutative56.5%
*-commutative56.5%
associate-*r*56.5%
cube-unmult56.5%
Simplified56.5%
Taylor expanded in x.re around inf 9.1%
expm1-log1p-u0.4%
expm1-udef0.4%
*-commutative0.4%
pow20.4%
associate-*l*0.4%
Applied egg-rr0.4%
Simplified36.8%
if -1.04999999999999999e148 < x.im < 5.0000000000000001e132Initial program 92.4%
Taylor expanded in x.re around inf 61.3%
Simplified61.3%
*-commutative61.3%
*-commutative61.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+34.8%
distribute-rgt-in34.8%
*-commutative34.8%
flip-+0.0%
clear-num0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
flip-+16.8%
Applied egg-rr16.8%
add-log-exp15.8%
+-commutative15.8%
exp-sum15.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
clear-num0.0%
flip-+30.9%
add-sqr-sqrt16.4%
sqrt-prod35.9%
sqr-neg35.9%
sqrt-unprod18.9%
add-sqr-sqrt40.1%
sub-neg40.1%
+-inverses40.1%
1-exp40.1%
*-un-lft-identity40.1%
Applied egg-rr43.6%
if 5.0000000000000001e132 < x.im Initial program 50.0%
difference-of-squares63.6%
*-commutative63.6%
Applied egg-rr63.6%
Taylor expanded in x.re around 0 86.4%
Simplified76.4%
Final simplification48.6%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 5e+132) (* x.re (* x.im x.re)) (* x.im (- x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 5e+132) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = 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 <= 5d+132) then
tmp = x_46re * (x_46im * x_46re)
else
tmp = 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 <= 5e+132) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = x_46_im * -x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 5e+132: tmp = x_46_re * (x_46_im * x_46_re) else: tmp = x_46_im * -x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 5e+132) tmp = Float64(x_46_re * Float64(x_46_im * x_46_re)); else tmp = Float64(x_46_im * Float64(-x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 5e+132) tmp = x_46_re * (x_46_im * x_46_re); else tmp = x_46_im * -x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 5e+132], N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * (-x$46$im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 5 \cdot 10^{+132}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-x.im\right)\\
\end{array}
\end{array}
if x.im < 5.0000000000000001e132Initial program 88.5%
Taylor expanded in x.re around inf 55.6%
Simplified55.6%
*-commutative55.6%
*-commutative55.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+32.1%
distribute-rgt-in32.1%
*-commutative32.1%
flip-+0.0%
clear-num0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
flip-+15.9%
Applied egg-rr15.9%
add-log-exp15.1%
+-commutative15.1%
exp-sum15.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
clear-num0.0%
flip-+27.6%
add-sqr-sqrt14.7%
sqrt-prod32.1%
sqr-neg32.1%
sqrt-unprod16.9%
add-sqr-sqrt36.7%
sub-neg36.7%
+-inverses36.7%
1-exp36.7%
*-un-lft-identity36.7%
Applied egg-rr39.9%
if 5.0000000000000001e132 < x.im Initial program 50.0%
difference-of-squares63.6%
*-commutative63.6%
Applied egg-rr63.6%
Taylor expanded in x.re around 0 86.4%
Simplified76.4%
Final simplification46.1%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -2.8e-187) (* x.re (- x.re)) (* x.im (- x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -2.8e-187) {
tmp = x_46_re * -x_46_re;
} else {
tmp = 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 <= (-2.8d-187)) then
tmp = x_46re * -x_46re
else
tmp = 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 <= -2.8e-187) {
tmp = x_46_re * -x_46_re;
} else {
tmp = x_46_im * -x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -2.8e-187: tmp = x_46_re * -x_46_re else: tmp = x_46_im * -x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -2.8e-187) tmp = Float64(x_46_re * Float64(-x_46_re)); else tmp = Float64(x_46_im * Float64(-x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -2.8e-187) tmp = x_46_re * -x_46_re; else tmp = x_46_im * -x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -2.8e-187], N[(x$46$re * (-x$46$re)), $MachinePrecision], N[(x$46$im * (-x$46$im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.8 \cdot 10^{-187}:\\
\;\;\;\;x.re \cdot \left(-x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-x.im\right)\\
\end{array}
\end{array}
if x.im < -2.8e-187Initial program 86.3%
difference-of-squares88.6%
*-commutative88.6%
Applied egg-rr88.6%
*-commutative88.6%
distribute-lft-out88.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified71.7%
Taylor expanded in x.im around 0 19.6%
unpow219.6%
mul-1-neg19.6%
distribute-rgt-neg-in19.6%
Simplified19.6%
if -2.8e-187 < x.im Initial program 79.5%
difference-of-squares83.1%
*-commutative83.1%
Applied egg-rr83.1%
Taylor expanded in x.re around 0 65.3%
Simplified40.8%
Final simplification33.5%
(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 * Float64(-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 \cdot \left(-x.im\right)
\end{array}
Initial program 81.9%
difference-of-squares85.0%
*-commutative85.0%
Applied egg-rr85.0%
Taylor expanded in x.re around 0 64.6%
Simplified28.8%
Final simplification28.8%
(FPCore (x.re x.im) :precision binary64 (* x.im -3.0))
double code(double x_46_re, double x_46_im) {
return x_46_im * -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 * (-3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * -3.0;
}
def code(x_46_re, x_46_im): return x_46_im * -3.0
function code(x_46_re, x_46_im) return Float64(x_46_im * -3.0) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * -3.0; end
code[x$46$re_, x$46$im_] := N[(x$46$im * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot -3
\end{array}
Initial program 81.9%
*-commutative81.9%
*-commutative81.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+63.8%
distribute-lft-in63.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+49.9%
Applied egg-rr49.9%
Taylor expanded in x.im around 0 17.5%
Simplified19.0%
Taylor expanded in x.re around 0 4.8%
*-commutative4.8%
Simplified4.8%
Final simplification4.8%
(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 81.9%
+-commutative81.9%
*-commutative81.9%
sub-neg81.9%
distribute-lft-in79.1%
associate-+r+79.1%
distribute-rgt-neg-out79.1%
unsub-neg79.1%
associate-*r*84.6%
distribute-rgt-out84.6%
*-commutative84.6%
count-284.6%
distribute-lft1-in84.6%
metadata-eval84.6%
*-commutative84.6%
*-commutative84.6%
associate-*r*84.6%
cube-unmult84.7%
Simplified84.7%
associate-*r*84.6%
associate-*l*84.6%
flip--22.1%
div-inv21.7%
swap-sqr21.7%
pow221.7%
metadata-eval21.7%
pow-prod-up21.7%
metadata-eval21.7%
associate-*l*21.6%
associate-*r*21.6%
fma-def21.6%
Applied egg-rr21.6%
Simplified2.9%
Final simplification2.9%
(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 2023194
(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)))