
(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 9 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 (or (<= x.re -6.8e+225) (not (<= x.re 1.3e+205)))
(+ (* x.re (* x.re x.re)) (* 0.0 x.im))
(fma
(- x.re x.im)
(* x.re (+ x.re x.im))
(* x.im (* x.re (- (- x.im) x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -6.8e+225) || !(x_46_re <= 1.3e+205)) {
tmp = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im);
} else {
tmp = fma((x_46_re - x_46_im), (x_46_re * (x_46_re + x_46_im)), (x_46_im * (x_46_re * (-x_46_im - x_46_im))));
}
return tmp;
}
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -6.8e+225) || !(x_46_re <= 1.3e+205)) tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_re)) + Float64(0.0 * x_46_im)); else tmp = fma(Float64(x_46_re - x_46_im), Float64(x_46_re * Float64(x_46_re + x_46_im)), Float64(x_46_im * Float64(x_46_re * Float64(Float64(-x_46_im) - x_46_im)))); end return tmp end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -6.8e+225], N[Not[LessEqual[x$46$re, 1.3e+205]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(0.0 * x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(x$46$re * N[((-x$46$im) - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -6.8 \cdot 10^{+225} \lor \neg \left(x.re \leq 1.3 \cdot 10^{+205}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right) + 0 \cdot x.im\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x.re - x.im, x.re \cdot \left(x.re + x.im\right), x.im \cdot \left(x.re \cdot \left(\left(-x.im\right) - x.im\right)\right)\right)\\
\end{array}
\end{array}
if x.re < -6.80000000000000037e225 or 1.2999999999999999e205 < x.re Initial program 65.0%
Taylor expanded in x.re around inf 65.0%
unpow265.0%
Simplified65.0%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses100.0%
Simplified100.0%
if -6.80000000000000037e225 < x.re < 1.2999999999999999e205Initial program 86.1%
sqr-neg86.1%
difference-of-squares89.8%
sub-neg89.8%
associate-*l*98.4%
sub-neg98.4%
remove-double-neg98.4%
+-commutative98.4%
*-commutative98.4%
*-commutative98.4%
distribute-rgt-out98.4%
Simplified98.4%
cancel-sign-sub-inv98.4%
fma-def98.4%
*-commutative98.4%
Applied egg-rr98.4%
Final simplification98.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (* x.re (* x.re x.re)) (* 0.0 x.im)))
(t_1
(-
(* (- x.re x.im) (* x.re (+ x.re x.im)))
(* (* x.re (* x.im x.im)) 2.0))))
(if (<= x.re -2.45e+224)
t_0
(if (<= x.re -2.4e-94)
t_1
(if (<= x.re 3.5e-160)
(* x.im (* -3.0 (* x.re x.im)))
(if (<= x.re 1.3e+205) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im);
double t_1 = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - ((x_46_re * (x_46_im * x_46_im)) * 2.0);
double tmp;
if (x_46_re <= -2.45e+224) {
tmp = t_0;
} else if (x_46_re <= -2.4e-94) {
tmp = t_1;
} else if (x_46_re <= 3.5e-160) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else if (x_46_re <= 1.3e+205) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46re * (x_46re * x_46re)) + (0.0d0 * x_46im)
t_1 = ((x_46re - x_46im) * (x_46re * (x_46re + x_46im))) - ((x_46re * (x_46im * x_46im)) * 2.0d0)
if (x_46re <= (-2.45d+224)) then
tmp = t_0
else if (x_46re <= (-2.4d-94)) then
tmp = t_1
else if (x_46re <= 3.5d-160) then
tmp = x_46im * ((-3.0d0) * (x_46re * x_46im))
else if (x_46re <= 1.3d+205) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im);
double t_1 = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - ((x_46_re * (x_46_im * x_46_im)) * 2.0);
double tmp;
if (x_46_re <= -2.45e+224) {
tmp = t_0;
} else if (x_46_re <= -2.4e-94) {
tmp = t_1;
} else if (x_46_re <= 3.5e-160) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else if (x_46_re <= 1.3e+205) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im) t_1 = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - ((x_46_re * (x_46_im * x_46_im)) * 2.0) tmp = 0 if x_46_re <= -2.45e+224: tmp = t_0 elif x_46_re <= -2.4e-94: tmp = t_1 elif x_46_re <= 3.5e-160: tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) elif x_46_re <= 1.3e+205: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_re * Float64(x_46_re * x_46_re)) + Float64(0.0 * x_46_im)) t_1 = Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re * Float64(x_46_re + x_46_im))) - Float64(Float64(x_46_re * Float64(x_46_im * x_46_im)) * 2.0)) tmp = 0.0 if (x_46_re <= -2.45e+224) tmp = t_0; elseif (x_46_re <= -2.4e-94) tmp = t_1; elseif (x_46_re <= 3.5e-160) tmp = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))); elseif (x_46_re <= 1.3e+205) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im); t_1 = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - ((x_46_re * (x_46_im * x_46_im)) * 2.0); tmp = 0.0; if (x_46_re <= -2.45e+224) tmp = t_0; elseif (x_46_re <= -2.4e-94) tmp = t_1; elseif (x_46_re <= 3.5e-160) tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); elseif (x_46_re <= 1.3e+205) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(0.0 * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2.45e+224], t$95$0, If[LessEqual[x$46$re, -2.4e-94], t$95$1, If[LessEqual[x$46$re, 3.5e-160], N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.3e+205], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot x.re\right) + 0 \cdot x.im\\
t_1 := \left(x.re - x.im\right) \cdot \left(x.re \cdot \left(x.re + x.im\right)\right) - \left(x.re \cdot \left(x.im \cdot x.im\right)\right) \cdot 2\\
\mathbf{if}\;x.re \leq -2.45 \cdot 10^{+224}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -2.4 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq 3.5 \cdot 10^{-160}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 1.3 \cdot 10^{+205}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.re < -2.44999999999999992e224 or 1.2999999999999999e205 < x.re Initial program 65.0%
Taylor expanded in x.re around inf 65.0%
unpow265.0%
Simplified65.0%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses100.0%
Simplified100.0%
if -2.44999999999999992e224 < x.re < -2.4e-94 or 3.5000000000000003e-160 < x.re < 1.2999999999999999e205Initial program 90.7%
sqr-neg90.7%
difference-of-squares96.8%
sub-neg96.8%
associate-*l*97.5%
sub-neg97.5%
remove-double-neg97.5%
+-commutative97.5%
*-commutative97.5%
*-commutative97.5%
distribute-rgt-out97.5%
Simplified97.5%
Taylor expanded in x.im around 0 96.8%
unpow296.8%
Simplified96.8%
if -2.4e-94 < x.re < 3.5000000000000003e-160Initial program 78.9%
sqr-neg78.9%
difference-of-squares78.9%
sub-neg78.9%
associate-*l*99.7%
sub-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
*-commutative99.7%
*-commutative99.7%
distribute-rgt-out99.7%
Simplified99.7%
cancel-sign-sub-inv99.7%
fma-def99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around 0 78.8%
distribute-rgt-out78.8%
unpow278.8%
metadata-eval78.8%
associate-*l*78.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
Simplified99.7%
Final simplification98.3%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* x.re x.re)))
(t_1 (+ t_0 (* 0.0 x.im)))
(t_2 (- t_0 (* x.im (+ (* x.re x.im) (* x.re x.im))))))
(if (<= x.re -2.1e+118)
t_1
(if (<= x.re -1.4e-44)
t_2
(if (<= x.re 3.5e-72)
(- (* x.im (* x.re (- (- x.im) x.im))) (* x.im (* x.re x.im)))
(if (<= x.re 1.2e+102) t_2 t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_re * x_46_re);
double t_1 = t_0 + (0.0 * x_46_im);
double t_2 = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (x_46_re <= -2.1e+118) {
tmp = t_1;
} else if (x_46_re <= -1.4e-44) {
tmp = t_2;
} else if (x_46_re <= 3.5e-72) {
tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (x_46_re * x_46_im));
} else if (x_46_re <= 1.2e+102) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x_46re * (x_46re * x_46re)
t_1 = t_0 + (0.0d0 * x_46im)
t_2 = t_0 - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))
if (x_46re <= (-2.1d+118)) then
tmp = t_1
else if (x_46re <= (-1.4d-44)) then
tmp = t_2
else if (x_46re <= 3.5d-72) then
tmp = (x_46im * (x_46re * (-x_46im - x_46im))) - (x_46im * (x_46re * x_46im))
else if (x_46re <= 1.2d+102) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_re * x_46_re);
double t_1 = t_0 + (0.0 * x_46_im);
double t_2 = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (x_46_re <= -2.1e+118) {
tmp = t_1;
} else if (x_46_re <= -1.4e-44) {
tmp = t_2;
} else if (x_46_re <= 3.5e-72) {
tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (x_46_re * x_46_im));
} else if (x_46_re <= 1.2e+102) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * (x_46_re * x_46_re) t_1 = t_0 + (0.0 * x_46_im) t_2 = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) tmp = 0 if x_46_re <= -2.1e+118: tmp = t_1 elif x_46_re <= -1.4e-44: tmp = t_2 elif x_46_re <= 3.5e-72: tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (x_46_re * x_46_im)) elif x_46_re <= 1.2e+102: tmp = t_2 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(x_46_re * x_46_re)) t_1 = Float64(t_0 + Float64(0.0 * x_46_im)) t_2 = Float64(t_0 - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) tmp = 0.0 if (x_46_re <= -2.1e+118) tmp = t_1; elseif (x_46_re <= -1.4e-44) tmp = t_2; elseif (x_46_re <= 3.5e-72) tmp = Float64(Float64(x_46_im * Float64(x_46_re * Float64(Float64(-x_46_im) - x_46_im))) - Float64(x_46_im * Float64(x_46_re * x_46_im))); elseif (x_46_re <= 1.2e+102) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_re * (x_46_re * x_46_re); t_1 = t_0 + (0.0 * x_46_im); t_2 = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); tmp = 0.0; if (x_46_re <= -2.1e+118) tmp = t_1; elseif (x_46_re <= -1.4e-44) tmp = t_2; elseif (x_46_re <= 3.5e-72) tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (x_46_re * x_46_im)); elseif (x_46_re <= 1.2e+102) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(0.0 * x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2.1e+118], t$95$1, If[LessEqual[x$46$re, -1.4e-44], t$95$2, If[LessEqual[x$46$re, 3.5e-72], N[(N[(x$46$im * N[(x$46$re * N[((-x$46$im) - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.2e+102], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot x.re\right)\\
t_1 := t_0 + 0 \cdot x.im\\
t_2 := t_0 - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;x.re \leq -2.1 \cdot 10^{+118}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq -1.4 \cdot 10^{-44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.re \leq 3.5 \cdot 10^{-72}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(\left(-x.im\right) - x.im\right)\right) - x.im \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.re \leq 1.2 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.re < -2.1e118 or 1.19999999999999997e102 < x.re Initial program 65.8%
Taylor expanded in x.re around inf 60.3%
unpow260.3%
Simplified60.3%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses83.6%
Simplified83.6%
if -2.1e118 < x.re < -1.4e-44 or 3.5e-72 < x.re < 1.19999999999999997e102Initial program 99.8%
Taylor expanded in x.re around inf 92.4%
unpow292.4%
Simplified92.4%
if -1.4e-44 < x.re < 3.5e-72Initial program 83.9%
sqr-neg83.9%
difference-of-squares83.9%
sub-neg83.9%
associate-*l*99.7%
sub-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
*-commutative99.7%
*-commutative99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in x.re around 0 79.6%
mul-1-neg79.6%
distribute-rgt-neg-in79.6%
unpow279.6%
mul-1-neg79.6%
associate-*l*95.4%
mul-1-neg95.4%
Simplified95.4%
Final simplification91.3%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.re -3.7e+224) (not (<= x.re 1.4e+205)))
(+ (* x.re (* x.re x.re)) (* 0.0 x.im))
(-
(* (- x.re x.im) (* x.re (+ x.re x.im)))
(* x.im (* x.re (+ x.im x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -3.7e+224) || !(x_46_re <= 1.4e+205)) {
tmp = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im);
} else {
tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46re <= (-3.7d+224)) .or. (.not. (x_46re <= 1.4d+205))) then
tmp = (x_46re * (x_46re * x_46re)) + (0.0d0 * x_46im)
else
tmp = ((x_46re - x_46im) * (x_46re * (x_46re + x_46im))) - (x_46im * (x_46re * (x_46im + x_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -3.7e+224) || !(x_46_re <= 1.4e+205)) {
tmp = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im);
} else {
tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -3.7e+224) or not (x_46_re <= 1.4e+205): tmp = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im) else: tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -3.7e+224) || !(x_46_re <= 1.4e+205)) tmp = Float64(Float64(x_46_re * Float64(x_46_re * x_46_re)) + Float64(0.0 * x_46_im)); else tmp = Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re * Float64(x_46_re + x_46_im))) - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -3.7e+224) || ~((x_46_re <= 1.4e+205))) tmp = (x_46_re * (x_46_re * x_46_re)) + (0.0 * x_46_im); else tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -3.7e+224], N[Not[LessEqual[x$46$re, 1.4e+205]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(0.0 * x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -3.7 \cdot 10^{+224} \lor \neg \left(x.re \leq 1.4 \cdot 10^{+205}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right) + 0 \cdot x.im\\
\mathbf{else}:\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.re \cdot \left(x.re + x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -3.70000000000000003e224 or 1.39999999999999996e205 < x.re Initial program 65.0%
Taylor expanded in x.re around inf 65.0%
unpow265.0%
Simplified65.0%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses100.0%
Simplified100.0%
if -3.70000000000000003e224 < x.re < 1.39999999999999996e205Initial program 86.1%
sqr-neg86.1%
difference-of-squares89.8%
sub-neg89.8%
associate-*l*98.4%
sub-neg98.4%
remove-double-neg98.4%
+-commutative98.4%
*-commutative98.4%
*-commutative98.4%
distribute-rgt-out98.4%
Simplified98.4%
Final simplification98.6%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (* x.re (* x.re x.re)) (* 0.0 x.im))))
(if (<= x.im 1.36e-24)
t_0
(if (<= x.im 480000000.0)
(* (* x.re (* x.im x.im)) -3.0)
(if (<= x.im 2.45e+68) 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)) + (0.0 * x_46_im);
double tmp;
if (x_46_im <= 1.36e-24) {
tmp = t_0;
} else if (x_46_im <= 480000000.0) {
tmp = (x_46_re * (x_46_im * x_46_im)) * -3.0;
} else if (x_46_im <= 2.45e+68) {
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)) + (0.0d0 * x_46im)
if (x_46im <= 1.36d-24) then
tmp = t_0
else if (x_46im <= 480000000.0d0) then
tmp = (x_46re * (x_46im * x_46im)) * (-3.0d0)
else if (x_46im <= 2.45d+68) 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)) + (0.0 * x_46_im);
double tmp;
if (x_46_im <= 1.36e-24) {
tmp = t_0;
} else if (x_46_im <= 480000000.0) {
tmp = (x_46_re * (x_46_im * x_46_im)) * -3.0;
} else if (x_46_im <= 2.45e+68) {
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)) + (0.0 * x_46_im) tmp = 0 if x_46_im <= 1.36e-24: tmp = t_0 elif x_46_im <= 480000000.0: tmp = (x_46_re * (x_46_im * x_46_im)) * -3.0 elif x_46_im <= 2.45e+68: 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(Float64(x_46_re * Float64(x_46_re * x_46_re)) + Float64(0.0 * x_46_im)) tmp = 0.0 if (x_46_im <= 1.36e-24) tmp = t_0; elseif (x_46_im <= 480000000.0) tmp = Float64(Float64(x_46_re * Float64(x_46_im * x_46_im)) * -3.0); elseif (x_46_im <= 2.45e+68) 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)) + (0.0 * x_46_im); tmp = 0.0; if (x_46_im <= 1.36e-24) tmp = t_0; elseif (x_46_im <= 480000000.0) tmp = (x_46_re * (x_46_im * x_46_im)) * -3.0; elseif (x_46_im <= 2.45e+68) 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[(N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(0.0 * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, 1.36e-24], t$95$0, If[LessEqual[x$46$im, 480000000.0], N[(N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision], If[LessEqual[x$46$im, 2.45e+68], 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) + 0 \cdot x.im\\
\mathbf{if}\;x.im \leq 1.36 \cdot 10^{-24}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 480000000:\\
\;\;\;\;\left(x.re \cdot \left(x.im \cdot x.im\right)\right) \cdot -3\\
\mathbf{elif}\;x.im \leq 2.45 \cdot 10^{+68}:\\
\;\;\;\;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 < 1.36000000000000001e-24 or 4.8e8 < x.im < 2.44999999999999989e68Initial program 85.7%
Taylor expanded in x.re around inf 73.5%
unpow273.5%
Simplified73.5%
flip-+0.0%
*-commutative0.0%
*-commutative0.0%
div-sub0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
pow20.0%
*-commutative0.0%
*-commutative0.0%
Applied egg-rr0.0%
+-inverses67.7%
Simplified67.7%
if 1.36000000000000001e-24 < x.im < 4.8e8Initial program 99.6%
sqr-neg99.6%
difference-of-squares99.6%
sub-neg99.6%
associate-*l*99.6%
sub-neg99.6%
remove-double-neg99.6%
+-commutative99.6%
*-commutative99.6%
*-commutative99.6%
distribute-rgt-out99.6%
Simplified99.6%
cancel-sign-sub-inv99.6%
fma-def99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 78.2%
distribute-rgt-out78.2%
unpow278.2%
metadata-eval78.2%
associate-*l*78.5%
associate-*l*78.5%
*-commutative78.5%
associate-*r*78.2%
Simplified78.2%
Taylor expanded in x.im around 0 78.3%
*-commutative78.3%
*-commutative78.3%
unpow278.3%
Simplified78.3%
if 2.44999999999999989e68 < x.im Initial program 63.2%
sqr-neg63.2%
difference-of-squares70.3%
sub-neg70.3%
associate-*l*90.2%
sub-neg90.2%
remove-double-neg90.2%
+-commutative90.2%
*-commutative90.2%
*-commutative90.2%
distribute-rgt-out90.2%
Simplified90.2%
cancel-sign-sub-inv90.2%
fma-def90.4%
*-commutative90.4%
Applied egg-rr90.4%
Taylor expanded in x.re around 0 70.1%
distribute-rgt-out70.1%
unpow270.1%
metadata-eval70.1%
associate-*l*70.1%
associate-*l*90.3%
*-commutative90.3%
associate-*r*90.3%
Simplified90.3%
Final simplification72.0%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -1.2e+201) (not (<= x.re 1.7e+205))) (* x.im (* x.re x.im)) (* x.im (* -3.0 (* x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -1.2e+201) || !(x_46_re <= 1.7e+205)) {
tmp = x_46_im * (x_46_re * x_46_im);
} 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) :: tmp
if ((x_46re <= (-1.2d+201)) .or. (.not. (x_46re <= 1.7d+205))) then
tmp = x_46im * (x_46re * x_46im)
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 tmp;
if ((x_46_re <= -1.2e+201) || !(x_46_re <= 1.7e+205)) {
tmp = x_46_im * (x_46_re * x_46_im);
} else {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -1.2e+201) or not (x_46_re <= 1.7e+205): tmp = x_46_im * (x_46_re * x_46_im) 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 <= -1.2e+201) || !(x_46_re <= 1.7e+205)) tmp = Float64(x_46_im * Float64(x_46_re * x_46_im)); 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) tmp = 0.0; if ((x_46_re <= -1.2e+201) || ~((x_46_re <= 1.7e+205))) tmp = x_46_im * (x_46_re * x_46_im); 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_] := If[Or[LessEqual[x$46$re, -1.2e+201], N[Not[LessEqual[x$46$re, 1.7e+205]], $MachinePrecision]], N[(x$46$im * N[(x$46$re * x$46$im), $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 -1.2 \cdot 10^{+201} \lor \neg \left(x.re \leq 1.7 \cdot 10^{+205}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -1.19999999999999996e201 or 1.7e205 < x.re Initial program 66.7%
sqr-neg66.7%
difference-of-squares66.7%
sub-neg66.7%
associate-*l*66.7%
sub-neg66.7%
remove-double-neg66.7%
+-commutative66.7%
*-commutative66.7%
*-commutative66.7%
distribute-rgt-out66.7%
Simplified66.7%
Taylor expanded in x.re around 0 0.5%
mul-1-neg0.5%
distribute-rgt-neg-in0.5%
unpow20.5%
mul-1-neg0.5%
associate-*l*0.5%
mul-1-neg0.5%
Simplified0.5%
distribute-lft-out--0.5%
add-sqr-sqrt0.2%
sqrt-unprod35.7%
sqr-neg35.7%
sqrt-unprod0.3%
add-sqr-sqrt0.5%
*-commutative0.5%
Applied egg-rr0.5%
distribute-lft-out--0.5%
associate--r+0.5%
unsub-neg0.5%
mul-1-neg0.5%
distribute-rgt1-in0.5%
metadata-eval0.5%
mul0-lft0.5%
neg-sub00.5%
distribute-rgt-neg-in0.5%
*-commutative0.5%
distribute-rgt-neg-in0.5%
Simplified0.5%
expm1-log1p-u0.5%
expm1-udef0.6%
add-sqr-sqrt0.3%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod17.5%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr17.8%
expm1-def18.0%
expm1-log1p36.1%
Simplified36.1%
if -1.19999999999999996e201 < x.re < 1.7e205Initial program 85.9%
sqr-neg85.9%
difference-of-squares89.7%
sub-neg89.7%
associate-*l*98.4%
sub-neg98.4%
remove-double-neg98.4%
+-commutative98.4%
*-commutative98.4%
*-commutative98.4%
distribute-rgt-out98.4%
Simplified98.4%
cancel-sign-sub-inv98.4%
fma-def98.4%
*-commutative98.4%
Applied egg-rr98.4%
Taylor expanded in x.re around 0 63.4%
distribute-rgt-out63.4%
unpow263.4%
metadata-eval63.4%
associate-*l*63.4%
associate-*l*72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Final simplification66.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -1.35e+209) (not (<= x.re 2.4e+205))) (* (* 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 <= -1.35e+209) || !(x_46_re <= 2.4e+205)) {
tmp = (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;
}
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_46re <= (-1.35d+209)) .or. (.not. (x_46re <= 2.4d+205))) then
tmp = (x_46re * x_46im) * (x_46im * 3.0d0)
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 tmp;
if ((x_46_re <= -1.35e+209) || !(x_46_re <= 2.4e+205)) {
tmp = (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;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -1.35e+209) or not (x_46_re <= 2.4e+205): tmp = (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 <= -1.35e+209) || !(x_46_re <= 2.4e+205)) tmp = Float64(Float64(x_46_re * 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
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -1.35e+209) || ~((x_46_re <= 2.4e+205))) tmp = (x_46_re * x_46_im) * (x_46_im * 3.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_] := If[Or[LessEqual[x$46$re, -1.35e+209], N[Not[LessEqual[x$46$re, 2.4e+205]], $MachinePrecision]], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$im * 3.0), $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 -1.35 \cdot 10^{+209} \lor \neg \left(x.re \leq 2.4 \cdot 10^{+205}\right):\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.im \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -1.35e209 or 2.39999999999999986e205 < x.re Initial program 66.7%
sqr-neg66.7%
difference-of-squares66.7%
sub-neg66.7%
associate-*l*66.7%
sub-neg66.7%
remove-double-neg66.7%
+-commutative66.7%
*-commutative66.7%
*-commutative66.7%
distribute-rgt-out66.7%
Simplified66.7%
Taylor expanded in x.re around 0 0.5%
mul-1-neg0.5%
unpow20.5%
Simplified0.5%
cancel-sign-sub-inv0.5%
add-sqr-sqrt0.4%
sqrt-unprod7.6%
sqr-neg7.6%
sqrt-unprod0.4%
add-sqr-sqrt0.5%
*-commutative0.5%
add-sqr-sqrt0.2%
sqrt-unprod18.7%
sqr-neg18.7%
sqrt-prod18.5%
add-sqr-sqrt36.1%
associate-*r*36.1%
*-commutative36.1%
Applied egg-rr36.1%
+-commutative36.1%
associate-*l*36.0%
unpow236.0%
distribute-lft-out36.0%
*-commutative36.0%
count-236.0%
associate-*r*36.0%
unpow236.0%
distribute-lft1-in36.0%
metadata-eval36.0%
*-commutative36.0%
unpow236.0%
Simplified36.0%
Taylor expanded in x.re around 0 36.0%
associate-*r*36.0%
*-commutative36.0%
unpow236.0%
associate-*r*36.0%
*-commutative36.0%
associate-*r*36.1%
Simplified36.1%
if -1.35e209 < x.re < 2.39999999999999986e205Initial program 85.9%
sqr-neg85.9%
difference-of-squares89.7%
sub-neg89.7%
associate-*l*98.4%
sub-neg98.4%
remove-double-neg98.4%
+-commutative98.4%
*-commutative98.4%
*-commutative98.4%
distribute-rgt-out98.4%
Simplified98.4%
cancel-sign-sub-inv98.4%
fma-def98.4%
*-commutative98.4%
Applied egg-rr98.4%
Taylor expanded in x.re around 0 63.4%
distribute-rgt-out63.4%
unpow263.4%
metadata-eval63.4%
associate-*l*63.4%
associate-*l*72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Final simplification66.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -4.25e+204) (not (<= x.re 7.2e+205))) (* x.im (* x.re x.im)) (* x.im (* x.re (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -4.25e+204) || !(x_46_re <= 7.2e+205)) {
tmp = x_46_im * (x_46_re * x_46_im);
} else {
tmp = x_46_im * (x_46_re * -x_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46re <= (-4.25d+204)) .or. (.not. (x_46re <= 7.2d+205))) then
tmp = x_46im * (x_46re * x_46im)
else
tmp = x_46im * (x_46re * -x_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -4.25e+204) || !(x_46_re <= 7.2e+205)) {
tmp = x_46_im * (x_46_re * x_46_im);
} else {
tmp = x_46_im * (x_46_re * -x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -4.25e+204) or not (x_46_re <= 7.2e+205): tmp = x_46_im * (x_46_re * x_46_im) else: tmp = x_46_im * (x_46_re * -x_46_im) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -4.25e+204) || !(x_46_re <= 7.2e+205)) tmp = Float64(x_46_im * Float64(x_46_re * x_46_im)); else tmp = Float64(x_46_im * Float64(x_46_re * Float64(-x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -4.25e+204) || ~((x_46_re <= 7.2e+205))) tmp = x_46_im * (x_46_re * x_46_im); else tmp = x_46_im * (x_46_re * -x_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -4.25e+204], N[Not[LessEqual[x$46$re, 7.2e+205]], $MachinePrecision]], N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -4.25 \cdot 10^{+204} \lor \neg \left(x.re \leq 7.2 \cdot 10^{+205}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -4.25e204 or 7.20000000000000003e205 < x.re Initial program 66.7%
sqr-neg66.7%
difference-of-squares66.7%
sub-neg66.7%
associate-*l*66.7%
sub-neg66.7%
remove-double-neg66.7%
+-commutative66.7%
*-commutative66.7%
*-commutative66.7%
distribute-rgt-out66.7%
Simplified66.7%
Taylor expanded in x.re around 0 0.5%
mul-1-neg0.5%
distribute-rgt-neg-in0.5%
unpow20.5%
mul-1-neg0.5%
associate-*l*0.5%
mul-1-neg0.5%
Simplified0.5%
distribute-lft-out--0.5%
add-sqr-sqrt0.2%
sqrt-unprod35.7%
sqr-neg35.7%
sqrt-unprod0.3%
add-sqr-sqrt0.5%
*-commutative0.5%
Applied egg-rr0.5%
distribute-lft-out--0.5%
associate--r+0.5%
unsub-neg0.5%
mul-1-neg0.5%
distribute-rgt1-in0.5%
metadata-eval0.5%
mul0-lft0.5%
neg-sub00.5%
distribute-rgt-neg-in0.5%
*-commutative0.5%
distribute-rgt-neg-in0.5%
Simplified0.5%
expm1-log1p-u0.5%
expm1-udef0.6%
add-sqr-sqrt0.3%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod17.5%
add-sqr-sqrt17.8%
*-commutative17.8%
Applied egg-rr17.8%
expm1-def18.0%
expm1-log1p36.1%
Simplified36.1%
if -4.25e204 < x.re < 7.20000000000000003e205Initial program 85.9%
sqr-neg85.9%
difference-of-squares89.7%
sub-neg89.7%
associate-*l*98.4%
sub-neg98.4%
remove-double-neg98.4%
+-commutative98.4%
*-commutative98.4%
*-commutative98.4%
distribute-rgt-out98.4%
Simplified98.4%
Taylor expanded in x.re around 0 63.5%
mul-1-neg63.5%
distribute-rgt-neg-in63.5%
unpow263.5%
mul-1-neg63.5%
associate-*l*72.2%
mul-1-neg72.2%
Simplified72.2%
distribute-lft-out--72.2%
add-sqr-sqrt32.0%
sqrt-unprod50.2%
sqr-neg50.2%
sqrt-unprod23.0%
add-sqr-sqrt38.1%
*-commutative38.1%
Applied egg-rr38.1%
distribute-lft-out--44.6%
associate--r+44.6%
unsub-neg44.6%
mul-1-neg44.6%
distribute-rgt1-in44.6%
metadata-eval44.6%
mul0-lft44.6%
neg-sub044.6%
distribute-rgt-neg-in44.6%
*-commutative44.6%
distribute-rgt-neg-in44.6%
Simplified44.6%
Final simplification43.2%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.re x.im)))
double code(double x_46_re, double x_46_im) {
return 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_46im * (x_46re * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * x_46_im);
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_re * x_46_im)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_re * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_re * x_46_im); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.re \cdot x.im\right)
\end{array}
Initial program 82.8%
sqr-neg82.8%
difference-of-squares85.9%
sub-neg85.9%
associate-*l*93.2%
sub-neg93.2%
remove-double-neg93.2%
+-commutative93.2%
*-commutative93.2%
*-commutative93.2%
distribute-rgt-out93.2%
Simplified93.2%
Taylor expanded in x.re around 0 53.1%
mul-1-neg53.1%
distribute-rgt-neg-in53.1%
unpow253.1%
mul-1-neg53.1%
associate-*l*60.4%
mul-1-neg60.4%
Simplified60.4%
distribute-lft-out--60.4%
add-sqr-sqrt26.8%
sqrt-unprod47.8%
sqr-neg47.8%
sqrt-unprod19.3%
add-sqr-sqrt31.9%
*-commutative31.9%
Applied egg-rr31.9%
distribute-lft-out--37.4%
associate--r+37.4%
unsub-neg37.4%
mul-1-neg37.4%
distribute-rgt1-in37.4%
metadata-eval37.4%
mul0-lft37.4%
neg-sub037.4%
distribute-rgt-neg-in37.4%
*-commutative37.4%
distribute-rgt-neg-in37.4%
Simplified37.4%
expm1-log1p-u25.8%
expm1-udef24.5%
add-sqr-sqrt14.3%
sqrt-unprod33.1%
sqr-neg33.1%
sqrt-unprod14.3%
add-sqr-sqrt20.6%
*-commutative20.6%
Applied egg-rr20.6%
expm1-def20.5%
expm1-log1p23.7%
Simplified23.7%
Final simplification23.7%
(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 2023293
(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)))