
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(fma (+ x.re x.im) (* x.im (- x.re x.im)) (* x.re (* x.re (+ x.im x.im))))
(* x.im (* (+ x.re x.im) (- x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = fma((x_46_re + x_46_im), (x_46_im * (x_46_re - x_46_im)), (x_46_re * (x_46_re * (x_46_im + x_46_im))));
} else {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = fma(Float64(x_46_re + x_46_im), Float64(x_46_im * Float64(x_46_re - x_46_im)), Float64(x_46_re * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x.re + x.im, x.im \cdot \left(x.re - x.im\right), x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 94.9%
*-commutative94.9%
*-commutative94.9%
difference-of-squares94.9%
associate-*l*99.8%
fma-def99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-lft-out99.8%
Simplified99.8%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
*-commutative0.0%
*-commutative0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+20.7%
Applied egg-rr20.7%
*-commutative20.7%
rem-cbrt-cube17.2%
add-sqr-sqrt10.3%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod0.0%
add-sqr-sqrt3.4%
neg-mul-13.4%
cbrt-prod3.4%
metadata-eval3.4%
metadata-eval3.4%
add-cbrt-cube3.4%
rem-cbrt-cube20.7%
neg-mul-120.7%
cancel-sign-sub-inv20.7%
*-commutative20.7%
+-inverses37.9%
Applied egg-rr37.9%
difference-of-squares100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
2e+302)
(- (* 3.0 (* (* x.re x.re) x.im)) (pow x.im 3.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 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)))) <= 2e+302) {
tmp = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - pow(x_46_im, 3.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) :: tmp
if (((x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (x_46re * ((x_46re * x_46im) + (x_46re * x_46im)))) <= 2d+302) then
tmp = (3.0d0 * ((x_46re * x_46re) * x_46im)) - (x_46im ** 3.0d0)
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 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)))) <= 2e+302) {
tmp = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - Math.pow(x_46_im, 3.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): tmp = 0 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)))) <= 2e+302: tmp = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - math.pow(x_46_im, 3.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) 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)))) <= 2e+302) tmp = Float64(Float64(3.0 * Float64(Float64(x_46_re * x_46_re) * x_46_im)) - (x_46_im ^ 3.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) tmp = 0.0; 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)))) <= 2e+302) tmp = (3.0 * ((x_46_re * x_46_re) * x_46_im)) - (x_46_im ^ 3.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_] := 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], 2e+302], 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], 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}
\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 2 \cdot 10^{+302}:\\
\;\;\;\;3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right) - {x.im}^{3}\\
\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)) < 2.0000000000000002e302Initial program 97.7%
+-commutative97.7%
*-commutative97.7%
distribute-lft-out97.7%
associate-*l*97.6%
*-commutative97.6%
distribute-lft-out97.6%
associate-+r-97.6%
distribute-lft-out--97.6%
Simplified97.7%
if 2.0000000000000002e302 < (+.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 54.4%
+-commutative54.4%
*-commutative54.4%
fma-def61.9%
*-commutative61.9%
distribute-lft-out61.9%
*-commutative61.9%
Simplified61.9%
fma-udef54.4%
distribute-lft-in54.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-+68.2%
*-commutative68.2%
difference-of-squares90.7%
associate-*r*91.8%
*-commutative91.8%
Applied egg-rr91.8%
Final simplification95.9%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(- (* x.re (* x.re (* x.im 3.0))) (pow x.im 3.0))
(* x.im (* (+ x.re x.im) (- x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - pow(x_46_im, 3.0);
} else {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Double.POSITIVE_INFINITY) {
tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - Math.pow(x_46_im, 3.0);
} else {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if ((x_46_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)))) <= math.inf: tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - math.pow(x_46_im, 3.0) else: tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_im * 3.0))) - (x_46_im ^ 3.0)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))); end return tmp end
function tmp_2 = code(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))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Inf) tmp = (x_46_re * (x_46_re * (x_46_im * 3.0))) - (x_46_im ^ 3.0); else tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[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 * N[(x$46$re * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3}\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 94.9%
+-commutative94.9%
*-commutative94.9%
distribute-lft-out94.9%
associate-*l*94.9%
*-commutative94.9%
distribute-lft-out94.9%
associate-+r-94.9%
distribute-lft-out--94.0%
Simplified94.1%
sub-neg94.1%
associate-*l*94.1%
associate-*l*99.0%
Applied egg-rr99.0%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
*-commutative0.0%
*-commutative0.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+20.7%
Applied egg-rr20.7%
*-commutative20.7%
rem-cbrt-cube17.2%
add-sqr-sqrt10.3%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod0.0%
add-sqr-sqrt3.4%
neg-mul-13.4%
cbrt-prod3.4%
metadata-eval3.4%
metadata-eval3.4%
add-cbrt-cube3.4%
rem-cbrt-cube20.7%
neg-mul-120.7%
cancel-sign-sub-inv20.7%
*-commutative20.7%
+-inverses37.9%
Applied egg-rr37.9%
difference-of-squares100.0%
Applied egg-rr100.0%
Final simplification99.1%
(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 2e+302)
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 <= 2e+302) {
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 <= 2d+302) 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 <= 2e+302) {
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 <= 2e+302: 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 <= 2e+302) 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 <= 2e+302) 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, 2e+302], 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 2 \cdot 10^{+302}:\\
\;\;\;\;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)) < 2.0000000000000002e302Initial program 97.7%
if 2.0000000000000002e302 < (+.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 54.4%
+-commutative54.4%
*-commutative54.4%
fma-def61.9%
*-commutative61.9%
distribute-lft-out61.9%
*-commutative61.9%
Simplified61.9%
fma-udef54.4%
distribute-lft-in54.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-+68.2%
*-commutative68.2%
difference-of-squares90.7%
associate-*r*91.8%
*-commutative91.8%
Applied egg-rr91.8%
Final simplification95.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5.5e-46) (not (<= x.im 3.2e-97))) (* x.im (* (+ x.re x.im) (- x.re x.im))) (* x.re (+ (* x.im x.im) (* x.im (* x.re 3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5.5e-46) || !(x_46_im <= 3.2e-97)) {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
} else {
tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0)));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-5.5d-46)) .or. (.not. (x_46im <= 3.2d-97))) then
tmp = x_46im * ((x_46re + x_46im) * (x_46re - x_46im))
else
tmp = x_46re * ((x_46im * x_46im) + (x_46im * (x_46re * 3.0d0)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5.5e-46) || !(x_46_im <= 3.2e-97)) {
tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im));
} else {
tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -5.5e-46) or not (x_46_im <= 3.2e-97): tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)) else: tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -5.5e-46) || !(x_46_im <= 3.2e-97)) tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))); else tmp = Float64(x_46_re * Float64(Float64(x_46_im * x_46_im) + Float64(x_46_im * Float64(x_46_re * 3.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -5.5e-46) || ~((x_46_im <= 3.2e-97))) tmp = x_46_im * ((x_46_re + x_46_im) * (x_46_re - x_46_im)); else tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -5.5e-46], N[Not[LessEqual[x$46$im, 3.2e-97]], $MachinePrecision]], N[(x$46$im * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5.5 \cdot 10^{-46} \lor \neg \left(x.im \leq 3.2 \cdot 10^{-97}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im + x.im \cdot \left(x.re \cdot 3\right)\right)\\
\end{array}
\end{array}
if x.im < -5.49999999999999983e-46 or 3.1999999999999998e-97 < x.im Initial program 80.8%
*-commutative80.8%
*-commutative80.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-+71.4%
Applied egg-rr71.4%
*-commutative71.4%
rem-cbrt-cube52.3%
add-sqr-sqrt30.2%
sqrt-unprod47.8%
sqr-neg47.8%
sqrt-unprod26.9%
add-sqr-sqrt57.3%
neg-mul-157.3%
cbrt-prod57.3%
metadata-eval57.3%
metadata-eval57.3%
add-cbrt-cube57.3%
rem-cbrt-cube74.1%
neg-mul-174.1%
cancel-sign-sub-inv74.1%
*-commutative74.1%
+-inverses79.2%
Applied egg-rr79.2%
difference-of-squares90.6%
Applied egg-rr90.6%
if -5.49999999999999983e-46 < x.im < 3.1999999999999998e-97Initial program 89.4%
*-commutative89.4%
*-commutative89.4%
difference-of-squares89.4%
associate-*l*99.7%
fma-def99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in x.im around 0 95.7%
Taylor expanded in x.re around 0 85.3%
distribute-rgt1-in85.3%
metadata-eval85.3%
*-commutative85.3%
*-commutative85.3%
unpow285.3%
unpow285.3%
associate-*r*95.6%
*-commutative95.6%
distribute-rgt-out95.6%
*-commutative95.6%
associate-*l*95.7%
Simplified95.7%
Final simplification92.6%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.85e-44) (not (<= x.im 1.1e-96))) (/ (+ x.re x.im) (/ (/ 1.0 (- x.re x.im)) x.im)) (* x.re (+ (* x.im x.im) (* x.im (* x.re 3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.85e-44) || !(x_46_im <= 1.1e-96)) {
tmp = (x_46_re + x_46_im) / ((1.0 / (x_46_re - x_46_im)) / x_46_im);
} else {
tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0)));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46im <= (-1.85d-44)) .or. (.not. (x_46im <= 1.1d-96))) then
tmp = (x_46re + x_46im) / ((1.0d0 / (x_46re - x_46im)) / x_46im)
else
tmp = x_46re * ((x_46im * x_46im) + (x_46im * (x_46re * 3.0d0)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.85e-44) || !(x_46_im <= 1.1e-96)) {
tmp = (x_46_re + x_46_im) / ((1.0 / (x_46_re - x_46_im)) / x_46_im);
} else {
tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -1.85e-44) or not (x_46_im <= 1.1e-96): tmp = (x_46_re + x_46_im) / ((1.0 / (x_46_re - x_46_im)) / x_46_im) else: tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -1.85e-44) || !(x_46_im <= 1.1e-96)) tmp = Float64(Float64(x_46_re + x_46_im) / Float64(Float64(1.0 / Float64(x_46_re - x_46_im)) / x_46_im)); else tmp = Float64(x_46_re * Float64(Float64(x_46_im * x_46_im) + Float64(x_46_im * Float64(x_46_re * 3.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -1.85e-44) || ~((x_46_im <= 1.1e-96))) tmp = (x_46_re + x_46_im) / ((1.0 / (x_46_re - x_46_im)) / x_46_im); else tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -1.85e-44], N[Not[LessEqual[x$46$im, 1.1e-96]], $MachinePrecision]], N[(N[(x$46$re + x$46$im), $MachinePrecision] / N[(N[(1.0 / N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.85 \cdot 10^{-44} \lor \neg \left(x.im \leq 1.1 \cdot 10^{-96}\right):\\
\;\;\;\;\frac{x.re + x.im}{\frac{\frac{1}{x.re - x.im}}{x.im}}\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im + x.im \cdot \left(x.re \cdot 3\right)\right)\\
\end{array}
\end{array}
if x.im < -1.85e-44 or 1.0999999999999999e-96 < x.im Initial program 80.8%
*-commutative80.8%
*-commutative80.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-+71.4%
Applied egg-rr71.4%
*-commutative71.4%
rem-cbrt-cube52.3%
add-sqr-sqrt30.2%
sqrt-unprod47.8%
sqr-neg47.8%
sqrt-unprod26.9%
add-sqr-sqrt57.3%
neg-mul-157.3%
cbrt-prod57.3%
metadata-eval57.3%
metadata-eval57.3%
add-cbrt-cube57.3%
rem-cbrt-cube74.1%
neg-mul-174.1%
cancel-sign-sub-inv74.1%
*-commutative74.1%
+-inverses79.2%
Applied egg-rr79.2%
difference-of-squares90.6%
Applied egg-rr90.6%
+-commutative90.6%
*-commutative90.6%
associate-*l*90.7%
flip--79.1%
+-commutative79.1%
clear-num79.1%
*-commutative79.1%
associate-/r/79.0%
clear-num79.0%
*-commutative79.0%
associate-/l*79.1%
+-commutative79.1%
clear-num79.2%
+-commutative79.2%
flip--90.7%
Applied egg-rr90.7%
if -1.85e-44 < x.im < 1.0999999999999999e-96Initial program 89.4%
*-commutative89.4%
*-commutative89.4%
difference-of-squares89.4%
associate-*l*99.7%
fma-def99.8%
*-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in x.im around 0 95.7%
Taylor expanded in x.re around 0 85.3%
distribute-rgt1-in85.3%
metadata-eval85.3%
*-commutative85.3%
*-commutative85.3%
unpow285.3%
unpow285.3%
associate-*r*95.6%
*-commutative95.6%
distribute-rgt-out95.6%
*-commutative95.6%
associate-*l*95.7%
Simplified95.7%
Final simplification92.6%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -1.5e+140) (* x.re (* x.im x.im)) (* x.re (+ (* x.im x.im) (* x.im (* x.re 3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -1.5e+140) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0)));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-1.5d+140)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = x_46re * ((x_46im * x_46im) + (x_46im * (x_46re * 3.0d0)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -1.5e+140) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -1.5e+140: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -1.5e+140) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(x_46_re * Float64(Float64(x_46_im * x_46_im) + Float64(x_46_im * Float64(x_46_re * 3.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -1.5e+140) tmp = x_46_re * (x_46_im * x_46_im); else tmp = x_46_re * ((x_46_im * x_46_im) + (x_46_im * (x_46_re * 3.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -1.5e+140], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{+140}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im + x.im \cdot \left(x.re \cdot 3\right)\right)\\
\end{array}
\end{array}
if x.im < -1.49999999999999998e140Initial program 68.8%
*-commutative68.8%
*-commutative68.8%
difference-of-squares78.1%
associate-*l*78.1%
fma-def78.1%
*-commutative78.1%
*-commutative78.1%
*-commutative78.1%
distribute-lft-out78.1%
Simplified78.1%
Taylor expanded in x.im around 0 26.9%
Taylor expanded in x.re around 0 44.3%
unpow244.3%
*-commutative44.3%
Simplified44.3%
if -1.49999999999999998e140 < x.im Initial program 86.4%
*-commutative86.4%
*-commutative86.4%
difference-of-squares89.0%
associate-*l*94.0%
fma-def94.0%
*-commutative94.0%
*-commutative94.0%
*-commutative94.0%
distribute-lft-out94.0%
Simplified94.0%
Taylor expanded in x.im around 0 66.0%
Taylor expanded in x.re around 0 59.5%
distribute-rgt1-in59.5%
metadata-eval59.5%
*-commutative59.5%
*-commutative59.5%
unpow259.5%
unpow259.5%
associate-*r*64.5%
*-commutative64.5%
distribute-rgt-out67.2%
*-commutative67.2%
associate-*l*67.2%
Simplified67.2%
Final simplification64.3%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -5.6e+138) (* x.re (* x.im x.im)) (* 3.0 (* x.re (* x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -5.6e+138) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-5.6d+138)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = 3.0d0 * (x_46re * (x_46re * x_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -5.6e+138) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -5.6e+138: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = 3.0 * (x_46_re * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -5.6e+138) tmp = Float64(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_im <= -5.6e+138) tmp = x_46_re * (x_46_im * x_46_im); else tmp = 3.0 * (x_46_re * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -5.6e+138], N[(x$46$re * 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.im \leq -5.6 \cdot 10^{+138}:\\
\;\;\;\;x.re \cdot \left(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.im < -5.6000000000000002e138Initial program 69.7%
*-commutative69.7%
*-commutative69.7%
difference-of-squares78.8%
associate-*l*78.8%
fma-def78.8%
*-commutative78.8%
*-commutative78.8%
*-commutative78.8%
distribute-lft-out78.8%
Simplified78.8%
Taylor expanded in x.im around 0 26.3%
Taylor expanded in x.re around 0 43.1%
unpow243.1%
*-commutative43.1%
Simplified43.1%
if -5.6000000000000002e138 < x.im Initial program 86.3%
+-commutative86.3%
*-commutative86.3%
distribute-lft-out86.3%
associate-*l*86.3%
*-commutative86.3%
distribute-lft-out89.4%
associate-+r-89.4%
distribute-lft-out--85.3%
Simplified85.4%
sub-neg85.4%
associate-*l*85.4%
associate-*l*90.4%
Applied egg-rr90.4%
Taylor expanded in x.re around inf 58.7%
*-commutative58.7%
associate-*l*58.7%
*-commutative58.7%
unpow258.7%
Simplified58.7%
Taylor expanded in x.im around 0 58.7%
unpow258.7%
associate-*r*63.7%
Simplified63.7%
Final simplification61.1%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -3.8e+136) (* x.re (* x.im x.im)) (* x.re (* x.im (* x.re 3.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -3.8e+136) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-3.8d+136)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = x_46re * (x_46im * (x_46re * 3.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -3.8e+136) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * (x_46_im * (x_46_re * 3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -3.8e+136: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = x_46_re * (x_46_im * (x_46_re * 3.0)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -3.8e+136) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_re * 3.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -3.8e+136) tmp = x_46_re * (x_46_im * x_46_im); else tmp = x_46_re * (x_46_im * (x_46_re * 3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -3.8e+136], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.8 \cdot 10^{+136}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\end{array}
\end{array}
if x.im < -3.80000000000000015e136Initial program 69.7%
*-commutative69.7%
*-commutative69.7%
difference-of-squares78.8%
associate-*l*78.8%
fma-def78.8%
*-commutative78.8%
*-commutative78.8%
*-commutative78.8%
distribute-lft-out78.8%
Simplified78.8%
Taylor expanded in x.im around 0 26.3%
Taylor expanded in x.re around 0 43.1%
unpow243.1%
*-commutative43.1%
Simplified43.1%
if -3.80000000000000015e136 < x.im Initial program 86.3%
*-commutative86.3%
*-commutative86.3%
difference-of-squares89.0%
associate-*l*94.0%
fma-def94.0%
*-commutative94.0%
*-commutative94.0%
*-commutative94.0%
distribute-lft-out94.0%
Simplified94.0%
Taylor expanded in x.im around 0 66.2%
Taylor expanded in x.re around 0 59.8%
distribute-rgt1-in59.8%
metadata-eval59.8%
*-commutative59.8%
*-commutative59.8%
unpow259.8%
unpow259.8%
associate-*r*64.8%
*-commutative64.8%
distribute-rgt-out67.4%
*-commutative67.4%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in x.im around 0 63.7%
*-commutative63.7%
associate-*r*63.7%
Simplified63.7%
Final simplification61.1%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -5.4e+138) (* x.re (* x.im x.im)) (* (* x.re x.re) x.im)))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -5.4e+138) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-5.4d+138)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -5.4e+138) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -5.4e+138: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -5.4e+138) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -5.4e+138) tmp = x_46_re * (x_46_im * x_46_im); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -5.4e+138], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5.4 \cdot 10^{+138}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.im < -5.40000000000000018e138Initial program 69.7%
*-commutative69.7%
*-commutative69.7%
difference-of-squares78.8%
associate-*l*78.8%
fma-def78.8%
*-commutative78.8%
*-commutative78.8%
*-commutative78.8%
distribute-lft-out78.8%
Simplified78.8%
Taylor expanded in x.im around 0 26.3%
Taylor expanded in x.re around 0 43.1%
unpow243.1%
*-commutative43.1%
Simplified43.1%
if -5.40000000000000018e138 < x.im Initial program 86.3%
*-commutative86.3%
*-commutative86.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+61.2%
Applied egg-rr61.2%
Taylor expanded in x.re around inf 38.9%
unpow238.9%
Simplified38.9%
Final simplification39.5%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im -2.7e+133) (* x.re (* x.im x.im)) (* x.re (* x.re x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -2.7e+133) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * (x_46_re * x_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= (-2.7d+133)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = x_46re * (x_46re * x_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -2.7e+133) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_re * (x_46_re * x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -2.7e+133: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = x_46_re * (x_46_re * x_46_im) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -2.7e+133) tmp = Float64(x_46_re * Float64(x_46_im * 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_im <= -2.7e+133) tmp = x_46_re * (x_46_im * x_46_im); else tmp = x_46_re * (x_46_re * x_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -2.7e+133], N[(x$46$re * 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.im \leq -2.7 \cdot 10^{+133}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < -2.7000000000000002e133Initial program 69.7%
*-commutative69.7%
*-commutative69.7%
difference-of-squares78.8%
associate-*l*78.8%
fma-def78.8%
*-commutative78.8%
*-commutative78.8%
*-commutative78.8%
distribute-lft-out78.8%
Simplified78.8%
Taylor expanded in x.im around 0 26.3%
Taylor expanded in x.re around 0 43.1%
unpow243.1%
*-commutative43.1%
Simplified43.1%
if -2.7000000000000002e133 < x.im Initial program 86.3%
*-commutative86.3%
*-commutative86.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+61.2%
Applied egg-rr61.2%
Taylor expanded in x.re around inf 38.9%
unpow238.9%
Simplified38.9%
Taylor expanded in x.im around 0 38.9%
unpow238.9%
associate-*r*39.5%
Simplified39.5%
Final simplification40.0%
(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 84.2%
*-commutative84.2%
*-commutative84.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
distribute-lft-out--0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+63.1%
Applied egg-rr63.1%
Taylor expanded in x.re around inf 35.1%
unpow235.1%
Simplified35.1%
Final simplification35.1%
(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 84.2%
Taylor expanded in x.re around 0 57.4%
Simplified2.5%
Final simplification2.5%
(FPCore (x.re x.im) :precision binary64 -2.6)
double code(double x_46_re, double x_46_im) {
return -2.6;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -2.6d0
end function
public static double code(double x_46_re, double x_46_im) {
return -2.6;
}
def code(x_46_re, x_46_im): return -2.6
function code(x_46_re, x_46_im) return -2.6 end
function tmp = code(x_46_re, x_46_im) tmp = -2.6; end
code[x$46$re_, x$46$im_] := -2.6
\begin{array}{l}
\\
-2.6
\end{array}
Initial program 84.2%
+-commutative84.2%
*-commutative84.2%
distribute-lft-out84.2%
associate-*l*84.1%
*-commutative84.1%
distribute-lft-out88.4%
associate-+r-88.4%
distribute-lft-out--83.3%
Simplified83.4%
flip3--10.7%
frac-2neg10.7%
*-commutative10.7%
unpow-prod-down10.7%
metadata-eval10.7%
associate-*l*10.6%
pow-pow10.6%
metadata-eval10.6%
Applied egg-rr6.8%
Simplified2.5%
Final simplification2.5%
(FPCore (x.re x.im) :precision binary64 2.6)
double code(double x_46_re, double x_46_im) {
return 2.6;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 2.6d0
end function
public static double code(double x_46_re, double x_46_im) {
return 2.6;
}
def code(x_46_re, x_46_im): return 2.6
function code(x_46_re, x_46_im) return 2.6 end
function tmp = code(x_46_re, x_46_im) tmp = 2.6; end
code[x$46$re_, x$46$im_] := 2.6
\begin{array}{l}
\\
2.6
\end{array}
Initial program 84.2%
+-commutative84.2%
*-commutative84.2%
distribute-lft-out84.2%
associate-*l*84.1%
*-commutative84.1%
distribute-lft-out88.4%
associate-+r-88.4%
distribute-lft-out--83.3%
Simplified83.4%
flip3--10.7%
div-inv10.7%
*-commutative10.7%
unpow-prod-down10.6%
metadata-eval10.6%
associate-*l*10.6%
pow-pow10.6%
metadata-eval10.6%
associate-+r+10.6%
Applied egg-rr6.8%
Simplified2.9%
Final simplification2.9%
(FPCore (x.re x.im) :precision binary64 10.0)
double code(double x_46_re, double x_46_im) {
return 10.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 10.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return 10.0;
}
def code(x_46_re, x_46_im): return 10.0
function code(x_46_re, x_46_im) return 10.0 end
function tmp = code(x_46_re, x_46_im) tmp = 10.0; end
code[x$46$re_, x$46$im_] := 10.0
\begin{array}{l}
\\
10
\end{array}
Initial program 84.2%
+-commutative84.2%
*-commutative84.2%
distribute-lft-out84.2%
associate-*l*84.1%
*-commutative84.1%
distribute-lft-out88.4%
associate-+r-88.4%
distribute-lft-out--83.3%
Simplified83.4%
flip--22.2%
div-inv21.5%
Applied egg-rr13.7%
Simplified2.9%
Final simplification2.9%
(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 2023278
(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)))