
(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 9 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)
(+ (* (+ x.re x.im) (* x.im (- x.re x.im))) (* x.re (* x.re (+ x.im x.im))))
(*
x.im
(* x.im (* x.im (+ -1.0 (* 3.0 (* x.re (/ (/ x.re x.im) 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_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_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / 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_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_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / 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_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_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / 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(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(x_46_im * Float64(x_46_im * Float64(-1.0 + Float64(3.0 * Float64(x_46_re * Float64(Float64(x_46_re / x_46_im) / x_46_im))))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (((x_46_im * ((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_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_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / 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[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $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[(x$46$im * N[(x$46$im * N[(-1.0 + N[(3.0 * N[(x$46$re * N[(N[(x$46$re / x$46$im), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 \infty:\\
\;\;\;\;\left(x.re + x.im\right) \cdot \left(x.im \cdot \left(x.re - x.im\right)\right) + x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.im \cdot \left(-1 + 3 \cdot \left(x.re \cdot \frac{\frac{x.re}{x.im}}{x.im}\right)\right)\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 95.3%
difference-of-squaresN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
*-commutativeN/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.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%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6432.0%
Simplified32.0%
Taylor expanded in x.im around inf
Simplified100.0%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re 5e+76)
(* x.im (- (* (* x.re x.re) 3.0) (* x.im x.im)))
(if (<= x.re 5.7e+210)
(* x.re (* x.im (- (* x.re 3.0) (/ (* x.im x.im) x.re))))
(* 3.0 (* x.re (* x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= 5e+76) {
tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (x_46_im * x_46_im));
} else if (x_46_re <= 5.7e+210) {
tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re)));
} 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 <= 5d+76) then
tmp = x_46im * (((x_46re * x_46re) * 3.0d0) - (x_46im * x_46im))
else if (x_46re <= 5.7d+210) then
tmp = x_46re * (x_46im * ((x_46re * 3.0d0) - ((x_46im * x_46im) / x_46re)))
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 <= 5e+76) {
tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (x_46_im * x_46_im));
} else if (x_46_re <= 5.7e+210) {
tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re)));
} 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 <= 5e+76: tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (x_46_im * x_46_im)) elif x_46_re <= 5.7e+210: tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re))) 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 <= 5e+76) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re * x_46_re) * 3.0) - Float64(x_46_im * x_46_im))); elseif (x_46_re <= 5.7e+210) tmp = Float64(x_46_re * Float64(x_46_im * Float64(Float64(x_46_re * 3.0) - Float64(Float64(x_46_im * x_46_im) / x_46_re)))); 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 <= 5e+76) tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (x_46_im * x_46_im)); elseif (x_46_re <= 5.7e+210) tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re))); 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, 5e+76], N[(x$46$im * N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5.7e+210], N[(x$46$re * N[(x$46$im * N[(N[(x$46$re * 3.0), $MachinePrecision] - N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $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 5 \cdot 10^{+76}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3 - x.im \cdot x.im\right)\\
\mathbf{elif}\;x.re \leq 5.7 \cdot 10^{+210}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3 - \frac{x.im \cdot x.im}{x.re}\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 < 4.99999999999999991e76Initial program 90.1%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6492.4%
Simplified92.4%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.4%
Applied egg-rr92.4%
if 4.99999999999999991e76 < x.re < 5.6999999999999995e210Initial program 55.3%
difference-of-squaresN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6479.0%
Applied egg-rr79.0%
Taylor expanded in x.re around inf
Simplified87.2%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6495.6%
Simplified95.6%
if 5.6999999999999995e210 < x.re Initial program 77.8%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6477.8%
Simplified77.8%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
Final simplification93.3%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im 2.2e-28)
(* x.re (* x.im (- (* x.re 3.0) (/ (* x.im x.im) x.re))))
(*
x.im
(* x.im (* x.im (+ -1.0 (* 3.0 (* x.re (/ (/ x.re x.im) x.im)))))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.2e-28) {
tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re)));
} else {
tmp = x_46_im * (x_46_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / x_46_im))))));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= 2.2d-28) then
tmp = x_46re * (x_46im * ((x_46re * 3.0d0) - ((x_46im * x_46im) / x_46re)))
else
tmp = x_46im * (x_46im * (x_46im * ((-1.0d0) + (3.0d0 * (x_46re * ((x_46re / x_46im) / x_46im))))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.2e-28) {
tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re)));
} else {
tmp = x_46_im * (x_46_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / x_46_im))))));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 2.2e-28: tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re))) else: tmp = x_46_im * (x_46_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / x_46_im)))))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 2.2e-28) tmp = Float64(x_46_re * Float64(x_46_im * Float64(Float64(x_46_re * 3.0) - Float64(Float64(x_46_im * x_46_im) / x_46_re)))); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_im * Float64(-1.0 + Float64(3.0 * Float64(x_46_re * Float64(Float64(x_46_re / x_46_im) / x_46_im))))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 2.2e-28) tmp = x_46_re * (x_46_im * ((x_46_re * 3.0) - ((x_46_im * x_46_im) / x_46_re))); else tmp = x_46_im * (x_46_im * (x_46_im * (-1.0 + (3.0 * (x_46_re * ((x_46_re / x_46_im) / x_46_im)))))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 2.2e-28], N[(x$46$re * N[(x$46$im * N[(N[(x$46$re * 3.0), $MachinePrecision] - N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$im * N[(-1.0 + N[(3.0 * N[(x$46$re * N[(N[(x$46$re / x$46$im), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.2 \cdot 10^{-28}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3 - \frac{x.im \cdot x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.im \cdot \left(-1 + 3 \cdot \left(x.re \cdot \frac{\frac{x.re}{x.im}}{x.im}\right)\right)\right)\right)\\
\end{array}
\end{array}
if x.im < 2.19999999999999996e-28Initial program 87.1%
difference-of-squaresN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.3%
Applied egg-rr94.3%
Taylor expanded in x.re around inf
Simplified74.6%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6496.3%
Simplified96.3%
if 2.19999999999999996e-28 < x.im Initial program 82.0%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6489.1%
Simplified89.1%
Taylor expanded in x.im around inf
Simplified99.9%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 6.8e+101) (* x.im (- (* (* x.re x.re) 3.0) (* 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 <= 6.8e+101) {
tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (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 <= 6.8d+101) then
tmp = x_46im * (((x_46re * x_46re) * 3.0d0) - (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 <= 6.8e+101) {
tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (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 <= 6.8e+101: tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (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 <= 6.8e+101) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re * x_46_re) * 3.0) - 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 <= 6.8e+101) tmp = x_46_im * (((x_46_re * x_46_re) * 3.0) - (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, 6.8e+101], N[(x$46$im * N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $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 6.8 \cdot 10^{+101}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3 - 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 < 6.80000000000000034e101Initial program 88.9%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6492.5%
Simplified92.5%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.6%
Applied egg-rr92.6%
if 6.80000000000000034e101 < x.re Initial program 69.1%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6469.1%
Simplified69.1%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.3%
Simplified82.3%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.6%
Applied egg-rr94.6%
Final simplification92.9%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 6.8e+101) (* x.im (- (* x.re (* x.re 3.0)) (* 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 <= 6.8e+101) {
tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (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 <= 6.8d+101) then
tmp = x_46im * ((x_46re * (x_46re * 3.0d0)) - (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 <= 6.8e+101) {
tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (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 <= 6.8e+101: tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (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 <= 6.8e+101) tmp = Float64(x_46_im * Float64(Float64(x_46_re * Float64(x_46_re * 3.0)) - Float64(x_46_im * x_46_im))); else tmp = Float64(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 <= 6.8e+101) tmp = x_46_im * ((x_46_re * (x_46_re * 3.0)) - (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, 6.8e+101], N[(x$46$im * N[(N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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 6.8 \cdot 10^{+101}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right) - 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 < 6.80000000000000034e101Initial program 88.9%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6492.5%
Simplified92.5%
if 6.80000000000000034e101 < x.re Initial program 69.1%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6469.1%
Simplified69.1%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6482.3%
Simplified82.3%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6494.6%
Applied egg-rr94.6%
Final simplification92.8%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 4.2e-23) (* (* x.im x.im) (- 0.0 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 <= 4.2e-23) {
tmp = (x_46_im * x_46_im) * (0.0 - 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 <= 4.2d-23) then
tmp = (x_46im * x_46im) * (0.0d0 - 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 <= 4.2e-23) {
tmp = (x_46_im * x_46_im) * (0.0 - 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 <= 4.2e-23: tmp = (x_46_im * x_46_im) * (0.0 - 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 <= 4.2e-23) tmp = Float64(Float64(x_46_im * x_46_im) * Float64(0.0 - 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 <= 4.2e-23) tmp = (x_46_im * x_46_im) * (0.0 - 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, 4.2e-23], N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[(0.0 - 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 4.2 \cdot 10^{-23}:\\
\;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(0 - 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 < 4.2000000000000002e-23Initial program 90.1%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6491.6%
Simplified91.6%
Taylor expanded in x.im around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.5%
Simplified63.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6463.5%
Applied egg-rr63.5%
if 4.2000000000000002e-23 < x.re Initial program 73.8%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6481.5%
Simplified81.5%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.9%
Simplified71.9%
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.3%
Applied egg-rr79.3%
Final simplification67.4%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 2.9e-24) (* (* x.im x.im) (- 0.0 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 <= 2.9e-24) {
tmp = (x_46_im * x_46_im) * (0.0 - 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 <= 2.9d-24) then
tmp = (x_46im * x_46im) * (0.0d0 - 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 <= 2.9e-24) {
tmp = (x_46_im * x_46_im) * (0.0 - 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 <= 2.9e-24: tmp = (x_46_im * x_46_im) * (0.0 - 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 <= 2.9e-24) tmp = Float64(Float64(x_46_im * x_46_im) * Float64(0.0 - 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 <= 2.9e-24) tmp = (x_46_im * x_46_im) * (0.0 - 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, 2.9e-24], N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[(0.0 - 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 2.9 \cdot 10^{-24}:\\
\;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(0 - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\left(x.re \cdot x.re\right) \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < 2.8999999999999999e-24Initial program 90.1%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6491.6%
Simplified91.6%
Taylor expanded in x.im around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.5%
Simplified63.5%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6463.5%
Applied egg-rr63.5%
if 2.8999999999999999e-24 < x.re Initial program 73.8%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6481.5%
Simplified81.5%
Taylor expanded in x.im around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6471.9%
Simplified71.9%
Final simplification65.6%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re 8.4e+211) (* (* x.im x.im) (- 0.0 x.im)) (* x.im (* x.im x.im))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= 8.4e+211) {
tmp = (x_46_im * x_46_im) * (0.0 - x_46_im);
} else {
tmp = x_46_im * (x_46_im * x_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re <= 8.4d+211) then
tmp = (x_46im * x_46im) * (0.0d0 - x_46im)
else
tmp = x_46im * (x_46im * x_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= 8.4e+211) {
tmp = (x_46_im * x_46_im) * (0.0 - x_46_im);
} else {
tmp = x_46_im * (x_46_im * x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= 8.4e+211: tmp = (x_46_im * x_46_im) * (0.0 - x_46_im) else: tmp = x_46_im * (x_46_im * x_46_im) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= 8.4e+211) tmp = Float64(Float64(x_46_im * x_46_im) * Float64(0.0 - x_46_im)); else tmp = Float64(x_46_im * Float64(x_46_im * x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= 8.4e+211) tmp = (x_46_im * x_46_im) * (0.0 - x_46_im); else tmp = x_46_im * (x_46_im * x_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, 8.4e+211], N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[(0.0 - x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 8.4 \cdot 10^{+211}:\\
\;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(0 - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < 8.3999999999999999e211Initial program 86.6%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6489.9%
Simplified89.9%
Taylor expanded in x.im around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.6%
Simplified56.6%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6456.6%
Applied egg-rr56.6%
if 8.3999999999999999e211 < x.re Initial program 77.8%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6477.8%
Simplified77.8%
Taylor expanded in x.im around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f640.7%
Simplified0.7%
flip3--N/A
metadata-evalN/A
sub0-negN/A
cube-negN/A
sub0-negN/A
sqr-powN/A
pow-prod-downN/A
sub0-negN/A
sub0-negN/A
sqr-negN/A
pow-prod-downN/A
sqr-powN/A
cube-unmultN/A
pow-powN/A
metadata-evalN/A
Applied egg-rr29.9%
Final simplification54.8%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.im x.im)))
double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_im * x_46_im);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * (x_46im * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_im * x_46_im);
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_im * x_46_im)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_im * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_im * x_46_im); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.im \cdot x.im\right)
\end{array}
Initial program 86.0%
+-commutativeN/A
*-commutativeN/A
distribute-lft-outN/A
associate-*l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
associate-+r-N/A
--lowering--.f64N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
count-2N/A
distribute-lft1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6489.0%
Simplified89.0%
Taylor expanded in x.im around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.7%
Simplified52.7%
flip3--N/A
metadata-evalN/A
sub0-negN/A
cube-negN/A
sub0-negN/A
sqr-powN/A
pow-prod-downN/A
sub0-negN/A
sub0-negN/A
sqr-negN/A
pow-prod-downN/A
sqr-powN/A
cube-unmultN/A
pow-powN/A
metadata-evalN/A
Applied egg-rr20.5%
Final simplification20.5%
(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 2024161
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:alt
(! :herbie-platform default (+ (* (* x.re x.im) (* 2 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)))