
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+103) (not (<= x.im 2e+101))) (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im)))) (- (* x.re (* x.im (* x.re 3.0))) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+103) || !(x_46_im <= 2e+101)) {
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_re * (x_46_im * (x_46_re * 3.0))) - pow(x_46_im, 3.0);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-5d+103)) .or. (.not. (x_46im <= 2d+101))) then
tmp = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
else
tmp = (x_46re * (x_46im * (x_46re * 3.0d0))) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+103) || !(x_46_im <= 2e+101)) {
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_re * (x_46_im * (x_46_re * 3.0))) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -5e+103) or not (x_46_im <= 2e+101): 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_re * (x_46_im * (x_46_re * 3.0))) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -5e+103) || !(x_46_im <= 2e+101)) 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(Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))) - (x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -5e+103) || ~((x_46_im <= 2e+101))) 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_re * (x_46_im * (x_46_re * 3.0))) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -5e+103], N[Not[LessEqual[x$46$im, 2e+101]], $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[(N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5 \cdot 10^{+103} \lor \neg \left(x.im \leq 2 \cdot 10^{+101}\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.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -5e103 or 2e101 < x.im Initial program 70.7%
+-commutative70.7%
*-commutative70.7%
fma-def76.0%
*-commutative76.0%
distribute-lft-out74.7%
*-commutative74.7%
Simplified74.7%
fma-udef69.3%
distribute-lft-in70.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.3%
distribute-lft-in74.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+81.3%
*-commutative81.3%
difference-of-squares98.7%
associate-*r*98.7%
*-commutative98.7%
Applied egg-rr98.7%
if -5e103 < x.im < 2e101Initial program 91.0%
+-commutative91.0%
*-commutative91.0%
distribute-lft-out91.0%
associate-*l*90.9%
*-commutative90.9%
distribute-lft-out90.9%
associate-+r-90.9%
distribute-lft-out--90.9%
Simplified91.0%
sub-neg91.0%
associate-*l*91.0%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around 0 99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.5%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (- x.re x.im))))
(if (<=
(+
(* x.re (+ (* x.re x.im) (* x.re x.im)))
(* x.im (- (* x.re x.re) (* x.im 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_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * 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_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) + Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * 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$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) + x.im \cdot \left(x.re \cdot x.re - x.im \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.0%
*-commutative93.0%
*-commutative93.0%
difference-of-squares93.0%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-lft-out99.4%
Simplified99.4%
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-def18.2%
*-commutative18.2%
distribute-lft-out18.2%
*-commutative18.2%
Simplified18.2%
fma-udef0.0%
distribute-lft-in0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+31.8%
distribute-lft-in31.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+40.9%
*-commutative40.9%
difference-of-squares100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification99.5%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (- (* 3.0 (* (* x.re x.re) x.im)) (pow x.im 3.0)))
(t_1 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -5e+103)
t_1
(if (<= x.im -1.45e-95)
t_0
(if (<= x.im 2.6e-151)
(+ (* x.re (+ (* x.re x.im) (* x.re x.im))) (* x.re (* x.re x.im)))
(if (<= x.im 2e+101) t_0 t_1))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - pow(x_46_im, 3.0);
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 <= -5e+103) {
tmp = t_1;
} else if (x_46_im <= -1.45e-95) {
tmp = t_0;
} else if (x_46_im <= 2.6e-151) {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 2e+101) {
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 = (3.0d0 * ((x_46re * x_46re) * x_46im)) - (x_46im ** 3.0d0)
t_1 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-5d+103)) then
tmp = t_1
else if (x_46im <= (-1.45d-95)) then
tmp = t_0
else if (x_46im <= 2.6d-151) then
tmp = (x_46re * ((x_46re * x_46im) + (x_46re * x_46im))) + (x_46re * (x_46re * x_46im))
else if (x_46im <= 2d+101) 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 = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - Math.pow(x_46_im, 3.0);
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 <= -5e+103) {
tmp = t_1;
} else if (x_46_im <= -1.45e-95) {
tmp = t_0;
} else if (x_46_im <= 2.6e-151) {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 2e+101) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - math.pow(x_46_im, 3.0) 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 <= -5e+103: tmp = t_1 elif x_46_im <= -1.45e-95: tmp = t_0 elif x_46_im <= 2.6e-151: tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im)) elif x_46_im <= 2e+101: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(3.0 * Float64(Float64(x_46_re * x_46_re) * x_46_im)) - (x_46_im ^ 3.0)) 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 <= -5e+103) tmp = t_1; elseif (x_46_im <= -1.45e-95) tmp = t_0; elseif (x_46_im <= 2.6e-151) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) + Float64(x_46_re * Float64(x_46_re * x_46_im))); elseif (x_46_im <= 2e+101) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - (x_46_im ^ 3.0); 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 <= -5e+103) tmp = t_1; elseif (x_46_im <= -1.45e-95) tmp = t_0; elseif (x_46_im <= 2.6e-151) tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im)); elseif (x_46_im <= 2e+101) 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[(3.0 * N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $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, -5e+103], t$95$1, If[LessEqual[x$46$im, -1.45e-95], t$95$0, If[LessEqual[x$46$im, 2.6e-151], N[(N[(x$46$re * 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$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2e+101], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right) - {x.im}^{3}\\
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 -5 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -1.45 \cdot 10^{-95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 2.6 \cdot 10^{-151}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 2 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.im < -5e103 or 2e101 < x.im Initial program 70.7%
+-commutative70.7%
*-commutative70.7%
fma-def76.0%
*-commutative76.0%
distribute-lft-out74.7%
*-commutative74.7%
Simplified74.7%
fma-udef69.3%
distribute-lft-in70.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.3%
distribute-lft-in74.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+81.3%
*-commutative81.3%
difference-of-squares98.7%
associate-*r*98.7%
*-commutative98.7%
Applied egg-rr98.7%
if -5e103 < x.im < -1.45000000000000001e-95 or 2.6e-151 < x.im < 2e101Initial program 98.9%
+-commutative98.9%
*-commutative98.9%
distribute-lft-out98.9%
associate-*l*98.8%
*-commutative98.8%
distribute-lft-out98.8%
associate-+r-98.8%
distribute-lft-out--98.8%
Simplified98.9%
if -1.45000000000000001e-95 < x.im < 2.6e-151Initial program 79.9%
*-commutative79.9%
sub-neg79.9%
distribute-rgt-in79.9%
associate-*l*99.8%
distribute-lft-neg-in99.8%
unpow399.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 79.9%
unpow279.9%
Simplified79.9%
Applied egg-rr99.8%
Final simplification99.1%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (+ (* x.re x.im) (* x.re x.im))))
(t_1 (+ t_0 (* x.im (- (* x.re x.re) (* x.im x.im)))))
(t_2 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -5e+148)
t_2
(if (<= x.im -1.45e-95)
t_1
(if (<= x.im 7.2e-152)
(+ t_0 (* x.re (* x.re x.im)))
(if (<= x.im 2e+63) t_1 t_2))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double t_1 = t_0 + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)));
double t_2 = (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 <= -5e+148) {
tmp = t_2;
} else if (x_46_im <= -1.45e-95) {
tmp = t_1;
} else if (x_46_im <= 7.2e-152) {
tmp = t_0 + (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 2e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = x_46re * ((x_46re * x_46im) + (x_46re * x_46im))
t_1 = t_0 + (x_46im * ((x_46re * x_46re) - (x_46im * x_46im)))
t_2 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-5d+148)) then
tmp = t_2
else if (x_46im <= (-1.45d-95)) then
tmp = t_1
else if (x_46im <= 7.2d-152) then
tmp = t_0 + (x_46re * (x_46re * x_46im))
else if (x_46im <= 2d+63) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double t_1 = t_0 + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)));
double t_2 = (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 <= -5e+148) {
tmp = t_2;
} else if (x_46_im <= -1.45e-95) {
tmp = t_1;
} else if (x_46_im <= 7.2e-152) {
tmp = t_0 + (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 2e+63) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)) t_1 = t_0 + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) t_2 = (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 <= -5e+148: tmp = t_2 elif x_46_im <= -1.45e-95: tmp = t_1 elif x_46_im <= 7.2e-152: tmp = t_0 + (x_46_re * (x_46_re * x_46_im)) elif x_46_im <= 2e+63: tmp = t_1 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) t_1 = Float64(t_0 + Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)))) t_2 = 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 <= -5e+148) tmp = t_2; elseif (x_46_im <= -1.45e-95) tmp = t_1; elseif (x_46_im <= 7.2e-152) tmp = Float64(t_0 + Float64(x_46_re * Float64(x_46_re * x_46_im))); elseif (x_46_im <= 2e+63) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)); t_1 = t_0 + (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))); t_2 = (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 <= -5e+148) tmp = t_2; elseif (x_46_im <= -1.45e-95) tmp = t_1; elseif (x_46_im <= 7.2e-152) tmp = t_0 + (x_46_re * (x_46_re * x_46_im)); elseif (x_46_im <= 2e+63) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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, -5e+148], t$95$2, If[LessEqual[x$46$im, -1.45e-95], t$95$1, If[LessEqual[x$46$im, 7.2e-152], N[(t$95$0 + N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2e+63], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
t_1 := t_0 + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\
t_2 := \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 -5 \cdot 10^{+148}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.im \leq -1.45 \cdot 10^{-95}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq 7.2 \cdot 10^{-152}:\\
\;\;\;\;t_0 + x.re \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 2 \cdot 10^{+63}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x.im < -5.00000000000000024e148 or 2.00000000000000012e63 < x.im Initial program 72.1%
+-commutative72.1%
*-commutative72.1%
fma-def77.2%
*-commutative77.2%
distribute-lft-out75.9%
*-commutative75.9%
Simplified75.9%
fma-udef70.8%
distribute-lft-in72.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.4%
distribute-lft-in74.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+82.2%
*-commutative82.2%
difference-of-squares98.7%
associate-*r*98.7%
*-commutative98.7%
Applied egg-rr98.7%
if -5.00000000000000024e148 < x.im < -1.45000000000000001e-95 or 7.2e-152 < x.im < 2.00000000000000012e63Initial program 98.9%
if -1.45000000000000001e-95 < x.im < 7.2e-152Initial program 79.6%
*-commutative79.6%
sub-neg79.6%
distribute-rgt-in79.6%
associate-*l*99.8%
distribute-lft-neg-in99.8%
unpow399.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 79.6%
unpow279.6%
Simplified79.6%
Applied egg-rr99.8%
Final simplification99.1%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -1250.0)
t_0
(if (<= x.im 1.8e-112)
(* 3.0 (* x.re (* x.re x.im)))
(if (<= x.im 400000000000.0)
(* x.im (- (* x.re x.re) (* x.im x.im)))
t_0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -1250.0) {
tmp = t_0;
} else if (x_46_im <= 1.8e-112) {
tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 400000000000.0) {
tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-1250.0d0)) then
tmp = t_0
else if (x_46im <= 1.8d-112) then
tmp = 3.0d0 * (x_46re * (x_46re * x_46im))
else if (x_46im <= 400000000000.0d0) then
tmp = x_46im * ((x_46re * x_46re) - (x_46im * x_46im))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -1250.0) {
tmp = t_0;
} else if (x_46_im <= 1.8e-112) {
tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 400000000000.0) {
tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) tmp = 0 if x_46_im <= -1250.0: tmp = t_0 elif x_46_im <= 1.8e-112: tmp = 3.0 * (x_46_re * (x_46_re * x_46_im)) elif x_46_im <= 400000000000.0: tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im + x_46_im) + Float64(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 <= -1250.0) tmp = t_0; elseif (x_46_im <= 1.8e-112) tmp = Float64(3.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); elseif (x_46_im <= 400000000000.0) tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); tmp = 0.0; if (x_46_im <= -1250.0) tmp = t_0; elseif (x_46_im <= 1.8e-112) tmp = 3.0 * (x_46_re * (x_46_re * x_46_im)); elseif (x_46_im <= 400000000000.0) tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(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, -1250.0], t$95$0, If[LessEqual[x$46$im, 1.8e-112], N[(3.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 400000000000.0], 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$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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 -1250:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 400000000000:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -1250 or 4e11 < x.im Initial program 82.7%
+-commutative82.7%
*-commutative82.7%
fma-def85.8%
*-commutative85.8%
distribute-lft-out85.0%
*-commutative85.0%
Simplified85.0%
fma-udef81.9%
distribute-lft-in82.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+77.4%
distribute-lft-in78.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+84.2%
*-commutative84.2%
difference-of-squares94.4%
associate-*r*94.4%
*-commutative94.4%
Applied egg-rr94.4%
if -1250 < x.im < 1.8e-112Initial program 85.7%
*-commutative85.7%
sub-neg85.7%
distribute-rgt-in85.7%
associate-*l*99.8%
distribute-lft-neg-in99.8%
unpow399.8%
Applied egg-rr99.8%
*-commutative99.8%
distribute-lft-out99.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 77.5%
unpow277.5%
*-commutative77.5%
distribute-rgt1-in77.5%
metadata-eval77.5%
associate-*l*77.4%
Simplified77.4%
Applied egg-rr91.7%
if 1.8e-112 < x.im < 4e11Initial program 95.5%
*-commutative95.5%
sub-neg95.5%
distribute-rgt-in95.5%
associate-*l*99.6%
distribute-lft-neg-in99.6%
unpow399.7%
Applied egg-rr99.7%
*-commutative99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Applied egg-rr73.9%
Final simplification91.5%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (+ (+ x.im x.im) (* (+ x.re x.im) (* x.im (- x.re x.im))))))
(if (<= x.im -5500.0)
t_0
(if (<= x.im 1.8e-112)
(+ (* x.re (+ (* x.re x.im) (* x.re x.im))) (* x.re (* x.re x.im)))
(if (<= x.im 400000000000.0)
(* x.im (- (* x.re x.re) (* x.im x.im)))
t_0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -5500.0) {
tmp = t_0;
} else if (x_46_im <= 1.8e-112) {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 400000000000.0) {
tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im + x_46im) + ((x_46re + x_46im) * (x_46im * (x_46re - x_46im)))
if (x_46im <= (-5500.0d0)) then
tmp = t_0
else if (x_46im <= 1.8d-112) then
tmp = (x_46re * ((x_46re * x_46im) + (x_46re * x_46im))) + (x_46re * (x_46re * x_46im))
else if (x_46im <= 400000000000.0d0) then
tmp = x_46im * ((x_46re * x_46re) - (x_46im * x_46im))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im)));
double tmp;
if (x_46_im <= -5500.0) {
tmp = t_0;
} else if (x_46_im <= 1.8e-112) {
tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im));
} else if (x_46_im <= 400000000000.0) {
tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))) tmp = 0 if x_46_im <= -5500.0: tmp = t_0 elif x_46_im <= 1.8e-112: tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im)) elif x_46_im <= 400000000000.0: tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im + x_46_im) + Float64(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 <= -5500.0) tmp = t_0; elseif (x_46_im <= 1.8e-112) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))) + Float64(x_46_re * Float64(x_46_re * x_46_im))); elseif (x_46_im <= 400000000000.0) tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im + x_46_im) + ((x_46_re + x_46_im) * (x_46_im * (x_46_re - x_46_im))); tmp = 0.0; if (x_46_im <= -5500.0) tmp = t_0; elseif (x_46_im <= 1.8e-112) tmp = (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) + (x_46_re * (x_46_re * x_46_im)); elseif (x_46_im <= 400000000000.0) tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(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, -5500.0], t$95$0, If[LessEqual[x$46$im, 1.8e-112], N[(N[(x$46$re * 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$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 400000000000.0], 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$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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 -5500:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.im \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.im \leq 400000000000:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.im < -5500 or 4e11 < x.im Initial program 82.7%
+-commutative82.7%
*-commutative82.7%
fma-def85.8%
*-commutative85.8%
distribute-lft-out85.0%
*-commutative85.0%
Simplified85.0%
fma-udef81.9%
distribute-lft-in82.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+77.4%
distribute-lft-in78.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+84.2%
*-commutative84.2%
difference-of-squares94.4%
associate-*r*94.4%
*-commutative94.4%
Applied egg-rr94.4%
if -5500 < x.im < 1.8e-112Initial program 85.7%
*-commutative85.7%
sub-neg85.7%
distribute-rgt-in85.7%
associate-*l*99.8%
distribute-lft-neg-in99.8%
unpow399.8%
Applied egg-rr99.8%
Taylor expanded in x.re around inf 77.6%
unpow277.6%
Simplified77.6%
Applied egg-rr91.7%
if 1.8e-112 < x.im < 4e11Initial program 95.5%
*-commutative95.5%
sub-neg95.5%
distribute-rgt-in95.5%
associate-*l*99.6%
distribute-lft-neg-in99.6%
unpow399.7%
Applied egg-rr99.7%
*-commutative99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Applied egg-rr73.9%
Final simplification91.5%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 1.7e+58) (* x.im (- (* x.re 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_re <= 1.7e+58) {
tmp = x_46_im * ((x_46_re * 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_46re <= 1.7d+58) then
tmp = x_46im * ((x_46re * 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_re <= 1.7e+58) {
tmp = x_46_im * ((x_46_re * 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_re <= 1.7e+58: tmp = x_46_im * ((x_46_re * 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_re <= 1.7e+58) tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))); else tmp = Float64(3.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= 1.7e+58) tmp = x_46_im * ((x_46_re * 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$re, 1.7e+58], N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 1.7 \cdot 10^{+58}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < 1.7e58Initial program 90.4%
*-commutative90.4%
sub-neg90.4%
distribute-rgt-in88.0%
associate-*l*91.1%
distribute-lft-neg-in91.1%
unpow391.2%
Applied egg-rr91.2%
*-commutative91.2%
distribute-lft-out90.8%
Applied egg-rr90.8%
Applied egg-rr75.0%
if 1.7e58 < x.re Initial program 61.8%
*-commutative61.8%
sub-neg61.8%
distribute-rgt-in57.7%
associate-*l*77.0%
distribute-lft-neg-in77.0%
unpow377.0%
Applied egg-rr77.0%
*-commutative77.0%
distribute-lft-out77.0%
Applied egg-rr77.0%
Taylor expanded in x.re around inf 66.0%
unpow266.0%
*-commutative66.0%
distribute-rgt1-in66.0%
metadata-eval66.0%
associate-*l*66.0%
Simplified66.0%
Applied egg-rr85.3%
Final simplification77.0%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 1.5e+58) (* x.im (* 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_re <= 1.5e+58) {
tmp = x_46_im * (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_46re <= 1.5d+58) then
tmp = x_46im * (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_re <= 1.5e+58) {
tmp = x_46_im * (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_re <= 1.5e+58: tmp = x_46_im * (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_re <= 1.5e+58) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-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_re <= 1.5e+58) tmp = x_46_im * (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$re, 1.5e+58], N[(x$46$im * 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.re \leq 1.5 \cdot 10^{+58}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < 1.5000000000000001e58Initial program 90.4%
*-commutative90.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+63.3%
*-commutative63.3%
distribute-lft-in63.7%
Applied egg-rr63.7%
Taylor expanded in x.re around 0 59.7%
+-commutative59.7%
*-commutative59.7%
count-259.7%
distribute-rgt-in59.7%
mul-1-neg59.7%
unsub-neg59.7%
Simplified59.7%
Applied egg-rr66.8%
if 1.5000000000000001e58 < x.re Initial program 61.8%
*-commutative61.8%
sub-neg61.8%
distribute-rgt-in57.7%
associate-*l*77.0%
distribute-lft-neg-in77.0%
unpow377.0%
Applied egg-rr77.0%
*-commutative77.0%
distribute-lft-out77.0%
Applied egg-rr77.0%
Taylor expanded in x.re around inf 66.0%
unpow266.0%
*-commutative66.0%
distribute-rgt1-in66.0%
metadata-eval66.0%
associate-*l*66.0%
Simplified66.0%
Final simplification66.7%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 1.55e+58) (* x.im (* 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_re <= 1.55e+58) {
tmp = x_46_im * (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_46re <= 1.55d+58) then
tmp = x_46im * (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_re <= 1.55e+58) {
tmp = x_46_im * (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_re <= 1.55e+58: tmp = x_46_im * (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_re <= 1.55e+58) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(3.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= 1.55e+58) tmp = x_46_im * (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$re, 1.55e+58], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 1.55 \cdot 10^{+58}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < 1.55e58Initial program 90.4%
*-commutative90.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+63.3%
*-commutative63.3%
distribute-lft-in63.7%
Applied egg-rr63.7%
Taylor expanded in x.re around 0 59.7%
+-commutative59.7%
*-commutative59.7%
count-259.7%
distribute-rgt-in59.7%
mul-1-neg59.7%
unsub-neg59.7%
Simplified59.7%
Applied egg-rr66.8%
if 1.55e58 < x.re Initial program 61.8%
*-commutative61.8%
sub-neg61.8%
distribute-rgt-in57.7%
associate-*l*77.0%
distribute-lft-neg-in77.0%
unpow377.0%
Applied egg-rr77.0%
*-commutative77.0%
distribute-lft-out77.0%
Applied egg-rr77.0%
Taylor expanded in x.re around inf 66.0%
unpow266.0%
*-commutative66.0%
distribute-rgt1-in66.0%
metadata-eval66.0%
associate-*l*66.0%
Simplified66.0%
Applied egg-rr85.3%
Final simplification70.3%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 2.4e+100) (* x.im (* 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_re <= 2.4e+100) {
tmp = x_46_im * (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_46re <= 2.4d+100) then
tmp = x_46im * (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_re <= 2.4e+100) {
tmp = x_46_im * (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_re <= 2.4e+100: tmp = x_46_im * (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_re <= 2.4e+100) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(x_46_re * Float64(x_46_re * x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= 2.4e+100) tmp = x_46_im * (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$re, 2.4e+100], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 2.4 \cdot 10^{+100}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < 2.40000000000000012e100Initial program 89.8%
*-commutative89.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+62.5%
*-commutative62.5%
distribute-lft-in62.9%
Applied egg-rr62.9%
Taylor expanded in x.re around 0 58.7%
+-commutative58.7%
*-commutative58.7%
count-258.7%
distribute-rgt-in58.7%
mul-1-neg58.7%
unsub-neg58.7%
Simplified58.7%
Applied egg-rr66.1%
if 2.40000000000000012e100 < x.re Initial program 60.2%
*-commutative60.2%
sub-neg60.2%
distribute-rgt-in55.3%
associate-*l*77.9%
distribute-lft-neg-in77.9%
unpow377.9%
Applied egg-rr77.9%
Taylor expanded in x.re around inf 67.5%
unpow267.5%
Simplified67.5%
Applied egg-rr62.1%
Final simplification65.4%
(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(x_46_re * Float64(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[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot \left(x.re \cdot x.im\right)
\end{array}
Initial program 85.0%
*-commutative85.0%
sub-neg85.0%
distribute-rgt-in82.3%
associate-*l*88.5%
distribute-lft-neg-in88.5%
unpow388.6%
Applied egg-rr88.6%
Taylor expanded in x.re around inf 50.2%
unpow250.2%
Simplified50.2%
Applied egg-rr34.5%
Final simplification34.5%
(FPCore (x.re x.im) :precision binary64 -3.0)
double code(double x_46_re, double x_46_im) {
return -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -3.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -3.0;
}
def code(x_46_re, x_46_im): return -3.0
function code(x_46_re, x_46_im) return -3.0 end
function tmp = code(x_46_re, x_46_im) tmp = -3.0; end
code[x$46$re_, x$46$im_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 85.0%
Taylor expanded in x.re around 0 66.8%
Simplified21.5%
*-commutative21.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+8.2%
*-commutative8.2%
distribute-rgt-in8.2%
*-commutative8.2%
flip-+0.0%
clear-num0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
flip-+2.8%
Applied egg-rr2.8%
Taylor expanded in x.im around inf 2.7%
Final simplification2.7%
(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 85.0%
+-commutative85.0%
*-commutative85.0%
distribute-lft-out85.0%
associate-*l*85.0%
*-commutative85.0%
distribute-lft-out88.5%
associate-+r-88.5%
distribute-lft-out--82.2%
Simplified82.3%
flip3--11.7%
frac-2neg11.7%
*-commutative11.7%
unpow-prod-down11.6%
metadata-eval11.6%
associate-*l*11.6%
pow-pow11.6%
metadata-eval11.6%
Applied egg-rr8.1%
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 2023271
(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)))