
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
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_re) - (((x_46_re * x_46_im) + (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_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (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_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
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_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * 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 * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); 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$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
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_re) - (((x_46_re * x_46_im) + (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_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (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_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
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_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * 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 * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); 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$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* x.im -3.0))))
(if (<= x.re -2e+152)
(* x.re (- (* x.re x.re) t_0))
(if (<= x.re 7.5e-59)
(-
(* (+ x.re x.im) (* x.re (- x.re x.im)))
(* x.im (* x.im (+ x.re x.re))))
(* x.re (fma x.re x.re t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_im * -3.0);
double tmp;
if (x_46_re <= -2e+152) {
tmp = x_46_re * ((x_46_re * x_46_re) - t_0);
} else if (x_46_re <= 7.5e-59) {
tmp = ((x_46_re + x_46_im) * (x_46_re * (x_46_re - x_46_im))) - (x_46_im * (x_46_im * (x_46_re + x_46_re)));
} else {
tmp = x_46_re * fma(x_46_re, x_46_re, t_0);
}
return tmp;
}
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(x_46_im * -3.0)) tmp = 0.0 if (x_46_re <= -2e+152) tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - t_0)); elseif (x_46_re <= 7.5e-59) tmp = Float64(Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re * Float64(x_46_re - x_46_im))) - Float64(x_46_im * Float64(x_46_im * Float64(x_46_re + x_46_re)))); else tmp = Float64(x_46_re * fma(x_46_re, x_46_re, t_0)); end return tmp end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2e+152], N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 7.5e-59], N[(N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(x$46$re * x$46$re + t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.im \cdot -3\right)\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{+152}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re - t_0\right)\\
\mathbf{elif}\;x.re \leq 7.5 \cdot 10^{-59}:\\
\;\;\;\;\left(x.re + x.im\right) \cdot \left(x.re \cdot \left(x.re - x.im\right)\right) - x.im \cdot \left(x.im \cdot \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \mathsf{fma}\left(x.re, x.re, t_0\right)\\
\end{array}
\end{array}
if x.re < -2.0000000000000001e152Initial program 61.3%
*-commutative61.3%
distribute-lft-out61.3%
associate-*l*61.3%
*-commutative61.3%
distribute-rgt-out--80.6%
associate--l-80.6%
associate--l-80.6%
sub-neg80.6%
associate--l+80.6%
fma-udef83.9%
neg-mul-183.9%
count-283.9%
associate-*l*83.9%
distribute-rgt-out--83.9%
associate-*r*83.9%
metadata-eval83.9%
Simplified83.9%
fma-udef80.6%
Applied egg-rr80.6%
add-sqr-sqrt25.8%
sqrt-prod87.1%
sqr-neg87.1%
sqrt-unprod61.3%
add-sqr-sqrt96.8%
cancel-sign-sub-inv96.8%
Applied egg-rr96.8%
if -2.0000000000000001e152 < x.re < 7.50000000000000019e-59Initial program 86.7%
*-commutative86.7%
*-commutative86.7%
*-commutative86.7%
distribute-lft-out86.7%
Simplified86.7%
sub-neg86.7%
*-commutative86.7%
difference-of-squares86.7%
associate-*l*99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
distribute-rgt-in99.8%
distribute-lft-out99.8%
Applied egg-rr99.8%
if 7.50000000000000019e-59 < x.re Initial program 80.0%
*-commutative80.0%
distribute-lft-out80.0%
associate-*l*80.0%
*-commutative80.0%
distribute-rgt-out--89.2%
associate--l-89.2%
associate--l-89.2%
sub-neg89.2%
associate--l+89.2%
fma-udef97.1%
neg-mul-197.1%
count-297.1%
associate-*l*97.1%
distribute-rgt-out--97.1%
associate-*r*97.1%
metadata-eval97.1%
Simplified97.1%
Final simplification98.6%
(FPCore (x.re x.im)
:precision binary64
(if (<=
(-
(* x.re (- (* x.re x.re) (* x.im x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(- (* (+ x.re x.im) (* x.re (- x.re x.im))) (* x.im (* x.im (+ x.re x.re))))
(* x.re (- (* x.re x.re) (* x.im (* x.im -3.0))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = ((x_46_re + x_46_im) * (x_46_re * (x_46_re - x_46_im))) - (x_46_im * (x_46_im * (x_46_re + x_46_re)));
} else {
tmp = x_46_re * ((x_46_re * x_46_re) - (x_46_im * (x_46_im * -3.0)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Double.POSITIVE_INFINITY) {
tmp = ((x_46_re + x_46_im) * (x_46_re * (x_46_re - x_46_im))) - (x_46_im * (x_46_im * (x_46_re + x_46_re)));
} else {
tmp = x_46_re * ((x_46_re * x_46_re) - (x_46_im * (x_46_im * -3.0)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if ((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= math.inf: tmp = ((x_46_re + x_46_im) * (x_46_re * (x_46_re - x_46_im))) - (x_46_im * (x_46_im * (x_46_re + x_46_re))) else: tmp = x_46_re * ((x_46_re * x_46_re) - (x_46_im * (x_46_im * -3.0))) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * 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_re * Float64(x_46_re - x_46_im))) - Float64(x_46_im * Float64(x_46_im * Float64(x_46_re + x_46_re)))); else tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * Float64(x_46_im * -3.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Inf) tmp = ((x_46_re + x_46_im) * (x_46_re * (x_46_re - x_46_im))) - (x_46_im * (x_46_im * (x_46_re + x_46_re))); else tmp = x_46_re * ((x_46_re * x_46_re) - (x_46_im * (x_46_im * -3.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $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]), $MachinePrecision], Infinity], N[(N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\left(x.re + x.im\right) \cdot \left(x.re \cdot \left(x.re - x.im\right)\right) - x.im \cdot \left(x.im \cdot \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot \left(x.im \cdot -3\right)\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) < +inf.0Initial program 91.2%
*-commutative91.2%
*-commutative91.2%
*-commutative91.2%
distribute-lft-out91.2%
Simplified91.2%
sub-neg91.2%
*-commutative91.2%
difference-of-squares91.2%
associate-*l*99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
distribute-rgt-in99.8%
distribute-lft-out99.8%
Applied egg-rr99.8%
if +inf.0 < (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) Initial program 0.0%
*-commutative0.0%
distribute-lft-out0.0%
associate-*l*0.0%
*-commutative0.0%
distribute-rgt-out--48.1%
associate--l-48.1%
associate--l-48.1%
sub-neg48.1%
associate--l+48.1%
fma-udef74.1%
neg-mul-174.1%
count-274.1%
associate-*l*74.1%
distribute-rgt-out--74.1%
associate-*r*74.1%
metadata-eval74.1%
Simplified74.1%
fma-udef48.1%
Applied egg-rr48.1%
add-sqr-sqrt18.5%
sqrt-prod55.6%
sqr-neg55.6%
sqrt-unprod37.0%
add-sqr-sqrt74.1%
cancel-sign-sub-inv74.1%
Applied egg-rr74.1%
Final simplification97.1%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -1.5e+147)
(* x.im (* x.re (* x.im -3.0)))
(if (<= x.im 7.8e+153)
(* x.re (+ (* x.re x.re) (* x.im (* x.im -3.0))))
(* 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+147) {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
} else if (x_46_im <= 7.8e+153) {
tmp = x_46_re * ((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 * -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+147)) then
tmp = x_46im * (x_46re * (x_46im * (-3.0d0)))
else if (x_46im <= 7.8d+153) then
tmp = x_46re * ((x_46re * x_46re) + (x_46im * (x_46im * (-3.0d0))))
else
tmp = 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+147) {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
} else if (x_46_im <= 7.8e+153) {
tmp = x_46_re * ((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 * -3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -1.5e+147: tmp = x_46_im * (x_46_re * (x_46_im * -3.0)) elif x_46_im <= 7.8e+153: tmp = x_46_re * ((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 * -3.0)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -1.5e+147) tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_im * -3.0))); elseif (x_46_im <= 7.8e+153) tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * Float64(x_46_im * -3.0)))); else tmp = Float64(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+147) tmp = x_46_im * (x_46_re * (x_46_im * -3.0)); elseif (x_46_im <= 7.8e+153) tmp = x_46_re * ((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 * -3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -1.5e+147], N[(x$46$im * N[(x$46$re * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7.8e+153], N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.5 \cdot 10^{+147}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{elif}\;x.im \leq 7.8 \cdot 10^{+153}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re + x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < -1.49999999999999997e147Initial program 43.8%
*-commutative43.8%
*-commutative43.8%
*-commutative43.8%
distribute-lft-out43.8%
Simplified43.8%
sub-neg43.8%
*-commutative43.8%
difference-of-squares57.6%
associate-*l*92.8%
*-commutative92.8%
distribute-rgt-neg-in92.8%
distribute-rgt-in92.8%
distribute-lft-out92.8%
Applied egg-rr92.8%
Taylor expanded in x.re around 0 57.6%
distribute-rgt-out57.6%
unpow257.6%
metadata-eval57.6%
associate-*r*57.6%
*-commutative57.6%
associate-*r*92.8%
associate-*r*92.8%
*-commutative92.8%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x.im around 0 92.9%
associate-*r*92.8%
*-commutative92.8%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
if -1.49999999999999997e147 < x.im < 7.79999999999999966e153Initial program 93.2%
*-commutative93.2%
distribute-lft-out93.2%
associate-*l*93.1%
*-commutative93.1%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
fma-udef99.8%
Applied egg-rr99.8%
if 7.79999999999999966e153 < x.im Initial program 45.5%
*-commutative45.5%
*-commutative45.5%
*-commutative45.5%
distribute-lft-out45.5%
Simplified45.5%
sub-neg45.5%
*-commutative45.5%
difference-of-squares51.7%
associate-*l*81.0%
*-commutative81.0%
distribute-rgt-neg-in81.0%
distribute-rgt-in81.0%
distribute-lft-out81.0%
Applied egg-rr81.0%
Taylor expanded in x.re around 0 54.9%
distribute-rgt-out54.9%
unpow254.9%
metadata-eval54.9%
associate-*r*54.9%
*-commutative54.9%
associate-*r*84.3%
associate-*r*84.1%
*-commutative84.1%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in x.im around 0 84.2%
associate-*r*84.3%
*-commutative84.3%
*-commutative84.3%
Simplified84.3%
Final simplification97.1%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -4.6e+147) (and (not (<= x.re 5.7e+145)) (<= x.re 5.8e+281))) (* 3.0 (* x.re (* x.im 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_re <= -4.6e+147) || (!(x_46_re <= 5.7e+145) && (x_46_re <= 5.8e+281))) {
tmp = 3.0 * (x_46_re * (x_46_im * x_46_im));
} else {
tmp = 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_46re <= (-4.6d+147)) .or. (.not. (x_46re <= 5.7d+145)) .and. (x_46re <= 5.8d+281)) then
tmp = 3.0d0 * (x_46re * (x_46im * x_46im))
else
tmp = 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_re <= -4.6e+147) || (!(x_46_re <= 5.7e+145) && (x_46_re <= 5.8e+281))) {
tmp = 3.0 * (x_46_re * (x_46_im * x_46_im));
} else {
tmp = 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_re <= -4.6e+147) or (not (x_46_re <= 5.7e+145) and (x_46_re <= 5.8e+281)): tmp = 3.0 * (x_46_re * (x_46_im * x_46_im)) else: tmp = 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_re <= -4.6e+147) || (!(x_46_re <= 5.7e+145) && (x_46_re <= 5.8e+281))) tmp = Float64(3.0 * Float64(x_46_re * Float64(x_46_im * x_46_im))); else tmp = Float64(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_re <= -4.6e+147) || (~((x_46_re <= 5.7e+145)) && (x_46_re <= 5.8e+281))) tmp = 3.0 * (x_46_re * (x_46_im * x_46_im)); else tmp = 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$re, -4.6e+147], And[N[Not[LessEqual[x$46$re, 5.7e+145]], $MachinePrecision], LessEqual[x$46$re, 5.8e+281]]], N[(3.0 * N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -4.6 \cdot 10^{+147} \lor \neg \left(x.re \leq 5.7 \cdot 10^{+145}\right) \land x.re \leq 5.8 \cdot 10^{+281}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.re < -4.5999999999999998e147 or 5.6999999999999999e145 < x.re < 5.80000000000000019e281Initial program 62.3%
*-commutative62.3%
distribute-lft-out62.3%
associate-*l*62.3%
*-commutative62.3%
distribute-rgt-out--81.2%
associate--l-81.2%
associate--l-81.2%
sub-neg81.2%
associate--l+81.2%
fma-udef89.9%
neg-mul-189.9%
count-289.9%
associate-*l*89.9%
distribute-rgt-out--89.9%
associate-*r*89.9%
metadata-eval89.9%
Simplified89.9%
fma-udef81.2%
Applied egg-rr81.2%
add-sqr-sqrt26.1%
sqrt-prod84.1%
sqr-neg84.1%
sqrt-unprod58.0%
add-sqr-sqrt91.3%
cancel-sign-sub-inv91.3%
Applied egg-rr91.3%
Taylor expanded in x.re around 0 31.0%
unpow231.0%
Simplified31.0%
if -4.5999999999999998e147 < x.re < 5.6999999999999999e145 or 5.80000000000000019e281 < x.re Initial program 88.7%
*-commutative88.7%
*-commutative88.7%
*-commutative88.7%
distribute-lft-out88.7%
Simplified88.7%
sub-neg88.7%
*-commutative88.7%
difference-of-squares89.3%
associate-*l*99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
distribute-rgt-in99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 65.9%
distribute-rgt-out65.9%
unpow265.9%
metadata-eval65.9%
associate-*r*65.9%
*-commutative65.9%
associate-*r*76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in x.im around 0 76.4%
associate-*r*76.4%
*-commutative76.4%
*-commutative76.4%
Simplified76.4%
Final simplification64.1%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -2.4e+151) (and (not (<= x.re 1e+144)) (<= x.re 5.8e+281))) (* x.im (* x.im (* x.re 3.0))) (* x.im (* x.im (* x.re -3.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -2.4e+151) || (!(x_46_re <= 1e+144) && (x_46_re <= 5.8e+281))) {
tmp = x_46_im * (x_46_im * (x_46_re * 3.0));
} else {
tmp = 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_46re <= (-2.4d+151)) .or. (.not. (x_46re <= 1d+144)) .and. (x_46re <= 5.8d+281)) then
tmp = x_46im * (x_46im * (x_46re * 3.0d0))
else
tmp = 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_re <= -2.4e+151) || (!(x_46_re <= 1e+144) && (x_46_re <= 5.8e+281))) {
tmp = x_46_im * (x_46_im * (x_46_re * 3.0));
} else {
tmp = 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_re <= -2.4e+151) or (not (x_46_re <= 1e+144) and (x_46_re <= 5.8e+281)): tmp = x_46_im * (x_46_im * (x_46_re * 3.0)) else: tmp = 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_re <= -2.4e+151) || (!(x_46_re <= 1e+144) && (x_46_re <= 5.8e+281))) tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * 3.0))); else tmp = Float64(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_re <= -2.4e+151) || (~((x_46_re <= 1e+144)) && (x_46_re <= 5.8e+281))) tmp = x_46_im * (x_46_im * (x_46_re * 3.0)); else tmp = 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$re, -2.4e+151], And[N[Not[LessEqual[x$46$re, 1e+144]], $MachinePrecision], LessEqual[x$46$re, 5.8e+281]]], N[(x$46$im * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.4 \cdot 10^{+151} \lor \neg \left(x.re \leq 10^{+144}\right) \land x.re \leq 5.8 \cdot 10^{+281}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.re < -2.4000000000000001e151 or 1.00000000000000002e144 < x.re < 5.80000000000000019e281Initial program 62.3%
*-commutative62.3%
*-commutative62.3%
*-commutative62.3%
distribute-lft-out62.3%
Simplified62.3%
sub-neg62.3%
*-commutative62.3%
difference-of-squares69.6%
associate-*l*69.6%
*-commutative69.6%
distribute-rgt-neg-in69.6%
distribute-rgt-in69.6%
distribute-lft-out69.6%
Applied egg-rr69.6%
Taylor expanded in x.re around 0 9.3%
distribute-rgt-out9.3%
unpow29.3%
metadata-eval9.3%
associate-*r*9.3%
*-commutative9.3%
associate-*r*9.2%
associate-*r*9.2%
*-commutative9.2%
associate-*l*9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in x.im around 0 9.2%
associate-*r*9.2%
*-commutative9.2%
*-commutative9.2%
Simplified9.2%
expm1-log1p-u6.1%
expm1-udef6.1%
add-sqr-sqrt1.6%
sqrt-unprod17.5%
swap-sqr17.5%
metadata-eval17.5%
metadata-eval17.5%
swap-sqr17.5%
sqrt-unprod7.7%
add-sqr-sqrt17.0%
Applied egg-rr17.0%
expm1-def17.0%
expm1-log1p31.1%
Simplified31.1%
if -2.4000000000000001e151 < x.re < 1.00000000000000002e144 or 5.80000000000000019e281 < x.re Initial program 88.7%
*-commutative88.7%
*-commutative88.7%
*-commutative88.7%
distribute-lft-out88.7%
Simplified88.7%
sub-neg88.7%
*-commutative88.7%
difference-of-squares89.3%
associate-*l*99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
distribute-rgt-in99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 65.9%
distribute-rgt-out65.9%
unpow265.9%
metadata-eval65.9%
associate-*r*65.9%
*-commutative65.9%
associate-*r*76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in x.im around 0 76.4%
associate-*r*76.4%
*-commutative76.4%
*-commutative76.4%
Simplified76.4%
Final simplification64.2%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* x.im (* x.re 3.0)))))
(if (<= x.re -1.9e+151)
t_0
(if (<= x.re 4.6e+142)
(* x.im (* -3.0 (* x.re x.im)))
(if (<= x.re 5.8e+281) t_0 (* x.im (* x.im (* x.re -3.0))))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_im * (x_46_re * 3.0));
double tmp;
if (x_46_re <= -1.9e+151) {
tmp = t_0;
} else if (x_46_re <= 4.6e+142) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else if (x_46_re <= 5.8e+281) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = x_46im * (x_46im * (x_46re * 3.0d0))
if (x_46re <= (-1.9d+151)) then
tmp = t_0
else if (x_46re <= 4.6d+142) then
tmp = x_46im * ((-3.0d0) * (x_46re * x_46im))
else if (x_46re <= 5.8d+281) then
tmp = t_0
else
tmp = 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 t_0 = x_46_im * (x_46_im * (x_46_re * 3.0));
double tmp;
if (x_46_re <= -1.9e+151) {
tmp = t_0;
} else if (x_46_re <= 4.6e+142) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else if (x_46_re <= 5.8e+281) {
tmp = t_0;
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * (x_46_im * (x_46_re * 3.0)) tmp = 0 if x_46_re <= -1.9e+151: tmp = t_0 elif x_46_re <= 4.6e+142: tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) elif x_46_re <= 5.8e+281: tmp = t_0 else: tmp = x_46_im * (x_46_im * (x_46_re * -3.0)) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * 3.0))) tmp = 0.0 if (x_46_re <= -1.9e+151) tmp = t_0; elseif (x_46_re <= 4.6e+142) tmp = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))); elseif (x_46_re <= 5.8e+281) tmp = t_0; else tmp = Float64(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) t_0 = x_46_im * (x_46_im * (x_46_re * 3.0)); tmp = 0.0; if (x_46_re <= -1.9e+151) tmp = t_0; elseif (x_46_re <= 4.6e+142) tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); elseif (x_46_re <= 5.8e+281) tmp = t_0; else tmp = x_46_im * (x_46_im * (x_46_re * -3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.9e+151], t$95$0, If[LessEqual[x$46$re, 4.6e+142], N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5.8e+281], t$95$0, N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{if}\;x.re \leq -1.9 \cdot 10^{+151}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 4.6 \cdot 10^{+142}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 5.8 \cdot 10^{+281}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.re < -1.9e151 or 4.60000000000000004e142 < x.re < 5.80000000000000019e281Initial program 62.3%
*-commutative62.3%
*-commutative62.3%
*-commutative62.3%
distribute-lft-out62.3%
Simplified62.3%
sub-neg62.3%
*-commutative62.3%
difference-of-squares69.6%
associate-*l*69.6%
*-commutative69.6%
distribute-rgt-neg-in69.6%
distribute-rgt-in69.6%
distribute-lft-out69.6%
Applied egg-rr69.6%
Taylor expanded in x.re around 0 9.3%
distribute-rgt-out9.3%
unpow29.3%
metadata-eval9.3%
associate-*r*9.3%
*-commutative9.3%
associate-*r*9.2%
associate-*r*9.2%
*-commutative9.2%
associate-*l*9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in x.im around 0 9.2%
associate-*r*9.2%
*-commutative9.2%
*-commutative9.2%
Simplified9.2%
expm1-log1p-u6.1%
expm1-udef6.1%
add-sqr-sqrt1.6%
sqrt-unprod17.5%
swap-sqr17.5%
metadata-eval17.5%
metadata-eval17.5%
swap-sqr17.5%
sqrt-unprod7.7%
add-sqr-sqrt17.0%
Applied egg-rr17.0%
expm1-def17.0%
expm1-log1p31.1%
Simplified31.1%
if -1.9e151 < x.re < 4.60000000000000004e142Initial program 89.1%
*-commutative89.1%
*-commutative89.1%
*-commutative89.1%
distribute-lft-out89.1%
Simplified89.1%
sub-neg89.1%
*-commutative89.1%
difference-of-squares89.1%
associate-*l*99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
distribute-rgt-in99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 66.4%
distribute-rgt-out66.4%
unpow266.4%
metadata-eval66.4%
associate-*r*66.4%
*-commutative66.4%
associate-*r*77.1%
associate-*r*77.1%
*-commutative77.1%
associate-*l*77.1%
*-commutative77.1%
Simplified77.1%
if 5.80000000000000019e281 < x.re Initial program 66.7%
*-commutative66.7%
*-commutative66.7%
*-commutative66.7%
distribute-lft-out66.7%
Simplified66.7%
sub-neg66.7%
*-commutative66.7%
difference-of-squares100.0%
associate-*l*100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
distribute-rgt-in100.0%
distribute-lft-out100.0%
Applied egg-rr100.0%
Taylor expanded in x.re around 0 34.4%
distribute-rgt-out34.4%
unpow234.4%
metadata-eval34.4%
associate-*r*34.4%
*-commutative34.4%
associate-*r*34.1%
associate-*r*34.1%
*-commutative34.1%
associate-*l*34.1%
*-commutative34.1%
Simplified34.1%
Taylor expanded in x.im around 0 34.1%
associate-*r*34.1%
*-commutative34.1%
*-commutative34.1%
Simplified34.1%
Final simplification64.2%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* x.im (* x.re 3.0)))))
(if (<= x.re -9e+151)
t_0
(if (<= x.re 1.25e+140)
(* x.im (* -3.0 (* x.re x.im)))
(if (<= x.re 5.8e+281) t_0 (* x.re (* x.im (* x.im -3.0))))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_im * (x_46_re * 3.0));
double tmp;
if (x_46_re <= -9e+151) {
tmp = t_0;
} else if (x_46_re <= 1.25e+140) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else if (x_46_re <= 5.8e+281) {
tmp = t_0;
} else {
tmp = x_46_re * (x_46_im * (x_46_im * -3.0));
}
return tmp;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im * (x_46im * (x_46re * 3.0d0))
if (x_46re <= (-9d+151)) then
tmp = t_0
else if (x_46re <= 1.25d+140) then
tmp = x_46im * ((-3.0d0) * (x_46re * x_46im))
else if (x_46re <= 5.8d+281) then
tmp = t_0
else
tmp = x_46re * (x_46im * (x_46im * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_im * (x_46_re * 3.0));
double tmp;
if (x_46_re <= -9e+151) {
tmp = t_0;
} else if (x_46_re <= 1.25e+140) {
tmp = x_46_im * (-3.0 * (x_46_re * x_46_im));
} else if (x_46_re <= 5.8e+281) {
tmp = t_0;
} else {
tmp = x_46_re * (x_46_im * (x_46_im * -3.0));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * (x_46_im * (x_46_re * 3.0)) tmp = 0 if x_46_re <= -9e+151: tmp = t_0 elif x_46_re <= 1.25e+140: tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)) elif x_46_re <= 5.8e+281: tmp = t_0 else: tmp = x_46_re * (x_46_im * (x_46_im * -3.0)) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * 3.0))) tmp = 0.0 if (x_46_re <= -9e+151) tmp = t_0; elseif (x_46_re <= 1.25e+140) tmp = Float64(x_46_im * Float64(-3.0 * Float64(x_46_re * x_46_im))); elseif (x_46_re <= 5.8e+281) tmp = t_0; else tmp = Float64(x_46_re * Float64(x_46_im * Float64(x_46_im * -3.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_im * (x_46_im * (x_46_re * 3.0)); tmp = 0.0; if (x_46_re <= -9e+151) tmp = t_0; elseif (x_46_re <= 1.25e+140) tmp = x_46_im * (-3.0 * (x_46_re * x_46_im)); elseif (x_46_re <= 5.8e+281) tmp = t_0; else tmp = x_46_re * (x_46_im * (x_46_im * -3.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$im * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -9e+151], t$95$0, If[LessEqual[x$46$re, 1.25e+140], N[(x$46$im * N[(-3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5.8e+281], t$95$0, N[(x$46$re * N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{if}\;x.re \leq -9 \cdot 10^{+151}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 1.25 \cdot 10^{+140}:\\
\;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 5.8 \cdot 10^{+281}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.im \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.re < -8.9999999999999997e151 or 1.25000000000000002e140 < x.re < 5.80000000000000019e281Initial program 62.3%
*-commutative62.3%
*-commutative62.3%
*-commutative62.3%
distribute-lft-out62.3%
Simplified62.3%
sub-neg62.3%
*-commutative62.3%
difference-of-squares69.6%
associate-*l*69.6%
*-commutative69.6%
distribute-rgt-neg-in69.6%
distribute-rgt-in69.6%
distribute-lft-out69.6%
Applied egg-rr69.6%
Taylor expanded in x.re around 0 9.3%
distribute-rgt-out9.3%
unpow29.3%
metadata-eval9.3%
associate-*r*9.3%
*-commutative9.3%
associate-*r*9.2%
associate-*r*9.2%
*-commutative9.2%
associate-*l*9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in x.im around 0 9.2%
associate-*r*9.2%
*-commutative9.2%
*-commutative9.2%
Simplified9.2%
expm1-log1p-u6.1%
expm1-udef6.1%
add-sqr-sqrt1.6%
sqrt-unprod17.5%
swap-sqr17.5%
metadata-eval17.5%
metadata-eval17.5%
swap-sqr17.5%
sqrt-unprod7.7%
add-sqr-sqrt17.0%
Applied egg-rr17.0%
expm1-def17.0%
expm1-log1p31.1%
Simplified31.1%
if -8.9999999999999997e151 < x.re < 1.25000000000000002e140Initial program 89.1%
*-commutative89.1%
*-commutative89.1%
*-commutative89.1%
distribute-lft-out89.1%
Simplified89.1%
sub-neg89.1%
*-commutative89.1%
difference-of-squares89.1%
associate-*l*99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
distribute-rgt-in99.7%
distribute-lft-out99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 66.4%
distribute-rgt-out66.4%
unpow266.4%
metadata-eval66.4%
associate-*r*66.4%
*-commutative66.4%
associate-*r*77.1%
associate-*r*77.1%
*-commutative77.1%
associate-*l*77.1%
*-commutative77.1%
Simplified77.1%
if 5.80000000000000019e281 < x.re Initial program 66.7%
*-commutative66.7%
distribute-lft-out66.7%
associate-*l*66.7%
*-commutative66.7%
distribute-rgt-out--66.7%
associate--l-66.7%
associate--l-66.7%
sub-neg66.7%
associate--l+66.7%
fma-udef100.0%
neg-mul-1100.0%
count-2100.0%
associate-*l*100.0%
distribute-rgt-out--100.0%
associate-*r*100.0%
metadata-eval100.0%
Simplified100.0%
fma-udef66.7%
Applied egg-rr66.7%
Taylor expanded in x.re around 0 34.4%
*-commutative34.4%
unpow234.4%
associate-*r*34.4%
Simplified34.4%
Final simplification64.2%
(FPCore (x.re x.im) :precision binary64 (* 3.0 (* x.re (* x.im x.im))))
double code(double x_46_re, double x_46_im) {
return 3.0 * (x_46_re * (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 = 3.0d0 * (x_46re * (x_46im * x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
return 3.0 * (x_46_re * (x_46_im * x_46_im));
}
def code(x_46_re, x_46_im): return 3.0 * (x_46_re * (x_46_im * x_46_im))
function code(x_46_re, x_46_im) return Float64(3.0 * Float64(x_46_re * Float64(x_46_im * x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = 3.0 * (x_46_re * (x_46_im * x_46_im)); end
code[x$46$re_, x$46$im_] := N[(3.0 * N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)
\end{array}
Initial program 81.6%
*-commutative81.6%
distribute-lft-out81.6%
associate-*l*81.6%
*-commutative81.6%
distribute-rgt-out--86.7%
associate--l-86.7%
associate--l-86.7%
sub-neg86.7%
associate--l+86.7%
fma-udef89.4%
neg-mul-189.4%
count-289.4%
associate-*l*89.4%
distribute-rgt-out--89.4%
associate-*r*89.4%
metadata-eval89.4%
Simplified89.4%
fma-udef86.7%
Applied egg-rr86.7%
add-sqr-sqrt38.7%
sqrt-prod72.4%
sqr-neg72.4%
sqrt-unprod33.6%
add-sqr-sqrt60.6%
cancel-sign-sub-inv60.6%
Applied egg-rr60.6%
Taylor expanded in x.re around 0 27.5%
unpow227.5%
Simplified27.5%
Final simplification27.5%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im)))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * 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_46re - x_46im)) + ((x_46re * x_46im) * (x_46re - (3.0d0 * 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_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)) + Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re - Float64(3.0 * x_46_im)))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im))); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re - N[(3.0 * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right) + \left(x.re \cdot x.im\right) \cdot \left(x.re - 3 \cdot x.im\right)
\end{array}
herbie shell --seed 2023182
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))