
(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 11 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
(let* ((t_0 (* x.re (fma x.re x.re (* x.im (* x.im -3.0))))))
(if (<= x.re -6.4e+113)
t_0
(if (<= x.re 1e+68)
(+ (pow x.re 3.0) (* x.im (* x.re (* x.im -3.0))))
(if (<= x.re 5e+184) t_0 (* x.re (* x.re x.re)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * fma(x_46_re, x_46_re, (x_46_im * (x_46_im * -3.0)));
double tmp;
if (x_46_re <= -6.4e+113) {
tmp = t_0;
} else if (x_46_re <= 1e+68) {
tmp = pow(x_46_re, 3.0) + (x_46_im * (x_46_re * (x_46_im * -3.0)));
} else if (x_46_re <= 5e+184) {
tmp = t_0;
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * fma(x_46_re, x_46_re, Float64(x_46_im * Float64(x_46_im * -3.0)))) tmp = 0.0 if (x_46_re <= -6.4e+113) tmp = t_0; elseif (x_46_re <= 1e+68) tmp = Float64((x_46_re ^ 3.0) + Float64(x_46_im * Float64(x_46_re * Float64(x_46_im * -3.0)))); elseif (x_46_re <= 5e+184) tmp = t_0; else tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); end return tmp end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = 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]}, If[LessEqual[x$46$re, -6.4e+113], t$95$0, If[LessEqual[x$46$re, 1e+68], N[(N[Power[x$46$re, 3.0], $MachinePrecision] + N[(x$46$im * N[(x$46$re * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5e+184], t$95$0, N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \mathsf{fma}\left(x.re, x.re, x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{if}\;x.re \leq -6.4 \cdot 10^{+113}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 10^{+68}:\\
\;\;\;\;{x.re}^{3} + x.im \cdot \left(x.re \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{+184}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.re < -6.3999999999999996e113 or 9.99999999999999953e67 < x.re < 4.9999999999999999e184Initial program 73.8%
*-commutative73.8%
distribute-lft-out73.8%
associate-*l*73.8%
*-commutative73.8%
distribute-rgt-out--86.9%
associate--l-86.9%
associate--l-86.9%
sub-neg86.9%
associate--l+86.9%
fma-udef96.7%
neg-mul-196.7%
count-296.7%
associate-*l*96.7%
distribute-rgt-out--96.7%
associate-*r*96.7%
metadata-eval96.7%
Simplified96.7%
if -6.3999999999999996e113 < x.re < 9.99999999999999953e67Initial program 89.0%
*-commutative89.0%
distribute-lft-out89.0%
associate-*l*89.0%
*-commutative89.0%
distribute-rgt-out--89.0%
associate--l-89.0%
associate--l-89.0%
sub-neg89.0%
associate--l+89.0%
fma-udef89.0%
neg-mul-189.0%
count-289.0%
associate-*l*89.0%
distribute-rgt-out--89.0%
associate-*r*89.0%
metadata-eval89.0%
Simplified89.0%
fma-udef89.0%
Applied egg-rr89.0%
distribute-lft-in89.0%
cube-unmult89.1%
*-commutative89.1%
associate-*r*99.9%
Applied egg-rr99.9%
if 4.9999999999999999e184 < x.re Initial program 51.7%
*-commutative51.7%
distribute-lft-out51.7%
associate-*l*51.7%
*-commutative51.7%
distribute-rgt-out--75.9%
associate--l-75.9%
associate--l-75.9%
sub-neg75.9%
associate--l+75.9%
fma-udef79.3%
neg-mul-179.3%
count-279.3%
associate-*l*79.3%
distribute-rgt-out--79.3%
associate-*r*79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x.re around inf 96.6%
unpow296.6%
Simplified96.6%
Final simplification98.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (fma x.re x.re (* x.im (* x.im -3.0))))))
(if (<= x.re -6.2e-71)
t_0
(if (<= x.re 1.86e-122)
(* x.im (* x.im (* x.re -3.0)))
(if (<= x.re 5e+186) t_0 (* x.re (* x.re x.re)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * fma(x_46_re, x_46_re, (x_46_im * (x_46_im * -3.0)));
double tmp;
if (x_46_re <= -6.2e-71) {
tmp = t_0;
} else if (x_46_re <= 1.86e-122) {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
} else if (x_46_re <= 5e+186) {
tmp = t_0;
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * fma(x_46_re, x_46_re, Float64(x_46_im * Float64(x_46_im * -3.0)))) tmp = 0.0 if (x_46_re <= -6.2e-71) tmp = t_0; elseif (x_46_re <= 1.86e-122) tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0))); elseif (x_46_re <= 5e+186) tmp = t_0; else tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); end return tmp end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = 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]}, If[LessEqual[x$46$re, -6.2e-71], t$95$0, If[LessEqual[x$46$re, 1.86e-122], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5e+186], t$95$0, N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \mathsf{fma}\left(x.re, x.re, x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{if}\;x.re \leq -6.2 \cdot 10^{-71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 1.86 \cdot 10^{-122}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.re < -6.20000000000000004e-71 or 1.8600000000000001e-122 < x.re < 4.99999999999999954e186Initial program 88.5%
*-commutative88.5%
distribute-lft-out88.5%
associate-*l*88.4%
*-commutative88.4%
distribute-rgt-out--93.8%
associate--l-93.8%
associate--l-93.8%
sub-neg93.8%
associate--l+93.8%
fma-udef97.8%
neg-mul-197.8%
count-297.8%
associate-*l*97.8%
distribute-rgt-out--97.8%
associate-*r*97.9%
metadata-eval97.9%
Simplified97.9%
if -6.20000000000000004e-71 < x.re < 1.8600000000000001e-122Initial program 78.1%
*-commutative78.1%
distribute-lft-out78.1%
associate-*l*78.1%
*-commutative78.1%
distribute-rgt-out--78.2%
associate--l-78.2%
associate--l-78.2%
sub-neg78.2%
associate--l+78.2%
fma-udef78.2%
neg-mul-178.2%
count-278.2%
associate-*l*78.2%
distribute-rgt-out--78.2%
associate-*r*78.2%
metadata-eval78.2%
Simplified78.2%
fma-udef78.2%
Applied egg-rr78.2%
Taylor expanded in x.re around 0 78.1%
unpow278.1%
Simplified78.1%
add-sqr-sqrt63.4%
pow263.4%
associate-*r*62.1%
sqrt-prod48.0%
sqrt-prod20.4%
add-sqr-sqrt59.9%
Applied egg-rr59.9%
unpow259.9%
*-commutative59.9%
associate-*l*60.0%
associate-*l*60.0%
add-sqr-sqrt99.8%
associate-*r*99.8%
*-commutative99.8%
Applied egg-rr99.8%
if 4.99999999999999954e186 < x.re Initial program 51.7%
*-commutative51.7%
distribute-lft-out51.7%
associate-*l*51.7%
*-commutative51.7%
distribute-rgt-out--75.9%
associate--l-75.9%
associate--l-75.9%
sub-neg75.9%
associate--l+75.9%
fma-udef79.3%
neg-mul-179.3%
count-279.3%
associate-*l*79.3%
distribute-rgt-out--79.3%
associate-*r*79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x.re around inf 96.6%
unpow296.6%
Simplified96.6%
Final simplification98.3%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (fma x.re x.re (* x.im (* x.im -3.0))))))
(if (<= x.re -1e+90)
t_0
(if (<= x.re 1e+68)
(+ (pow x.re 3.0) (* x.im (* -3.0 (* x.re x.im))))
(if (<= x.re 5e+184) t_0 (* x.re (* x.re x.re)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * fma(x_46_re, x_46_re, (x_46_im * (x_46_im * -3.0)));
double tmp;
if (x_46_re <= -1e+90) {
tmp = t_0;
} else if (x_46_re <= 1e+68) {
tmp = pow(x_46_re, 3.0) + (x_46_im * (-3.0 * (x_46_re * x_46_im)));
} else if (x_46_re <= 5e+184) {
tmp = t_0;
} else {
tmp = x_46_re * (x_46_re * x_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * fma(x_46_re, x_46_re, Float64(x_46_im * Float64(x_46_im * -3.0)))) tmp = 0.0 if (x_46_re <= -1e+90) tmp = t_0; elseif (x_46_re <= 1e+68) tmp = Float64((x_46_re ^ 3.0) + Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im)))); elseif (x_46_re <= 5e+184) tmp = t_0; else tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); end return tmp end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = 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]}, If[LessEqual[x$46$re, -1e+90], t$95$0, If[LessEqual[x$46$re, 1e+68], N[(N[Power[x$46$re, 3.0], $MachinePrecision] + N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5e+184], t$95$0, N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \mathsf{fma}\left(x.re, x.re, x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{+90}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 10^{+68}:\\
\;\;\;\;{x.re}^{3} + x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{+184}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.re < -9.99999999999999966e89 or 9.99999999999999953e67 < x.re < 4.9999999999999999e184Initial program 75.8%
*-commutative75.8%
distribute-lft-out75.8%
associate-*l*75.7%
*-commutative75.7%
distribute-rgt-out--87.9%
associate--l-87.9%
associate--l-87.9%
sub-neg87.9%
associate--l+87.9%
fma-udef96.9%
neg-mul-196.9%
count-296.9%
associate-*l*96.9%
distribute-rgt-out--96.9%
associate-*r*97.0%
metadata-eval97.0%
Simplified97.0%
if -9.99999999999999966e89 < x.re < 9.99999999999999953e67Initial program 88.7%
*-commutative88.7%
distribute-lft-out88.7%
associate-*l*88.6%
*-commutative88.6%
distribute-rgt-out--88.7%
associate--l-88.7%
associate--l-88.7%
sub-neg88.7%
associate--l+88.7%
fma-udef88.7%
neg-mul-188.7%
count-288.7%
associate-*l*88.7%
distribute-rgt-out--88.7%
associate-*r*88.7%
metadata-eval88.7%
Simplified88.7%
fma-udef88.7%
Applied egg-rr88.7%
distribute-lft-in88.7%
cube-unmult88.8%
*-commutative88.8%
associate-*r*99.9%
Applied egg-rr99.9%
Taylor expanded in x.re around 0 99.8%
if 4.9999999999999999e184 < x.re Initial program 51.7%
*-commutative51.7%
distribute-lft-out51.7%
associate-*l*51.7%
*-commutative51.7%
distribute-rgt-out--75.9%
associate--l-75.9%
associate--l-75.9%
sub-neg75.9%
associate--l+75.9%
fma-udef79.3%
neg-mul-179.3%
count-279.3%
associate-*l*79.3%
distribute-rgt-out--79.3%
associate-*r*79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in x.re around inf 96.6%
unpow296.6%
Simplified96.6%
Final simplification98.7%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.im -2.7e+79)
(not
(or (<= x.im -18500000000.0)
(and (not (<= x.im -9.8e-48)) (<= x.im 7800000.0)))))
(* -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 <= -2.7e+79) || !((x_46_im <= -18500000000.0) || (!(x_46_im <= -9.8e-48) && (x_46_im <= 7800000.0)))) {
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 <= (-2.7d+79)) .or. (.not. (x_46im <= (-18500000000.0d0)) .or. (.not. (x_46im <= (-9.8d-48))) .and. (x_46im <= 7800000.0d0))) 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 <= -2.7e+79) || !((x_46_im <= -18500000000.0) || (!(x_46_im <= -9.8e-48) && (x_46_im <= 7800000.0)))) {
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 <= -2.7e+79) or not ((x_46_im <= -18500000000.0) or (not (x_46_im <= -9.8e-48) and (x_46_im <= 7800000.0))): 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 <= -2.7e+79) || !((x_46_im <= -18500000000.0) || (!(x_46_im <= -9.8e-48) && (x_46_im <= 7800000.0)))) 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 <= -2.7e+79) || ~(((x_46_im <= -18500000000.0) || (~((x_46_im <= -9.8e-48)) && (x_46_im <= 7800000.0))))) 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, -2.7e+79], N[Not[Or[LessEqual[x$46$im, -18500000000.0], And[N[Not[LessEqual[x$46$im, -9.8e-48]], $MachinePrecision], LessEqual[x$46$im, 7800000.0]]]], $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 -2.7 \cdot 10^{+79} \lor \neg \left(x.im \leq -18500000000 \lor \neg \left(x.im \leq -9.8 \cdot 10^{-48}\right) \land x.im \leq 7800000\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 < -2.7e79 or -1.85e10 < x.im < -9.8000000000000005e-48 or 7.8e6 < x.im Initial program 64.9%
*-commutative64.9%
distribute-lft-out64.9%
associate-*l*64.8%
*-commutative64.8%
distribute-rgt-out--71.0%
associate--l-71.0%
associate--l-71.0%
sub-neg71.0%
associate--l+71.0%
fma-udef77.1%
neg-mul-177.1%
count-277.1%
associate-*l*77.1%
distribute-rgt-out--77.1%
associate-*r*77.2%
metadata-eval77.2%
Simplified77.2%
fma-udef71.0%
Applied egg-rr71.0%
Taylor expanded in x.re around 0 63.0%
unpow263.0%
Simplified63.0%
if -2.7e79 < x.im < -1.85e10 or -9.8000000000000005e-48 < x.im < 7.8e6Initial program 94.2%
*-commutative94.2%
distribute-lft-out94.2%
associate-*l*94.2%
*-commutative94.2%
distribute-rgt-out--99.9%
associate--l-99.9%
associate--l-99.9%
sub-neg99.9%
associate--l+99.9%
fma-udef99.9%
neg-mul-199.9%
count-299.9%
associate-*l*99.9%
distribute-rgt-out--99.9%
associate-*r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x.re around inf 92.6%
unpow292.6%
Simplified92.6%
Final simplification79.4%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -3.3e+78)
(* (* x.im -3.0) (* x.re x.im))
(if (or (<= x.im -33500000000.0)
(and (not (<= x.im -9.8e-48)) (<= x.im 3800000.0)))
(* x.re (* x.re x.re))
(* x.im (* x.im (* x.re -3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -3.3e+78) {
tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
} else if ((x_46_im <= -33500000000.0) || (!(x_46_im <= -9.8e-48) && (x_46_im <= 3800000.0))) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-3.3d+78)) then
tmp = (x_46im * (-3.0d0)) * (x_46re * x_46im)
else if ((x_46im <= (-33500000000.0d0)) .or. (.not. (x_46im <= (-9.8d-48))) .and. (x_46im <= 3800000.0d0)) then
tmp = x_46re * (x_46re * x_46re)
else
tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -3.3e+78) {
tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
} else if ((x_46_im <= -33500000000.0) || (!(x_46_im <= -9.8e-48) && (x_46_im <= 3800000.0))) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -3.3e+78: tmp = (x_46_im * -3.0) * (x_46_re * x_46_im) elif (x_46_im <= -33500000000.0) or (not (x_46_im <= -9.8e-48) and (x_46_im <= 3800000.0)): tmp = x_46_re * (x_46_re * x_46_re) else: tmp = x_46_im * (x_46_im * (x_46_re * -3.0)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -3.3e+78) tmp = Float64(Float64(x_46_im * -3.0) * Float64(x_46_re * x_46_im)); elseif ((x_46_im <= -33500000000.0) || (!(x_46_im <= -9.8e-48) && (x_46_im <= 3800000.0))) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -3.3e+78) tmp = (x_46_im * -3.0) * (x_46_re * x_46_im); elseif ((x_46_im <= -33500000000.0) || (~((x_46_im <= -9.8e-48)) && (x_46_im <= 3800000.0))) tmp = x_46_re * (x_46_re * x_46_re); else tmp = x_46_im * (x_46_im * (x_46_re * -3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -3.3e+78], N[(N[(x$46$im * -3.0), $MachinePrecision] * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$im, -33500000000.0], And[N[Not[LessEqual[x$46$im, -9.8e-48]], $MachinePrecision], LessEqual[x$46$im, 3800000.0]]], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.3 \cdot 10^{+78}:\\
\;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq -33500000000 \lor \neg \left(x.im \leq -9.8 \cdot 10^{-48}\right) \land x.im \leq 3800000:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < -3.3e78Initial program 58.5%
*-commutative58.5%
distribute-lft-out58.5%
associate-*l*58.5%
*-commutative58.5%
distribute-rgt-out--62.8%
associate--l-62.8%
associate--l-62.8%
sub-neg62.8%
associate--l+62.8%
fma-udef71.3%
neg-mul-171.3%
count-271.3%
associate-*l*71.3%
distribute-rgt-out--71.3%
associate-*r*71.3%
metadata-eval71.3%
Simplified71.3%
fma-udef62.8%
Applied egg-rr62.8%
Taylor expanded in x.re around 0 67.0%
unpow267.0%
Simplified67.0%
add-sqr-sqrt39.0%
pow239.0%
associate-*r*39.0%
sqrt-prod38.9%
sqrt-prod0.0%
add-sqr-sqrt50.8%
Applied egg-rr50.8%
unpow250.8%
swap-sqr38.9%
add-sqr-sqrt67.0%
associate-*l*85.0%
associate-*r*84.9%
*-commutative84.9%
associate-*l*85.0%
*-commutative85.0%
Applied egg-rr85.0%
if -3.3e78 < x.im < -3.35e10 or -9.8000000000000005e-48 < x.im < 3.8e6Initial program 94.2%
*-commutative94.2%
distribute-lft-out94.2%
associate-*l*94.2%
*-commutative94.2%
distribute-rgt-out--99.9%
associate--l-99.9%
associate--l-99.9%
sub-neg99.9%
associate--l+99.9%
fma-udef99.9%
neg-mul-199.9%
count-299.9%
associate-*l*99.9%
distribute-rgt-out--99.9%
associate-*r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x.re around inf 92.6%
unpow292.6%
Simplified92.6%
if -3.35e10 < x.im < -9.8000000000000005e-48 or 3.8e6 < x.im Initial program 69.3%
*-commutative69.3%
distribute-lft-out69.3%
associate-*l*69.3%
*-commutative69.3%
distribute-rgt-out--76.8%
associate--l-76.8%
associate--l-76.8%
sub-neg76.8%
associate--l+76.8%
fma-udef81.2%
neg-mul-181.2%
count-281.2%
associate-*l*81.2%
distribute-rgt-out--81.2%
associate-*r*81.3%
metadata-eval81.3%
Simplified81.3%
fma-udef76.8%
Applied egg-rr76.8%
Taylor expanded in x.re around 0 60.2%
unpow260.2%
Simplified60.2%
add-sqr-sqrt35.5%
pow235.5%
associate-*r*35.5%
sqrt-prod35.5%
sqrt-prod27.7%
add-sqr-sqrt41.0%
Applied egg-rr41.0%
unpow241.0%
*-commutative41.0%
associate-*l*41.1%
associate-*l*41.1%
add-sqr-sqrt74.2%
associate-*r*74.2%
*-commutative74.2%
Applied egg-rr74.2%
Final simplification86.4%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* -3.0 (* x.im x.im)))) (t_1 (* x.re (* x.re x.re))))
(if (<= x.im -2.8e+78)
t_0
(if (<= x.im -52000000000.0)
t_1
(if (<= x.im -9.8e-48)
(* -3.0 (* x.re (* x.im x.im)))
(if (<= x.im 5000000.0) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (-3.0 * (x_46_im * x_46_im));
double t_1 = x_46_re * (x_46_re * x_46_re);
double tmp;
if (x_46_im <= -2.8e+78) {
tmp = t_0;
} else if (x_46_im <= -52000000000.0) {
tmp = t_1;
} else if (x_46_im <= -9.8e-48) {
tmp = -3.0 * (x_46_re * (x_46_im * x_46_im));
} else if (x_46_im <= 5000000.0) {
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 * ((-3.0d0) * (x_46im * x_46im))
t_1 = x_46re * (x_46re * x_46re)
if (x_46im <= (-2.8d+78)) then
tmp = t_0
else if (x_46im <= (-52000000000.0d0)) then
tmp = t_1
else if (x_46im <= (-9.8d-48)) then
tmp = (-3.0d0) * (x_46re * (x_46im * x_46im))
else if (x_46im <= 5000000.0d0) 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 * (-3.0 * (x_46_im * x_46_im));
double t_1 = x_46_re * (x_46_re * x_46_re);
double tmp;
if (x_46_im <= -2.8e+78) {
tmp = t_0;
} else if (x_46_im <= -52000000000.0) {
tmp = t_1;
} else if (x_46_im <= -9.8e-48) {
tmp = -3.0 * (x_46_re * (x_46_im * x_46_im));
} else if (x_46_im <= 5000000.0) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * (-3.0 * (x_46_im * x_46_im)) t_1 = x_46_re * (x_46_re * x_46_re) tmp = 0 if x_46_im <= -2.8e+78: tmp = t_0 elif x_46_im <= -52000000000.0: tmp = t_1 elif x_46_im <= -9.8e-48: tmp = -3.0 * (x_46_re * (x_46_im * x_46_im)) elif x_46_im <= 5000000.0: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(-3.0 * Float64(x_46_im * x_46_im))) t_1 = Float64(x_46_re * Float64(x_46_re * x_46_re)) tmp = 0.0 if (x_46_im <= -2.8e+78) tmp = t_0; elseif (x_46_im <= -52000000000.0) tmp = t_1; elseif (x_46_im <= -9.8e-48) tmp = Float64(-3.0 * Float64(x_46_re * Float64(x_46_im * x_46_im))); elseif (x_46_im <= 5000000.0) 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 * (-3.0 * (x_46_im * x_46_im)); t_1 = x_46_re * (x_46_re * x_46_re); tmp = 0.0; if (x_46_im <= -2.8e+78) tmp = t_0; elseif (x_46_im <= -52000000000.0) tmp = t_1; elseif (x_46_im <= -9.8e-48) tmp = -3.0 * (x_46_re * (x_46_im * x_46_im)); elseif (x_46_im <= 5000000.0) 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$re * N[(-3.0 * N[(x$46$im * 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, -2.8e+78], t$95$0, If[LessEqual[x$46$im, -52000000000.0], t$95$1, If[LessEqual[x$46$im, -9.8e-48], N[(-3.0 * N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5000000.0], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(-3 \cdot \left(x.im \cdot x.im\right)\right)\\
t_1 := x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{if}\;x.im \leq -2.8 \cdot 10^{+78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq -52000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -9.8 \cdot 10^{-48}:\\
\;\;\;\;-3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 5000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -2.8000000000000001e78 or 5e6 < x.im Initial program 59.2%
*-commutative59.2%
distribute-lft-out59.2%
associate-*l*59.2%
*-commutative59.2%
distribute-rgt-out--66.4%
associate--l-66.4%
associate--l-66.4%
sub-neg66.4%
associate--l+66.4%
fma-udef73.5%
neg-mul-173.5%
count-273.5%
associate-*l*73.5%
distribute-rgt-out--73.5%
associate-*r*73.5%
metadata-eval73.5%
Simplified73.5%
Taylor expanded in x.re around 0 61.1%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
metadata-eval61.1%
distribute-rgt-out61.1%
+-commutative61.1%
distribute-rgt-in61.1%
*-commutative61.1%
metadata-eval61.1%
distribute-lft-neg-in61.1%
count-261.1%
distribute-rgt-neg-in61.1%
distribute-rgt-out61.1%
distribute-lft-out61.1%
distribute-rgt-neg-in61.1%
count-261.1%
distribute-lft-neg-in61.1%
metadata-eval61.1%
mul-1-neg61.1%
distribute-lft-neg-in61.1%
distribute-rgt-neg-in61.1%
unpow261.1%
distribute-rgt-neg-out61.1%
Simplified61.2%
if -2.8000000000000001e78 < x.im < -5.2e10 or -9.8000000000000005e-48 < x.im < 5e6Initial program 94.2%
*-commutative94.2%
distribute-lft-out94.2%
associate-*l*94.2%
*-commutative94.2%
distribute-rgt-out--99.9%
associate--l-99.9%
associate--l-99.9%
sub-neg99.9%
associate--l+99.9%
fma-udef99.9%
neg-mul-199.9%
count-299.9%
associate-*l*99.9%
distribute-rgt-out--99.9%
associate-*r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x.re around inf 92.6%
unpow292.6%
Simplified92.6%
if -5.2e10 < x.im < -9.8000000000000005e-48Initial program 99.8%
*-commutative99.8%
distribute-lft-out99.8%
associate-*l*99.5%
*-commutative99.5%
distribute-rgt-out--99.3%
associate--l-99.3%
associate--l-99.3%
sub-neg99.3%
associate--l+99.3%
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 74.7%
unpow274.7%
Simplified74.7%
Final simplification79.5%
(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 -2.8e+78)
t_0
(if (<= x.im -36000000000.0)
t_1
(if (<= x.im -2.2e-48)
(* -3.0 (* x.re (* x.im x.im)))
(if (<= x.im 2550000.0) 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 <= -2.8e+78) {
tmp = t_0;
} else if (x_46_im <= -36000000000.0) {
tmp = t_1;
} else if (x_46_im <= -2.2e-48) {
tmp = -3.0 * (x_46_re * (x_46_im * x_46_im));
} else if (x_46_im <= 2550000.0) {
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 <= (-2.8d+78)) then
tmp = t_0
else if (x_46im <= (-36000000000.0d0)) then
tmp = t_1
else if (x_46im <= (-2.2d-48)) then
tmp = (-3.0d0) * (x_46re * (x_46im * x_46im))
else if (x_46im <= 2550000.0d0) 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 <= -2.8e+78) {
tmp = t_0;
} else if (x_46_im <= -36000000000.0) {
tmp = t_1;
} else if (x_46_im <= -2.2e-48) {
tmp = -3.0 * (x_46_re * (x_46_im * x_46_im));
} else if (x_46_im <= 2550000.0) {
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 <= -2.8e+78: tmp = t_0 elif x_46_im <= -36000000000.0: tmp = t_1 elif x_46_im <= -2.2e-48: tmp = -3.0 * (x_46_re * (x_46_im * x_46_im)) elif x_46_im <= 2550000.0: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * -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 <= -2.8e+78) tmp = t_0; elseif (x_46_im <= -36000000000.0) tmp = t_1; elseif (x_46_im <= -2.2e-48) tmp = Float64(-3.0 * Float64(x_46_re * Float64(x_46_im * x_46_im))); elseif (x_46_im <= 2550000.0) 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 <= -2.8e+78) tmp = t_0; elseif (x_46_im <= -36000000000.0) tmp = t_1; elseif (x_46_im <= -2.2e-48) tmp = -3.0 * (x_46_re * (x_46_im * x_46_im)); elseif (x_46_im <= 2550000.0) 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$im * -3.0), $MachinePrecision] * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.8e+78], t$95$0, If[LessEqual[x$46$im, -36000000000.0], t$95$1, If[LessEqual[x$46$im, -2.2e-48], N[(-3.0 * N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2550000.0], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\
t_1 := x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{if}\;x.im \leq -2.8 \cdot 10^{+78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq -36000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -2.2 \cdot 10^{-48}:\\
\;\;\;\;-3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 2550000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -2.8000000000000001e78 or 2.55e6 < x.im Initial program 59.2%
*-commutative59.2%
distribute-lft-out59.2%
associate-*l*59.2%
*-commutative59.2%
distribute-rgt-out--66.4%
associate--l-66.4%
associate--l-66.4%
sub-neg66.4%
associate--l+66.4%
fma-udef73.5%
neg-mul-173.5%
count-273.5%
associate-*l*73.5%
distribute-rgt-out--73.5%
associate-*r*73.5%
metadata-eval73.5%
Simplified73.5%
fma-udef66.4%
Applied egg-rr66.4%
Taylor expanded in x.re around 0 61.1%
unpow261.1%
Simplified61.1%
add-sqr-sqrt33.9%
pow233.9%
associate-*r*33.9%
sqrt-prod33.8%
sqrt-prod18.9%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
unpow243.3%
swap-sqr33.8%
add-sqr-sqrt61.1%
associate-*l*79.3%
associate-*r*79.3%
*-commutative79.3%
associate-*l*79.3%
*-commutative79.3%
Applied egg-rr79.3%
if -2.8000000000000001e78 < x.im < -3.6e10 or -2.20000000000000013e-48 < x.im < 2.55e6Initial program 94.2%
*-commutative94.2%
distribute-lft-out94.2%
associate-*l*94.2%
*-commutative94.2%
distribute-rgt-out--99.9%
associate--l-99.9%
associate--l-99.9%
sub-neg99.9%
associate--l+99.9%
fma-udef99.9%
neg-mul-199.9%
count-299.9%
associate-*l*99.9%
distribute-rgt-out--99.9%
associate-*r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x.re around inf 92.6%
unpow292.6%
Simplified92.6%
if -3.6e10 < x.im < -2.20000000000000013e-48Initial program 99.8%
*-commutative99.8%
distribute-lft-out99.8%
associate-*l*99.5%
*-commutative99.5%
distribute-rgt-out--99.3%
associate--l-99.3%
associate--l-99.3%
sub-neg99.3%
associate--l+99.3%
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 74.7%
unpow274.7%
Simplified74.7%
Final simplification86.4%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -7.8e+153)
(* (* x.im -3.0) (* x.re x.im))
(if (<= x.im 1.05e+136)
(* x.re (+ (* x.im (* x.im -3.0)) (* x.re x.re)))
(* x.im (* x.im (* x.re -3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -7.8e+153) {
tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
} else if (x_46_im <= 1.05e+136) {
tmp = x_46_re * ((x_46_im * (x_46_im * -3.0)) + (x_46_re * x_46_re));
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-7.8d+153)) then
tmp = (x_46im * (-3.0d0)) * (x_46re * x_46im)
else if (x_46im <= 1.05d+136) then
tmp = x_46re * ((x_46im * (x_46im * (-3.0d0))) + (x_46re * x_46re))
else
tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -7.8e+153) {
tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
} else if (x_46_im <= 1.05e+136) {
tmp = x_46_re * ((x_46_im * (x_46_im * -3.0)) + (x_46_re * x_46_re));
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -7.8e+153: tmp = (x_46_im * -3.0) * (x_46_re * x_46_im) elif x_46_im <= 1.05e+136: tmp = x_46_re * ((x_46_im * (x_46_im * -3.0)) + (x_46_re * x_46_re)) else: tmp = x_46_im * (x_46_im * (x_46_re * -3.0)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -7.8e+153) tmp = Float64(Float64(x_46_im * -3.0) * Float64(x_46_re * x_46_im)); elseif (x_46_im <= 1.05e+136) tmp = Float64(x_46_re * Float64(Float64(x_46_im * Float64(x_46_im * -3.0)) + Float64(x_46_re * x_46_re))); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -7.8e+153) tmp = (x_46_im * -3.0) * (x_46_re * x_46_im); elseif (x_46_im <= 1.05e+136) tmp = x_46_re * ((x_46_im * (x_46_im * -3.0)) + (x_46_re * x_46_re)); else tmp = x_46_im * (x_46_im * (x_46_re * -3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -7.8e+153], N[(N[(x$46$im * -3.0), $MachinePrecision] * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.05e+136], N[(x$46$re * N[(N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -7.8 \cdot 10^{+153}:\\
\;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.im \cdot -3\right) + x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < -7.79999999999999966e153Initial program 50.0%
*-commutative50.0%
distribute-lft-out50.0%
associate-*l*50.0%
*-commutative50.0%
distribute-rgt-out--50.0%
associate--l-50.0%
associate--l-50.0%
sub-neg50.0%
associate--l+50.0%
fma-udef61.5%
neg-mul-161.5%
count-261.5%
associate-*l*61.5%
distribute-rgt-out--61.5%
associate-*r*61.5%
metadata-eval61.5%
Simplified61.5%
fma-udef50.0%
Applied egg-rr50.0%
Taylor expanded in x.re around 0 61.5%
unpow261.5%
Simplified61.5%
add-sqr-sqrt29.6%
pow229.6%
associate-*r*29.6%
sqrt-prod29.6%
sqrt-prod0.0%
add-sqr-sqrt45.5%
Applied egg-rr45.5%
unpow245.5%
swap-sqr29.6%
add-sqr-sqrt61.5%
associate-*l*85.7%
associate-*r*85.6%
*-commutative85.6%
associate-*l*85.7%
*-commutative85.7%
Applied egg-rr85.7%
if -7.79999999999999966e153 < x.im < 1.05e136Initial program 92.0%
*-commutative92.0%
distribute-lft-out92.0%
associate-*l*91.9%
*-commutative91.9%
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%
fma-udef99.8%
Applied egg-rr99.8%
if 1.05e136 < x.im Initial program 48.7%
*-commutative48.7%
distribute-lft-out48.7%
associate-*l*48.8%
*-commutative48.8%
distribute-rgt-out--48.8%
associate--l-48.8%
associate--l-48.8%
sub-neg48.8%
associate--l+48.8%
fma-udef58.8%
neg-mul-158.8%
count-258.8%
associate-*l*58.8%
distribute-rgt-out--58.8%
associate-*r*58.8%
metadata-eval58.8%
Simplified58.8%
fma-udef48.8%
Applied egg-rr48.8%
Taylor expanded in x.re around 0 58.8%
unpow258.8%
Simplified58.8%
add-sqr-sqrt30.8%
pow230.8%
associate-*r*30.8%
sqrt-prod30.8%
sqrt-prod43.2%
add-sqr-sqrt43.2%
Applied egg-rr43.2%
unpow243.2%
*-commutative43.2%
associate-*l*43.3%
associate-*l*43.3%
add-sqr-sqrt89.9%
associate-*r*89.9%
*-commutative89.9%
Applied egg-rr89.9%
Final simplification96.7%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -2.4e+115) (not (<= x.im 6.5e+135))) (* 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 <= -2.4e+115) || !(x_46_im <= 6.5e+135)) {
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 <= (-2.4d+115)) .or. (.not. (x_46im <= 6.5d+135))) 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 <= -2.4e+115) || !(x_46_im <= 6.5e+135)) {
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 <= -2.4e+115) or not (x_46_im <= 6.5e+135): 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 <= -2.4e+115) || !(x_46_im <= 6.5e+135)) 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 <= -2.4e+115) || ~((x_46_im <= 6.5e+135))) 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, -2.4e+115], N[Not[LessEqual[x$46$im, 6.5e+135]], $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 -2.4 \cdot 10^{+115} \lor \neg \left(x.im \leq 6.5 \cdot 10^{+135}\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 < -2.4e115 or 6.5000000000000003e135 < x.im Initial program 53.0%
*-commutative53.0%
*-commutative53.0%
*-commutative53.0%
distribute-lft-out53.0%
Simplified53.0%
Taylor expanded in x.re around 0 63.0%
associate-*r*63.0%
mul-1-neg63.0%
unpow263.0%
Simplified63.0%
associate-*r*88.3%
*-commutative88.3%
distribute-rgt-out--88.5%
*-commutative88.5%
add-sqr-sqrt45.6%
sqrt-unprod52.7%
sqr-neg52.7%
sqrt-unprod17.1%
add-sqr-sqrt38.7%
distribute-rgt-in38.7%
distribute-lft-out38.7%
Applied egg-rr38.7%
distribute-lft-out--61.5%
Simplified61.5%
Taylor expanded in x.im around 0 58.4%
count-258.4%
associate--r+58.4%
+-inverses58.4%
sub0-neg58.4%
unpow258.4%
distribute-lft-neg-in58.4%
distribute-rgt-neg-in58.4%
Simplified58.4%
if -2.4e115 < x.im < 6.5000000000000003e135Initial program 91.8%
*-commutative91.8%
distribute-lft-out91.8%
associate-*l*91.7%
*-commutative91.7%
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 78.6%
unpow278.6%
Simplified78.6%
Final simplification73.1%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -2.3e+115) (not (<= x.im 4e+135))) (* 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 <= -2.3e+115) || !(x_46_im <= 4e+135)) {
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 <= (-2.3d+115)) .or. (.not. (x_46im <= 4d+135))) 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 <= -2.3e+115) || !(x_46_im <= 4e+135)) {
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 <= -2.3e+115) or not (x_46_im <= 4e+135): 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 <= -2.3e+115) || !(x_46_im <= 4e+135)) 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 <= -2.3e+115) || ~((x_46_im <= 4e+135))) 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, -2.3e+115], N[Not[LessEqual[x$46$im, 4e+135]], $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 -2.3 \cdot 10^{+115} \lor \neg \left(x.im \leq 4 \cdot 10^{+135}\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 < -2.30000000000000004e115 or 3.99999999999999985e135 < x.im Initial program 53.0%
*-commutative53.0%
*-commutative53.0%
*-commutative53.0%
distribute-lft-out53.0%
Simplified53.0%
Taylor expanded in x.re around 0 63.0%
associate-*r*63.0%
mul-1-neg63.0%
unpow263.0%
Simplified63.0%
associate-*r*88.3%
*-commutative88.3%
distribute-rgt-out--88.5%
*-commutative88.5%
add-sqr-sqrt45.6%
sqrt-unprod52.7%
sqr-neg52.7%
sqrt-unprod17.1%
add-sqr-sqrt38.7%
distribute-rgt-in38.7%
distribute-lft-out38.7%
Applied egg-rr38.7%
distribute-lft-out--61.5%
Simplified61.5%
Taylor expanded in x.im around 0 58.4%
count-258.4%
associate--r+58.4%
+-inverses58.4%
sub0-neg58.4%
unpow258.4%
distribute-lft-neg-in58.4%
associate-*r*61.5%
*-commutative61.5%
distribute-rgt-neg-in61.5%
*-commutative61.5%
Simplified61.5%
if -2.30000000000000004e115 < x.im < 3.99999999999999985e135Initial program 91.8%
*-commutative91.8%
distribute-lft-out91.8%
associate-*l*91.7%
*-commutative91.7%
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 78.6%
unpow278.6%
Simplified78.6%
Final simplification74.0%
(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 81.2%
*-commutative81.2%
distribute-lft-out81.2%
associate-*l*81.1%
*-commutative81.1%
distribute-rgt-out--87.0%
associate--l-87.0%
associate--l-87.0%
sub-neg87.0%
associate--l+87.0%
fma-udef89.7%
neg-mul-189.7%
count-289.7%
associate-*l*89.7%
distribute-rgt-out--89.7%
associate-*r*89.8%
metadata-eval89.8%
Simplified89.8%
Taylor expanded in x.re around inf 60.5%
unpow260.5%
Simplified60.5%
Final simplification60.5%
(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 2023171
(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)))