
(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 4 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}
x.re_m = (fabs.f64 x.re)
(FPCore (x.re_m x.im)
:precision binary64
(let* ((t_0 (* x.re_m (+ (* x.re_m x.im) (* x.re_m x.im)))))
(if (<= (+ (* x.im (- (* x.re_m x.re_m) (* x.im x.im))) t_0) INFINITY)
(+ t_0 (* (* x.im (+ x.re_m x.im)) (- x.re_m x.im)))
(* x.im (* x.re_m (* x.re_m -3.0))))))x.re_m = fabs(x_46_re);
double code(double x_46_re_m, double x_46_im) {
double t_0 = x_46_re_m * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im));
double tmp;
if (((x_46_im * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + t_0) <= ((double) INFINITY)) {
tmp = t_0 + ((x_46_im * (x_46_re_m + x_46_im)) * (x_46_re_m - x_46_im));
} else {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
return tmp;
}
x.re_m = Math.abs(x_46_re);
public static double code(double x_46_re_m, double x_46_im) {
double t_0 = x_46_re_m * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im));
double tmp;
if (((x_46_im * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + t_0) <= Double.POSITIVE_INFINITY) {
tmp = t_0 + ((x_46_im * (x_46_re_m + x_46_im)) * (x_46_re_m - x_46_im));
} else {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
return tmp;
}
x.re_m = math.fabs(x_46_re) def code(x_46_re_m, x_46_im): t_0 = x_46_re_m * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)) tmp = 0 if ((x_46_im * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + t_0) <= math.inf: tmp = t_0 + ((x_46_im * (x_46_re_m + x_46_im)) * (x_46_re_m - x_46_im)) else: tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)) return tmp
x.re_m = abs(x_46_re) function code(x_46_re_m, x_46_im) t_0 = Float64(x_46_re_m * Float64(Float64(x_46_re_m * x_46_im) + Float64(x_46_re_m * x_46_im))) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re_m * x_46_re_m) - Float64(x_46_im * x_46_im))) + t_0) <= Inf) tmp = Float64(t_0 + Float64(Float64(x_46_im * Float64(x_46_re_m + x_46_im)) * Float64(x_46_re_m - x_46_im))); else tmp = Float64(x_46_im * Float64(x_46_re_m * Float64(x_46_re_m * -3.0))); end return tmp end
x.re_m = abs(x_46_re); function tmp_2 = code(x_46_re_m, x_46_im) t_0 = x_46_re_m * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)); tmp = 0.0; if (((x_46_im * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + t_0) <= Inf) tmp = t_0 + ((x_46_im * (x_46_re_m + x_46_im)) * (x_46_re_m - x_46_im)); else tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)); end tmp_2 = tmp; end
x.re_m = N[Abs[x$46$re], $MachinePrecision]
code[x$46$re$95$m_, x$46$im_] := Block[{t$95$0 = N[(x$46$re$95$m * N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] + N[(x$46$re$95$m * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x$46$im * N[(N[(x$46$re$95$m * x$46$re$95$m), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], Infinity], N[(t$95$0 + N[(N[(x$46$im * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision] * N[(x$46$re$95$m - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re$95$m * N[(x$46$re$95$m * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.re_m = \left|x.re\right|
\\
\begin{array}{l}
t_0 := x.re\_m \cdot \left(x.re\_m \cdot x.im + x.re\_m \cdot x.im\right)\\
\mathbf{if}\;x.im \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right) + t\_0 \leq \infty:\\
\;\;\;\;t\_0 + \left(x.im \cdot \left(x.re\_m + x.im\right)\right) \cdot \left(x.re\_m - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m \cdot -3\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.8%
*-commutative94.8%
difference-of-squares94.8%
associate-*r*99.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%
Simplified0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
associate-*r*0.0%
associate-*r*0.0%
Applied egg-rr0.0%
Taylor expanded in x.re around inf 18.2%
associate-*r*18.2%
*-commutative18.2%
associate-*l*18.2%
Simplified18.2%
metadata-eval18.2%
associate-*r*18.2%
neg-mul-118.2%
add-sqr-sqrt0.0%
associate-*r*0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
unpow20.0%
sqrt-prod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-unprod69.7%
add-sqr-sqrt69.7%
unpow269.7%
sqrt-prod57.6%
add-sqr-sqrt81.8%
Applied egg-rr81.8%
Final simplification97.4%
x.re_m = (fabs.f64 x.re) (FPCore (x.re_m x.im) :precision binary64 (if (<= x.im 3.3e+126) (* x.re_m (* x.re_m (* x.im 3.0))) (* x.im (* x.re_m (* x.re_m -3.0)))))
x.re_m = fabs(x_46_re);
double code(double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_im <= 3.3e+126) {
tmp = x_46_re_m * (x_46_re_m * (x_46_im * 3.0));
} else {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
return tmp;
}
x.re_m = abs(x_46re)
real(8) function code(x_46re_m, x_46im)
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= 3.3d+126) then
tmp = x_46re_m * (x_46re_m * (x_46im * 3.0d0))
else
tmp = x_46im * (x_46re_m * (x_46re_m * (-3.0d0)))
end if
code = tmp
end function
x.re_m = Math.abs(x_46_re);
public static double code(double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_im <= 3.3e+126) {
tmp = x_46_re_m * (x_46_re_m * (x_46_im * 3.0));
} else {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
return tmp;
}
x.re_m = math.fabs(x_46_re) def code(x_46_re_m, x_46_im): tmp = 0 if x_46_im <= 3.3e+126: tmp = x_46_re_m * (x_46_re_m * (x_46_im * 3.0)) else: tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)) return tmp
x.re_m = abs(x_46_re) function code(x_46_re_m, x_46_im) tmp = 0.0 if (x_46_im <= 3.3e+126) tmp = Float64(x_46_re_m * Float64(x_46_re_m * Float64(x_46_im * 3.0))); else tmp = Float64(x_46_im * Float64(x_46_re_m * Float64(x_46_re_m * -3.0))); end return tmp end
x.re_m = abs(x_46_re); function tmp_2 = code(x_46_re_m, x_46_im) tmp = 0.0; if (x_46_im <= 3.3e+126) tmp = x_46_re_m * (x_46_re_m * (x_46_im * 3.0)); else tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)); end tmp_2 = tmp; end
x.re_m = N[Abs[x$46$re], $MachinePrecision] code[x$46$re$95$m_, x$46$im_] := If[LessEqual[x$46$im, 3.3e+126], N[(x$46$re$95$m * N[(x$46$re$95$m * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re$95$m * N[(x$46$re$95$m * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.re_m = \left|x.re\right|
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 3.3 \cdot 10^{+126}:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot \left(x.im \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < 3.30000000000000013e126Initial program 87.0%
Simplified91.2%
*-commutative91.2%
add-sqr-sqrt44.2%
associate-*r*44.2%
associate-*r*44.2%
Applied egg-rr44.2%
Taylor expanded in x.re around inf 54.9%
associate-*r*54.9%
*-commutative54.9%
associate-*l*54.9%
Simplified54.9%
associate-*r*54.9%
unpow254.9%
associate-*r*60.0%
Applied egg-rr60.0%
if 3.30000000000000013e126 < x.im Initial program 56.8%
Simplified56.8%
*-commutative56.8%
add-sqr-sqrt27.0%
associate-*r*27.0%
associate-*r*27.0%
Applied egg-rr27.0%
Taylor expanded in x.re around inf 11.3%
associate-*r*11.3%
*-commutative11.3%
associate-*l*11.3%
Simplified11.3%
metadata-eval11.3%
associate-*r*11.3%
neg-mul-111.3%
add-sqr-sqrt0.3%
associate-*r*0.3%
add-sqr-sqrt0.3%
sqrt-unprod0.3%
sqr-neg0.3%
sqrt-unprod0.3%
add-sqr-sqrt0.3%
unpow20.3%
sqrt-prod0.2%
add-sqr-sqrt0.3%
add-sqr-sqrt0.3%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod28.3%
add-sqr-sqrt28.3%
unpow228.3%
sqrt-prod22.6%
add-sqr-sqrt34.4%
Applied egg-rr34.4%
Final simplification56.3%
x.re_m = (fabs.f64 x.re) (FPCore (x.re_m x.im) :precision binary64 (if (<= x.im 3e+126) (* x.im (* x.re_m (* x.re_m 3.0))) (* x.im (* x.re_m (* x.re_m -3.0)))))
x.re_m = fabs(x_46_re);
double code(double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_im <= 3e+126) {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * 3.0));
} else {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
return tmp;
}
x.re_m = abs(x_46re)
real(8) function code(x_46re_m, x_46im)
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= 3d+126) then
tmp = x_46im * (x_46re_m * (x_46re_m * 3.0d0))
else
tmp = x_46im * (x_46re_m * (x_46re_m * (-3.0d0)))
end if
code = tmp
end function
x.re_m = Math.abs(x_46_re);
public static double code(double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_im <= 3e+126) {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * 3.0));
} else {
tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
return tmp;
}
x.re_m = math.fabs(x_46_re) def code(x_46_re_m, x_46_im): tmp = 0 if x_46_im <= 3e+126: tmp = x_46_im * (x_46_re_m * (x_46_re_m * 3.0)) else: tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)) return tmp
x.re_m = abs(x_46_re) function code(x_46_re_m, x_46_im) tmp = 0.0 if (x_46_im <= 3e+126) tmp = Float64(x_46_im * Float64(x_46_re_m * Float64(x_46_re_m * 3.0))); else tmp = Float64(x_46_im * Float64(x_46_re_m * Float64(x_46_re_m * -3.0))); end return tmp end
x.re_m = abs(x_46_re); function tmp_2 = code(x_46_re_m, x_46_im) tmp = 0.0; if (x_46_im <= 3e+126) tmp = x_46_im * (x_46_re_m * (x_46_re_m * 3.0)); else tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)); end tmp_2 = tmp; end
x.re_m = N[Abs[x$46$re], $MachinePrecision] code[x$46$re$95$m_, x$46$im_] := If[LessEqual[x$46$im, 3e+126], N[(x$46$im * N[(x$46$re$95$m * N[(x$46$re$95$m * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re$95$m * N[(x$46$re$95$m * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.re_m = \left|x.re\right|
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 3 \cdot 10^{+126}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < 3.0000000000000002e126Initial program 87.0%
Simplified91.2%
*-commutative91.2%
add-sqr-sqrt44.2%
associate-*r*44.2%
associate-*r*44.2%
Applied egg-rr44.2%
Taylor expanded in x.re around inf 54.9%
associate-*r*54.9%
*-commutative54.9%
associate-*l*54.9%
Simplified54.9%
unpow254.9%
associate-*r*54.8%
Applied egg-rr54.8%
if 3.0000000000000002e126 < x.im Initial program 56.8%
Simplified56.8%
*-commutative56.8%
add-sqr-sqrt27.0%
associate-*r*27.0%
associate-*r*27.0%
Applied egg-rr27.0%
Taylor expanded in x.re around inf 11.3%
associate-*r*11.3%
*-commutative11.3%
associate-*l*11.3%
Simplified11.3%
metadata-eval11.3%
associate-*r*11.3%
neg-mul-111.3%
add-sqr-sqrt0.3%
associate-*r*0.3%
add-sqr-sqrt0.3%
sqrt-unprod0.3%
sqr-neg0.3%
sqrt-unprod0.3%
add-sqr-sqrt0.3%
unpow20.3%
sqrt-prod0.2%
add-sqr-sqrt0.3%
add-sqr-sqrt0.3%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod28.3%
add-sqr-sqrt28.3%
unpow228.3%
sqrt-prod22.6%
add-sqr-sqrt34.4%
Applied egg-rr34.4%
Final simplification51.9%
x.re_m = (fabs.f64 x.re) (FPCore (x.re_m x.im) :precision binary64 (* x.im (* x.re_m (* x.re_m -3.0))))
x.re_m = fabs(x_46_re);
double code(double x_46_re_m, double x_46_im) {
return x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
x.re_m = abs(x_46re)
real(8) function code(x_46re_m, x_46im)
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
code = x_46im * (x_46re_m * (x_46re_m * (-3.0d0)))
end function
x.re_m = Math.abs(x_46_re);
public static double code(double x_46_re_m, double x_46_im) {
return x_46_im * (x_46_re_m * (x_46_re_m * -3.0));
}
x.re_m = math.fabs(x_46_re) def code(x_46_re_m, x_46_im): return x_46_im * (x_46_re_m * (x_46_re_m * -3.0))
x.re_m = abs(x_46_re) function code(x_46_re_m, x_46_im) return Float64(x_46_im * Float64(x_46_re_m * Float64(x_46_re_m * -3.0))) end
x.re_m = abs(x_46_re); function tmp = code(x_46_re_m, x_46_im) tmp = x_46_im * (x_46_re_m * (x_46_re_m * -3.0)); end
x.re_m = N[Abs[x$46$re], $MachinePrecision] code[x$46$re$95$m_, x$46$im_] := N[(x$46$im * N[(x$46$re$95$m * N[(x$46$re$95$m * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.re_m = \left|x.re\right|
\\
x.im \cdot \left(x.re\_m \cdot \left(x.re\_m \cdot -3\right)\right)
\end{array}
Initial program 82.6%
Simplified86.2%
*-commutative86.2%
add-sqr-sqrt41.7%
associate-*r*41.7%
associate-*r*41.7%
Applied egg-rr41.7%
Taylor expanded in x.re around inf 48.6%
associate-*r*48.6%
*-commutative48.6%
associate-*l*48.6%
Simplified48.6%
metadata-eval48.6%
associate-*r*48.6%
neg-mul-148.6%
add-sqr-sqrt4.8%
associate-*r*4.8%
add-sqr-sqrt4.8%
sqrt-unprod4.8%
sqr-neg4.8%
sqrt-unprod4.8%
add-sqr-sqrt4.8%
unpow24.8%
sqrt-prod3.0%
add-sqr-sqrt4.8%
add-sqr-sqrt4.8%
sqrt-unprod34.5%
sqr-neg34.5%
sqrt-unprod38.9%
add-sqr-sqrt38.9%
unpow238.9%
sqrt-prod15.8%
add-sqr-sqrt25.0%
Applied egg-rr25.0%
Final simplification25.0%
(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 2024096
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:alt
(+ (* (* 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)))