
(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 11 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 -5e+102) (not (<= x.im 2e+93))) (+ (+ x.im x.im) (* (* x.im (+ x.im x.re)) (- x.re x.im))) (- (* 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 <= -5e+102) || !(x_46_im <= 2e+93)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} 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 <= (-5d+102)) .or. (.not. (x_46im <= 2d+93))) then
tmp = (x_46im + x_46im) + ((x_46im * (x_46im + x_46re)) * (x_46re - x_46im))
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 <= -5e+102) || !(x_46_im <= 2e+93)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} 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 <= -5e+102) or not (x_46_im <= 2e+93): tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)) 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 <= -5e+102) || !(x_46_im <= 2e+93)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im * Float64(x_46_im + x_46_re)) * Float64(x_46_re - x_46_im))); 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 <= -5e+102) || ~((x_46_im <= 2e+93))) tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)); 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, -5e+102], N[Not[LessEqual[x$46$im, 2e+93]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] * N[(x$46$re - x$46$im), $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 -5 \cdot 10^{+102} \lor \neg \left(x.im \leq 2 \cdot 10^{+93}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im \cdot \left(x.im + x.re\right)\right) \cdot \left(x.re - x.im\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 < -5e102 or 2.00000000000000009e93 < x.im Initial program 63.9%
+-commutative63.9%
*-commutative63.9%
fma-def68.7%
*-commutative68.7%
distribute-rgt-out68.7%
*-commutative68.7%
Simplified68.7%
fma-udef63.9%
distribute-lft-in63.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.3%
distribute-lft-in72.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+84.3%
difference-of-squares100.0%
associate-*r*100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 2.00000000000000009e93Initial program 91.2%
+-commutative91.2%
*-commutative91.2%
sub-neg91.2%
distribute-lft-in91.2%
associate-+r+91.2%
distribute-rgt-neg-out91.2%
unsub-neg91.2%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.8%
*-commutative99.8%
associate-*r*99.8%
expm1-log1p-u80.9%
expm1-udef62.9%
*-commutative62.9%
Applied egg-rr62.9%
expm1-def80.9%
expm1-log1p99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+102) (not (<= x.im 2e+94))) (+ (+ x.im x.im) (* (* x.im (+ x.im x.re)) (- x.re x.im))) (- (* x.re (* 3.0 (* x.im x.re))) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+102) || !(x_46_im <= 2e+94)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} else {
tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - 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 <= (-5d+102)) .or. (.not. (x_46im <= 2d+94))) then
tmp = (x_46im + x_46im) + ((x_46im * (x_46im + x_46re)) * (x_46re - x_46im))
else
tmp = (x_46re * (3.0d0 * (x_46im * x_46re))) - (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 <= -5e+102) || !(x_46_im <= 2e+94)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} else {
tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -5e+102) or not (x_46_im <= 2e+94): tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)) else: tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -5e+102) || !(x_46_im <= 2e+94)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im * Float64(x_46_im + x_46_re)) * Float64(x_46_re - x_46_im))); else tmp = Float64(Float64(x_46_re * Float64(3.0 * Float64(x_46_im * x_46_re))) - (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 <= -5e+102) || ~((x_46_im <= 2e+94))) tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)); else tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -5e+102], N[Not[LessEqual[x$46$im, 2e+94]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(3.0 * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5 \cdot 10^{+102} \lor \neg \left(x.im \leq 2 \cdot 10^{+94}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im \cdot \left(x.im + x.re\right)\right) \cdot \left(x.re - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.im \cdot x.re\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -5e102 or 2e94 < x.im Initial program 63.9%
+-commutative63.9%
*-commutative63.9%
fma-def68.7%
*-commutative68.7%
distribute-rgt-out68.7%
*-commutative68.7%
Simplified68.7%
fma-udef63.9%
distribute-lft-in63.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.3%
distribute-lft-in72.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+84.3%
difference-of-squares100.0%
associate-*r*100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 2e94Initial program 91.2%
+-commutative91.2%
*-commutative91.2%
sub-neg91.2%
distribute-lft-in91.2%
associate-+r+91.2%
distribute-rgt-neg-out91.2%
unsub-neg91.2%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.8%
Final simplification99.9%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* x.im (- x.im))))
(t_1 (+ (+ x.im x.im) (* x.im (- (* x.re x.re) (* x.im x.im))))))
(if (<= x.im -6.8e+161)
t_0
(if (<= x.im -1.05e-5)
t_1
(if (<= x.im -9.5e-34)
t_0
(if (<= x.im 3050.0) (* x.re (* x.im (* x.re 3.0))) t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_im * -x_46_im);
double t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)));
double tmp;
if (x_46_im <= -6.8e+161) {
tmp = t_0;
} else if (x_46_im <= -1.05e-5) {
tmp = t_1;
} else if (x_46_im <= -9.5e-34) {
tmp = t_0;
} else if (x_46_im <= 3050.0) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} 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_46im * (x_46im * -x_46im)
t_1 = (x_46im + x_46im) + (x_46im * ((x_46re * x_46re) - (x_46im * x_46im)))
if (x_46im <= (-6.8d+161)) then
tmp = t_0
else if (x_46im <= (-1.05d-5)) then
tmp = t_1
else if (x_46im <= (-9.5d-34)) then
tmp = t_0
else if (x_46im <= 3050.0d0) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
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_im * (x_46_im * -x_46_im);
double t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)));
double tmp;
if (x_46_im <= -6.8e+161) {
tmp = t_0;
} else if (x_46_im <= -1.05e-5) {
tmp = t_1;
} else if (x_46_im <= -9.5e-34) {
tmp = t_0;
} else if (x_46_im <= 3050.0) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * (x_46_im * -x_46_im) t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) tmp = 0 if x_46_im <= -6.8e+161: tmp = t_0 elif x_46_im <= -1.05e-5: tmp = t_1 elif x_46_im <= -9.5e-34: tmp = t_0 elif x_46_im <= 3050.0: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))) t_1 = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)))) tmp = 0.0 if (x_46_im <= -6.8e+161) tmp = t_0; elseif (x_46_im <= -1.05e-5) tmp = t_1; elseif (x_46_im <= -9.5e-34) tmp = t_0; elseif (x_46_im <= 3050.0) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); else tmp = t_1; 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); t_1 = (x_46_im + x_46_im) + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))); tmp = 0.0; if (x_46_im <= -6.8e+161) tmp = t_0; elseif (x_46_im <= -1.05e-5) tmp = t_1; elseif (x_46_im <= -9.5e-34) tmp = t_0; elseif (x_46_im <= 3050.0) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$im * (-x$46$im)), $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$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -6.8e+161], t$95$0, If[LessEqual[x$46$im, -1.05e-5], t$95$1, If[LessEqual[x$46$im, -9.5e-34], t$95$0, If[LessEqual[x$46$im, 3050.0], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
t_1 := \left(x.im + x.im\right) + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\
\mathbf{if}\;x.im \leq -6.8 \cdot 10^{+161}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq -1.05 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -9.5 \cdot 10^{-34}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 3050:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -6.79999999999999986e161 or -1.04999999999999994e-5 < x.im < -9.49999999999999985e-34Initial program 54.8%
+-commutative54.8%
*-commutative54.8%
sub-neg54.8%
distribute-lft-in54.8%
associate-+r+54.8%
distribute-rgt-neg-out54.8%
unsub-neg54.8%
associate-*r*54.8%
distribute-rgt-out54.8%
*-commutative54.8%
count-254.8%
distribute-lft1-in54.8%
metadata-eval54.8%
*-commutative54.8%
*-commutative54.8%
associate-*r*54.7%
cube-unmult54.7%
Simplified54.7%
Taylor expanded in x.re around 0 54.7%
Taylor expanded in x.re around 0 88.1%
neg-mul-188.1%
Simplified88.1%
unpow388.1%
Applied egg-rr88.1%
if -6.79999999999999986e161 < x.im < -1.04999999999999994e-5 or 3050 < x.im Initial program 88.9%
*-commutative88.9%
*-commutative88.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+82.9%
distribute-lft-in82.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+90.6%
Applied egg-rr90.6%
if -9.49999999999999985e-34 < x.im < 3050Initial program 86.8%
+-commutative86.8%
*-commutative86.8%
sub-neg86.8%
distribute-lft-in86.8%
associate-+r+86.8%
distribute-rgt-neg-out86.8%
unsub-neg86.8%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.8%
*-commutative99.8%
associate-*r*99.8%
expm1-log1p-u83.5%
expm1-udef55.9%
*-commutative55.9%
Applied egg-rr55.9%
expm1-def83.5%
expm1-log1p99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x.re around inf 73.4%
*-commutative73.4%
unpow273.4%
associate-*r*86.5%
associate-*r*86.4%
*-commutative86.4%
associate-*l*86.5%
*-commutative86.5%
Simplified86.5%
Final simplification88.4%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (+ x.im x.im) (* (* x.im (+ x.im x.re)) (- x.re x.im)))))
(if (<= x.im -9e-6)
t_0
(if (<= x.im -7e-34)
(* x.im (* x.im (- x.im)))
(if (<= x.im 85.0) (* x.re (* x.im (* x.re 3.0))) 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_im + x_46_re)) * (x_46_re - x_46_im));
double tmp;
if (x_46_im <= -9e-6) {
tmp = t_0;
} else if (x_46_im <= -7e-34) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else if (x_46_im <= 85.0) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} 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_46im + x_46re)) * (x_46re - x_46im))
if (x_46im <= (-9d-6)) then
tmp = t_0
else if (x_46im <= (-7d-34)) then
tmp = x_46im * (x_46im * -x_46im)
else if (x_46im <= 85.0d0) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
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_im + x_46_re)) * (x_46_re - x_46_im));
double tmp;
if (x_46_im <= -9e-6) {
tmp = t_0;
} else if (x_46_im <= -7e-34) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else if (x_46_im <= 85.0) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} 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_im + x_46_re)) * (x_46_re - x_46_im)) tmp = 0 if x_46_im <= -9e-6: tmp = t_0 elif x_46_im <= -7e-34: tmp = x_46_im * (x_46_im * -x_46_im) elif x_46_im <= 85.0: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) 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(Float64(x_46_im * Float64(x_46_im + x_46_re)) * Float64(x_46_re - x_46_im))) tmp = 0.0 if (x_46_im <= -9e-6) tmp = t_0; elseif (x_46_im <= -7e-34) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); elseif (x_46_im <= 85.0) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); 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_im + x_46_re)) * (x_46_re - x_46_im)); tmp = 0.0; if (x_46_im <= -9e-6) tmp = t_0; elseif (x_46_im <= -7e-34) tmp = x_46_im * (x_46_im * -x_46_im); elseif (x_46_im <= 85.0) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); 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[(N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -9e-6], t$95$0, If[LessEqual[x$46$im, -7e-34], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 85.0], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x.im + x.im\right) + \left(x.im \cdot \left(x.im + x.re\right)\right) \cdot \left(x.re - x.im\right)\\
\mathbf{if}\;x.im \leq -9 \cdot 10^{-6}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq -7 \cdot 10^{-34}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 85:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -9.00000000000000023e-6 or 85 < x.im Initial program 77.1%
+-commutative77.1%
*-commutative77.1%
fma-def80.2%
*-commutative80.2%
distribute-rgt-out80.2%
*-commutative80.2%
Simplified80.2%
fma-udef77.1%
distribute-lft-in77.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+77.1%
distribute-lft-in77.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+86.0%
difference-of-squares95.9%
associate-*r*95.9%
Applied egg-rr95.9%
if -9.00000000000000023e-6 < x.im < -7e-34Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in100.0%
associate-+r+100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
count-2100.0%
distribute-lft1-in100.0%
metadata-eval100.0%
*-commutative100.0%
*-commutative100.0%
associate-*r*99.9%
cube-unmult99.7%
Simplified99.7%
Taylor expanded in x.re around 0 99.9%
Taylor expanded in x.re around 0 81.8%
neg-mul-181.8%
Simplified81.8%
unpow382.0%
Applied egg-rr82.0%
if -7e-34 < x.im < 85Initial program 86.8%
+-commutative86.8%
*-commutative86.8%
sub-neg86.8%
distribute-lft-in86.8%
associate-+r+86.8%
distribute-rgt-neg-out86.8%
unsub-neg86.8%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.8%
*-commutative99.8%
associate-*r*99.8%
expm1-log1p-u83.5%
expm1-udef55.9%
*-commutative55.9%
Applied egg-rr55.9%
expm1-def83.5%
expm1-log1p99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x.re around inf 73.4%
*-commutative73.4%
unpow273.4%
associate-*r*86.5%
associate-*r*86.4%
*-commutative86.4%
associate-*l*86.5%
*-commutative86.5%
Simplified86.5%
Final simplification91.1%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -4e+57) (not (<= x.im 3.9e+45))) (+ (+ x.im x.im) (* (* x.im (+ x.im x.re)) (- x.re x.im))) (- (* x.re (* 3.0 (* x.im x.re))) (* x.im (* x.im x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -4e+57) || !(x_46_im <= 3.9e+45)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} else {
tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - (x_46_im * (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 <= (-4d+57)) .or. (.not. (x_46im <= 3.9d+45))) then
tmp = (x_46im + x_46im) + ((x_46im * (x_46im + x_46re)) * (x_46re - x_46im))
else
tmp = (x_46re * (3.0d0 * (x_46im * x_46re))) - (x_46im * (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 <= -4e+57) || !(x_46_im <= 3.9e+45)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} else {
tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - (x_46_im * (x_46_im * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -4e+57) or not (x_46_im <= 3.9e+45): tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)) else: tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - (x_46_im * (x_46_im * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -4e+57) || !(x_46_im <= 3.9e+45)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im * Float64(x_46_im + x_46_re)) * Float64(x_46_re - x_46_im))); else tmp = Float64(Float64(x_46_re * Float64(3.0 * Float64(x_46_im * x_46_re))) - Float64(x_46_im * 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 <= -4e+57) || ~((x_46_im <= 3.9e+45))) tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)); else tmp = (x_46_re * (3.0 * (x_46_im * x_46_re))) - (x_46_im * (x_46_im * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -4e+57], N[Not[LessEqual[x$46$im, 3.9e+45]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(3.0 * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4 \cdot 10^{+57} \lor \neg \left(x.im \leq 3.9 \cdot 10^{+45}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im \cdot \left(x.im + x.re\right)\right) \cdot \left(x.re - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.im \cdot x.re\right)\right) - x.im \cdot \left(x.im \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -4.00000000000000019e57 or 3.8999999999999999e45 < x.im Initial program 71.1%
+-commutative71.1%
*-commutative71.1%
fma-def74.9%
*-commutative74.9%
distribute-rgt-out74.9%
*-commutative74.9%
Simplified74.9%
fma-udef71.1%
distribute-lft-in71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+74.9%
distribute-lft-in74.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+87.4%
difference-of-squares99.9%
associate-*r*99.9%
Applied egg-rr99.9%
if -4.00000000000000019e57 < x.im < 3.8999999999999999e45Initial program 90.1%
+-commutative90.1%
*-commutative90.1%
sub-neg90.1%
distribute-lft-in90.1%
associate-+r+90.1%
distribute-rgt-neg-out90.1%
unsub-neg90.1%
associate-*r*99.7%
distribute-rgt-out99.7%
*-commutative99.7%
count-299.7%
distribute-lft1-in99.7%
metadata-eval99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in x.re around 0 99.8%
unpow350.8%
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -4.8e+57) (not (<= x.im 3.9e+45))) (+ (+ x.im x.im) (* (* x.im (+ x.im x.re)) (- x.re x.im))) (- (* 3.0 (* x.re (* x.im x.re))) (* x.im (* x.im x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -4.8e+57) || !(x_46_im <= 3.9e+45)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} else {
tmp = (3.0 * (x_46_re * (x_46_im * x_46_re))) - (x_46_im * (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 <= (-4.8d+57)) .or. (.not. (x_46im <= 3.9d+45))) then
tmp = (x_46im + x_46im) + ((x_46im * (x_46im + x_46re)) * (x_46re - x_46im))
else
tmp = (3.0d0 * (x_46re * (x_46im * x_46re))) - (x_46im * (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 <= -4.8e+57) || !(x_46_im <= 3.9e+45)) {
tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im));
} else {
tmp = (3.0 * (x_46_re * (x_46_im * x_46_re))) - (x_46_im * (x_46_im * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -4.8e+57) or not (x_46_im <= 3.9e+45): tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)) else: tmp = (3.0 * (x_46_re * (x_46_im * x_46_re))) - (x_46_im * (x_46_im * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -4.8e+57) || !(x_46_im <= 3.9e+45)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im * Float64(x_46_im + x_46_re)) * Float64(x_46_re - x_46_im))); else tmp = Float64(Float64(3.0 * Float64(x_46_re * Float64(x_46_im * x_46_re))) - Float64(x_46_im * 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 <= -4.8e+57) || ~((x_46_im <= 3.9e+45))) tmp = (x_46_im + x_46_im) + ((x_46_im * (x_46_im + x_46_re)) * (x_46_re - x_46_im)); else tmp = (3.0 * (x_46_re * (x_46_im * x_46_re))) - (x_46_im * (x_46_im * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -4.8e+57], N[Not[LessEqual[x$46$im, 3.9e+45]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.8 \cdot 10^{+57} \lor \neg \left(x.im \leq 3.9 \cdot 10^{+45}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im \cdot \left(x.im + x.re\right)\right) \cdot \left(x.re - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.im \cdot x.re\right)\right) - x.im \cdot \left(x.im \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -4.80000000000000009e57 or 3.8999999999999999e45 < x.im Initial program 71.1%
+-commutative71.1%
*-commutative71.1%
fma-def74.9%
*-commutative74.9%
distribute-rgt-out74.9%
*-commutative74.9%
Simplified74.9%
fma-udef71.1%
distribute-lft-in71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+74.9%
distribute-lft-in74.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+87.4%
difference-of-squares99.9%
associate-*r*99.9%
Applied egg-rr99.9%
if -4.80000000000000009e57 < x.im < 3.8999999999999999e45Initial program 90.1%
+-commutative90.1%
*-commutative90.1%
sub-neg90.1%
distribute-lft-in90.1%
associate-+r+90.1%
distribute-rgt-neg-out90.1%
unsub-neg90.1%
Simplified99.8%
unpow350.8%
Applied egg-rr99.7%
Final simplification99.8%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 2.3e+92) (* 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_re <= 2.3e+92) {
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_46re <= 2.3d+92) 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_re <= 2.3e+92) {
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_re <= 2.3e+92: 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_re <= 2.3e+92) 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_re <= 2.3e+92) 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[LessEqual[x$46$re, 2.3e+92], 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.re \leq 2.3 \cdot 10^{+92}:\\
\;\;\;\;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.re < 2.29999999999999998e92Initial program 88.7%
+-commutative88.7%
*-commutative88.7%
sub-neg88.7%
distribute-lft-in88.3%
associate-+r+88.3%
distribute-rgt-neg-out88.3%
unsub-neg88.3%
associate-*r*91.3%
distribute-rgt-out91.3%
*-commutative91.3%
count-291.3%
distribute-lft1-in91.3%
metadata-eval91.3%
*-commutative91.3%
*-commutative91.3%
associate-*r*91.3%
cube-unmult91.4%
Simplified91.4%
Taylor expanded in x.re around 0 91.4%
Taylor expanded in x.re around 0 72.1%
neg-mul-172.1%
Simplified72.1%
unpow372.1%
Applied egg-rr72.1%
if 2.29999999999999998e92 < x.re Initial program 51.7%
+-commutative51.7%
*-commutative51.7%
sub-neg51.7%
distribute-lft-in40.4%
associate-+r+40.4%
distribute-rgt-neg-out40.4%
unsub-neg40.4%
associate-*r*59.0%
distribute-rgt-out59.0%
*-commutative59.0%
count-259.0%
distribute-lft1-in59.0%
metadata-eval59.0%
*-commutative59.0%
*-commutative59.0%
associate-*r*59.0%
cube-unmult59.0%
Simplified59.0%
Taylor expanded in x.re around 0 59.0%
Taylor expanded in x.re around inf 58.6%
unpow258.6%
*-commutative58.6%
Simplified58.6%
Final simplification69.7%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 2.3e+92) (* x.im (* x.im (- x.im))) (* x.re (* x.im (* x.re 3.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= 2.3e+92) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re <= 2.3d+92) then
tmp = x_46im * (x_46im * -x_46im)
else
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= 2.3e+92) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= 2.3e+92: tmp = x_46_im * (x_46_im * -x_46_im) else: tmp = x_46_re * (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 <= 2.3e+92) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= 2.3e+92) tmp = x_46_im * (x_46_im * -x_46_im); else tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, 2.3e+92], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 2.3 \cdot 10^{+92}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\end{array}
\end{array}
if x.re < 2.29999999999999998e92Initial program 88.7%
+-commutative88.7%
*-commutative88.7%
sub-neg88.7%
distribute-lft-in88.3%
associate-+r+88.3%
distribute-rgt-neg-out88.3%
unsub-neg88.3%
associate-*r*91.3%
distribute-rgt-out91.3%
*-commutative91.3%
count-291.3%
distribute-lft1-in91.3%
metadata-eval91.3%
*-commutative91.3%
*-commutative91.3%
associate-*r*91.3%
cube-unmult91.4%
Simplified91.4%
Taylor expanded in x.re around 0 91.4%
Taylor expanded in x.re around 0 72.1%
neg-mul-172.1%
Simplified72.1%
unpow372.1%
Applied egg-rr72.1%
if 2.29999999999999998e92 < x.re Initial program 51.7%
+-commutative51.7%
*-commutative51.7%
sub-neg51.7%
distribute-lft-in40.4%
associate-+r+40.4%
distribute-rgt-neg-out40.4%
unsub-neg40.4%
associate-*r*59.0%
distribute-rgt-out59.0%
*-commutative59.0%
count-259.0%
distribute-lft1-in59.0%
metadata-eval59.0%
*-commutative59.0%
*-commutative59.0%
associate-*r*59.0%
cube-unmult59.0%
Simplified59.0%
Taylor expanded in x.re around 0 59.0%
*-commutative59.0%
associate-*r*59.0%
expm1-log1p-u29.0%
expm1-udef19.9%
*-commutative19.9%
Applied egg-rr19.9%
expm1-def29.0%
expm1-log1p59.0%
*-commutative59.0%
*-commutative59.0%
associate-*l*59.0%
Simplified59.0%
Taylor expanded in x.re around inf 58.6%
*-commutative58.6%
unpow258.6%
associate-*r*77.2%
associate-*r*77.2%
*-commutative77.2%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
Final simplification72.9%
(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 * Float64(-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 \left(-x.im\right)\right)
\end{array}
Initial program 82.4%
+-commutative82.4%
*-commutative82.4%
sub-neg82.4%
distribute-lft-in80.0%
associate-+r+80.0%
distribute-rgt-neg-out80.0%
unsub-neg80.0%
associate-*r*85.7%
distribute-rgt-out85.7%
*-commutative85.7%
count-285.7%
distribute-lft1-in85.7%
metadata-eval85.7%
*-commutative85.7%
*-commutative85.7%
associate-*r*85.7%
cube-unmult85.8%
Simplified85.8%
Taylor expanded in x.re around 0 85.8%
Taylor expanded in x.re around 0 63.8%
neg-mul-163.8%
Simplified63.8%
unpow363.7%
Applied egg-rr63.7%
Final simplification63.7%
(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 82.4%
Taylor expanded in x.re around 0 63.8%
Simplified2.7%
Final simplification2.7%
(FPCore (x.re x.im) :precision binary64 0.1)
double code(double x_46_re, double x_46_im) {
return 0.1;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 0.1d0
end function
public static double code(double x_46_re, double x_46_im) {
return 0.1;
}
def code(x_46_re, x_46_im): return 0.1
function code(x_46_re, x_46_im) return 0.1 end
function tmp = code(x_46_re, x_46_im) tmp = 0.1; end
code[x$46$re_, x$46$im_] := 0.1
\begin{array}{l}
\\
0.1
\end{array}
Initial program 82.4%
+-commutative82.4%
*-commutative82.4%
sub-neg82.4%
distribute-lft-in80.0%
associate-+r+80.0%
distribute-rgt-neg-out80.0%
unsub-neg80.0%
associate-*r*85.7%
distribute-rgt-out85.7%
*-commutative85.7%
count-285.7%
distribute-lft1-in85.7%
metadata-eval85.7%
*-commutative85.7%
*-commutative85.7%
associate-*r*85.7%
cube-unmult85.8%
Simplified85.8%
sub-neg85.8%
associate-*r*85.8%
associate-*l*85.8%
flip3-+16.2%
associate-*r*16.2%
associate-*r*16.2%
unpow-prod-down11.9%
pow211.9%
pow-pow11.9%
metadata-eval11.9%
Applied egg-rr11.9%
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 2023200
(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)))