
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
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_re) - (((x_46_re * x_46_im) + (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_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (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_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
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_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * 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 * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); 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$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
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_re) - (((x_46_re * x_46_im) + (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_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (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_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
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_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * 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 * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); 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$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -5e+195)
(* x.re (* x.re x.re))
(if (or (<= x.re -3.4e-106) (not (<= x.re 5.2e-157)))
(* x.re (fma x.re x.re (* x.im (* x.im -3.0))))
(* x.im (* -3.0 (* x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -5e+195) {
tmp = x_46_re * (x_46_re * x_46_re);
} else if ((x_46_re <= -3.4e-106) || !(x_46_re <= 5.2e-157)) {
tmp = x_46_re * fma(x_46_re, x_46_re, (x_46_im * (x_46_im * -3.0)));
} else {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -5e+195) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); elseif ((x_46_re <= -3.4e-106) || !(x_46_re <= 5.2e-157)) tmp = Float64(x_46_re * fma(x_46_re, x_46_re, Float64(x_46_im * Float64(x_46_im * -3.0)))); else tmp = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -5e+195], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, -3.4e-106], N[Not[LessEqual[x$46$re, 5.2e-157]], $MachinePrecision]], N[(x$46$re * N[(x$46$re * x$46$re + N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{+195}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{elif}\;x.re \leq -3.4 \cdot 10^{-106} \lor \neg \left(x.re \leq 5.2 \cdot 10^{-157}\right):\\
\;\;\;\;x.re \cdot \mathsf{fma}\left(x.re, x.re, x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -4.9999999999999998e195Initial program 41.4%
*-commutative41.4%
distribute-lft-out41.4%
associate-*l*41.4%
*-commutative41.4%
distribute-rgt-out--65.5%
associate--l-65.5%
associate--l-65.5%
sub-neg65.5%
associate--l+65.5%
fma-udef72.4%
neg-mul-172.4%
count-272.4%
associate-*l*72.4%
distribute-rgt-out--72.4%
associate-*r*72.4%
metadata-eval72.4%
Simplified72.4%
Taylor expanded in x.re around inf 93.1%
unpow293.1%
Simplified93.1%
if -4.9999999999999998e195 < x.re < -3.39999999999999982e-106 or 5.19999999999999977e-157 < x.re Initial program 89.9%
*-commutative89.9%
distribute-lft-out89.9%
associate-*l*89.9%
*-commutative89.9%
distribute-rgt-out--95.8%
associate--l-95.8%
associate--l-95.8%
sub-neg95.8%
associate--l+95.8%
fma-udef98.5%
neg-mul-198.5%
count-298.5%
associate-*l*98.5%
distribute-rgt-out--98.5%
associate-*r*98.4%
metadata-eval98.4%
Simplified98.4%
if -3.39999999999999982e-106 < x.re < 5.19999999999999977e-157Initial program 86.1%
*-commutative86.1%
*-commutative86.1%
*-commutative86.1%
distribute-lft-out86.1%
Simplified86.1%
Taylor expanded in x.im around inf 86.1%
add-sqr-sqrt68.7%
pow268.7%
pow268.7%
*-commutative68.7%
sqrt-prod56.9%
sqrt-prod29.9%
add-sqr-sqrt66.8%
distribute-rgt-out--66.8%
metadata-eval66.8%
Applied egg-rr66.8%
unpow266.8%
swap-sqr56.9%
add-sqr-sqrt86.1%
associate-*r*86.0%
*-commutative86.0%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.7%
Applied egg-rr99.7%
Final simplification98.2%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.im -4.3e+39)
(and (not (<= x.im 600000.0))
(or (<= x.im 1.1e+95) (not (<= x.im 3.6e+115)))))
(* -3.0 (* x.re (* x.im x.im)))
(* x.re (* x.re x.re))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -4.3e+39) || (!(x_46_im <= 600000.0) && ((x_46_im <= 1.1e+95) || !(x_46_im <= 3.6e+115)))) {
tmp = -3.0 * (x_46_re * (x_46_im * x_46_im));
} else {
tmp = x_46_re * (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 <= (-4.3d+39)) .or. (.not. (x_46im <= 600000.0d0)) .and. (x_46im <= 1.1d+95) .or. (.not. (x_46im <= 3.6d+115))) then
tmp = (-3.0d0) * (x_46re * (x_46im * x_46im))
else
tmp = x_46re * (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 <= -4.3e+39) || (!(x_46_im <= 600000.0) && ((x_46_im <= 1.1e+95) || !(x_46_im <= 3.6e+115)))) {
tmp = -3.0 * (x_46_re * (x_46_im * x_46_im));
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -4.3e+39) or (not (x_46_im <= 600000.0) and ((x_46_im <= 1.1e+95) or not (x_46_im <= 3.6e+115))): tmp = -3.0 * (x_46_re * (x_46_im * x_46_im)) else: tmp = x_46_re * (x_46_re * x_46_re) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -4.3e+39) || (!(x_46_im <= 600000.0) && ((x_46_im <= 1.1e+95) || !(x_46_im <= 3.6e+115)))) tmp = Float64(-3.0 * Float64(x_46_re * Float64(x_46_im * x_46_im))); else tmp = Float64(x_46_re * 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 <= -4.3e+39) || (~((x_46_im <= 600000.0)) && ((x_46_im <= 1.1e+95) || ~((x_46_im <= 3.6e+115))))) tmp = -3.0 * (x_46_re * (x_46_im * x_46_im)); else tmp = x_46_re * (x_46_re * x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -4.3e+39], And[N[Not[LessEqual[x$46$im, 600000.0]], $MachinePrecision], Or[LessEqual[x$46$im, 1.1e+95], N[Not[LessEqual[x$46$im, 3.6e+115]], $MachinePrecision]]]], N[(-3.0 * N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.3 \cdot 10^{+39} \lor \neg \left(x.im \leq 600000\right) \land \left(x.im \leq 1.1 \cdot 10^{+95} \lor \neg \left(x.im \leq 3.6 \cdot 10^{+115}\right)\right):\\
\;\;\;\;-3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < -4.3e39 or 6e5 < x.im < 1.0999999999999999e95 or 3.6000000000000001e115 < x.im Initial program 67.6%
*-commutative67.6%
distribute-lft-out67.6%
associate-*l*67.6%
*-commutative67.6%
distribute-rgt-out--76.4%
associate--l-76.4%
associate--l-76.4%
sub-neg76.4%
associate--l+76.4%
fma-udef81.7%
neg-mul-181.7%
count-281.7%
associate-*l*81.7%
distribute-rgt-out--81.7%
associate-*r*81.7%
metadata-eval81.7%
Simplified81.7%
Taylor expanded in x.re around 0 70.2%
unpow270.2%
Simplified70.2%
if -4.3e39 < x.im < 6e5 or 1.0999999999999999e95 < x.im < 3.6000000000000001e115Initial program 95.6%
*-commutative95.6%
distribute-lft-out95.6%
associate-*l*95.6%
*-commutative95.6%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 89.5%
unpow289.5%
Simplified89.5%
Final simplification81.0%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.im -4.4e+39)
(and (not (<= x.im 50000.0))
(or (<= x.im 5e+95) (not (<= x.im 3.6e+115)))))
(* x.im (* -3.0 (* x.re x.im)))
(* x.re (* x.re x.re))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -4.4e+39) || (!(x_46_im <= 50000.0) && ((x_46_im <= 5e+95) || !(x_46_im <= 3.6e+115)))) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else {
tmp = x_46_re * (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 <= (-4.4d+39)) .or. (.not. (x_46im <= 50000.0d0)) .and. (x_46im <= 5d+95) .or. (.not. (x_46im <= 3.6d+115))) then
tmp = x_46im * ((-3.0d0) * (x_46re * x_46im))
else
tmp = x_46re * (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 <= -4.4e+39) || (!(x_46_im <= 50000.0) && ((x_46_im <= 5e+95) || !(x_46_im <= 3.6e+115)))) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -4.4e+39) or (not (x_46_im <= 50000.0) and ((x_46_im <= 5e+95) or not (x_46_im <= 3.6e+115))): tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) else: tmp = x_46_re * (x_46_re * x_46_re) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -4.4e+39) || (!(x_46_im <= 50000.0) && ((x_46_im <= 5e+95) || !(x_46_im <= 3.6e+115)))) tmp = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))); else tmp = Float64(x_46_re * 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 <= -4.4e+39) || (~((x_46_im <= 50000.0)) && ((x_46_im <= 5e+95) || ~((x_46_im <= 3.6e+115))))) tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); else tmp = x_46_re * (x_46_re * x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -4.4e+39], And[N[Not[LessEqual[x$46$im, 50000.0]], $MachinePrecision], Or[LessEqual[x$46$im, 5e+95], N[Not[LessEqual[x$46$im, 3.6e+115]], $MachinePrecision]]]], N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.4 \cdot 10^{+39} \lor \neg \left(x.im \leq 50000\right) \land \left(x.im \leq 5 \cdot 10^{+95} \lor \neg \left(x.im \leq 3.6 \cdot 10^{+115}\right)\right):\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < -4.4000000000000003e39 or 5e4 < x.im < 5.00000000000000025e95 or 3.6000000000000001e115 < x.im Initial program 67.6%
*-commutative67.6%
*-commutative67.6%
*-commutative67.6%
distribute-lft-out67.6%
Simplified67.6%
Taylor expanded in x.im around inf 70.2%
add-sqr-sqrt34.7%
pow234.7%
pow234.7%
*-commutative34.7%
sqrt-prod34.7%
sqrt-prod21.0%
add-sqr-sqrt41.4%
distribute-rgt-out--41.4%
metadata-eval41.4%
Applied egg-rr41.4%
unpow241.4%
swap-sqr34.8%
add-sqr-sqrt70.2%
associate-*r*70.2%
*-commutative70.2%
associate-*r*79.3%
*-commutative79.3%
associate-*l*79.3%
Applied egg-rr79.3%
if -4.4000000000000003e39 < x.im < 5e4 or 5.00000000000000025e95 < x.im < 3.6000000000000001e115Initial program 95.6%
*-commutative95.6%
distribute-lft-out95.6%
associate-*l*95.6%
*-commutative95.6%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 89.5%
unpow289.5%
Simplified89.5%
Final simplification85.0%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* -3.0 (* x.re x.im)))) (t_1 (* x.re (* x.re x.re))))
(if (<= x.im -6e+43)
t_0
(if (<= x.im 95000000.0)
t_1
(if (<= x.im 5.4e+95)
(* (* x.re -3.0) (* x.im x.im))
(if (<= x.im 3.6e+115) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (-3.0 * (x_46_re * x_46_im));
double t_1 = x_46_re * (x_46_re * x_46_re);
double tmp;
if (x_46_im <= -6e+43) {
tmp = t_0;
} else if (x_46_im <= 95000000.0) {
tmp = t_1;
} else if (x_46_im <= 5.4e+95) {
tmp = (x_46_re * -3.0) * (x_46_im * x_46_im);
} else if (x_46_im <= 3.6e+115) {
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_46im * ((-3.0d0) * (x_46re * x_46im))
t_1 = x_46re * (x_46re * x_46re)
if (x_46im <= (-6d+43)) then
tmp = t_0
else if (x_46im <= 95000000.0d0) then
tmp = t_1
else if (x_46im <= 5.4d+95) then
tmp = (x_46re * (-3.0d0)) * (x_46im * x_46im)
else if (x_46im <= 3.6d+115) 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_im * (-3.0 * (x_46_re * x_46_im));
double t_1 = x_46_re * (x_46_re * x_46_re);
double tmp;
if (x_46_im <= -6e+43) {
tmp = t_0;
} else if (x_46_im <= 95000000.0) {
tmp = t_1;
} else if (x_46_im <= 5.4e+95) {
tmp = (x_46_re * -3.0) * (x_46_im * x_46_im);
} else if (x_46_im <= 3.6e+115) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * (-3.0 * (x_46_re * x_46_im)) t_1 = x_46_re * (x_46_re * x_46_re) tmp = 0 if x_46_im <= -6e+43: tmp = t_0 elif x_46_im <= 95000000.0: tmp = t_1 elif x_46_im <= 5.4e+95: tmp = (x_46_re * -3.0) * (x_46_im * x_46_im) elif x_46_im <= 3.6e+115: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))) t_1 = Float64(x_46_re * Float64(x_46_re * x_46_re)) tmp = 0.0 if (x_46_im <= -6e+43) tmp = t_0; elseif (x_46_im <= 95000000.0) tmp = t_1; elseif (x_46_im <= 5.4e+95) tmp = Float64(Float64(x_46_re * -3.0) * Float64(x_46_im * x_46_im)); elseif (x_46_im <= 3.6e+115) 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_im * (-3.0 * (x_46_re * x_46_im)); t_1 = x_46_re * (x_46_re * x_46_re); tmp = 0.0; if (x_46_im <= -6e+43) tmp = t_0; elseif (x_46_im <= 95000000.0) tmp = t_1; elseif (x_46_im <= 5.4e+95) tmp = (x_46_re * -3.0) * (x_46_im * x_46_im); elseif (x_46_im <= 3.6e+115) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -6e+43], t$95$0, If[LessEqual[x$46$im, 95000000.0], t$95$1, If[LessEqual[x$46$im, 5.4e+95], N[(N[(x$46$re * -3.0), $MachinePrecision] * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.6e+115], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
t_1 := x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{if}\;x.im \leq -6 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 95000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 5.4 \cdot 10^{+95}:\\
\;\;\;\;\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 3.6 \cdot 10^{+115}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -6.00000000000000033e43 or 3.6000000000000001e115 < x.im Initial program 64.0%
*-commutative64.0%
*-commutative64.0%
*-commutative64.0%
distribute-lft-out64.0%
Simplified64.0%
Taylor expanded in x.im around inf 69.0%
add-sqr-sqrt35.8%
pow235.8%
pow235.8%
*-commutative35.8%
sqrt-prod35.8%
sqrt-prod19.2%
add-sqr-sqrt43.9%
distribute-rgt-out--43.9%
metadata-eval43.9%
Applied egg-rr43.9%
unpow243.9%
swap-sqr35.8%
add-sqr-sqrt69.0%
associate-*r*69.0%
*-commutative69.0%
associate-*r*80.1%
*-commutative80.1%
associate-*l*80.1%
Applied egg-rr80.1%
if -6.00000000000000033e43 < x.im < 9.5e7 or 5.4e95 < x.im < 3.6000000000000001e115Initial program 95.6%
*-commutative95.6%
distribute-lft-out95.6%
associate-*l*95.6%
*-commutative95.6%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 89.5%
unpow289.5%
Simplified89.5%
if 9.5e7 < x.im < 5.4e95Initial program 84.7%
*-commutative84.7%
distribute-lft-out84.7%
associate-*l*84.5%
*-commutative84.5%
distribute-rgt-out--99.4%
associate--l-99.4%
associate--l-99.4%
sub-neg99.4%
associate--l+99.4%
fma-udef99.3%
neg-mul-199.3%
count-299.3%
associate-*l*99.3%
distribute-rgt-out--99.3%
associate-*r*99.5%
metadata-eval99.5%
Simplified99.5%
fma-udef99.5%
Applied egg-rr99.5%
Taylor expanded in x.re around 0 75.7%
unpow275.7%
associate-*r*75.8%
Simplified75.8%
Final simplification85.0%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* x.re x.re))))
(if (<= x.im -3.6e+39)
(* (* x.im -3.0) (* x.re x.im))
(if (<= x.im 25.0)
t_0
(if (<= x.im 5.4e+95)
(* (* x.re -3.0) (* x.im x.im))
(if (<= x.im 3.8e+115) t_0 (* x.im (* -3.0 (* 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_re);
double tmp;
if (x_46_im <= -3.6e+39) {
tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
} else if (x_46_im <= 25.0) {
tmp = t_0;
} else if (x_46_im <= 5.4e+95) {
tmp = (x_46_re * -3.0) * (x_46_im * x_46_im);
} else if (x_46_im <= 3.8e+115) {
tmp = t_0;
} else {
tmp = x_46_im * (-3.0 * (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_46re * (x_46re * x_46re)
if (x_46im <= (-3.6d+39)) then
tmp = (x_46im * (-3.0d0)) * (x_46re * x_46im)
else if (x_46im <= 25.0d0) then
tmp = t_0
else if (x_46im <= 5.4d+95) then
tmp = (x_46re * (-3.0d0)) * (x_46im * x_46im)
else if (x_46im <= 3.8d+115) then
tmp = t_0
else
tmp = x_46im * ((-3.0d0) * (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_re);
double tmp;
if (x_46_im <= -3.6e+39) {
tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
} else if (x_46_im <= 25.0) {
tmp = t_0;
} else if (x_46_im <= 5.4e+95) {
tmp = (x_46_re * -3.0) * (x_46_im * x_46_im);
} else if (x_46_im <= 3.8e+115) {
tmp = t_0;
} else {
tmp = x_46_im * (-3.0 * (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_re) tmp = 0 if x_46_im <= -3.6e+39: tmp = (x_46_im * -3.0) * (x_46_re * x_46_im) elif x_46_im <= 25.0: tmp = t_0 elif x_46_im <= 5.4e+95: tmp = (x_46_re * -3.0) * (x_46_im * x_46_im) elif x_46_im <= 3.8e+115: tmp = t_0 else: tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(x_46_re * x_46_re)) tmp = 0.0 if (x_46_im <= -3.6e+39) tmp = Float64(Float64(x_46_im * -3.0) * Float64(x_46_re * x_46_im)); elseif (x_46_im <= 25.0) tmp = t_0; elseif (x_46_im <= 5.4e+95) tmp = Float64(Float64(x_46_re * -3.0) * Float64(x_46_im * x_46_im)); elseif (x_46_im <= 3.8e+115) tmp = t_0; else tmp = Float64(x_46_im * Float64(-3.0 * 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_re); tmp = 0.0; if (x_46_im <= -3.6e+39) tmp = (x_46_im * -3.0) * (x_46_re * x_46_im); elseif (x_46_im <= 25.0) tmp = t_0; elseif (x_46_im <= 5.4e+95) tmp = (x_46_re * -3.0) * (x_46_im * x_46_im); elseif (x_46_im <= 3.8e+115) tmp = t_0; else tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.6e+39], N[(N[(x$46$im * -3.0), $MachinePrecision] * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 25.0], t$95$0, If[LessEqual[x$46$im, 5.4e+95], N[(N[(x$46$re * -3.0), $MachinePrecision] * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.8e+115], t$95$0, N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{if}\;x.im \leq -3.6 \cdot 10^{+39}:\\
\;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 25:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 5.4 \cdot 10^{+95}:\\
\;\;\;\;\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 3.8 \cdot 10^{+115}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -3.59999999999999984e39Initial program 66.9%
*-commutative66.9%
*-commutative66.9%
*-commutative66.9%
distribute-lft-out66.9%
Simplified66.9%
Taylor expanded in x.im around inf 70.1%
add-sqr-sqrt38.9%
pow238.9%
pow238.9%
*-commutative38.9%
sqrt-prod39.0%
sqrt-prod0.0%
add-sqr-sqrt42.4%
distribute-rgt-out--42.4%
metadata-eval42.4%
Applied egg-rr42.4%
unpow242.4%
swap-sqr39.1%
add-sqr-sqrt70.1%
associate-*r*70.0%
*-commutative70.0%
associate-*r*77.0%
associate-*l*77.0%
Applied egg-rr77.0%
if -3.59999999999999984e39 < x.im < 25 or 5.4e95 < x.im < 3.8000000000000001e115Initial program 95.6%
*-commutative95.6%
distribute-lft-out95.6%
associate-*l*95.6%
*-commutative95.6%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 89.5%
unpow289.5%
Simplified89.5%
if 25 < x.im < 5.4e95Initial program 84.7%
*-commutative84.7%
distribute-lft-out84.7%
associate-*l*84.5%
*-commutative84.5%
distribute-rgt-out--99.4%
associate--l-99.4%
associate--l-99.4%
sub-neg99.4%
associate--l+99.4%
fma-udef99.3%
neg-mul-199.3%
count-299.3%
associate-*l*99.3%
distribute-rgt-out--99.3%
associate-*r*99.5%
metadata-eval99.5%
Simplified99.5%
fma-udef99.5%
Applied egg-rr99.5%
Taylor expanded in x.re around 0 75.7%
unpow275.7%
associate-*r*75.8%
Simplified75.8%
if 3.8000000000000001e115 < x.im Initial program 59.9%
*-commutative59.9%
*-commutative59.9%
*-commutative59.9%
distribute-lft-out59.9%
Simplified59.9%
Taylor expanded in x.im around inf 67.6%
add-sqr-sqrt31.4%
pow231.4%
pow231.4%
*-commutative31.4%
sqrt-prod31.4%
sqrt-prod45.7%
add-sqr-sqrt45.9%
distribute-rgt-out--45.9%
metadata-eval45.9%
Applied egg-rr45.9%
unpow245.9%
swap-sqr31.4%
add-sqr-sqrt67.6%
associate-*r*67.5%
*-commutative67.5%
associate-*r*84.5%
*-commutative84.5%
associate-*l*84.4%
Applied egg-rr84.4%
Final simplification85.0%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* x.re x.re))))
(if (<= x.im -4.1e+41)
(* x.im (* x.re (* x.im -3.0)))
(if (<= x.im 2.4)
t_0
(if (<= x.im 5e+95)
(* (* x.re -3.0) (* x.im x.im))
(if (<= x.im 3.6e+115) t_0 (* x.im (* -3.0 (* 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_re);
double tmp;
if (x_46_im <= -4.1e+41) {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
} else if (x_46_im <= 2.4) {
tmp = t_0;
} else if (x_46_im <= 5e+95) {
tmp = (x_46_re * -3.0) * (x_46_im * x_46_im);
} else if (x_46_im <= 3.6e+115) {
tmp = t_0;
} else {
tmp = x_46_im * (-3.0 * (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_46re * (x_46re * x_46re)
if (x_46im <= (-4.1d+41)) then
tmp = x_46im * (x_46re * (x_46im * (-3.0d0)))
else if (x_46im <= 2.4d0) then
tmp = t_0
else if (x_46im <= 5d+95) then
tmp = (x_46re * (-3.0d0)) * (x_46im * x_46im)
else if (x_46im <= 3.6d+115) then
tmp = t_0
else
tmp = x_46im * ((-3.0d0) * (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_re);
double tmp;
if (x_46_im <= -4.1e+41) {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
} else if (x_46_im <= 2.4) {
tmp = t_0;
} else if (x_46_im <= 5e+95) {
tmp = (x_46_re * -3.0) * (x_46_im * x_46_im);
} else if (x_46_im <= 3.6e+115) {
tmp = t_0;
} else {
tmp = x_46_im * (-3.0 * (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_re) tmp = 0 if x_46_im <= -4.1e+41: tmp = x_46_im * (x_46_re * (x_46_im * -3.0)) elif x_46_im <= 2.4: tmp = t_0 elif x_46_im <= 5e+95: tmp = (x_46_re * -3.0) * (x_46_im * x_46_im) elif x_46_im <= 3.6e+115: tmp = t_0 else: tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(x_46_re * x_46_re)) tmp = 0.0 if (x_46_im <= -4.1e+41) tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_im * -3.0))); elseif (x_46_im <= 2.4) tmp = t_0; elseif (x_46_im <= 5e+95) tmp = Float64(Float64(x_46_re * -3.0) * Float64(x_46_im * x_46_im)); elseif (x_46_im <= 3.6e+115) tmp = t_0; else tmp = Float64(x_46_im * Float64(-3.0 * 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_re); tmp = 0.0; if (x_46_im <= -4.1e+41) tmp = x_46_im * (x_46_re * (x_46_im * -3.0)); elseif (x_46_im <= 2.4) tmp = t_0; elseif (x_46_im <= 5e+95) tmp = (x_46_re * -3.0) * (x_46_im * x_46_im); elseif (x_46_im <= 3.6e+115) tmp = t_0; else tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -4.1e+41], N[(x$46$im * N[(x$46$re * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.4], t$95$0, If[LessEqual[x$46$im, 5e+95], N[(N[(x$46$re * -3.0), $MachinePrecision] * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3.6e+115], t$95$0, N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{if}\;x.im \leq -4.1 \cdot 10^{+41}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{elif}\;x.im \leq 2.4:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{+95}:\\
\;\;\;\;\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 3.6 \cdot 10^{+115}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -4.1000000000000004e41Initial program 66.9%
*-commutative66.9%
*-commutative66.9%
*-commutative66.9%
distribute-lft-out66.9%
Simplified66.9%
Taylor expanded in x.im around inf 70.1%
add-sqr-sqrt38.9%
pow238.9%
pow238.9%
*-commutative38.9%
sqrt-prod39.0%
sqrt-prod0.0%
add-sqr-sqrt42.4%
distribute-rgt-out--42.4%
metadata-eval42.4%
Applied egg-rr42.4%
unpow242.4%
swap-sqr39.1%
add-sqr-sqrt70.1%
*-commutative70.1%
associate-*r*77.1%
associate-*l*77.1%
Applied egg-rr77.1%
if -4.1000000000000004e41 < x.im < 2.39999999999999991 or 5.00000000000000025e95 < x.im < 3.6000000000000001e115Initial program 95.6%
*-commutative95.6%
distribute-lft-out95.6%
associate-*l*95.6%
*-commutative95.6%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 89.5%
unpow289.5%
Simplified89.5%
if 2.39999999999999991 < x.im < 5.00000000000000025e95Initial program 84.7%
*-commutative84.7%
distribute-lft-out84.7%
associate-*l*84.5%
*-commutative84.5%
distribute-rgt-out--99.4%
associate--l-99.4%
associate--l-99.4%
sub-neg99.4%
associate--l+99.4%
fma-udef99.3%
neg-mul-199.3%
count-299.3%
associate-*l*99.3%
distribute-rgt-out--99.3%
associate-*r*99.5%
metadata-eval99.5%
Simplified99.5%
fma-udef99.5%
Applied egg-rr99.5%
Taylor expanded in x.re around 0 75.7%
unpow275.7%
associate-*r*75.8%
Simplified75.8%
if 3.6000000000000001e115 < x.im Initial program 59.9%
*-commutative59.9%
*-commutative59.9%
*-commutative59.9%
distribute-lft-out59.9%
Simplified59.9%
Taylor expanded in x.im around inf 67.6%
add-sqr-sqrt31.4%
pow231.4%
pow231.4%
*-commutative31.4%
sqrt-prod31.4%
sqrt-prod45.7%
add-sqr-sqrt45.9%
distribute-rgt-out--45.9%
metadata-eval45.9%
Applied egg-rr45.9%
unpow245.9%
swap-sqr31.4%
add-sqr-sqrt67.6%
associate-*r*67.5%
*-commutative67.5%
associate-*r*84.5%
*-commutative84.5%
associate-*l*84.4%
Applied egg-rr84.4%
Final simplification85.0%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -7.5e+153) (not (<= x.im 1.8e+142))) (* x.im (* -3.0 (* x.re x.im))) (* x.re (+ (* x.re x.re) (* x.im (* x.im -3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -7.5e+153) || !(x_46_im <= 1.8e+142)) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else {
tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (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 <= (-7.5d+153)) .or. (.not. (x_46im <= 1.8d+142))) then
tmp = x_46im * ((-3.0d0) * (x_46re * x_46im))
else
tmp = x_46re * ((x_46re * x_46re) + (x_46im * (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 <= -7.5e+153) || !(x_46_im <= 1.8e+142)) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else {
tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -7.5e+153) or not (x_46_im <= 1.8e+142): tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) else: tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -7.5e+153) || !(x_46_im <= 1.8e+142)) tmp = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))); else tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * Float64(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 <= -7.5e+153) || ~((x_46_im <= 1.8e+142))) tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); else tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -7.5e+153], N[Not[LessEqual[x$46$im, 1.8e+142]], $MachinePrecision]], N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -7.5 \cdot 10^{+153} \lor \neg \left(x.im \leq 1.8 \cdot 10^{+142}\right):\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re + x.im \cdot \left(x.im \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < -7.50000000000000065e153 or 1.8000000000000001e142 < x.im Initial program 53.7%
*-commutative53.7%
*-commutative53.7%
*-commutative53.7%
distribute-lft-out53.7%
Simplified53.7%
Taylor expanded in x.im around inf 64.2%
add-sqr-sqrt32.3%
pow232.3%
pow232.3%
*-commutative32.3%
sqrt-prod32.3%
sqrt-prod24.4%
add-sqr-sqrt45.5%
distribute-rgt-out--45.5%
metadata-eval45.5%
Applied egg-rr45.5%
unpow245.5%
swap-sqr32.3%
add-sqr-sqrt64.2%
associate-*r*64.2%
*-commutative64.2%
associate-*r*82.4%
*-commutative82.4%
associate-*l*82.3%
Applied egg-rr82.3%
if -7.50000000000000065e153 < x.im < 1.8000000000000001e142Initial program 91.7%
*-commutative91.7%
distribute-lft-out91.7%
associate-*l*91.7%
*-commutative91.7%
distribute-rgt-out--99.7%
associate--l-99.7%
associate--l-99.7%
sub-neg99.7%
associate--l+99.7%
fma-udef99.7%
neg-mul-199.7%
count-299.7%
associate-*l*99.7%
distribute-rgt-out--99.7%
associate-*r*99.7%
metadata-eval99.7%
Simplified99.7%
fma-udef99.7%
Applied egg-rr99.7%
Final simplification95.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -6e+191) (not (<= x.im 1.35e+116))) (* x.re (* x.im (- x.im))) (* x.re (* x.re x.re))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -6e+191) || !(x_46_im <= 1.35e+116)) {
tmp = x_46_re * (x_46_im * -x_46_im);
} else {
tmp = x_46_re * (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 <= (-6d+191)) .or. (.not. (x_46im <= 1.35d+116))) then
tmp = x_46re * (x_46im * -x_46im)
else
tmp = x_46re * (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 <= -6e+191) || !(x_46_im <= 1.35e+116)) {
tmp = x_46_re * (x_46_im * -x_46_im);
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -6e+191) or not (x_46_im <= 1.35e+116): tmp = x_46_re * (x_46_im * -x_46_im) else: tmp = x_46_re * (x_46_re * x_46_re) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -6e+191) || !(x_46_im <= 1.35e+116)) tmp = Float64(x_46_re * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(x_46_re * 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 <= -6e+191) || ~((x_46_im <= 1.35e+116))) tmp = x_46_re * (x_46_im * -x_46_im); else tmp = x_46_re * (x_46_re * x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -6e+191], N[Not[LessEqual[x$46$im, 1.35e+116]], $MachinePrecision]], N[(x$46$re * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -6 \cdot 10^{+191} \lor \neg \left(x.im \leq 1.35 \cdot 10^{+116}\right):\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < -5.9999999999999995e191 or 1.35e116 < x.im Initial program 61.9%
*-commutative61.9%
*-commutative61.9%
*-commutative61.9%
distribute-lft-out61.9%
Simplified61.9%
Taylor expanded in x.re around 0 72.1%
associate-*r*72.1%
mul-1-neg72.1%
unpow272.1%
Simplified72.1%
distribute-lft-in72.1%
distribute-lft-in72.1%
Applied egg-rr72.1%
associate--r+72.1%
fma-neg72.1%
add-sqr-sqrt36.3%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod7.4%
add-sqr-sqrt8.6%
fma-neg1.8%
associate-*r*4.8%
*-commutative4.8%
+-inverses65.8%
neg-sub065.8%
*-commutative65.8%
associate-*r*63.8%
*-commutative63.8%
distribute-lft-neg-in63.8%
Applied egg-rr63.8%
if -5.9999999999999995e191 < x.im < 1.35e116Initial program 89.7%
*-commutative89.7%
distribute-lft-out89.7%
associate-*l*89.6%
*-commutative89.6%
distribute-rgt-out--97.2%
associate--l-97.2%
associate--l-97.2%
sub-neg97.2%
associate--l+97.2%
fma-udef97.2%
neg-mul-197.2%
count-297.2%
associate-*l*97.2%
distribute-rgt-out--97.2%
associate-*r*97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in x.re around inf 73.1%
unpow273.1%
Simplified73.1%
Final simplification70.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -3.8e+191) (not (<= x.im 8.5e+115))) (* x.im (* x.re (- x.im))) (* x.re (* x.re x.re))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -3.8e+191) || !(x_46_im <= 8.5e+115)) {
tmp = x_46_im * (x_46_re * -x_46_im);
} else {
tmp = x_46_re * (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 <= (-3.8d+191)) .or. (.not. (x_46im <= 8.5d+115))) then
tmp = x_46im * (x_46re * -x_46im)
else
tmp = x_46re * (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 <= -3.8e+191) || !(x_46_im <= 8.5e+115)) {
tmp = x_46_im * (x_46_re * -x_46_im);
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -3.8e+191) or not (x_46_im <= 8.5e+115): tmp = x_46_im * (x_46_re * -x_46_im) else: tmp = x_46_re * (x_46_re * x_46_re) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -3.8e+191) || !(x_46_im <= 8.5e+115)) tmp = Float64(x_46_im * Float64(x_46_re * Float64(-x_46_im))); else tmp = Float64(x_46_re * 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 <= -3.8e+191) || ~((x_46_im <= 8.5e+115))) tmp = x_46_im * (x_46_re * -x_46_im); else tmp = x_46_re * (x_46_re * x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -3.8e+191], N[Not[LessEqual[x$46$im, 8.5e+115]], $MachinePrecision]], N[(x$46$im * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.8 \cdot 10^{+191} \lor \neg \left(x.im \leq 8.5 \cdot 10^{+115}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < -3.7999999999999998e191 or 8.50000000000000057e115 < x.im Initial program 61.9%
*-commutative61.9%
*-commutative61.9%
*-commutative61.9%
distribute-lft-out61.9%
Simplified61.9%
Taylor expanded in x.re around 0 72.1%
associate-*r*72.1%
mul-1-neg72.1%
unpow272.1%
Simplified72.1%
distribute-lft-in72.1%
distribute-lft-in72.1%
Applied egg-rr72.1%
associate--r+72.1%
fma-neg72.1%
add-sqr-sqrt36.3%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod7.4%
add-sqr-sqrt8.6%
fma-neg1.8%
associate-*r*4.8%
*-commutative4.8%
+-inverses65.8%
neg-sub065.8%
*-commutative65.8%
distribute-rgt-neg-in65.8%
Applied egg-rr65.8%
if -3.7999999999999998e191 < x.im < 8.50000000000000057e115Initial program 89.7%
*-commutative89.7%
distribute-lft-out89.7%
associate-*l*89.6%
*-commutative89.6%
distribute-rgt-out--97.2%
associate--l-97.2%
associate--l-97.2%
sub-neg97.2%
associate--l+97.2%
fma-udef97.2%
neg-mul-197.2%
count-297.2%
associate-*l*97.2%
distribute-rgt-out--97.2%
associate-*r*97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in x.re around inf 73.1%
unpow273.1%
Simplified73.1%
Final simplification71.4%
(FPCore (x.re x.im) :precision binary64 (* x.re (* x.re x.re)))
double code(double x_46_re, double x_46_im) {
return x_46_re * (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_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_re * (x_46_re * x_46_re);
}
def code(x_46_re, x_46_im): return x_46_re * (x_46_re * x_46_re)
function code(x_46_re, x_46_im) return Float64(x_46_re * Float64(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_re); end
code[x$46$re_, x$46$im_] := N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot \left(x.re \cdot x.re\right)
\end{array}
Initial program 83.3%
*-commutative83.3%
distribute-lft-out83.3%
associate-*l*83.2%
*-commutative83.2%
distribute-rgt-out--89.5%
associate--l-89.5%
associate--l-89.5%
sub-neg89.5%
associate--l+89.5%
fma-udef91.8%
neg-mul-191.8%
count-291.8%
associate-*l*91.8%
distribute-rgt-out--91.8%
associate-*r*91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in x.re around inf 59.2%
unpow259.2%
Simplified59.2%
Final simplification59.2%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im)))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * 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_46re - x_46im)) + ((x_46re * x_46im) * (x_46re - (3.0d0 * 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_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)) + Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re - Float64(3.0 * x_46_im)))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im))); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re - N[(3.0 * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right) + \left(x.re \cdot x.im\right) \cdot \left(x.re - 3 \cdot x.im\right)
\end{array}
herbie shell --seed 2023174
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))