
(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
(let* ((t_0 (* x.im (- x.re x.im))))
(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) t_0 (* x.re (* x.re (+ x.im x.im))))
(+ (+ x.im 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);
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), t_0, (x_46_re * (x_46_re * (x_46_im + x_46_im))));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * t_0);
}
return tmp;
}
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(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), t_0, Float64(x_46_re * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * t_0)); end return tmp end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]}, 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] * t$95$0 + N[(x$46$re * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re - x.im\right)\\
\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, t_0, x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot t_0\\
\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 93.9%
*-commutative93.9%
*-commutative93.9%
difference-of-squares93.9%
associate-*l*99.7%
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%
fma-def12.1%
*-commutative12.1%
distribute-lft-out12.1%
*-commutative12.1%
Simplified12.1%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+42.4%
*-commutative42.4%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))))
(if (<= t_0 5e+246)
t_0
(+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= 5e+246) {
tmp = t_0;
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (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) :: t_0
real(8) :: tmp
t_0 = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (x_46re * ((x_46re * x_46im) + (x_46re * x_46im)))
if (t_0 <= 5d+246) then
tmp = t_0
else
tmp = (x_46im + x_46im) + ((x_46re + x_46im) * (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 t_0 = (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 tmp;
if (t_0 <= 5e+246) {
tmp = t_0;
} else {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) tmp = 0 if t_0 <= 5e+246: tmp = t_0 else: tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) tmp = 0.0 if (t_0 <= 5e+246) tmp = t_0; else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * 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) t_0 = (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))); tmp = 0.0; if (t_0 <= 5e+246) tmp = t_0; else tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+246], t$95$0, N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+246}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \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)) < 4.99999999999999976e246Initial program 95.1%
if 4.99999999999999976e246 < (+.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 58.9%
+-commutative58.9%
*-commutative58.9%
fma-def63.1%
*-commutative63.1%
distribute-lft-out63.1%
*-commutative63.1%
Simplified63.1%
fma-udef58.9%
distribute-lft-in58.9%
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-+73.8%
*-commutative73.8%
difference-of-squares94.0%
associate-*r*94.7%
*-commutative94.7%
Applied egg-rr94.7%
Final simplification95.0%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* (+ x.re x.im) (* x.im (- x.re x.im))))
(t_1 (* x.re (+ (* x.re x.im) (* x.re x.im)))))
(if (<= (+ (* x.im (- (* x.re x.re) (* x.im x.im))) t_1) INFINITY)
(+ t_1 t_0)
(+ (+ x.im x.im) t_0))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im));
double t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_1) <= ((double) INFINITY)) {
tmp = t_1 + t_0;
} else {
tmp = (x_46_im + x_46_im) + t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im));
double t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_1) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + t_0;
} else {
tmp = (x_46_im + x_46_im) + t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)) t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)) tmp = 0 if ((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_1) <= math.inf: tmp = t_1 + t_0 else: tmp = (x_46_im + x_46_im) + t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - x_46_im))) t_1 = Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(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))) + t_1) <= Inf) tmp = Float64(t_1 + t_0); else tmp = Float64(Float64(x_46_im + x_46_im) + 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_im * (x_46_re - x_46_im)); t_1 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)); tmp = 0.0; if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_1) <= Inf) tmp = t_1 + t_0; else tmp = (x_46_im + x_46_im) + t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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] + t$95$1), $MachinePrecision], Infinity], N[(t$95$1 + t$95$0), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
t_1 := x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + t_1 \leq \infty:\\
\;\;\;\;t_1 + t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + t_0\\
\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 93.9%
difference-of-squares93.9%
associate-*r*99.7%
*-commutative99.7%
flip-+93.8%
associate-*l/90.7%
Applied egg-rr90.7%
*-un-lft-identity90.7%
associate-/l*93.8%
Applied egg-rr93.8%
associate-/r/93.8%
flip-+99.7%
Applied egg-rr99.7%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
fma-def12.1%
*-commutative12.1%
distribute-lft-out12.1%
*-commutative12.1%
Simplified12.1%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+42.4%
*-commutative42.4%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(+ (* x.re x.im) (* x.re x.im))))
(t_1 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -3.5e+155)
t_1
(if (<= x.im -2.8e-23)
t_0
(if (<= x.im 1.6e-64)
(* x.im (* (* x.re x.re) 3.0))
(if (<= x.im 5000000.0) t_0 t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -3.5e+155) {
tmp = t_1;
} else if (x_46_im <= -2.8e-23) {
tmp = t_0;
} else if (x_46_im <= 1.6e-64) {
tmp = x_46_im * ((x_46_re * x_46_re) * 3.0);
} else if (x_46_im <= 5000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + ((x_46re * x_46im) + (x_46re * x_46im))
t_1 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-3.5d+155)) then
tmp = t_1
else if (x_46im <= (-2.8d-23)) then
tmp = t_0
else if (x_46im <= 1.6d-64) then
tmp = x_46im * ((x_46re * x_46re) * 3.0d0)
else if (x_46im <= 5000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -3.5e+155) {
tmp = t_1;
} else if (x_46_im <= -2.8e-23) {
tmp = t_0;
} else if (x_46_im <= 1.6e-64) {
tmp = x_46_im * ((x_46_re * x_46_re) * 3.0);
} else if (x_46_im <= 5000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + ((x_46_re * x_46_im) + (x_46_re * x_46_im)) t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) tmp = 0 if x_46_im <= -3.5e+155: tmp = t_1 elif x_46_im <= -2.8e-23: tmp = t_0 elif x_46_im <= 1.6e-64: tmp = x_46_im * ((x_46_re * x_46_re) * 3.0) elif x_46_im <= 5000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) t_1 = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - x_46_im)))) tmp = 0.0 if (x_46_im <= -3.5e+155) tmp = t_1; elseif (x_46_im <= -2.8e-23) tmp = t_0; elseif (x_46_im <= 1.6e-64) tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) * 3.0)); elseif (x_46_im <= 5000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + ((x_46_re * x_46_im) + (x_46_re * x_46_im)); t_1 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); tmp = 0.0; if (x_46_im <= -3.5e+155) tmp = t_1; elseif (x_46_im <= -2.8e-23) tmp = t_0; elseif (x_46_im <= 1.6e-64) tmp = x_46_im * ((x_46_re * x_46_re) * 3.0); elseif (x_46_im <= 5000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.5e+155], t$95$1, If[LessEqual[x$46$im, -2.8e-23], t$95$0, If[LessEqual[x$46$im, 1.6e-64], N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5000000.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
t_1 := \left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\mathbf{if}\;x.im \leq -3.5 \cdot 10^{+155}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -2.8 \cdot 10^{-23}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 1.6 \cdot 10^{-64}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right)\\
\mathbf{elif}\;x.im \leq 5000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -3.49999999999999985e155 or 5e6 < x.im Initial program 67.0%
+-commutative67.0%
*-commutative67.0%
fma-def71.0%
*-commutative71.0%
distribute-lft-out71.0%
*-commutative71.0%
Simplified71.0%
fma-udef67.0%
distribute-lft-in67.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-+78.4%
*-commutative78.4%
difference-of-squares97.4%
associate-*r*97.4%
*-commutative97.4%
Applied egg-rr97.4%
if -3.49999999999999985e155 < x.im < -2.7999999999999997e-23 or 1.59999999999999988e-64 < x.im < 5e6Initial program 98.1%
*-commutative98.1%
*-commutative98.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+87.0%
Applied egg-rr87.0%
if -2.7999999999999997e-23 < x.im < 1.59999999999999988e-64Initial program 87.6%
+-commutative87.6%
*-commutative87.6%
distribute-lft-out87.6%
associate-*l*87.6%
*-commutative87.6%
distribute-lft-out87.7%
associate-+r-87.7%
distribute-lft-out--87.7%
Simplified87.7%
sub-neg87.7%
associate-*l*87.7%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 82.5%
*-commutative82.5%
*-commutative82.5%
associate-*l*82.6%
*-commutative82.6%
unpow282.6%
Simplified82.6%
Final simplification89.3%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -3.5e+155)
(+ (+ x.im x.im) (* x.re (* x.im x.im)))
(if (or (<= x.im -30.0) (not (<= x.im 2.45e+31)))
(+ (* x.im (- (* x.re x.re) (* x.im x.im))) (+ 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 <= -3.5e+155) {
tmp = (x_46_im + x_46_im) + (x_46_re * (x_46_im * x_46_im));
} else if ((x_46_im <= -30.0) || !(x_46_im <= 2.45e+31)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (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 <= (-3.5d+155)) then
tmp = (x_46im + x_46im) + (x_46re * (x_46im * x_46im))
else if ((x_46im <= (-30.0d0)) .or. (.not. (x_46im <= 2.45d+31))) then
tmp = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (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 <= -3.5e+155) {
tmp = (x_46_im + x_46_im) + (x_46_re * (x_46_im * x_46_im));
} else if ((x_46_im <= -30.0) || !(x_46_im <= 2.45e+31)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (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 <= -3.5e+155: tmp = (x_46_im + x_46_im) + (x_46_re * (x_46_im * x_46_im)) elif (x_46_im <= -30.0) or not (x_46_im <= 2.45e+31): tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (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 <= -3.5e+155) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_re * Float64(x_46_im * x_46_im))); elseif ((x_46_im <= -30.0) || !(x_46_im <= 2.45e+31)) tmp = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + 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 <= -3.5e+155) tmp = (x_46_im + x_46_im) + (x_46_re * (x_46_im * x_46_im)); elseif ((x_46_im <= -30.0) || ~((x_46_im <= 2.45e+31))) tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (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, -3.5e+155], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$im, -30.0], N[Not[LessEqual[x$46$im, 2.45e+31]], $MachinePrecision]], 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$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 -3.5 \cdot 10^{+155}:\\
\;\;\;\;\left(x.im + x.im\right) + x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq -30 \lor \neg \left(x.im \leq 2.45 \cdot 10^{+31}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + \left(x.im + 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 < -3.49999999999999985e155Initial program 55.6%
+-commutative55.6%
*-commutative55.6%
fma-def61.1%
*-commutative61.1%
distribute-lft-out61.1%
*-commutative61.1%
Simplified61.1%
fma-udef55.6%
distribute-lft-in55.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+69.4%
*-commutative69.4%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x.im around 0 50.7%
Taylor expanded in x.re around 0 52.8%
unpow252.8%
Simplified52.8%
if -3.49999999999999985e155 < x.im < -30 or 2.44999999999999998e31 < x.im Initial program 80.4%
*-commutative80.4%
*-commutative80.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-+89.3%
Applied egg-rr89.3%
if -30 < x.im < 2.44999999999999998e31Initial program 89.8%
+-commutative89.8%
*-commutative89.8%
distribute-lft-out89.8%
associate-*l*89.8%
*-commutative89.8%
distribute-lft-out89.8%
associate-+r-89.8%
distribute-lft-out--89.8%
Simplified89.9%
sub-neg89.9%
associate-*l*89.9%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*l*74.4%
*-commutative74.4%
unpow274.4%
Simplified74.4%
Final simplification76.4%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -17.0) (not (<= x.im 2.45e+31))) (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re 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 <= -17.0) || !(x_46_im <= 2.45e+31)) {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - 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 <= (-17.0d0)) .or. (.not. (x_46im <= 2.45d+31))) then
tmp = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - 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 <= -17.0) || !(x_46_im <= 2.45e+31)) {
tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - 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 <= -17.0) or not (x_46_im <= 2.45e+31): tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - 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 <= -17.0) || !(x_46_im <= 2.45e+31)) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_re + x_46_im) * Float64(x_46_im * Float64(x_46_re - 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 <= -17.0) || ~((x_46_im <= 2.45e+31))) tmp = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - 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[Or[LessEqual[x$46$im, -17.0], N[Not[LessEqual[x$46$im, 2.45e+31]], $MachinePrecision]], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $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 -17 \lor \neg \left(x.im \leq 2.45 \cdot 10^{+31}\right):\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -17 or 2.44999999999999998e31 < x.im Initial program 73.1%
+-commutative73.1%
*-commutative73.1%
fma-def76.4%
*-commutative76.4%
distribute-lft-out76.4%
*-commutative76.4%
Simplified76.4%
fma-udef73.1%
distribute-lft-in73.1%
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-+83.5%
*-commutative83.5%
difference-of-squares98.9%
associate-*r*98.9%
*-commutative98.9%
Applied egg-rr98.9%
if -17 < x.im < 2.44999999999999998e31Initial program 89.8%
+-commutative89.8%
*-commutative89.8%
distribute-lft-out89.8%
associate-*l*89.8%
*-commutative89.8%
distribute-lft-out89.8%
associate-+r-89.8%
distribute-lft-out--89.8%
Simplified89.9%
sub-neg89.9%
associate-*l*89.9%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*l*74.4%
*-commutative74.4%
unpow274.4%
Simplified74.4%
Final simplification86.2%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -8.5e+164) (+ (+ x.im x.im) (* x.im (* x.re 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 <= -8.5e+164) {
tmp = (x_46_im + x_46_im) + (x_46_im * (x_46_re * 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 <= (-8.5d+164)) then
tmp = (x_46im + x_46im) + (x_46im * (x_46re * 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 <= -8.5e+164) {
tmp = (x_46_im + x_46_im) + (x_46_im * (x_46_re * 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 <= -8.5e+164: tmp = (x_46_im + x_46_im) + (x_46_im * (x_46_re * 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 <= -8.5e+164) tmp = Float64(Float64(x_46_im + x_46_im) + Float64(x_46_im * Float64(x_46_re * 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 <= -8.5e+164) tmp = (x_46_im + x_46_im) + (x_46_im * (x_46_re * 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, -8.5e+164], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $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 -8.5 \cdot 10^{+164}:\\
\;\;\;\;\left(x.im + x.im\right) + x.im \cdot \left(x.re \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 < -8.50000000000000027e164Initial program 58.8%
+-commutative58.8%
*-commutative58.8%
fma-def64.7%
*-commutative64.7%
distribute-lft-out64.7%
*-commutative64.7%
Simplified64.7%
fma-udef58.8%
distribute-lft-in58.8%
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-+73.5%
*-commutative73.5%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x.im around 0 47.8%
Taylor expanded in x.re around 0 50.0%
unpow250.0%
*-commutative50.0%
associate-*r*36.0%
Simplified36.0%
if -8.50000000000000027e164 < x.im Initial program 85.3%
+-commutative85.3%
*-commutative85.3%
distribute-lft-out85.3%
associate-*l*85.3%
*-commutative85.3%
distribute-lft-out89.4%
associate-+r-89.4%
distribute-lft-out--79.9%
Simplified80.0%
sub-neg80.0%
associate-*l*80.0%
associate-*l*85.9%
Applied egg-rr85.9%
Taylor expanded in x.re around inf 57.9%
*-commutative57.9%
*-commutative57.9%
associate-*l*57.9%
*-commutative57.9%
unpow257.9%
Simplified57.9%
Final simplification55.0%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -2.2e+164) (+ (+ x.im x.im) (* 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 <= -2.2e+164) {
tmp = (x_46_im + x_46_im) + (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 <= (-2.2d+164)) then
tmp = (x_46im + x_46im) + (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 <= -2.2e+164) {
tmp = (x_46_im + x_46_im) + (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 <= -2.2e+164: tmp = (x_46_im + x_46_im) + (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 <= -2.2e+164) tmp = Float64(Float64(x_46_im + x_46_im) + 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 <= -2.2e+164) tmp = (x_46_im + x_46_im) + (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, -2.2e+164], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $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 -2.2 \cdot 10^{+164}:\\
\;\;\;\;\left(x.im + x.im\right) + 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 < -2.20000000000000006e164Initial program 58.8%
+-commutative58.8%
*-commutative58.8%
fma-def64.7%
*-commutative64.7%
distribute-lft-out64.7%
*-commutative64.7%
Simplified64.7%
fma-udef58.8%
distribute-lft-in58.8%
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-+73.5%
*-commutative73.5%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x.im around 0 47.8%
Taylor expanded in x.re around 0 50.0%
unpow250.0%
Simplified50.0%
if -2.20000000000000006e164 < x.im Initial program 85.3%
+-commutative85.3%
*-commutative85.3%
distribute-lft-out85.3%
associate-*l*85.3%
*-commutative85.3%
distribute-lft-out89.4%
associate-+r-89.4%
distribute-lft-out--79.9%
Simplified80.0%
sub-neg80.0%
associate-*l*80.0%
associate-*l*85.9%
Applied egg-rr85.9%
Taylor expanded in x.re around inf 57.9%
*-commutative57.9%
*-commutative57.9%
associate-*l*57.9%
*-commutative57.9%
unpow257.9%
Simplified57.9%
Final simplification56.8%
(FPCore (x.re x.im) :precision binary64 (* x.im (* (* x.re x.re) 3.0)))
double code(double x_46_re, double x_46_im) {
return x_46_im * ((x_46_re * 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_46im * ((x_46re * x_46re) * 3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * ((x_46_re * x_46_re) * 3.0);
}
def code(x_46_re, x_46_im): return x_46_im * ((x_46_re * x_46_re) * 3.0)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) * 3.0)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * ((x_46_re * x_46_re) * 3.0); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right)
\end{array}
Initial program 81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-out81.8%
associate-*l*81.8%
*-commutative81.8%
distribute-lft-out87.3%
associate-+r-87.3%
distribute-lft-out--77.1%
Simplified77.2%
sub-neg77.2%
associate-*l*77.2%
associate-*l*82.3%
Applied egg-rr82.3%
Taylor expanded in x.re around inf 52.2%
*-commutative52.2%
*-commutative52.2%
associate-*l*52.2%
*-commutative52.2%
unpow252.2%
Simplified52.2%
Final simplification52.2%
(FPCore (x.re x.im) :precision binary64 (* (* x.re x.re) x.im))
double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (x_46re * x_46re) * x_46im
end function
public static double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
def code(x_46_re, x_46_im): return (x_46_re * x_46_re) * x_46_im
function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * x_46_re) * x_46_im) end
function tmp = code(x_46_re, x_46_im) tmp = (x_46_re * x_46_re) * x_46_im; end
code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re\right) \cdot x.im
\end{array}
Initial program 81.8%
*-commutative81.8%
*-commutative81.8%
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-+53.7%
Applied egg-rr53.7%
Taylor expanded in x.re around inf 37.7%
*-commutative37.7%
unpow237.7%
Simplified37.7%
Final simplification37.7%
(FPCore (x.re x.im) :precision binary64 (+ x.im x.im))
double code(double x_46_re, double x_46_im) {
return x_46_im + x_46_im;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im + x_46im
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im + x_46_im;
}
def code(x_46_re, x_46_im): return x_46_im + x_46_im
function code(x_46_re, x_46_im) return Float64(x_46_im + x_46_im) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im + x_46_im; end
code[x$46$re_, x$46$im_] := N[(x$46$im + x$46$im), $MachinePrecision]
\begin{array}{l}
\\
x.im + x.im
\end{array}
Initial program 81.8%
+-commutative81.8%
*-commutative81.8%
fma-def83.4%
*-commutative83.4%
distribute-lft-out83.4%
*-commutative83.4%
Simplified83.4%
fma-udef81.8%
distribute-lft-in81.8%
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-+53.7%
*-commutative53.7%
difference-of-squares61.1%
associate-*r*61.8%
*-commutative61.8%
Applied egg-rr61.8%
Taylor expanded in x.im around 0 34.2%
Taylor expanded in x.re around 0 3.0%
count-23.0%
Simplified3.0%
Final simplification3.0%
(FPCore (x.re x.im) :precision binary64 -3.0)
double code(double x_46_re, double x_46_im) {
return -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -3.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -3.0;
}
def code(x_46_re, x_46_im): return -3.0
function code(x_46_re, x_46_im) return -3.0 end
function tmp = code(x_46_re, x_46_im) tmp = -3.0; end
code[x$46$re_, x$46$im_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 81.8%
Taylor expanded in x.re around 0 55.6%
Simplified2.6%
Final simplification2.6%
(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 81.8%
+-commutative81.8%
*-commutative81.8%
distribute-lft-out81.8%
associate-*l*81.8%
*-commutative81.8%
distribute-lft-out87.3%
associate-+r-87.3%
distribute-lft-out--77.1%
Simplified77.2%
flip3--12.8%
div-inv12.8%
*-commutative12.8%
unpow-prod-down12.8%
metadata-eval12.8%
associate-*l*12.8%
pow-pow12.8%
metadata-eval12.8%
associate-+r+12.8%
Applied egg-rr10.0%
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 2023274
(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)))