
(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 16 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 -6.2e+110) (not (<= x.im 7.8e+69))) (* 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 <= -6.2e+110) || !(x_46_im <= 7.8e+69)) {
tmp = 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 <= (-6.2d+110)) .or. (.not. (x_46im <= 7.8d+69))) then
tmp = 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 <= -6.2e+110) || !(x_46_im <= 7.8e+69)) {
tmp = 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 <= -6.2e+110) or not (x_46_im <= 7.8e+69): tmp = 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 <= -6.2e+110) || !(x_46_im <= 7.8e+69)) tmp = Float64(x_46_im * Float64(Float64(x_46_re + 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 <= -6.2e+110) || ~((x_46_im <= 7.8e+69))) tmp = 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, -6.2e+110], N[Not[LessEqual[x$46$im, 7.8e+69]], $MachinePrecision]], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $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 -6.2 \cdot 10^{+110} \lor \neg \left(x.im \leq 7.8 \cdot 10^{+69}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \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 < -6.20000000000000035e110 or 7.7999999999999998e69 < x.im Initial program 63.2%
*-commutative63.2%
*-commutative63.2%
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-+67.4%
Applied egg-rr67.4%
+-commutative67.4%
add-cube-cbrt67.4%
fma-def67.4%
Applied egg-rr0.0%
Simplified100.0%
if -6.20000000000000035e110 < x.im < 7.7999999999999998e69Initial program 88.8%
+-commutative88.8%
*-commutative88.8%
distribute-lft-out88.8%
associate-*l*88.7%
*-commutative88.7%
distribute-lft-out88.7%
associate-+r-88.7%
distribute-lft-out--88.7%
Simplified88.8%
sub-neg88.8%
associate-*l*88.9%
associate-*l*99.8%
Applied egg-rr99.8%
Final simplification99.9%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(fma (+ x.re x.im) (* x.im (- x.re x.im)) (* x.re (* x.re (+ 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_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = fma((x_46_re + x_46_im), (x_46_im * (x_46_re - x_46_im)), (x_46_re * (x_46_re * (x_46_im + x_46_im))));
} else {
tmp = 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 (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_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = fma(Float64(x_46_re + x_46_im), Float64(x_46_im * Float64(x_46_re - x_46_im)), Float64(x_46_re * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[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$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x.re + x.im, x.im \cdot \left(x.re - x.im\right), x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\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 91.8%
*-commutative91.8%
*-commutative91.8%
difference-of-squares91.8%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-lft-out99.8%
Simplified99.8%
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%
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-+20.0%
Applied egg-rr20.0%
+-commutative20.0%
add-cube-cbrt20.0%
fma-def20.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* (+ x.re x.im) (- x.re x.im)))))
(if (<= x.im -2.5e-52)
t_0
(if (<= x.im 2.12e-100)
(* x.re (* x.im (* x.re 3.0)))
(if (<= x.im 1e+60)
(- (* (* x.re x.re) (* x.im 3.0)) (pow x.im 3.0))
t_0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
double tmp;
if (x_46_im <= -2.5e-52) {
tmp = t_0;
} else if (x_46_im <= 2.12e-100) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else if (x_46_im <= 1e+60) {
tmp = ((x_46_re * x_46_re) * (x_46_im * 3.0)) - pow(x_46_im, 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_46re + x_46im) * (x_46re - x_46im))
if (x_46im <= (-2.5d-52)) then
tmp = t_0
else if (x_46im <= 2.12d-100) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
else if (x_46im <= 1d+60) then
tmp = ((x_46re * x_46re) * (x_46im * 3.0d0)) - (x_46im ** 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_re + x_46_im) * (x_46_re - x_46_im));
double tmp;
if (x_46_im <= -2.5e-52) {
tmp = t_0;
} else if (x_46_im <= 2.12e-100) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else if (x_46_im <= 1e+60) {
tmp = ((x_46_re * x_46_re) * (x_46_im * 3.0)) - Math.pow(x_46_im, 3.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)) tmp = 0 if x_46_im <= -2.5e-52: tmp = t_0 elif x_46_im <= 2.12e-100: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) elif x_46_im <= 1e+60: tmp = ((x_46_re * x_46_re) * (x_46_im * 3.0)) - math.pow(x_46_im, 3.0) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))) tmp = 0.0 if (x_46_im <= -2.5e-52) tmp = t_0; elseif (x_46_im <= 2.12e-100) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); elseif (x_46_im <= 1e+60) tmp = Float64(Float64(Float64(x_46_re * x_46_re) * Float64(x_46_im * 3.0)) - (x_46_im ^ 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_re + x_46_im) * (x_46_re - x_46_im)); tmp = 0.0; if (x_46_im <= -2.5e-52) tmp = t_0; elseif (x_46_im <= 2.12e-100) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); elseif (x_46_im <= 1e+60) tmp = ((x_46_re * x_46_re) * (x_46_im * 3.0)) - (x_46_im ^ 3.0); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.5e-52], t$95$0, If[LessEqual[x$46$im, 2.12e-100], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1e+60], N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\mathbf{if}\;x.im \leq -2.5 \cdot 10^{-52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 2.12 \cdot 10^{-100}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{elif}\;x.im \leq 10^{+60}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.im \cdot 3\right) - {x.im}^{3}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -2.5e-52 or 9.9999999999999995e59 < x.im Initial program 71.3%
*-commutative71.3%
*-commutative71.3%
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-+72.5%
Applied egg-rr72.5%
+-commutative72.5%
add-cube-cbrt72.5%
fma-def72.5%
Applied egg-rr0.0%
Simplified98.4%
if -2.5e-52 < x.im < 2.1200000000000001e-100Initial program 82.8%
+-commutative82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-*l*82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-+r-82.8%
distribute-lft-out--82.8%
Simplified82.7%
sub-neg82.7%
associate-*l*82.8%
associate-*l*99.7%
Applied egg-rr99.7%
unsub-neg99.7%
associate-*r*82.8%
Applied egg-rr82.8%
Taylor expanded in x.re around inf 80.1%
Simplified80.1%
Taylor expanded in x.im around 0 80.1%
*-commutative80.1%
unpow280.1%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.1%
associate-*l*97.1%
Simplified97.1%
if 2.1200000000000001e-100 < x.im < 9.9999999999999995e59Initial program 97.1%
+-commutative97.1%
*-commutative97.1%
distribute-lft-out97.1%
associate-*l*97.1%
*-commutative97.1%
distribute-lft-out97.0%
associate-+r-97.0%
distribute-lft-out--97.1%
Simplified97.3%
sub-neg97.3%
associate-*l*97.3%
associate-*l*100.0%
Applied egg-rr100.0%
unsub-neg100.0%
associate-*r*97.3%
Applied egg-rr97.3%
Final simplification97.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* (+ x.re x.im) (- x.re x.im)))))
(if (<= x.im -1.35e-50)
t_0
(if (<= x.im 2.15e-100)
(* x.re (* x.im (* x.re 3.0)))
(if (<= x.im 4e+67)
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
t_0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
double tmp;
if (x_46_im <= -1.35e-50) {
tmp = t_0;
} else if (x_46_im <= 2.15e-100) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else if (x_46_im <= 4e+67) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * 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_46re + x_46im) * (x_46re - x_46im))
if (x_46im <= (-1.35d-50)) then
tmp = t_0
else if (x_46im <= 2.15d-100) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
else if (x_46im <= 4d+67) then
tmp = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (x_46re * ((x_46re * x_46im) + (x_46re * 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_re + x_46_im) * (x_46_re - x_46_im));
double tmp;
if (x_46_im <= -1.35e-50) {
tmp = t_0;
} else if (x_46_im <= 2.15e-100) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else if (x_46_im <= 4e+67) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)) tmp = 0 if x_46_im <= -1.35e-50: tmp = t_0 elif x_46_im <= 2.15e-100: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) elif x_46_im <= 4e+67: tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))) tmp = 0.0 if (x_46_im <= -1.35e-50) tmp = t_0; elseif (x_46_im <= 2.15e-100) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); elseif (x_46_im <= 4e+67) tmp = 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_re * x_46_im) + Float64(x_46_re * 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_re + x_46_im) * (x_46_re - x_46_im)); tmp = 0.0; if (x_46_im <= -1.35e-50) tmp = t_0; elseif (x_46_im <= 2.15e-100) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); elseif (x_46_im <= 4e+67) tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.35e-50], t$95$0, If[LessEqual[x$46$im, 2.15e-100], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4e+67], 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$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\mathbf{if}\;x.im \leq -1.35 \cdot 10^{-50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 2.15 \cdot 10^{-100}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{elif}\;x.im \leq 4 \cdot 10^{+67}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -1.35e-50 or 3.99999999999999993e67 < x.im Initial program 71.3%
*-commutative71.3%
*-commutative71.3%
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-+72.5%
Applied egg-rr72.5%
+-commutative72.5%
add-cube-cbrt72.5%
fma-def72.5%
Applied egg-rr0.0%
Simplified98.4%
if -1.35e-50 < x.im < 2.14999999999999999e-100Initial program 82.8%
+-commutative82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-*l*82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-+r-82.8%
distribute-lft-out--82.8%
Simplified82.7%
sub-neg82.7%
associate-*l*82.8%
associate-*l*99.7%
Applied egg-rr99.7%
unsub-neg99.7%
associate-*r*82.8%
Applied egg-rr82.8%
Taylor expanded in x.re around inf 80.1%
Simplified80.1%
Taylor expanded in x.im around 0 80.1%
*-commutative80.1%
unpow280.1%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.1%
associate-*l*97.1%
Simplified97.1%
if 2.14999999999999999e-100 < x.im < 3.99999999999999993e67Initial program 97.1%
Final simplification97.7%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -1.55e-50)
(* x.im (* (+ x.re x.im) (- x.re x.im)))
(if (<= x.im 9.6e-96)
(* x.re (* x.im (* x.re 3.0)))
(/ x.im (/ (/ 1.0 (- x.re x.im)) (+ x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -1.55e-50) {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
} else if (x_46_im <= 9.6e-96) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else {
tmp = x_46_im / ((1.0 / (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_46im <= (-1.55d-50)) then
tmp = x_46im * ((x_46re + x_46im) * (x_46re - x_46im))
else if (x_46im <= 9.6d-96) then
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
else
tmp = x_46im / ((1.0d0 / (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_im <= -1.55e-50) {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
} else if (x_46_im <= 9.6e-96) {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
} else {
tmp = x_46_im / ((1.0 / (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_im <= -1.55e-50: tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)) elif x_46_im <= 9.6e-96: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) else: tmp = x_46_im / ((1.0 / (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_im <= -1.55e-50) tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))); elseif (x_46_im <= 9.6e-96) tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); else tmp = Float64(x_46_im / Float64(Float64(1.0 / Float64(x_46_re - 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_im <= -1.55e-50) tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)); elseif (x_46_im <= 9.6e-96) tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); else tmp = x_46_im / ((1.0 / (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$im, -1.55e-50], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 9.6e-96], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im / N[(N[(1.0 / N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] / N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.55 \cdot 10^{-50}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 9.6 \cdot 10^{-96}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\frac{\frac{1}{x.re - x.im}}{x.re + x.im}}\\
\end{array}
\end{array}
if x.im < -1.5500000000000001e-50Initial program 79.4%
*-commutative79.4%
*-commutative79.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-+77.3%
Applied egg-rr77.3%
+-commutative77.3%
add-cube-cbrt77.3%
fma-def77.3%
Applied egg-rr0.0%
Simplified97.4%
if -1.5500000000000001e-50 < x.im < 9.60000000000000076e-96Initial program 82.8%
+-commutative82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-*l*82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-+r-82.8%
distribute-lft-out--82.8%
Simplified82.7%
sub-neg82.7%
associate-*l*82.8%
associate-*l*99.7%
Applied egg-rr99.7%
unsub-neg99.7%
associate-*r*82.8%
Applied egg-rr82.8%
Taylor expanded in x.re around inf 80.1%
Simplified80.1%
Taylor expanded in x.im around 0 80.1%
*-commutative80.1%
unpow280.1%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.1%
associate-*l*97.1%
Simplified97.1%
if 9.60000000000000076e-96 < x.im Initial program 75.0%
*-commutative75.0%
*-commutative75.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-+67.5%
Applied egg-rr67.5%
+-commutative67.5%
add-cube-cbrt67.5%
fma-def67.5%
Applied egg-rr0.0%
Simplified91.0%
associate-*r*91.1%
distribute-rgt-in81.6%
flip--73.1%
+-commutative73.1%
associate-*r/67.5%
distribute-rgt-in69.9%
Applied egg-rr69.9%
associate-/l*75.4%
associate-/l*75.5%
difference-of-squares90.9%
+-commutative90.9%
associate-/r*91.1%
*-inverses91.1%
+-commutative91.1%
Simplified91.1%
Final simplification95.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.7e-49) (not (<= x.im 5.5e-98))) (* x.im (* (+ x.re x.im) (- x.re 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_im <= -1.7e-49) || !(x_46_im <= 5.5e-98)) {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - 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_46im <= (-1.7d-49)) .or. (.not. (x_46im <= 5.5d-98))) then
tmp = x_46im * ((x_46re + x_46im) * (x_46re - 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_im <= -1.7e-49) || !(x_46_im <= 5.5e-98)) {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - 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_im <= -1.7e-49) or not (x_46_im <= 5.5e-98): tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - 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_im <= -1.7e-49) || !(x_46_im <= 5.5e-98)) tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - 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_im <= -1.7e-49) || ~((x_46_im <= 5.5e-98))) tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - 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[Or[LessEqual[x$46$im, -1.7e-49], N[Not[LessEqual[x$46$im, 5.5e-98]], $MachinePrecision]], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $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.im \leq -1.7 \cdot 10^{-49} \lor \neg \left(x.im \leq 5.5 \cdot 10^{-98}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - 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.im < -1.70000000000000002e-49 or 5.4999999999999997e-98 < x.im Initial program 77.0%
*-commutative77.0%
*-commutative77.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-+72.0%
Applied egg-rr72.0%
+-commutative72.0%
add-cube-cbrt72.0%
fma-def72.0%
Applied egg-rr0.0%
Simplified94.0%
if -1.70000000000000002e-49 < x.im < 5.4999999999999997e-98Initial program 82.8%
+-commutative82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-*l*82.8%
*-commutative82.8%
distribute-lft-out82.8%
associate-+r-82.8%
distribute-lft-out--82.8%
Simplified82.7%
sub-neg82.7%
associate-*l*82.8%
associate-*l*99.7%
Applied egg-rr99.7%
unsub-neg99.7%
associate-*r*82.8%
Applied egg-rr82.8%
Taylor expanded in x.re around inf 80.1%
Simplified80.1%
Taylor expanded in x.im around 0 80.1%
*-commutative80.1%
unpow280.1%
associate-*l*97.0%
*-commutative97.0%
associate-*r*97.1%
associate-*l*97.1%
Simplified97.1%
Final simplification95.2%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -2.2e+145) (* x.re (* x.im x.im)) (* 3.0 (* (* x.re x.re) x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -2.2e+145) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = 3.0 * ((x_46_re * 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_46im <= (-2.2d+145)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = 3.0d0 * ((x_46re * 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_im <= -2.2e+145) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = 3.0 * ((x_46_re * x_46_re) * x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -2.2e+145: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = 3.0 * ((x_46_re * x_46_re) * x_46_im) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -2.2e+145) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(3.0 * Float64(Float64(x_46_re * 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_im <= -2.2e+145) tmp = x_46_re * (x_46_im * x_46_im); else tmp = 3.0 * ((x_46_re * x_46_re) * x_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -2.2e+145], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{+145}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -2.20000000000000009e145Initial program 61.5%
*-commutative61.5%
*-commutative61.5%
difference-of-squares74.4%
associate-*l*74.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
distribute-lft-out74.4%
Simplified74.4%
Taylor expanded in x.im around 0 29.0%
Taylor expanded in x.re around 0 46.2%
unpow246.2%
Simplified46.2%
if -2.20000000000000009e145 < x.im Initial program 82.4%
+-commutative82.4%
*-commutative82.4%
distribute-lft-out82.4%
associate-*l*82.4%
*-commutative82.4%
distribute-lft-out85.6%
associate-+r-85.6%
distribute-lft-out--78.3%
Simplified78.3%
sub-neg78.3%
associate-*l*78.4%
associate-*l*86.5%
Applied egg-rr86.5%
unsub-neg86.5%
associate-*r*78.4%
Applied egg-rr78.4%
Taylor expanded in x.re around inf 56.3%
Simplified56.3%
Final simplification54.8%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -1.35e+148) (* x.re (* x.im x.im)) (* x.im (* (* x.re x.re) 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -1.35e+148) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_im * ((x_46_re * 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_46im <= (-1.35d+148)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = x_46im * ((x_46re * 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_im <= -1.35e+148) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_im * ((x_46_re * x_46_re) * 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -1.35e+148: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = x_46_im * ((x_46_re * x_46_re) * 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -1.35e+148) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re * 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_im <= -1.35e+148) tmp = x_46_re * (x_46_im * x_46_im); else tmp = x_46_im * ((x_46_re * x_46_re) * 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -1.35e+148], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.35 \cdot 10^{+148}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -1.35000000000000009e148Initial program 61.5%
*-commutative61.5%
*-commutative61.5%
difference-of-squares74.4%
associate-*l*74.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
distribute-lft-out74.4%
Simplified74.4%
Taylor expanded in x.im around 0 29.0%
Taylor expanded in x.re around 0 46.2%
unpow246.2%
Simplified46.2%
if -1.35000000000000009e148 < x.im Initial program 82.4%
+-commutative82.4%
*-commutative82.4%
distribute-lft-out82.4%
associate-*l*82.4%
*-commutative82.4%
distribute-lft-out85.6%
associate-+r-85.6%
distribute-lft-out--78.3%
Simplified78.3%
sub-neg78.3%
associate-*l*78.4%
associate-*l*86.5%
Applied egg-rr86.5%
Taylor expanded in x.re around inf 56.3%
*-commutative56.3%
*-commutative56.3%
associate-*l*56.4%
*-commutative56.4%
unpow256.3%
Simplified56.3%
Final simplification54.8%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -4.6e+149) (* x.re (* x.im x.im)) (* x.re (* (* x.re x.im) 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -4.6e+149) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * ((x_46_re * 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 <= (-4.6d+149)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = x_46re * ((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 <= -4.6e+149) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * ((x_46_re * x_46_im) * 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -4.6e+149: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = x_46_re * ((x_46_re * x_46_im) * 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -4.6e+149) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(x_46_re * Float64(Float64(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 <= -4.6e+149) tmp = x_46_re * (x_46_im * x_46_im); else tmp = x_46_re * ((x_46_re * x_46_im) * 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -4.6e+149], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4.6 \cdot 10^{+149}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re \cdot x.im\right) \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -4.5999999999999997e149Initial program 61.5%
*-commutative61.5%
*-commutative61.5%
difference-of-squares74.4%
associate-*l*74.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
distribute-lft-out74.4%
Simplified74.4%
Taylor expanded in x.im around 0 29.0%
Taylor expanded in x.re around 0 46.2%
unpow246.2%
Simplified46.2%
if -4.5999999999999997e149 < x.im Initial program 82.4%
*-commutative82.4%
*-commutative82.4%
difference-of-squares85.2%
associate-*l*93.3%
fma-def93.3%
*-commutative93.3%
*-commutative93.3%
*-commutative93.3%
distribute-lft-out93.3%
Simplified93.3%
Taylor expanded in x.im around 0 66.8%
Taylor expanded in x.re around 0 54.0%
+-commutative54.0%
unpow254.0%
distribute-rgt1-in54.0%
metadata-eval54.0%
*-commutative54.0%
unpow254.0%
associate-*l*62.1%
distribute-lft-out66.8%
*-commutative66.8%
associate-*l*66.8%
Simplified66.8%
Taylor expanded in x.im around 0 64.5%
Final simplification61.7%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -1.76e+149) (* x.re (* 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_im <= -1.76e+149) {
tmp = x_46_re * (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_46im <= (-1.76d+149)) then
tmp = x_46re * (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_im <= -1.76e+149) {
tmp = x_46_re * (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_im <= -1.76e+149: tmp = x_46_re * (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_im <= -1.76e+149) tmp = Float64(x_46_re * Float64(x_46_im * 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_im <= -1.76e+149) tmp = x_46_re * (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$im, -1.76e+149], N[(x$46$re * 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.im \leq -1.76 \cdot 10^{+149}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\end{array}
\end{array}
if x.im < -1.7599999999999999e149Initial program 61.5%
*-commutative61.5%
*-commutative61.5%
difference-of-squares74.4%
associate-*l*74.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
distribute-lft-out74.4%
Simplified74.4%
Taylor expanded in x.im around 0 29.0%
Taylor expanded in x.re around 0 46.2%
unpow246.2%
Simplified46.2%
if -1.7599999999999999e149 < x.im Initial program 82.4%
+-commutative82.4%
*-commutative82.4%
distribute-lft-out82.4%
associate-*l*82.4%
*-commutative82.4%
distribute-lft-out85.6%
associate-+r-85.6%
distribute-lft-out--78.3%
Simplified78.3%
sub-neg78.3%
associate-*l*78.4%
associate-*l*86.5%
Applied egg-rr86.5%
unsub-neg86.5%
associate-*r*78.4%
Applied egg-rr78.4%
Taylor expanded in x.re around inf 56.3%
Simplified56.3%
Taylor expanded in x.im around 0 56.3%
*-commutative56.3%
unpow256.3%
associate-*l*64.5%
*-commutative64.5%
associate-*r*64.5%
associate-*l*64.5%
Simplified64.5%
Final simplification61.7%
(FPCore (x.re x.im) :precision binary64 (* x.re (* x.im (+ x.im (* x.re 3.0)))))
double code(double x_46_re, double x_46_im) {
return x_46_re * (x_46_im * (x_46_im + (x_46_re * 3.0)));
}
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 * (x_46im + (x_46re * 3.0d0)))
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_re * (x_46_im * (x_46_im + (x_46_re * 3.0)));
}
def code(x_46_re, x_46_im): return x_46_re * (x_46_im * (x_46_im + (x_46_re * 3.0)))
function code(x_46_re, x_46_im) return Float64(x_46_re * Float64(x_46_im * Float64(x_46_im + Float64(x_46_re * 3.0)))) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_re * (x_46_im * (x_46_im + (x_46_re * 3.0))); end
code[x$46$re_, x$46$im_] := N[(x$46$re * N[(x$46$im * N[(x$46$im + N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot \left(x.im \cdot \left(x.im + x.re \cdot 3\right)\right)
\end{array}
Initial program 79.3%
*-commutative79.3%
*-commutative79.3%
difference-of-squares83.6%
associate-*l*90.4%
fma-def90.5%
*-commutative90.5%
*-commutative90.5%
*-commutative90.5%
distribute-lft-out90.5%
Simplified90.5%
Taylor expanded in x.im around 0 61.0%
Taylor expanded in x.re around 0 51.3%
+-commutative51.3%
unpow251.3%
distribute-rgt1-in51.3%
metadata-eval51.3%
*-commutative51.3%
unpow251.3%
associate-*l*58.1%
distribute-lft-out62.1%
*-commutative62.1%
associate-*l*62.1%
Simplified62.1%
distribute-lft-out67.1%
*-commutative67.1%
*-commutative67.1%
Applied egg-rr67.1%
Final simplification67.1%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -4e+147) (* x.im (* x.re x.im)) (* (* x.re x.re) x.im)))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -4e+147) {
tmp = x_46_im * (x_46_re * x_46_im);
} else {
tmp = (x_46_re * 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_46im <= (-4d+147)) then
tmp = x_46im * (x_46re * x_46im)
else
tmp = (x_46re * 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_im <= -4e+147) {
tmp = x_46_im * (x_46_re * x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -4e+147: tmp = x_46_im * (x_46_re * x_46_im) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -4e+147) tmp = Float64(x_46_im * Float64(x_46_re * x_46_im)); else tmp = Float64(Float64(x_46_re * 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_im <= -4e+147) tmp = x_46_im * (x_46_re * x_46_im); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -4e+147], N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -4 \cdot 10^{+147}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.im < -3.9999999999999999e147Initial program 61.5%
*-commutative61.5%
*-commutative61.5%
difference-of-squares74.4%
associate-*l*74.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
distribute-lft-out74.4%
Simplified74.4%
Taylor expanded in x.im around 0 29.0%
Taylor expanded in x.re around 0 46.2%
unpow246.2%
*-commutative46.2%
associate-*l*36.7%
Simplified36.7%
if -3.9999999999999999e147 < x.im Initial program 82.4%
*-commutative82.4%
*-commutative82.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%
clear-num0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+43.2%
Applied egg-rr43.2%
Taylor expanded in x.re around inf 40.5%
*-commutative40.5%
unpow240.5%
Simplified40.5%
Final simplification39.9%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -9.2e+140) (* x.re (* x.im x.im)) (* (* x.re x.re) x.im)))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -9.2e+140) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = (x_46_re * 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_46im <= (-9.2d+140)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = (x_46re * 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_im <= -9.2e+140) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -9.2e+140: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -9.2e+140) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(Float64(x_46_re * 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_im <= -9.2e+140) tmp = x_46_re * (x_46_im * x_46_im); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -9.2e+140], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -9.2 \cdot 10^{+140}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.im < -9.19999999999999961e140Initial program 61.5%
*-commutative61.5%
*-commutative61.5%
difference-of-squares74.4%
associate-*l*74.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
distribute-lft-out74.4%
Simplified74.4%
Taylor expanded in x.im around 0 29.0%
Taylor expanded in x.re around 0 46.2%
unpow246.2%
Simplified46.2%
if -9.19999999999999961e140 < x.im Initial program 82.4%
*-commutative82.4%
*-commutative82.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%
clear-num0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+43.2%
Applied egg-rr43.2%
Taylor expanded in x.re around inf 40.5%
*-commutative40.5%
unpow240.5%
Simplified40.5%
Final simplification41.4%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.re x.im)))
double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * x_46_im);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * (x_46re * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * x_46_im);
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_re * x_46_im)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_re * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_re * x_46_im); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.re \cdot x.im\right)
\end{array}
Initial program 79.3%
*-commutative79.3%
*-commutative79.3%
difference-of-squares83.6%
associate-*l*90.4%
fma-def90.5%
*-commutative90.5%
*-commutative90.5%
*-commutative90.5%
distribute-lft-out90.5%
Simplified90.5%
Taylor expanded in x.im around 0 61.0%
Taylor expanded in x.re around 0 30.7%
unpow230.7%
*-commutative30.7%
associate-*l*28.5%
Simplified28.5%
Final simplification28.5%
(FPCore (x.re x.im) :precision binary64 (* x.im -3.0))
double code(double x_46_re, double x_46_im) {
return x_46_im * -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * (-3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * -3.0;
}
def code(x_46_re, x_46_im): return x_46_im * -3.0
function code(x_46_re, x_46_im) return Float64(x_46_im * -3.0) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * -3.0; end
code[x$46$re_, x$46$im_] := N[(x$46$im * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot -3
\end{array}
Initial program 79.3%
Taylor expanded in x.re around 0 63.5%
Simplified25.7%
Taylor expanded in x.re around 0 4.5%
*-commutative4.5%
Simplified4.5%
Final simplification4.5%
(FPCore (x.re x.im) :precision binary64 -2.6)
double code(double x_46_re, double x_46_im) {
return -2.6;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -2.6d0
end function
public static double code(double x_46_re, double x_46_im) {
return -2.6;
}
def code(x_46_re, x_46_im): return -2.6
function code(x_46_re, x_46_im) return -2.6 end
function tmp = code(x_46_re, x_46_im) tmp = -2.6; end
code[x$46$re_, x$46$im_] := -2.6
\begin{array}{l}
\\
-2.6
\end{array}
Initial program 79.3%
+-commutative79.3%
*-commutative79.3%
distribute-lft-out79.3%
associate-*l*79.2%
*-commutative79.2%
distribute-lft-out83.1%
associate-+r-83.1%
distribute-lft-out--75.7%
Simplified75.8%
flip3--10.7%
frac-2neg10.7%
*-commutative10.7%
unpow-prod-down10.7%
metadata-eval10.7%
associate-*l*10.7%
pow-pow10.6%
metadata-eval10.6%
Applied egg-rr7.2%
Simplified2.7%
Final simplification2.7%
(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 2023268
(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)))