
(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 -5e+102) (not (<= x.im 5e+76))) (+ (+ x.im x.im) (* (+ x.im x.re) (* x.im (- x.re x.im)))) (fma (* 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 <= 5e+76)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = fma((x_46_re * (x_46_im * x_46_re)), 3.0, -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 <= 5e+76)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im + x_46_re) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); else tmp = fma(Float64(x_46_re * Float64(x_46_im * x_46_re)), 3.0, Float64(-(x_46_im ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -5e+102], N[Not[LessEqual[x$46$im, 5e+76]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im + x$46$re), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * 3.0 + (-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 5 \cdot 10^{+76}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im + x.re\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x.re \cdot \left(x.im \cdot x.re\right), 3, -{x.im}^{3}\right)\\
\end{array}
\end{array}
if x.im < -5e102 or 4.99999999999999991e76 < x.im Initial program 60.0%
+-commutative60.0%
*-commutative60.0%
fma-def68.9%
*-commutative68.9%
distribute-rgt-out68.9%
*-commutative68.9%
Simplified68.9%
fma-udef60.0%
distribute-lft-in60.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+71.1%
distribute-lft-in71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+82.2%
*-commutative82.2%
difference-of-squares100.0%
associate-*l*100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 4.99999999999999991e76Initial program 92.9%
+-commutative92.9%
*-commutative92.9%
sub-neg92.9%
distribute-lft-in92.9%
associate-+r+92.9%
distribute-rgt-neg-out92.9%
unsub-neg92.9%
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%
associate-*r*99.8%
associate-*l*99.8%
fma-neg99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+102) (not (<= x.im 8e+79))) (+ (+ x.im x.im) (* (+ x.im x.re) (* x.im (- x.re x.im)))) (- (* 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 <= -5e+102) || !(x_46_im <= 8e+79)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
} 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 <= (-5d+102)) .or. (.not. (x_46im <= 8d+79))) then
tmp = (x_46im + x_46im) + ((x_46im + x_46re) * (x_46im * (x_46re - x_46im)))
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 <= -5e+102) || !(x_46_im <= 8e+79)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
} 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 <= -5e+102) or not (x_46_im <= 8e+79): tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))) 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 <= -5e+102) || !(x_46_im <= 8e+79)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im + x_46_re) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); 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 <= -5e+102) || ~((x_46_im <= 8e+79))) tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))); 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, -5e+102], N[Not[LessEqual[x$46$im, 8e+79]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im + x$46$re), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $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 -5 \cdot 10^{+102} \lor \neg \left(x.im \leq 8 \cdot 10^{+79}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im + x.re\right) \cdot \left(x.im \cdot \left(x.re - x.im\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 < -5e102 or 7.99999999999999974e79 < x.im Initial program 60.0%
+-commutative60.0%
*-commutative60.0%
fma-def68.9%
*-commutative68.9%
distribute-rgt-out68.9%
*-commutative68.9%
Simplified68.9%
fma-udef60.0%
distribute-lft-in60.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+71.1%
distribute-lft-in71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+82.2%
*-commutative82.2%
difference-of-squares100.0%
associate-*l*100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 7.99999999999999974e79Initial program 92.9%
+-commutative92.9%
*-commutative92.9%
sub-neg92.9%
distribute-lft-in92.9%
associate-+r+92.9%
distribute-rgt-neg-out92.9%
unsub-neg92.9%
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%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+102) (not (<= x.im 2e+79))) (+ (+ x.im x.im) (* (+ x.im x.re) (* x.im (- x.re x.im)))) (- (* 3.0 (* x.re (* 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+79)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = (3.0 * (x_46_re * (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+79))) then
tmp = (x_46im + x_46im) + ((x_46im + x_46re) * (x_46im * (x_46re - x_46im)))
else
tmp = (3.0d0 * (x_46re * (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+79)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
} else {
tmp = (3.0 * (x_46_re * (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+79): tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))) else: tmp = (3.0 * (x_46_re * (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+79)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im + x_46_re) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); else tmp = Float64(Float64(3.0 * Float64(x_46_re * 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+79))) tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))); else tmp = (3.0 * (x_46_re * (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+79]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im + x$46$re), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[(x$46$re * 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^{+79}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im + x.re\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.im \cdot x.re\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -5e102 or 1.99999999999999993e79 < x.im Initial program 60.0%
+-commutative60.0%
*-commutative60.0%
fma-def68.9%
*-commutative68.9%
distribute-rgt-out68.9%
*-commutative68.9%
Simplified68.9%
fma-udef60.0%
distribute-lft-in60.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+71.1%
distribute-lft-in71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+82.2%
*-commutative82.2%
difference-of-squares100.0%
associate-*l*100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 1.99999999999999993e79Initial program 92.9%
+-commutative92.9%
*-commutative92.9%
sub-neg92.9%
distribute-lft-in92.9%
associate-+r+92.9%
distribute-rgt-neg-out92.9%
unsub-neg92.9%
Simplified99.8%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+102) (not (<= x.im 1150000000000.0))) (+ (+ x.im x.im) (* (+ x.im x.re) (* x.im (- 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 <= -5e+102) || !(x_46_im <= 1150000000000.0)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (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 <= (-5d+102)) .or. (.not. (x_46im <= 1150000000000.0d0))) then
tmp = (x_46im + x_46im) + ((x_46im + x_46re) * (x_46im * (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 <= -5e+102) || !(x_46_im <= 1150000000000.0)) {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (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 <= -5e+102) or not (x_46_im <= 1150000000000.0): tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (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 <= -5e+102) || !(x_46_im <= 1150000000000.0)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im + x_46_re) * Float64(x_46_im * 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 <= -5e+102) || ~((x_46_im <= 1150000000000.0))) tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (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, -5e+102], N[Not[LessEqual[x$46$im, 1150000000000.0]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im + x$46$re), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $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 -5 \cdot 10^{+102} \lor \neg \left(x.im \leq 1150000000000\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im + x.re\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\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 < -5e102 or 1.15e12 < x.im Initial program 65.6%
+-commutative65.6%
*-commutative65.6%
fma-def73.3%
*-commutative73.3%
distribute-rgt-out73.3%
*-commutative73.3%
Simplified73.3%
fma-udef65.6%
distribute-lft-in65.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+74.2%
distribute-lft-in74.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+84.7%
*-commutative84.7%
difference-of-squares99.9%
associate-*l*99.9%
Applied egg-rr99.9%
if -5e102 < x.im < 1.15e12Initial program 92.3%
+-commutative92.3%
*-commutative92.3%
sub-neg92.3%
distribute-lft-in92.3%
associate-+r+92.3%
distribute-rgt-neg-out92.3%
unsub-neg92.3%
associate-*r*99.8%
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%
sub-neg99.8%
*-commutative99.8%
associate-*l*99.7%
Applied egg-rr99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*r*92.2%
cube-mult92.2%
distribute-lft-out--92.2%
*-commutative92.2%
*-commutative92.2%
Applied egg-rr92.2%
sub-neg92.2%
distribute-rgt-in92.2%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.2%
associate-*r*99.8%
distribute-rgt-neg-in99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -7.5e+154)
(* x.re (* x.im (* x.re 3.0)))
(if (<= x.re 3.85e+152)
(* x.im (- (* x.re (* x.re 3.0)) (* x.im x.im)))
(+ (+ x.im x.im) (* (+ x.im x.re) (* x.im (- x.re x.im)))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -7.5e+154) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else if (x_46_re <= 3.85e+152) {
tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re <= (-7.5d+154)) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
else if (x_46re <= 3.85d+152) then
tmp = x_46im * ((x_46re * (x_46re * 3.0d0)) - (x_46im * x_46im))
else
tmp = (x_46im + x_46im) + ((x_46im + x_46re) * (x_46im * (x_46re - x_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -7.5e+154) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else if (x_46_re <= 3.85e+152) {
tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -7.5e+154: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) elif x_46_re <= 3.85e+152: tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im)) else: tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -7.5e+154) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); elseif (x_46_re <= 3.85e+152) tmp = Float64(x_46_im * Float64(Float64(x_46_re * Float64(x_46_re * 3.0)) - Float64(x_46_im * x_46_im))); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im + x_46_re) * Float64(x_46_im * Float64(x_46_re - x_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -7.5e+154) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); elseif (x_46_re <= 3.85e+152) tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im)); else tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -7.5e+154], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 3.85e+152], N[(x$46$im * N[(N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im + x$46$re), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+154}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{elif}\;x.re \leq 3.85 \cdot 10^{+152}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right) - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im + x.re\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -7.5000000000000004e154Initial program 48.6%
+-commutative48.6%
*-commutative48.6%
sub-neg48.6%
distribute-lft-in38.1%
associate-+r+38.1%
distribute-rgt-neg-out38.1%
unsub-neg38.1%
associate-*r*60.4%
distribute-rgt-out60.4%
*-commutative60.4%
count-260.4%
distribute-lft1-in60.4%
metadata-eval60.4%
*-commutative60.4%
*-commutative60.4%
associate-*r*60.4%
cube-unmult60.4%
Simplified60.4%
sub-neg60.4%
*-commutative60.4%
associate-*l*60.3%
Applied egg-rr60.3%
unsub-neg60.3%
*-commutative60.3%
associate-*r*38.1%
cube-mult38.1%
distribute-lft-out--48.6%
*-commutative48.6%
*-commutative48.6%
Applied egg-rr48.6%
Taylor expanded in x.im around 0 69.6%
associate-*r*69.6%
*-commutative69.6%
unpow269.6%
associate-*r*69.6%
associate-*l*91.9%
*-commutative91.9%
Simplified91.9%
if -7.5000000000000004e154 < x.re < 3.84999999999999984e152Initial program 89.6%
+-commutative89.6%
*-commutative89.6%
sub-neg89.6%
distribute-lft-in89.6%
associate-+r+89.6%
distribute-rgt-neg-out89.6%
unsub-neg89.6%
associate-*r*89.6%
distribute-rgt-out89.6%
*-commutative89.6%
count-289.6%
distribute-lft1-in89.6%
metadata-eval89.6%
*-commutative89.6%
*-commutative89.6%
associate-*r*89.5%
cube-unmult89.6%
Simplified89.6%
sub-neg89.6%
*-commutative89.6%
associate-*l*89.6%
Applied egg-rr89.6%
unsub-neg89.6%
*-commutative89.6%
associate-*r*89.6%
cube-mult89.5%
distribute-lft-out--99.7%
*-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
if 3.84999999999999984e152 < x.re Initial program 64.3%
+-commutative64.3%
*-commutative64.3%
fma-def64.3%
*-commutative64.3%
distribute-rgt-out64.3%
*-commutative64.3%
Simplified64.3%
fma-udef64.3%
distribute-lft-in64.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+64.3%
distribute-lft-in64.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+64.3%
*-commutative64.3%
difference-of-squares87.1%
associate-*l*88.8%
Applied egg-rr88.8%
Final simplification97.6%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.re -1.1e+72)
(not
(or (<= x.re -2.4e+23)
(and (not (<= x.re -5.6e-64)) (<= x.re 9.2e+59)))))
(* 3.0 (* x.im (* x.re x.re)))
(* x.im (* x.im (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -1.1e+72) || !((x_46_re <= -2.4e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 9.2e+59)))) {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
} else {
tmp = 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_46re <= (-1.1d+72)) .or. (.not. (x_46re <= (-2.4d+23)) .or. (.not. (x_46re <= (-5.6d-64))) .and. (x_46re <= 9.2d+59))) then
tmp = 3.0d0 * (x_46im * (x_46re * x_46re))
else
tmp = 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_re <= -1.1e+72) || !((x_46_re <= -2.4e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 9.2e+59)))) {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
} else {
tmp = x_46_im * (x_46_im * -x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -1.1e+72) or not ((x_46_re <= -2.4e+23) or (not (x_46_re <= -5.6e-64) and (x_46_re <= 9.2e+59))): tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)) else: tmp = 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_re <= -1.1e+72) || !((x_46_re <= -2.4e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 9.2e+59)))) tmp = Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -1.1e+72) || ~(((x_46_re <= -2.4e+23) || (~((x_46_re <= -5.6e-64)) && (x_46_re <= 9.2e+59))))) tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)); else tmp = 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$re, -1.1e+72], N[Not[Or[LessEqual[x$46$re, -2.4e+23], And[N[Not[LessEqual[x$46$re, -5.6e-64]], $MachinePrecision], LessEqual[x$46$re, 9.2e+59]]]], $MachinePrecision]], N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.1 \cdot 10^{+72} \lor \neg \left(x.re \leq -2.4 \cdot 10^{+23} \lor \neg \left(x.re \leq -5.6 \cdot 10^{-64}\right) \land x.re \leq 9.2 \cdot 10^{+59}\right):\\
\;\;\;\;3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -1.1e72 or -2.4e23 < x.re < -5.60000000000000008e-64 or 9.20000000000000032e59 < x.re Initial program 67.6%
+-commutative67.6%
*-commutative67.6%
sub-neg67.6%
distribute-lft-in61.0%
associate-+r+61.0%
distribute-rgt-neg-out61.0%
unsub-neg61.0%
associate-*r*70.3%
distribute-rgt-out70.3%
*-commutative70.3%
count-270.3%
distribute-lft1-in70.3%
metadata-eval70.3%
*-commutative70.3%
*-commutative70.3%
associate-*r*70.2%
cube-unmult70.2%
Simplified70.2%
associate-*r*70.3%
associate-*l*70.4%
fma-neg70.4%
Applied egg-rr70.4%
Taylor expanded in x.re around inf 70.9%
*-commutative70.9%
unpow270.9%
Simplified70.9%
if -1.1e72 < x.re < -2.4e23 or -5.60000000000000008e-64 < x.re < 9.20000000000000032e59Initial program 93.9%
+-commutative93.9%
*-commutative93.9%
sub-neg93.9%
distribute-lft-in93.9%
associate-+r+93.9%
distribute-rgt-neg-out93.9%
unsub-neg93.9%
associate-*r*93.8%
distribute-rgt-out93.9%
*-commutative93.9%
count-293.9%
distribute-lft1-in93.9%
metadata-eval93.9%
*-commutative93.9%
*-commutative93.9%
associate-*r*93.9%
cube-unmult94.0%
Simplified94.0%
sub-neg94.0%
*-commutative94.0%
associate-*l*94.0%
Applied egg-rr94.0%
unsub-neg94.0%
*-commutative94.0%
associate-*r*94.0%
cube-mult93.9%
distribute-lft-out--99.8%
*-commutative99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around 0 91.5%
unpow291.5%
mul-1-neg91.5%
distribute-rgt-neg-out91.5%
Simplified91.5%
Final simplification81.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* x.im (* x.re 3.0)))) (t_1 (* x.im (* x.im (- x.im)))))
(if (<= x.re -7.5e+71)
t_0
(if (<= x.re -3.4e+23)
t_1
(if (<= x.re -5.6e-64)
(* 3.0 (* x.im (* x.re x.re)))
(if (<= x.re 3.5e+60) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_im * (x_46_re * 3.0));
double t_1 = x_46_im * (x_46_im * -x_46_im);
double tmp;
if (x_46_re <= -7.5e+71) {
tmp = t_0;
} else if (x_46_re <= -3.4e+23) {
tmp = t_1;
} else if (x_46_re <= -5.6e-64) {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
} else if (x_46_re <= 3.5e+60) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x_46re * (x_46im * (x_46re * 3.0d0))
t_1 = x_46im * (x_46im * -x_46im)
if (x_46re <= (-7.5d+71)) then
tmp = t_0
else if (x_46re <= (-3.4d+23)) then
tmp = t_1
else if (x_46re <= (-5.6d-64)) then
tmp = 3.0d0 * (x_46im * (x_46re * x_46re))
else if (x_46re <= 3.5d+60) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_im * (x_46_re * 3.0));
double t_1 = x_46_im * (x_46_im * -x_46_im);
double tmp;
if (x_46_re <= -7.5e+71) {
tmp = t_0;
} else if (x_46_re <= -3.4e+23) {
tmp = t_1;
} else if (x_46_re <= -5.6e-64) {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
} else if (x_46_re <= 3.5e+60) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * (x_46_im * (x_46_re * 3.0)) t_1 = x_46_im * (x_46_im * -x_46_im) tmp = 0 if x_46_re <= -7.5e+71: tmp = t_0 elif x_46_re <= -3.4e+23: tmp = t_1 elif x_46_re <= -5.6e-64: tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)) elif x_46_re <= 3.5e+60: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))) t_1 = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))) tmp = 0.0 if (x_46_re <= -7.5e+71) tmp = t_0; elseif (x_46_re <= -3.4e+23) tmp = t_1; elseif (x_46_re <= -5.6e-64) tmp = Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))); elseif (x_46_re <= 3.5e+60) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_re * (x_46_im * (x_46_re * 3.0)); t_1 = x_46_im * (x_46_im * -x_46_im); tmp = 0.0; if (x_46_re <= -7.5e+71) tmp = t_0; elseif (x_46_re <= -3.4e+23) tmp = t_1; elseif (x_46_re <= -5.6e-64) tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)); elseif (x_46_re <= 3.5e+60) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -7.5e+71], t$95$0, If[LessEqual[x$46$re, -3.4e+23], t$95$1, If[LessEqual[x$46$re, -5.6e-64], N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 3.5e+60], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
t_1 := x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -3.4 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq -5.6 \cdot 10^{-64}:\\
\;\;\;\;3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{elif}\;x.re \leq 3.5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.re < -7.50000000000000007e71 or 3.5000000000000002e60 < x.re Initial program 60.5%
+-commutative60.5%
*-commutative60.5%
sub-neg60.5%
distribute-lft-in52.5%
associate-+r+52.5%
distribute-rgt-neg-out52.5%
unsub-neg52.5%
associate-*r*63.9%
distribute-rgt-out63.8%
*-commutative63.8%
count-263.8%
distribute-lft1-in63.8%
metadata-eval63.8%
*-commutative63.8%
*-commutative63.8%
associate-*r*63.8%
cube-unmult63.8%
Simplified63.8%
sub-neg63.8%
*-commutative63.8%
associate-*l*63.7%
Applied egg-rr63.7%
unsub-neg63.7%
*-commutative63.7%
associate-*r*52.5%
cube-mult52.5%
distribute-lft-out--72.5%
*-commutative72.5%
*-commutative72.5%
Applied egg-rr72.5%
Taylor expanded in x.im around 0 70.5%
associate-*r*70.5%
*-commutative70.5%
unpow270.5%
associate-*r*70.5%
associate-*l*81.7%
*-commutative81.7%
Simplified81.7%
if -7.50000000000000007e71 < x.re < -3.39999999999999992e23 or -5.60000000000000008e-64 < x.re < 3.5000000000000002e60Initial program 93.9%
+-commutative93.9%
*-commutative93.9%
sub-neg93.9%
distribute-lft-in93.9%
associate-+r+93.9%
distribute-rgt-neg-out93.9%
unsub-neg93.9%
associate-*r*93.8%
distribute-rgt-out93.9%
*-commutative93.9%
count-293.9%
distribute-lft1-in93.9%
metadata-eval93.9%
*-commutative93.9%
*-commutative93.9%
associate-*r*93.9%
cube-unmult94.0%
Simplified94.0%
sub-neg94.0%
*-commutative94.0%
associate-*l*94.0%
Applied egg-rr94.0%
unsub-neg94.0%
*-commutative94.0%
associate-*r*94.0%
cube-mult93.9%
distribute-lft-out--99.8%
*-commutative99.8%
*-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around 0 91.5%
unpow291.5%
mul-1-neg91.5%
distribute-rgt-neg-out91.5%
Simplified91.5%
if -3.39999999999999992e23 < x.re < -5.60000000000000008e-64Initial program 99.7%
+-commutative99.7%
*-commutative99.7%
sub-neg99.7%
distribute-lft-in99.7%
associate-+r+99.8%
distribute-rgt-neg-out99.8%
unsub-neg99.8%
associate-*r*99.8%
distribute-rgt-out99.5%
*-commutative99.5%
count-299.5%
distribute-lft1-in99.5%
metadata-eval99.5%
*-commutative99.5%
*-commutative99.5%
associate-*r*99.5%
cube-unmult99.6%
Simplified99.6%
associate-*r*99.6%
associate-*l*99.9%
fma-neg99.9%
Applied egg-rr99.9%
Taylor expanded in x.re around inf 72.7%
*-commutative72.7%
unpow272.7%
Simplified72.7%
Final simplification86.1%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -7.5e+154) (not (<= x.re 9.5e+149))) (* x.re (* x.im (* x.re 3.0))) (* x.im (- (* x.re (* x.re 3.0)) (* x.im x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7.5e+154) || !(x_46_re <= 9.5e+149)) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else {
tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46re <= (-7.5d+154)) .or. (.not. (x_46re <= 9.5d+149))) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
else
tmp = x_46im * ((x_46re * (x_46re * 3.0d0)) - (x_46im * x_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7.5e+154) || !(x_46_re <= 9.5e+149)) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else {
tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -7.5e+154) or not (x_46_re <= 9.5e+149): tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) else: tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -7.5e+154) || !(x_46_re <= 9.5e+149)) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); else tmp = Float64(x_46_im * Float64(Float64(x_46_re * Float64(x_46_re * 3.0)) - Float64(x_46_im * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -7.5e+154) || ~((x_46_re <= 9.5e+149))) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); else tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (x_46_im * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -7.5e+154], N[Not[LessEqual[x$46$re, 9.5e+149]], $MachinePrecision]], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+154} \lor \neg \left(x.re \leq 9.5 \cdot 10^{+149}\right):\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right) - x.im \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < -7.5000000000000004e154 or 9.49999999999999973e149 < x.re Initial program 55.1%
+-commutative55.1%
*-commutative55.1%
sub-neg55.1%
distribute-lft-in42.0%
associate-+r+42.0%
distribute-rgt-neg-out42.0%
unsub-neg42.0%
associate-*r*60.6%
distribute-rgt-out60.6%
*-commutative60.6%
count-260.6%
distribute-lft1-in60.6%
metadata-eval60.6%
*-commutative60.6%
*-commutative60.6%
associate-*r*60.6%
cube-unmult60.6%
Simplified60.6%
sub-neg60.6%
*-commutative60.6%
associate-*l*60.5%
Applied egg-rr60.5%
unsub-neg60.5%
*-commutative60.5%
associate-*r*42.0%
cube-mult42.0%
distribute-lft-out--55.1%
*-commutative55.1%
*-commutative55.1%
Applied egg-rr55.1%
Taylor expanded in x.im around 0 71.5%
associate-*r*71.5%
*-commutative71.5%
unpow271.5%
associate-*r*71.5%
associate-*l*90.0%
*-commutative90.0%
Simplified90.0%
if -7.5000000000000004e154 < x.re < 9.49999999999999973e149Initial program 89.6%
+-commutative89.6%
*-commutative89.6%
sub-neg89.6%
distribute-lft-in89.6%
associate-+r+89.6%
distribute-rgt-neg-out89.6%
unsub-neg89.6%
associate-*r*89.6%
distribute-rgt-out89.5%
*-commutative89.5%
count-289.5%
distribute-lft1-in89.5%
metadata-eval89.5%
*-commutative89.5%
*-commutative89.5%
associate-*r*89.5%
cube-unmult89.6%
Simplified89.6%
sub-neg89.6%
*-commutative89.6%
associate-*l*89.6%
Applied egg-rr89.6%
unsub-neg89.6%
*-commutative89.6%
associate-*r*89.6%
cube-mult89.5%
distribute-lft-out--99.7%
*-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
Final simplification97.4%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -5e+153) (not (<= x.re 4.4e+149))) (* 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_re <= -5e+153) || !(x_46_re <= 4.4e+149)) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = 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_46re <= (-5d+153)) .or. (.not. (x_46re <= 4.4d+149))) then
tmp = x_46re * (x_46im * x_46re)
else
tmp = 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_re <= -5e+153) || !(x_46_re <= 4.4e+149)) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = x_46_im * (x_46_im * -x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -5e+153) or not (x_46_re <= 4.4e+149): tmp = x_46_re * (x_46_im * x_46_re) else: tmp = 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_re <= -5e+153) || !(x_46_re <= 4.4e+149)) tmp = Float64(x_46_re * Float64(x_46_im * x_46_re)); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -5e+153) || ~((x_46_re <= 4.4e+149))) tmp = x_46_re * (x_46_im * x_46_re); else tmp = 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$re, -5e+153], N[Not[LessEqual[x$46$re, 4.4e+149]], $MachinePrecision]], N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5 \cdot 10^{+153} \lor \neg \left(x.re \leq 4.4 \cdot 10^{+149}\right):\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -5.00000000000000018e153 or 4.4e149 < x.re Initial program 55.8%
Taylor expanded in x.re around inf 71.9%
Simplified71.9%
add-log-exp70.4%
+-commutative70.4%
exp-sum70.4%
Applied egg-rr73.1%
if -5.00000000000000018e153 < x.re < 4.4e149Initial program 89.5%
+-commutative89.5%
*-commutative89.5%
sub-neg89.5%
distribute-lft-in89.5%
associate-+r+89.5%
distribute-rgt-neg-out89.5%
unsub-neg89.5%
associate-*r*89.5%
distribute-rgt-out89.5%
*-commutative89.5%
count-289.5%
distribute-lft1-in89.5%
metadata-eval89.5%
*-commutative89.5%
*-commutative89.5%
associate-*r*89.4%
cube-unmult89.5%
Simplified89.5%
sub-neg89.5%
*-commutative89.5%
associate-*l*89.5%
Applied egg-rr89.5%
unsub-neg89.5%
*-commutative89.5%
associate-*r*89.5%
cube-mult89.4%
distribute-lft-out--99.7%
*-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 72.8%
unpow272.8%
mul-1-neg72.8%
distribute-rgt-neg-out72.8%
Simplified72.8%
Final simplification72.9%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 2e+213) (* x.re (* x.im x.re)) (* x.im (* x.re 2.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2e+213) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = x_46_im * (x_46_re * 2.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 <= 2d+213) then
tmp = x_46re * (x_46im * x_46re)
else
tmp = x_46im * (x_46re * 2.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 <= 2e+213) {
tmp = x_46_re * (x_46_im * x_46_re);
} else {
tmp = x_46_im * (x_46_re * 2.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 2e+213: tmp = x_46_re * (x_46_im * x_46_re) else: tmp = x_46_im * (x_46_re * 2.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 2e+213) tmp = Float64(x_46_re * Float64(x_46_im * x_46_re)); else tmp = Float64(x_46_im * Float64(x_46_re * 2.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 2e+213) tmp = x_46_re * (x_46_im * x_46_re); else tmp = x_46_im * (x_46_re * 2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 2e+213], N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2 \cdot 10^{+213}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot 2\right)\\
\end{array}
\end{array}
if x.im < 1.99999999999999997e213Initial program 85.3%
Taylor expanded in x.re around inf 54.6%
Simplified54.6%
add-log-exp34.9%
+-commutative34.9%
exp-sum34.9%
Applied egg-rr37.0%
if 1.99999999999999997e213 < x.im Initial program 31.6%
*-commutative31.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+63.2%
*-commutative63.2%
distribute-lft-in63.2%
Applied egg-rr63.2%
Taylor expanded in x.re around inf 1.2%
unpow21.2%
associate-*r*1.2%
+-commutative1.2%
distribute-rgt-out6.5%
*-commutative6.5%
Simplified6.5%
Taylor expanded in x.re around 0 28.4%
associate-*r*28.4%
Simplified28.4%
Final simplification36.3%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.re 2.0)))
double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * 2.0);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * (x_46re * 2.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * 2.0);
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_re * 2.0)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_re * 2.0)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_re * 2.0); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$re * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.re \cdot 2\right)
\end{array}
Initial program 81.3%
*-commutative81.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+63.4%
*-commutative63.4%
distribute-lft-in63.4%
Applied egg-rr63.4%
Taylor expanded in x.re around inf 27.1%
unpow227.1%
associate-*r*27.7%
+-commutative27.7%
distribute-rgt-out32.8%
*-commutative32.8%
Simplified32.8%
Taylor expanded in x.re around 0 19.6%
associate-*r*19.6%
Simplified19.6%
Final simplification19.6%
(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 81.3%
+-commutative81.3%
*-commutative81.3%
fma-def84.5%
*-commutative84.5%
distribute-rgt-out84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in x.re around 0 57.8%
Simplified2.8%
Final simplification2.8%
(FPCore (x.re x.im) :precision binary64 0.125)
double code(double x_46_re, double x_46_im) {
return 0.125;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 0.125d0
end function
public static double code(double x_46_re, double x_46_im) {
return 0.125;
}
def code(x_46_re, x_46_im): return 0.125
function code(x_46_re, x_46_im) return 0.125 end
function tmp = code(x_46_re, x_46_im) tmp = 0.125; end
code[x$46$re_, x$46$im_] := 0.125
\begin{array}{l}
\\
0.125
\end{array}
Initial program 81.3%
+-commutative81.3%
*-commutative81.3%
sub-neg81.3%
distribute-lft-in78.2%
associate-+r+78.2%
distribute-rgt-neg-out78.2%
unsub-neg78.2%
associate-*r*82.6%
distribute-rgt-out82.6%
*-commutative82.6%
count-282.6%
distribute-lft1-in82.6%
metadata-eval82.6%
*-commutative82.6%
*-commutative82.6%
associate-*r*82.6%
cube-unmult82.7%
Simplified82.7%
sub-neg82.7%
associate-*r*82.7%
associate-*l*82.7%
flip3-+15.6%
associate-*r*15.2%
associate-*r*15.2%
unpow-prod-down8.9%
pow28.9%
pow-pow8.9%
metadata-eval8.9%
Applied egg-rr8.8%
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 2023174
(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)))