
(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+234)
(* x.re (* x.re x.re))
(if (or (<= x.re -1.72e-107) (not (<= x.re 6.5e-54)))
(* x.re (fma x.re x.re (* x.im (* x.im -3.0))))
(* x.im (* x.im (* x.re -3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -5e+234) {
tmp = x_46_re * (x_46_re * x_46_re);
} else if ((x_46_re <= -1.72e-107) || !(x_46_re <= 6.5e-54)) {
tmp = x_46_re * fma(x_46_re, x_46_re, (x_46_im * (x_46_im * -3.0)));
} 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_re <= -5e+234) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); elseif ((x_46_re <= -1.72e-107) || !(x_46_re <= 6.5e-54)) 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(x_46_im * Float64(x_46_re * -3.0))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -5e+234], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, -1.72e-107], N[Not[LessEqual[x$46$re, 6.5e-54]], $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[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{+234}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{elif}\;x.re \leq -1.72 \cdot 10^{-107} \lor \neg \left(x.re \leq 6.5 \cdot 10^{-54}\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(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.re < -5.0000000000000003e234Initial program 35.3%
*-commutative35.3%
distribute-lft-out35.3%
associate-*l*35.3%
*-commutative35.3%
distribute-rgt-out--47.1%
associate--l-47.1%
associate--l-47.1%
sub-neg47.1%
associate--l+47.1%
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%
Taylor expanded in x.re around inf 88.2%
unpow288.2%
Simplified88.2%
if -5.0000000000000003e234 < x.re < -1.72e-107 or 6.49999999999999991e-54 < x.re Initial program 88.9%
*-commutative88.9%
distribute-lft-out88.9%
associate-*l*88.9%
*-commutative88.9%
distribute-rgt-out--92.2%
associate--l-92.2%
associate--l-92.2%
sub-neg92.2%
associate--l+92.2%
fma-udef95.4%
neg-mul-195.4%
count-295.4%
associate-*l*95.4%
distribute-rgt-out--95.4%
associate-*r*95.4%
metadata-eval95.4%
Simplified95.4%
if -1.72e-107 < x.re < 6.49999999999999991e-54Initial program 87.7%
*-commutative87.7%
distribute-lft-out87.7%
associate-*l*87.7%
*-commutative87.7%
distribute-rgt-out--87.7%
associate--l-87.7%
associate--l-87.7%
sub-neg87.7%
associate--l+87.7%
fma-udef87.7%
neg-mul-187.7%
count-287.7%
associate-*l*87.7%
distribute-rgt-out--87.7%
associate-*r*87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in x.re around 0 87.7%
associate-*r*87.6%
*-commutative87.6%
metadata-eval87.6%
distribute-rgt-out87.6%
metadata-eval87.6%
cancel-sign-sub-inv87.6%
*-commutative87.6%
unpow287.6%
distribute-rgt-out--87.6%
metadata-eval87.6%
*-commutative87.6%
Simplified87.6%
pow187.6%
associate-*l*99.8%
*-commutative99.8%
Applied egg-rr99.8%
Final simplification96.4%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(-
(* x.re (- (* x.re x.re) (* x.im x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(fma x.im (* x.im (* x.re -2.0)) (- (pow x.re 3.0) (* 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_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = fma(x_46_im, (x_46_im * (x_46_re * -2.0)), (pow(x_46_re, 3.0) - (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 (Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = fma(x_46_im, Float64(x_46_im * Float64(x_46_re * -2.0)), Float64((x_46_re ^ 3.0) - Float64(x_46_im * Float64(x_46_re * x_46_im)))); else tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(x$46$im * N[(x$46$im * N[(x$46$re * -2.0), $MachinePrecision]), $MachinePrecision] + N[(N[Power[x$46$re, 3.0], $MachinePrecision] - N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $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.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x.im, x.im \cdot \left(x.re \cdot -2\right), {x.re}^{3} - x.im \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 (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) < +inf.0Initial program 95.0%
*-commutative95.0%
fma-neg95.0%
distribute-lft-neg-in95.0%
*-commutative95.0%
*-commutative95.0%
count-295.0%
distribute-lft-neg-in95.0%
metadata-eval95.0%
*-commutative95.0%
Simplified95.0%
fma-udef95.0%
fma-neg95.0%
distribute-rgt-neg-in95.0%
associate-*r*95.0%
Applied egg-rr95.0%
+-commutative95.0%
fma-def95.0%
*-commutative95.0%
*-commutative95.0%
fma-def95.0%
distribute-rgt-in91.9%
unpow392.0%
*-commutative92.0%
associate-*r*96.8%
distribute-rgt-neg-in96.8%
associate-*r*92.0%
unsub-neg92.0%
associate-*r*96.8%
*-commutative96.8%
*-commutative96.8%
Simplified96.8%
if +inf.0 < (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) Initial program 0.0%
*-commutative0.0%
distribute-lft-out0.0%
associate-*l*0.0%
*-commutative0.0%
distribute-rgt-out--25.9%
associate--l-25.9%
associate--l-25.9%
sub-neg25.9%
associate--l+25.9%
fma-udef51.9%
neg-mul-151.9%
count-251.9%
associate-*l*51.9%
distribute-rgt-out--51.9%
associate-*r*51.9%
metadata-eval51.9%
Simplified51.9%
Taylor expanded in x.re around inf 74.1%
unpow274.1%
Simplified74.1%
Final simplification94.4%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5.5e+155) (not (<= x.im 7.6e+153))) (- (* x.im (* x.re (- x.im))) (* x.im (* x.re (+ x.im 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 <= -5.5e+155) || !(x_46_im <= 7.6e+153)) {
tmp = (x_46_im * (x_46_re * -x_46_im)) - (x_46_im * (x_46_re * (x_46_im + 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 <= (-5.5d+155)) .or. (.not. (x_46im <= 7.6d+153))) then
tmp = (x_46im * (x_46re * -x_46im)) - (x_46im * (x_46re * (x_46im + 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 <= -5.5e+155) || !(x_46_im <= 7.6e+153)) {
tmp = (x_46_im * (x_46_re * -x_46_im)) - (x_46_im * (x_46_re * (x_46_im + 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 <= -5.5e+155) or not (x_46_im <= 7.6e+153): tmp = (x_46_im * (x_46_re * -x_46_im)) - (x_46_im * (x_46_re * (x_46_im + 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 <= -5.5e+155) || !(x_46_im <= 7.6e+153)) tmp = Float64(Float64(x_46_im * Float64(x_46_re * Float64(-x_46_im))) - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + 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 <= -5.5e+155) || ~((x_46_im <= 7.6e+153))) tmp = (x_46_im * (x_46_re * -x_46_im)) - (x_46_im * (x_46_re * (x_46_im + 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, -5.5e+155], N[Not[LessEqual[x$46$im, 7.6e+153]], $MachinePrecision]], N[(N[(x$46$im * 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], 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 -5.5 \cdot 10^{+155} \lor \neg \left(x.im \leq 7.6 \cdot 10^{+153}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(-x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + 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 < -5.5000000000000001e155 or 7.59999999999999933e153 < x.im Initial program 51.2%
*-commutative51.2%
*-commutative51.2%
*-commutative51.2%
distribute-lft-out51.2%
Simplified51.2%
Taylor expanded in x.re around 0 62.1%
mul-1-neg62.1%
unpow262.1%
associate-*r*79.6%
*-commutative79.6%
distribute-rgt-neg-in79.6%
distribute-rgt-neg-in79.6%
Simplified79.6%
if -5.5000000000000001e155 < x.im < 7.59999999999999933e153Initial program 96.2%
*-commutative96.2%
distribute-lft-out96.2%
associate-*l*96.1%
*-commutative96.1%
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%
Final simplification94.8%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -5.5e+155)
(* x.im (* x.im (* x.re -3.0)))
(if (<= x.im 7.6e+153)
(* x.re (+ (* x.re x.re) (* x.im (* x.im -3.0))))
(- (* x.im (* 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_im <= -5.5e+155) {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
} else if (x_46_im <= 7.6e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0)));
} else {
tmp = (x_46_im * (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_46im <= (-5.5d+155)) then
tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
else if (x_46im <= 7.6d+153) then
tmp = x_46re * ((x_46re * x_46re) + (x_46im * (x_46im * (-3.0d0))))
else
tmp = (x_46im * (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_im <= -5.5e+155) {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
} else if (x_46_im <= 7.6e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0)));
} else {
tmp = (x_46_im * (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_im <= -5.5e+155: tmp = x_46_im * (x_46_im * (x_46_re * -3.0)) elif x_46_im <= 7.6e+153: tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0))) else: tmp = (x_46_im * (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_im <= -5.5e+155) tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0))); elseif (x_46_im <= 7.6e+153) tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * Float64(x_46_im * -3.0)))); else tmp = Float64(Float64(x_46_im * Float64(x_46_re * Float64(-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_im <= -5.5e+155) tmp = x_46_im * (x_46_im * (x_46_re * -3.0)); elseif (x_46_im <= 7.6e+153) tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0))); else tmp = (x_46_im * (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[LessEqual[x$46$im, -5.5e+155], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7.6e+153], 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], N[(N[(x$46$im * 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.im \leq -5.5 \cdot 10^{+155}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\mathbf{elif}\;x.im \leq 7.6 \cdot 10^{+153}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re + x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(-x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -5.5000000000000001e155Initial program 62.3%
*-commutative62.3%
distribute-lft-out62.3%
associate-*l*62.3%
*-commutative62.3%
distribute-rgt-out--62.3%
associate--l-62.3%
associate--l-62.3%
sub-neg62.3%
associate--l+62.3%
fma-udef70.6%
neg-mul-170.6%
count-270.6%
associate-*l*70.6%
distribute-rgt-out--70.6%
associate-*r*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in x.re around 0 70.6%
associate-*r*70.6%
*-commutative70.6%
metadata-eval70.6%
distribute-rgt-out70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
unpow270.6%
distribute-rgt-out--70.6%
metadata-eval70.6%
*-commutative70.6%
Simplified70.6%
pow170.6%
associate-*l*88.8%
*-commutative88.8%
Applied egg-rr88.8%
if -5.5000000000000001e155 < x.im < 7.59999999999999933e153Initial program 96.2%
*-commutative96.2%
distribute-lft-out96.2%
associate-*l*96.1%
*-commutative96.1%
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 7.59999999999999933e153 < x.im Initial program 36.9%
*-commutative36.9%
*-commutative36.9%
*-commutative36.9%
distribute-lft-out36.9%
Simplified36.9%
Taylor expanded in x.re around 0 51.2%
mul-1-neg51.2%
unpow251.2%
associate-*r*67.8%
*-commutative67.8%
distribute-rgt-neg-in67.8%
distribute-rgt-neg-in67.8%
Simplified67.8%
Final simplification94.8%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -5.5e+155)
(* x.im (* x.re (* x.im -3.0)))
(if (<= x.im 7.6e+153)
(* x.re (+ (* x.re x.re) (* x.im (* x.im -3.0))))
(- (* x.im (* 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_im <= -5.5e+155) {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
} else if (x_46_im <= 7.6e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0)));
} else {
tmp = (x_46_im * (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_46im <= (-5.5d+155)) then
tmp = x_46im * (x_46re * (x_46im * (-3.0d0)))
else if (x_46im <= 7.6d+153) then
tmp = x_46re * ((x_46re * x_46re) + (x_46im * (x_46im * (-3.0d0))))
else
tmp = (x_46im * (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_im <= -5.5e+155) {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
} else if (x_46_im <= 7.6e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0)));
} else {
tmp = (x_46_im * (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_im <= -5.5e+155: tmp = x_46_im * (x_46_re * (x_46_im * -3.0)) elif x_46_im <= 7.6e+153: tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0))) else: tmp = (x_46_im * (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_im <= -5.5e+155) tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_im * -3.0))); elseif (x_46_im <= 7.6e+153) tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * Float64(x_46_im * -3.0)))); else tmp = Float64(Float64(x_46_im * Float64(x_46_re * Float64(-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_im <= -5.5e+155) tmp = x_46_im * (x_46_re * (x_46_im * -3.0)); elseif (x_46_im <= 7.6e+153) tmp = x_46_re * ((x_46_re * x_46_re) + (x_46_im * (x_46_im * -3.0))); else tmp = (x_46_im * (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[LessEqual[x$46$im, -5.5e+155], N[(x$46$im * N[(x$46$re * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7.6e+153], 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], N[(N[(x$46$im * 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.im \leq -5.5 \cdot 10^{+155}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{elif}\;x.im \leq 7.6 \cdot 10^{+153}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re + x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(-x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -5.5000000000000001e155Initial program 62.3%
*-commutative62.3%
distribute-lft-out62.3%
associate-*l*62.3%
*-commutative62.3%
distribute-rgt-out--62.3%
associate--l-62.3%
associate--l-62.3%
sub-neg62.3%
associate--l+62.3%
fma-udef70.6%
neg-mul-170.6%
count-270.6%
associate-*l*70.6%
distribute-rgt-out--70.6%
associate-*r*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in x.re around 0 70.6%
associate-*r*70.6%
*-commutative70.6%
metadata-eval70.6%
distribute-rgt-out70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
unpow270.6%
distribute-rgt-out--70.6%
metadata-eval70.6%
*-commutative70.6%
Simplified70.6%
pow170.6%
associate-*l*88.8%
*-commutative88.8%
Applied egg-rr88.8%
Taylor expanded in x.im around 0 88.8%
*-commutative88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.9%
Simplified88.9%
if -5.5000000000000001e155 < x.im < 7.59999999999999933e153Initial program 96.2%
*-commutative96.2%
distribute-lft-out96.2%
associate-*l*96.1%
*-commutative96.1%
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 7.59999999999999933e153 < x.im Initial program 36.9%
*-commutative36.9%
*-commutative36.9%
*-commutative36.9%
distribute-lft-out36.9%
Simplified36.9%
Taylor expanded in x.re around 0 51.2%
mul-1-neg51.2%
unpow251.2%
associate-*r*67.8%
*-commutative67.8%
distribute-rgt-neg-in67.8%
distribute-rgt-neg-in67.8%
Simplified67.8%
Final simplification94.8%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.im -5.5e+30)
(and (not (<= x.im 6.6e-18))
(or (<= x.im 5.5e+133) (not (<= x.im 1.4e+214)))))
(* -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 <= -5.5e+30) || (!(x_46_im <= 6.6e-18) && ((x_46_im <= 5.5e+133) || !(x_46_im <= 1.4e+214)))) {
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 <= (-5.5d+30)) .or. (.not. (x_46im <= 6.6d-18)) .and. (x_46im <= 5.5d+133) .or. (.not. (x_46im <= 1.4d+214))) 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 <= -5.5e+30) || (!(x_46_im <= 6.6e-18) && ((x_46_im <= 5.5e+133) || !(x_46_im <= 1.4e+214)))) {
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 <= -5.5e+30) or (not (x_46_im <= 6.6e-18) and ((x_46_im <= 5.5e+133) or not (x_46_im <= 1.4e+214))): 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 <= -5.5e+30) || (!(x_46_im <= 6.6e-18) && ((x_46_im <= 5.5e+133) || !(x_46_im <= 1.4e+214)))) 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 <= -5.5e+30) || (~((x_46_im <= 6.6e-18)) && ((x_46_im <= 5.5e+133) || ~((x_46_im <= 1.4e+214))))) 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, -5.5e+30], And[N[Not[LessEqual[x$46$im, 6.6e-18]], $MachinePrecision], Or[LessEqual[x$46$im, 5.5e+133], N[Not[LessEqual[x$46$im, 1.4e+214]], $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 -5.5 \cdot 10^{+30} \lor \neg \left(x.im \leq 6.6 \cdot 10^{-18}\right) \land \left(x.im \leq 5.5 \cdot 10^{+133} \lor \neg \left(x.im \leq 1.4 \cdot 10^{+214}\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 < -5.50000000000000025e30 or 6.6000000000000003e-18 < x.im < 5.5e133 or 1.3999999999999999e214 < x.im Initial program 75.8%
*-commutative75.8%
*-commutative75.8%
*-commutative75.8%
distribute-lft-out75.8%
Simplified75.8%
add-cbrt-cube50.9%
pow350.9%
Applied egg-rr50.9%
Taylor expanded in x.re around 0 74.5%
unpow274.5%
unpow274.5%
distribute-rgt-out--74.5%
metadata-eval74.5%
associate-*r*74.4%
Simplified74.4%
Taylor expanded in x.re around 0 74.4%
unpow274.4%
Simplified74.4%
if -5.50000000000000025e30 < x.im < 6.6000000000000003e-18 or 5.5e133 < x.im < 1.3999999999999999e214Initial program 91.4%
*-commutative91.4%
distribute-lft-out91.4%
associate-*l*91.3%
*-commutative91.3%
distribute-rgt-out--94.0%
associate--l-94.0%
associate--l-94.0%
sub-neg94.0%
associate--l+94.0%
fma-udef94.0%
neg-mul-194.0%
count-294.0%
associate-*l*94.0%
distribute-rgt-out--94.0%
associate-*r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in x.re around inf 92.8%
unpow292.8%
Simplified92.8%
Final simplification85.2%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* -3.0 (* x.re (* x.im x.im)))) (t_1 (* x.re (* x.re x.re))))
(if (<= x.im -1.95e+30)
t_0
(if (<= x.im 5.1e-18)
t_1
(if (<= x.im 5.5e+133)
(* x.re (* (* x.im x.im) -3.0))
(if (<= x.im 1.4e+214) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = -3.0 * (x_46_re * (x_46_im * x_46_im));
double t_1 = x_46_re * (x_46_re * x_46_re);
double tmp;
if (x_46_im <= -1.95e+30) {
tmp = t_0;
} else if (x_46_im <= 5.1e-18) {
tmp = t_1;
} else if (x_46_im <= 5.5e+133) {
tmp = x_46_re * ((x_46_im * x_46_im) * -3.0);
} else if (x_46_im <= 1.4e+214) {
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 = (-3.0d0) * (x_46re * (x_46im * x_46im))
t_1 = x_46re * (x_46re * x_46re)
if (x_46im <= (-1.95d+30)) then
tmp = t_0
else if (x_46im <= 5.1d-18) then
tmp = t_1
else if (x_46im <= 5.5d+133) then
tmp = x_46re * ((x_46im * x_46im) * (-3.0d0))
else if (x_46im <= 1.4d+214) 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 = -3.0 * (x_46_re * (x_46_im * x_46_im));
double t_1 = x_46_re * (x_46_re * x_46_re);
double tmp;
if (x_46_im <= -1.95e+30) {
tmp = t_0;
} else if (x_46_im <= 5.1e-18) {
tmp = t_1;
} else if (x_46_im <= 5.5e+133) {
tmp = x_46_re * ((x_46_im * x_46_im) * -3.0);
} else if (x_46_im <= 1.4e+214) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = -3.0 * (x_46_re * (x_46_im * x_46_im)) t_1 = x_46_re * (x_46_re * x_46_re) tmp = 0 if x_46_im <= -1.95e+30: tmp = t_0 elif x_46_im <= 5.1e-18: tmp = t_1 elif x_46_im <= 5.5e+133: tmp = x_46_re * ((x_46_im * x_46_im) * -3.0) elif x_46_im <= 1.4e+214: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(-3.0 * Float64(x_46_re * 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 <= -1.95e+30) tmp = t_0; elseif (x_46_im <= 5.1e-18) tmp = t_1; elseif (x_46_im <= 5.5e+133) tmp = Float64(x_46_re * Float64(Float64(x_46_im * x_46_im) * -3.0)); elseif (x_46_im <= 1.4e+214) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = -3.0 * (x_46_re * (x_46_im * x_46_im)); t_1 = x_46_re * (x_46_re * x_46_re); tmp = 0.0; if (x_46_im <= -1.95e+30) tmp = t_0; elseif (x_46_im <= 5.1e-18) tmp = t_1; elseif (x_46_im <= 5.5e+133) tmp = x_46_re * ((x_46_im * x_46_im) * -3.0); elseif (x_46_im <= 1.4e+214) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(-3.0 * N[(x$46$re * 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, -1.95e+30], t$95$0, If[LessEqual[x$46$im, 5.1e-18], t$95$1, If[LessEqual[x$46$im, 5.5e+133], N[(x$46$re * N[(N[(x$46$im * x$46$im), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.4e+214], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -3 \cdot \left(x.re \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 -1.95 \cdot 10^{+30}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 5.1 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 5.5 \cdot 10^{+133}:\\
\;\;\;\;x.re \cdot \left(\left(x.im \cdot x.im\right) \cdot -3\right)\\
\mathbf{elif}\;x.im \leq 1.4 \cdot 10^{+214}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -1.95000000000000005e30 or 1.3999999999999999e214 < x.im Initial program 70.1%
*-commutative70.1%
*-commutative70.1%
*-commutative70.1%
distribute-lft-out70.1%
Simplified70.1%
add-cbrt-cube52.6%
pow352.6%
Applied egg-rr52.6%
Taylor expanded in x.re around 0 74.4%
unpow274.4%
unpow274.4%
distribute-rgt-out--74.4%
metadata-eval74.4%
associate-*r*74.3%
Simplified74.3%
Taylor expanded in x.re around 0 74.4%
unpow274.4%
Simplified74.4%
if -1.95000000000000005e30 < x.im < 5.09999999999999983e-18 or 5.5e133 < x.im < 1.3999999999999999e214Initial program 91.4%
*-commutative91.4%
distribute-lft-out91.4%
associate-*l*91.3%
*-commutative91.3%
distribute-rgt-out--94.0%
associate--l-94.0%
associate--l-94.0%
sub-neg94.0%
associate--l+94.0%
fma-udef94.0%
neg-mul-194.0%
count-294.0%
associate-*l*94.0%
distribute-rgt-out--94.0%
associate-*r*94.0%
metadata-eval94.0%
Simplified94.0%
Taylor expanded in x.re around inf 92.8%
unpow292.8%
Simplified92.8%
if 5.09999999999999983e-18 < x.im < 5.5e133Initial program 95.6%
*-commutative95.6%
distribute-lft-out95.6%
associate-*l*95.4%
*-commutative95.4%
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 0 74.8%
unpow274.8%
Simplified74.8%
Final simplification85.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -2.7e+173) (not (<= x.re 1.35e+154))) (* x.re (* x.re x.re)) (* 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_re <= -2.7e+173) || !(x_46_re <= 1.35e+154)) {
tmp = x_46_re * (x_46_re * x_46_re);
} 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_46re <= (-2.7d+173)) .or. (.not. (x_46re <= 1.35d+154))) then
tmp = x_46re * (x_46re * x_46re)
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_re <= -2.7e+173) || !(x_46_re <= 1.35e+154)) {
tmp = x_46_re * (x_46_re * x_46_re);
} 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_re <= -2.7e+173) or not (x_46_re <= 1.35e+154): tmp = x_46_re * (x_46_re * x_46_re) 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_re <= -2.7e+173) || !(x_46_re <= 1.35e+154)) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); 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_re <= -2.7e+173) || ~((x_46_re <= 1.35e+154))) tmp = x_46_re * (x_46_re * x_46_re); 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$re, -2.7e+173], N[Not[LessEqual[x$46$re, 1.35e+154]], $MachinePrecision]], N[(x$46$re * N[(x$46$re * x$46$re), $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.re \leq -2.7 \cdot 10^{+173} \lor \neg \left(x.re \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\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.re < -2.7000000000000001e173 or 1.35000000000000003e154 < x.re Initial program 59.7%
*-commutative59.7%
distribute-lft-out59.7%
associate-*l*59.7%
*-commutative59.7%
distribute-rgt-out--67.7%
associate--l-67.7%
associate--l-67.7%
sub-neg67.7%
associate--l+67.7%
fma-udef79.0%
neg-mul-179.0%
count-279.0%
associate-*l*79.0%
distribute-rgt-out--79.0%
associate-*r*79.0%
metadata-eval79.0%
Simplified79.0%
Taylor expanded in x.re around inf 88.7%
unpow288.7%
Simplified88.7%
if -2.7000000000000001e173 < x.re < 1.35000000000000003e154Initial program 93.0%
*-commutative93.0%
distribute-lft-out93.0%
associate-*l*93.0%
*-commutative93.0%
distribute-rgt-out--94.0%
associate--l-94.0%
associate--l-94.0%
sub-neg94.0%
associate--l+94.0%
fma-udef94.0%
neg-mul-194.0%
count-294.0%
associate-*l*94.0%
distribute-rgt-out--94.0%
associate-*r*94.0%
metadata-eval94.0%
Simplified94.0%
fma-udef94.0%
Applied egg-rr94.0%
Final simplification92.7%
(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 84.9%
*-commutative84.9%
distribute-lft-out84.9%
associate-*l*84.9%
*-commutative84.9%
distribute-rgt-out--87.7%
associate--l-87.7%
associate--l-87.7%
sub-neg87.7%
associate--l+87.7%
fma-udef90.4%
neg-mul-190.4%
count-290.4%
associate-*l*90.4%
distribute-rgt-out--90.4%
associate-*r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in x.re around inf 62.0%
unpow262.0%
Simplified62.0%
Final simplification62.0%
(FPCore (x.re x.im) :precision binary64 -3.0)
double code(double x_46_re, double x_46_im) {
return -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -3.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -3.0;
}
def code(x_46_re, x_46_im): return -3.0
function code(x_46_re, x_46_im) return -3.0 end
function tmp = code(x_46_re, x_46_im) tmp = -3.0; end
code[x$46$re_, x$46$im_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 84.9%
*-commutative84.9%
distribute-lft-out84.9%
associate-*l*84.9%
*-commutative84.9%
distribute-rgt-out--87.7%
associate--l-87.7%
associate--l-87.7%
sub-neg87.7%
associate--l+87.7%
fma-udef90.4%
neg-mul-190.4%
count-290.4%
associate-*l*90.4%
distribute-rgt-out--90.4%
associate-*r*90.4%
metadata-eval90.4%
Simplified90.4%
fma-udef87.7%
Applied egg-rr87.7%
Taylor expanded in x.re around 0 50.6%
Simplified2.6%
Final simplification2.6%
(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 2023187
(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)))