
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.5e+117) (not (<= x.im 1.5e+80))) (+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re)))) (- (* (* x.re (* x.im x.re)) 3.0) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 1.5e+80)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-1.5d+117)) .or. (.not. (x_46im <= 1.5d+80))) then
tmp = (x_46im + x_46im) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
else
tmp = ((x_46re * (x_46im * x_46re)) * 3.0d0) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 1.5e+80)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -1.5e+117) or not (x_46_im <= 1.5e+80): tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) else: tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -1.5e+117) || !(x_46_im <= 1.5e+80)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))); else tmp = Float64(Float64(Float64(x_46_re * Float64(x_46_im * x_46_re)) * 3.0) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -1.5e+117) || ~((x_46_im <= 1.5e+80))) tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); else tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -1.5e+117], N[Not[LessEqual[x$46$im, 1.5e+80]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{+117} \lor \neg \left(x.im \leq 1.5 \cdot 10^{+80}\right):\\
\;\;\;\;\left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot \left(x.im \cdot x.re\right)\right) \cdot 3 - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -1.5e117 or 1.49999999999999993e80 < x.im Initial program 71.6%
+-commutative71.6%
*-commutative71.6%
fma-def77.8%
*-commutative77.8%
distribute-rgt-out77.8%
*-commutative77.8%
Simplified77.8%
fma-udef71.6%
distribute-lft-in71.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+85.2%
Applied egg-rr85.2%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -1.5e117 < x.im < 1.49999999999999993e80Initial program 92.2%
+-commutative92.2%
*-commutative92.2%
sub-neg92.2%
distribute-lft-in92.2%
associate-+r+92.2%
distribute-rgt-neg-out92.2%
unsub-neg92.2%
Simplified99.8%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.5e+117) (not (<= x.im 2e+79))) (+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re)))) (- (* x.re (* (* x.im x.re) 3.0)) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 2e+79)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-1.5d+117)) .or. (.not. (x_46im <= 2d+79))) then
tmp = (x_46im + x_46im) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
else
tmp = (x_46re * ((x_46im * x_46re) * 3.0d0)) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 2e+79)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -1.5e+117) or not (x_46_im <= 2e+79): tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) else: tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -1.5e+117) || !(x_46_im <= 2e+79)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) * 3.0)) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -1.5e+117) || ~((x_46_im <= 2e+79))) tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); else tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -1.5e+117], N[Not[LessEqual[x$46$im, 2e+79]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(N[(x$46$im * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{+117} \lor \neg \left(x.im \leq 2 \cdot 10^{+79}\right):\\
\;\;\;\;\left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.im \cdot x.re\right) \cdot 3\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -1.5e117 or 1.99999999999999993e79 < x.im Initial program 71.6%
+-commutative71.6%
*-commutative71.6%
fma-def77.8%
*-commutative77.8%
distribute-rgt-out77.8%
*-commutative77.8%
Simplified77.8%
fma-udef71.6%
distribute-lft-in71.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+85.2%
Applied egg-rr85.2%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -1.5e117 < x.im < 1.99999999999999993e79Initial program 92.2%
+-commutative92.2%
*-commutative92.2%
sub-neg92.2%
distribute-lft-in92.2%
associate-+r+92.2%
distribute-rgt-neg-out92.2%
unsub-neg92.2%
associate-*r*99.8%
distribute-rgt-out99.6%
*-commutative99.6%
count-299.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.7%
Final simplification99.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.5e+117) (not (<= x.im 2e+79))) (+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re)))) (- (* x.re (* x.im (* x.re 3.0))) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 2e+79)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_re * (x_46_im * (x_46_re * 3.0))) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-1.5d+117)) .or. (.not. (x_46im <= 2d+79))) then
tmp = (x_46im + x_46im) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
else
tmp = (x_46re * (x_46im * (x_46re * 3.0d0))) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 2e+79)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_re * (x_46_im * (x_46_re * 3.0))) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -1.5e+117) or not (x_46_im <= 2e+79): tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) else: tmp = (x_46_re * (x_46_im * (x_46_re * 3.0))) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -1.5e+117) || !(x_46_im <= 2e+79)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))); else tmp = Float64(Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -1.5e+117) || ~((x_46_im <= 2e+79))) tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); else tmp = (x_46_re * (x_46_im * (x_46_re * 3.0))) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -1.5e+117], N[Not[LessEqual[x$46$im, 2e+79]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{+117} \lor \neg \left(x.im \leq 2 \cdot 10^{+79}\right):\\
\;\;\;\;\left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -1.5e117 or 1.99999999999999993e79 < x.im Initial program 71.6%
+-commutative71.6%
*-commutative71.6%
fma-def77.8%
*-commutative77.8%
distribute-rgt-out77.8%
*-commutative77.8%
Simplified77.8%
fma-udef71.6%
distribute-lft-in71.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+85.2%
Applied egg-rr85.2%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -1.5e117 < x.im < 1.99999999999999993e79Initial program 92.2%
+-commutative92.2%
*-commutative92.2%
sub-neg92.2%
distribute-lft-in92.2%
associate-+r+92.2%
distribute-rgt-neg-out92.2%
unsub-neg92.2%
associate-*r*99.8%
distribute-rgt-out99.6%
*-commutative99.6%
count-299.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.7%
expm1-log1p-u85.1%
expm1-udef54.7%
Applied egg-rr54.7%
expm1-def85.1%
expm1-log1p99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
Simplified99.7%
Final simplification99.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.5e+117) (not (<= x.im 1.5e+80))) (+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re)))) (- (* x.re (* x.re (* x.im 3.0))) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 1.5e+80)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-1.5d+117)) .or. (.not. (x_46im <= 1.5d+80))) then
tmp = (x_46im + x_46im) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
else
tmp = (x_46re * (x_46re * (x_46im * 3.0d0))) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.5e+117) || !(x_46_im <= 1.5e+80)) {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -1.5e+117) or not (x_46_im <= 1.5e+80): tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) else: tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -1.5e+117) || !(x_46_im <= 1.5e+80)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))); else tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_im * 3.0))) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -1.5e+117) || ~((x_46_im <= 1.5e+80))) tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); else tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -1.5e+117], N[Not[LessEqual[x$46$im, 1.5e+80]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$re * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{+117} \lor \neg \left(x.im \leq 1.5 \cdot 10^{+80}\right):\\
\;\;\;\;\left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -1.5e117 or 1.49999999999999993e80 < x.im Initial program 71.6%
+-commutative71.6%
*-commutative71.6%
fma-def77.8%
*-commutative77.8%
distribute-rgt-out77.8%
*-commutative77.8%
Simplified77.8%
fma-udef71.6%
distribute-lft-in71.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+85.2%
Applied egg-rr85.2%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -1.5e117 < x.im < 1.49999999999999993e80Initial program 92.2%
+-commutative92.2%
*-commutative92.2%
sub-neg92.2%
distribute-lft-in92.2%
associate-+r+92.2%
distribute-rgt-neg-out92.2%
unsub-neg92.2%
associate-*r*99.8%
distribute-rgt-out99.6%
*-commutative99.6%
count-299.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.im x.re) (* x.im x.re))))))
(if (<= t_0 INFINITY)
t_0
(+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re)));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re)));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) + Float64(x_46_im * x_46_re)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$im * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.im \cdot x.re + x.im \cdot x.re\right)\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 94.2%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
fma-def21.7%
*-commutative21.7%
distribute-rgt-out21.7%
*-commutative21.7%
Simplified21.7%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+47.8%
Applied egg-rr47.8%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification94.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re))))))
(if (<= x.im -56000000.0)
t_0
(if (<= x.im 7.2e-40)
(+ (* x.re (* (* x.im x.re) 2.0)) (* x.im (* x.re x.re)))
(if (<= x.im 6200.0) (* x.im (* x.im (- x.im))) t_0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
double tmp;
if (x_46_im <= -56000000.0) {
tmp = t_0;
} else if (x_46_im <= 7.2e-40) {
tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re));
} else if (x_46_im <= 6200.0) {
tmp = x_46_im * (x_46_im * -x_46_im);
} 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) :: tmp
t_0 = (x_46im + x_46im) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
if (x_46im <= (-56000000.0d0)) then
tmp = t_0
else if (x_46im <= 7.2d-40) then
tmp = (x_46re * ((x_46im * x_46re) * 2.0d0)) + (x_46im * (x_46re * x_46re))
else if (x_46im <= 6200.0d0) then
tmp = x_46im * (x_46im * -x_46im)
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 + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
double tmp;
if (x_46_im <= -56000000.0) {
tmp = t_0;
} else if (x_46_im <= 7.2e-40) {
tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re));
} else if (x_46_im <= 6200.0) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) tmp = 0 if x_46_im <= -56000000.0: tmp = t_0 elif x_46_im <= 7.2e-40: tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re)) elif x_46_im <= 6200.0: tmp = x_46_im * (x_46_im * -x_46_im) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))) tmp = 0.0 if (x_46_im <= -56000000.0) tmp = t_0; elseif (x_46_im <= 7.2e-40) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) * 2.0)) + Float64(x_46_im * Float64(x_46_re * x_46_re))); elseif (x_46_im <= 6200.0) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); tmp = 0.0; if (x_46_im <= -56000000.0) tmp = t_0; elseif (x_46_im <= 7.2e-40) tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re)); elseif (x_46_im <= 6200.0) tmp = x_46_im * (x_46_im * -x_46_im); 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 + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -56000000.0], t$95$0, If[LessEqual[x$46$im, 7.2e-40], N[(N[(x$46$re * N[(N[(x$46$im * x$46$re), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6200.0], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{if}\;x.im \leq -56000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 7.2 \cdot 10^{-40}:\\
\;\;\;\;x.re \cdot \left(\left(x.im \cdot x.re\right) \cdot 2\right) + x.im \cdot \left(x.re \cdot x.re\right)\\
\mathbf{elif}\;x.im \leq 6200:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -5.6e7 or 6200 < x.im Initial program 80.6%
+-commutative80.6%
*-commutative80.6%
fma-def84.8%
*-commutative84.8%
distribute-rgt-out84.8%
*-commutative84.8%
Simplified84.8%
fma-udef80.6%
distribute-lft-in80.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+86.7%
Applied egg-rr86.7%
difference-of-squares96.8%
*-commutative96.8%
Applied egg-rr96.8%
if -5.6e7 < x.im < 7.2e-40Initial program 89.5%
Taylor expanded in x.re around inf 83.6%
Simplified83.6%
Taylor expanded in x.re around 0 83.6%
if 7.2e-40 < x.im < 6200Initial program 99.4%
sub-neg99.4%
flip-+99.2%
pow299.2%
pow299.2%
pow-prod-up99.2%
metadata-eval99.2%
distribute-rgt-neg-in99.2%
distribute-rgt-neg-in99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
Taylor expanded in x.re around 0 83.1%
unpow283.1%
neg-mul-183.1%
Simplified83.1%
+-commutative83.1%
*-commutative83.1%
Applied egg-rr80.5%
Final simplification89.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* (* x.im x.re) 2.0)))
(t_1 (+ (+ x.im x.im) (* x.im (* (- x.re x.im) (+ x.im x.re))))))
(if (<= x.im -155000000.0)
t_1
(if (<= x.im 7.5e-64)
(+ t_0 (* x.im (* x.re x.re)))
(if (<= x.im 7.6e+55) (- t_0 (* x.im (* x.im x.im))) t_1)))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * ((x_46_im * x_46_re) * 2.0);
double t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
double tmp;
if (x_46_im <= -155000000.0) {
tmp = t_1;
} else if (x_46_im <= 7.5e-64) {
tmp = t_0 + (x_46_im * (x_46_re * x_46_re));
} else if (x_46_im <= 7.6e+55) {
tmp = t_0 - (x_46_im * (x_46_im * x_46_im));
} 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) :: tmp
t_0 = x_46re * ((x_46im * x_46re) * 2.0d0)
t_1 = (x_46im + x_46im) + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
if (x_46im <= (-155000000.0d0)) then
tmp = t_1
else if (x_46im <= 7.5d-64) then
tmp = t_0 + (x_46im * (x_46re * x_46re))
else if (x_46im <= 7.6d+55) then
tmp = t_0 - (x_46im * (x_46im * x_46im))
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_im * x_46_re) * 2.0);
double t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
double tmp;
if (x_46_im <= -155000000.0) {
tmp = t_1;
} else if (x_46_im <= 7.5e-64) {
tmp = t_0 + (x_46_im * (x_46_re * x_46_re));
} else if (x_46_im <= 7.6e+55) {
tmp = t_0 - (x_46_im * (x_46_im * x_46_im));
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * ((x_46_im * x_46_re) * 2.0) t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) tmp = 0 if x_46_im <= -155000000.0: tmp = t_1 elif x_46_im <= 7.5e-64: tmp = t_0 + (x_46_im * (x_46_re * x_46_re)) elif x_46_im <= 7.6e+55: tmp = t_0 - (x_46_im * (x_46_im * x_46_im)) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) * 2.0)) t_1 = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))) tmp = 0.0 if (x_46_im <= -155000000.0) tmp = t_1; elseif (x_46_im <= 7.5e-64) tmp = Float64(t_0 + Float64(x_46_im * Float64(x_46_re * x_46_re))); elseif (x_46_im <= 7.6e+55) tmp = Float64(t_0 - Float64(x_46_im * Float64(x_46_im * x_46_im))); 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_im * x_46_re) * 2.0); t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); tmp = 0.0; if (x_46_im <= -155000000.0) tmp = t_1; elseif (x_46_im <= 7.5e-64) tmp = t_0 + (x_46_im * (x_46_re * x_46_re)); elseif (x_46_im <= 7.6e+55) tmp = t_0 - (x_46_im * (x_46_im * x_46_im)); 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[(N[(x$46$im * x$46$re), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -155000000.0], t$95$1, If[LessEqual[x$46$im, 7.5e-64], N[(t$95$0 + N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7.6e+55], N[(t$95$0 - N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(\left(x.im \cdot x.re\right) \cdot 2\right)\\
t_1 := \left(x.im + x.im\right) + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{if}\;x.im \leq -155000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-64}:\\
\;\;\;\;t_0 + x.im \cdot \left(x.re \cdot x.re\right)\\
\mathbf{elif}\;x.im \leq 7.6 \cdot 10^{+55}:\\
\;\;\;\;t_0 - x.im \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -1.55e8 or 7.5999999999999999e55 < x.im Initial program 79.4%
+-commutative79.4%
*-commutative79.4%
fma-def83.9%
*-commutative83.9%
distribute-rgt-out83.9%
*-commutative83.9%
Simplified83.9%
fma-udef79.4%
distribute-lft-in79.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+87.8%
Applied egg-rr87.8%
difference-of-squares98.5%
*-commutative98.5%
Applied egg-rr98.5%
if -1.55e8 < x.im < 7.49999999999999949e-64Initial program 89.0%
Taylor expanded in x.re around inf 84.4%
Simplified84.4%
Taylor expanded in x.re around 0 84.4%
if 7.49999999999999949e-64 < x.im < 7.5999999999999999e55Initial program 99.6%
sub-neg99.6%
flip-+71.9%
pow271.9%
pow271.9%
pow-prod-up71.9%
metadata-eval71.9%
distribute-rgt-neg-in71.9%
distribute-rgt-neg-in71.9%
distribute-rgt-neg-in71.9%
Applied egg-rr71.9%
Taylor expanded in x.re around 0 80.0%
unpow280.0%
neg-mul-180.0%
Simplified80.0%
Taylor expanded in x.re around 0 80.0%
Final simplification90.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -4.1e+96) (not (<= x.im 1.55e-39))) (* x.im (* x.im (- x.im))) (+ (* x.re (* (* x.im x.re) 2.0)) (* x.im (* x.re x.re)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -4.1e+96) || !(x_46_im <= 1.55e-39)) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-4.1d+96)) .or. (.not. (x_46im <= 1.55d-39))) then
tmp = x_46im * (x_46im * -x_46im)
else
tmp = (x_46re * ((x_46im * x_46re) * 2.0d0)) + (x_46im * (x_46re * x_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -4.1e+96) || !(x_46_im <= 1.55e-39)) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -4.1e+96) or not (x_46_im <= 1.55e-39): tmp = x_46_im * (x_46_im * -x_46_im) else: tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -4.1e+96) || !(x_46_im <= 1.55e-39)) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) * 2.0)) + Float64(x_46_im * Float64(x_46_re * x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -4.1e+96) || ~((x_46_im <= 1.55e-39))) tmp = x_46_im * (x_46_im * -x_46_im); else tmp = (x_46_re * ((x_46_im * x_46_re) * 2.0)) + (x_46_im * (x_46_re * x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -4.1e+96], N[Not[LessEqual[x$46$im, 1.55e-39]], $MachinePrecision]], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(N[(x$46$im * x$46$re), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.1 \cdot 10^{+96} \lor \neg \left(x.im \leq 1.55 \cdot 10^{-39}\right):\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.im \cdot x.re\right) \cdot 2\right) + x.im \cdot \left(x.re \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < -4.09999999999999998e96 or 1.54999999999999985e-39 < x.im Initial program 79.0%
sub-neg79.0%
flip-+28.1%
pow228.1%
pow228.1%
pow-prod-up28.1%
metadata-eval28.1%
distribute-rgt-neg-in28.1%
distribute-rgt-neg-in28.1%
distribute-rgt-neg-in28.1%
Applied egg-rr28.1%
Taylor expanded in x.re around 0 69.6%
unpow269.6%
neg-mul-169.6%
Simplified69.6%
+-commutative69.6%
*-commutative69.6%
Applied egg-rr79.9%
if -4.09999999999999998e96 < x.im < 1.54999999999999985e-39Initial program 90.7%
Taylor expanded in x.re around inf 80.8%
Simplified80.8%
Taylor expanded in x.re around 0 80.8%
Final simplification80.4%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -2.4e+96) (not (<= x.im 4.9e-40))) (* x.im (* x.im (- x.im))) (* 3.0 (* x.im (* x.re x.re)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2.4e+96) || !(x_46_im <= 4.9e-40)) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-2.4d+96)) .or. (.not. (x_46im <= 4.9d-40))) then
tmp = x_46im * (x_46im * -x_46im)
else
tmp = 3.0d0 * (x_46im * (x_46re * x_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -2.4e+96) || !(x_46_im <= 4.9e-40)) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -2.4e+96) or not (x_46_im <= 4.9e-40): tmp = x_46_im * (x_46_im * -x_46_im) else: tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -2.4e+96) || !(x_46_im <= 4.9e-40)) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -2.4e+96) || ~((x_46_im <= 4.9e-40))) tmp = x_46_im * (x_46_im * -x_46_im); else tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -2.4e+96], N[Not[LessEqual[x$46$im, 4.9e-40]], $MachinePrecision]], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.4 \cdot 10^{+96} \lor \neg \left(x.im \leq 4.9 \cdot 10^{-40}\right):\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)\\
\end{array}
\end{array}
if x.im < -2.39999999999999993e96 or 4.8999999999999997e-40 < x.im Initial program 79.0%
sub-neg79.0%
flip-+28.1%
pow228.1%
pow228.1%
pow-prod-up28.1%
metadata-eval28.1%
distribute-rgt-neg-in28.1%
distribute-rgt-neg-in28.1%
distribute-rgt-neg-in28.1%
Applied egg-rr28.1%
Taylor expanded in x.re around 0 69.6%
unpow269.6%
neg-mul-169.6%
Simplified69.6%
+-commutative69.6%
*-commutative69.6%
Applied egg-rr79.9%
if -2.39999999999999993e96 < x.im < 4.8999999999999997e-40Initial program 90.7%
+-commutative90.7%
*-commutative90.7%
sub-neg90.7%
distribute-lft-in90.7%
associate-+r+90.7%
distribute-rgt-neg-out90.7%
unsub-neg90.7%
associate-*r*99.8%
distribute-rgt-out99.6%
*-commutative99.6%
count-299.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.7%
cube-unmult99.7%
Simplified99.7%
Taylor expanded in x.re around 0 99.6%
expm1-log1p-u85.1%
expm1-udef49.0%
Applied egg-rr49.0%
expm1-def85.1%
expm1-log1p99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.7%
*-commutative99.7%
Simplified99.7%
associate-*r*99.7%
fma-neg99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around inf 80.8%
*-commutative80.8%
unpow280.8%
Simplified80.8%
Final simplification80.4%
(FPCore (x.re x.im) :precision binary64 (* 3.0 (* x.im (* x.re x.re))))
double code(double x_46_re, double x_46_im) {
return 3.0 * (x_46_im * (x_46_re * x_46_re));
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 3.0d0 * (x_46im * (x_46re * x_46re))
end function
public static double code(double x_46_re, double x_46_im) {
return 3.0 * (x_46_im * (x_46_re * x_46_re));
}
def code(x_46_re, x_46_im): return 3.0 * (x_46_im * (x_46_re * x_46_re))
function code(x_46_re, x_46_im) return Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))) end
function tmp = code(x_46_re, x_46_im) tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)); end
code[x$46$re_, x$46$im_] := N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)
\end{array}
Initial program 85.7%
+-commutative85.7%
*-commutative85.7%
sub-neg85.7%
distribute-lft-in83.0%
associate-+r+83.0%
distribute-rgt-neg-out83.0%
unsub-neg83.0%
associate-*r*88.1%
distribute-rgt-out88.0%
*-commutative88.0%
count-288.0%
distribute-lft1-in88.0%
metadata-eval88.0%
*-commutative88.0%
*-commutative88.0%
associate-*r*88.1%
cube-unmult88.1%
Simplified88.1%
Taylor expanded in x.re around 0 88.0%
expm1-log1p-u71.5%
expm1-udef50.7%
Applied egg-rr50.7%
expm1-def71.5%
expm1-log1p88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*88.1%
*-commutative88.1%
Simplified88.1%
associate-*r*88.1%
fma-neg90.0%
*-commutative90.0%
Applied egg-rr90.0%
Taylor expanded in x.re around inf 54.5%
*-commutative54.5%
unpow254.5%
Simplified54.5%
Final simplification54.5%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.im x.im)))
double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_im * x_46_im);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * (x_46im * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_im * x_46_im);
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_im * x_46_im)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_im * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_im * x_46_im); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.im \cdot x.im\right)
\end{array}
Initial program 85.7%
sub-neg85.7%
flip-+37.3%
pow237.3%
pow237.3%
pow-prod-up37.3%
metadata-eval37.3%
distribute-rgt-neg-in37.3%
distribute-rgt-neg-in37.3%
distribute-rgt-neg-in37.3%
Applied egg-rr37.3%
Taylor expanded in x.re around 0 64.7%
unpow264.7%
neg-mul-164.7%
Simplified64.7%
+-commutative64.7%
*-commutative64.7%
Applied egg-rr18.7%
Final simplification18.7%
(FPCore (x.re x.im) :precision binary64 -10.0)
double code(double x_46_re, double x_46_im) {
return -10.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -10.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -10.0;
}
def code(x_46_re, x_46_im): return -10.0
function code(x_46_re, x_46_im) return -10.0 end
function tmp = code(x_46_re, x_46_im) tmp = -10.0; end
code[x$46$re_, x$46$im_] := -10.0
\begin{array}{l}
\\
-10
\end{array}
Initial program 85.7%
+-commutative85.7%
*-commutative85.7%
sub-neg85.7%
distribute-lft-in83.0%
associate-+r+83.0%
distribute-rgt-neg-out83.0%
unsub-neg83.0%
associate-*r*88.1%
distribute-rgt-out88.0%
*-commutative88.0%
count-288.0%
distribute-lft1-in88.0%
metadata-eval88.0%
*-commutative88.0%
*-commutative88.0%
associate-*r*88.1%
cube-unmult88.1%
Simplified88.1%
associate-*r*88.0%
associate-*l*88.2%
flip--23.9%
div-inv23.8%
swap-sqr23.8%
pow223.8%
metadata-eval23.8%
pow-prod-up23.7%
metadata-eval23.7%
associate-*l*23.7%
associate-*r*23.7%
fma-def23.7%
Applied egg-rr23.7%
Simplified2.8%
Final simplification2.8%
(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 85.7%
Taylor expanded in x.re around 0 52.7%
Simplified2.8%
Final simplification2.8%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = ((x_46re * x_46im) * (2.0d0 * x_46re)) + ((x_46im * (x_46re - x_46im)) * (x_46re + x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_im) * Float64(2.0 * x_46_re)) + Float64(Float64(x_46_im * Float64(x_46_re - x_46_im)) * Float64(x_46_re + x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im)); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(2.0 * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.im\right) \cdot \left(2 \cdot x.re\right) + \left(x.im \cdot \left(x.re - x.im\right)\right) \cdot \left(x.re + x.im\right)
\end{array}
herbie shell --seed 2023201
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:herbie-target
(+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im)))
(+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))