
(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 11 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}
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -2.3e+153)
(* (* x.re x.re) (+ x.re x.im))
(if (<= x.re 2e+101)
(fma (* x.re x.im) (* x.im -3.0) (pow x.re 3.0))
(* (* x.re x.re) (- x.re x.im)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -2.3e+153) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else if (x_46_re <= 2e+101) {
tmp = fma((x_46_re * x_46_im), (x_46_im * -3.0), pow(x_46_re, 3.0));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -2.3e+153) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re + x_46_im)); elseif (x_46_re <= 2e+101) tmp = fma(Float64(x_46_re * x_46_im), Float64(x_46_im * -3.0), (x_46_re ^ 3.0)); else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -2.3e+153], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2e+101], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision] + N[Power[x$46$re, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.3 \cdot 10^{+153}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re + x.im\right)\\
\mathbf{elif}\;x.re \leq 2 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(x.re \cdot x.im, x.im \cdot -3, {x.re}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\end{array}
\end{array}
if x.re < -2.3000000000000001e153Initial program 55.0%
sqr-neg55.0%
difference-of-squares70.0%
sub-neg70.0%
associate-*l*70.0%
sub-neg70.0%
remove-double-neg70.0%
+-commutative70.0%
*-commutative70.0%
*-commutative70.0%
distribute-rgt-out70.0%
Simplified70.0%
Taylor expanded in x.re around inf 62.5%
unpow262.5%
Simplified62.5%
expm1-log1p-u7.5%
expm1-udef7.5%
sub-neg7.5%
add-sqr-sqrt7.5%
sqrt-unprod15.0%
sqr-neg15.0%
sqrt-unprod7.5%
add-sqr-sqrt7.5%
+-commutative7.5%
Applied egg-rr7.5%
expm1-def7.5%
expm1-log1p62.5%
Simplified62.5%
Taylor expanded in x.im around 0 30.0%
unpow230.0%
cube-mult30.0%
distribute-rgt-in92.5%
+-commutative92.5%
Simplified92.5%
if -2.3000000000000001e153 < x.re < 2e101Initial program 92.0%
Simplified92.0%
associate-*r*92.1%
associate-*l*92.1%
+-commutative92.1%
associate-*l*92.1%
associate-*r*92.0%
associate-*r*99.2%
fma-def99.7%
Applied egg-rr99.7%
if 2e101 < x.re Initial program 64.4%
sqr-neg64.4%
difference-of-squares77.8%
sub-neg77.8%
associate-*l*77.8%
sub-neg77.8%
remove-double-neg77.8%
+-commutative77.8%
*-commutative77.8%
*-commutative77.8%
distribute-rgt-out77.8%
Simplified77.8%
Taylor expanded in x.re around inf 77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in x.re around inf 46.7%
+-commutative46.7%
cube-mult46.7%
unpow246.7%
associate-*r*46.7%
distribute-rgt-out100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification98.7%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -1.8e+130)
(* (* x.re x.re) (+ x.re x.im))
(if (<= x.re 2e+101)
(+ (pow x.re 3.0) (* (* x.im -3.0) (* x.re x.im)))
(* (* x.re x.re) (- x.re x.im)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.8e+130) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else if (x_46_re <= 2e+101) {
tmp = pow(x_46_re, 3.0) + ((x_46_im * -3.0) * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re <= (-1.8d+130)) then
tmp = (x_46re * x_46re) * (x_46re + x_46im)
else if (x_46re <= 2d+101) then
tmp = (x_46re ** 3.0d0) + ((x_46im * (-3.0d0)) * (x_46re * x_46im))
else
tmp = (x_46re * x_46re) * (x_46re - x_46im)
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.8e+130) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else if (x_46_re <= 2e+101) {
tmp = Math.pow(x_46_re, 3.0) + ((x_46_im * -3.0) * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -1.8e+130: tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im) elif x_46_re <= 2e+101: tmp = math.pow(x_46_re, 3.0) + ((x_46_im * -3.0) * (x_46_re * x_46_im)) else: tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -1.8e+130) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re + x_46_im)); elseif (x_46_re <= 2e+101) tmp = Float64((x_46_re ^ 3.0) + Float64(Float64(x_46_im * -3.0) * Float64(x_46_re * x_46_im))); else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -1.8e+130) tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im); elseif (x_46_re <= 2e+101) tmp = (x_46_re ^ 3.0) + ((x_46_im * -3.0) * (x_46_re * x_46_im)); else tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -1.8e+130], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2e+101], N[(N[Power[x$46$re, 3.0], $MachinePrecision] + N[(N[(x$46$im * -3.0), $MachinePrecision] * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.8 \cdot 10^{+130}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re + x.im\right)\\
\mathbf{elif}\;x.re \leq 2 \cdot 10^{+101}:\\
\;\;\;\;{x.re}^{3} + \left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\end{array}
\end{array}
if x.re < -1.8000000000000001e130Initial program 54.8%
sqr-neg54.8%
difference-of-squares69.0%
sub-neg69.0%
associate-*l*69.0%
sub-neg69.0%
remove-double-neg69.0%
+-commutative69.0%
*-commutative69.0%
*-commutative69.0%
distribute-rgt-out69.0%
Simplified69.0%
Taylor expanded in x.re around inf 61.9%
unpow261.9%
Simplified61.9%
expm1-log1p-u7.1%
expm1-udef7.1%
sub-neg7.1%
add-sqr-sqrt7.1%
sqrt-unprod14.3%
sqr-neg14.3%
sqrt-unprod7.1%
add-sqr-sqrt7.1%
+-commutative7.1%
Applied egg-rr7.1%
expm1-def7.1%
expm1-log1p61.9%
Simplified61.9%
Taylor expanded in x.im around 0 31.0%
unpow231.0%
cube-mult31.0%
distribute-rgt-in92.9%
+-commutative92.9%
Simplified92.9%
if -1.8000000000000001e130 < x.re < 2e101Initial program 92.5%
Simplified92.5%
associate-*r*92.6%
associate-*l*92.6%
+-commutative92.6%
associate-*l*92.6%
associate-*r*92.5%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
fma-udef99.7%
*-commutative99.7%
Applied egg-rr99.7%
if 2e101 < x.re Initial program 64.4%
sqr-neg64.4%
difference-of-squares77.8%
sub-neg77.8%
associate-*l*77.8%
sub-neg77.8%
remove-double-neg77.8%
+-commutative77.8%
*-commutative77.8%
*-commutative77.8%
distribute-rgt-out77.8%
Simplified77.8%
Taylor expanded in x.re around inf 77.8%
unpow277.8%
Simplified77.8%
Taylor expanded in x.re around inf 46.7%
+-commutative46.7%
cube-mult46.7%
unpow246.7%
associate-*r*46.7%
distribute-rgt-out100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification98.7%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -1e+140)
(* (* x.re x.re) (+ x.re x.im))
(if (<= x.re 5.1e+73)
(-
(* (- x.re x.im) (* x.re (+ x.re x.im)))
(* x.im (* x.re (+ x.im x.im))))
(* (* x.re x.re) (- x.re x.im)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1e+140) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else if (x_46_re <= 5.1e+73) {
tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
NOTE: x.im should be positive before calling this function
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 <= (-1d+140)) then
tmp = (x_46re * x_46re) * (x_46re + x_46im)
else if (x_46re <= 5.1d+73) then
tmp = ((x_46re - x_46im) * (x_46re * (x_46re + x_46im))) - (x_46im * (x_46re * (x_46im + x_46im)))
else
tmp = (x_46re * x_46re) * (x_46re - x_46im)
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1e+140) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else if (x_46_re <= 5.1e+73) {
tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -1e+140: tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im) elif x_46_re <= 5.1e+73: tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im))) else: tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -1e+140) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re + x_46_im)); elseif (x_46_re <= 5.1e+73) 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_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -1e+140) tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im); elseif (x_46_re <= 5.1e+73) tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im))); else tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -1e+140], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5.1e+73], 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$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1 \cdot 10^{+140}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re + x.im\right)\\
\mathbf{elif}\;x.re \leq 5.1 \cdot 10^{+73}:\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.re \cdot \left(x.re + x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\end{array}
\end{array}
if x.re < -1.00000000000000006e140Initial program 54.8%
sqr-neg54.8%
difference-of-squares69.0%
sub-neg69.0%
associate-*l*69.0%
sub-neg69.0%
remove-double-neg69.0%
+-commutative69.0%
*-commutative69.0%
*-commutative69.0%
distribute-rgt-out69.0%
Simplified69.0%
Taylor expanded in x.re around inf 61.9%
unpow261.9%
Simplified61.9%
expm1-log1p-u7.1%
expm1-udef7.1%
sub-neg7.1%
add-sqr-sqrt7.1%
sqrt-unprod14.3%
sqr-neg14.3%
sqrt-unprod7.1%
add-sqr-sqrt7.1%
+-commutative7.1%
Applied egg-rr7.1%
expm1-def7.1%
expm1-log1p61.9%
Simplified61.9%
Taylor expanded in x.im around 0 31.0%
unpow231.0%
cube-mult31.0%
distribute-rgt-in92.9%
+-commutative92.9%
Simplified92.9%
if -1.00000000000000006e140 < x.re < 5.10000000000000024e73Initial program 92.1%
sqr-neg92.1%
difference-of-squares92.1%
sub-neg92.1%
associate-*l*99.7%
sub-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
*-commutative99.7%
*-commutative99.7%
distribute-rgt-out99.7%
Simplified99.7%
if 5.10000000000000024e73 < x.re Initial program 70.3%
sqr-neg70.3%
difference-of-squares81.4%
sub-neg81.4%
associate-*l*81.4%
sub-neg81.4%
remove-double-neg81.4%
+-commutative81.4%
*-commutative81.4%
*-commutative81.4%
distribute-rgt-out81.4%
Simplified81.4%
Taylor expanded in x.re around inf 77.7%
unpow277.7%
Simplified77.7%
Taylor expanded in x.re around inf 51.9%
+-commutative51.9%
cube-mult51.8%
unpow251.8%
associate-*r*51.8%
distribute-rgt-out96.2%
mul-1-neg96.2%
Simplified96.2%
Final simplification97.8%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* (* x.re x.re) (+ x.re x.im))))
(if (<= x.re -1e+140)
t_0
(if (<= x.re -1.16e-63)
(- t_0 (* x.im (* x.re (+ x.im x.im))))
(if (<= x.re 3.9e-53)
(* -3.0 (* x.im (* x.re x.im)))
(* (* x.re x.re) (- x.re x.im)))))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im);
double tmp;
if (x_46_re <= -1e+140) {
tmp = t_0;
} else if (x_46_re <= -1.16e-63) {
tmp = t_0 - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
} else if (x_46_re <= 3.9e-53) {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
NOTE: x.im should be positive before calling this function
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_46re * x_46re) * (x_46re + x_46im)
if (x_46re <= (-1d+140)) then
tmp = t_0
else if (x_46re <= (-1.16d-63)) then
tmp = t_0 - (x_46im * (x_46re * (x_46im + x_46im)))
else if (x_46re <= 3.9d-53) then
tmp = (-3.0d0) * (x_46im * (x_46re * x_46im))
else
tmp = (x_46re * x_46re) * (x_46re - x_46im)
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im);
double tmp;
if (x_46_re <= -1e+140) {
tmp = t_0;
} else if (x_46_re <= -1.16e-63) {
tmp = t_0 - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
} else if (x_46_re <= 3.9e-53) {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im) tmp = 0 if x_46_re <= -1e+140: tmp = t_0 elif x_46_re <= -1.16e-63: tmp = t_0 - (x_46_im * (x_46_re * (x_46_im + x_46_im))) elif x_46_re <= 3.9e-53: tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)) else: tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re + x_46_im)) tmp = 0.0 if (x_46_re <= -1e+140) tmp = t_0; elseif (x_46_re <= -1.16e-63) tmp = Float64(t_0 - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im)))); elseif (x_46_re <= 3.9e-53) tmp = Float64(-3.0 * Float64(x_46_im * Float64(x_46_re * x_46_im))); else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im); tmp = 0.0; if (x_46_re <= -1e+140) tmp = t_0; elseif (x_46_re <= -1.16e-63) tmp = t_0 - (x_46_im * (x_46_re * (x_46_im + x_46_im))); elseif (x_46_re <= 3.9e-53) tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)); else tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1e+140], t$95$0, If[LessEqual[x$46$re, -1.16e-63], N[(t$95$0 - N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 3.9e-53], N[(-3.0 * N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := \left(x.re \cdot x.re\right) \cdot \left(x.re + x.im\right)\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{+140}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -1.16 \cdot 10^{-63}:\\
\;\;\;\;t_0 - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 3.9 \cdot 10^{-53}:\\
\;\;\;\;-3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\end{array}
\end{array}
if x.re < -1.00000000000000006e140Initial program 54.8%
sqr-neg54.8%
difference-of-squares69.0%
sub-neg69.0%
associate-*l*69.0%
sub-neg69.0%
remove-double-neg69.0%
+-commutative69.0%
*-commutative69.0%
*-commutative69.0%
distribute-rgt-out69.0%
Simplified69.0%
Taylor expanded in x.re around inf 61.9%
unpow261.9%
Simplified61.9%
expm1-log1p-u7.1%
expm1-udef7.1%
sub-neg7.1%
add-sqr-sqrt7.1%
sqrt-unprod14.3%
sqr-neg14.3%
sqrt-unprod7.1%
add-sqr-sqrt7.1%
+-commutative7.1%
Applied egg-rr7.1%
expm1-def7.1%
expm1-log1p61.9%
Simplified61.9%
Taylor expanded in x.im around 0 31.0%
unpow231.0%
cube-mult31.0%
distribute-rgt-in92.9%
+-commutative92.9%
Simplified92.9%
if -1.00000000000000006e140 < x.re < -1.16e-63Initial program 99.6%
sqr-neg99.6%
difference-of-squares99.6%
sub-neg99.6%
associate-*l*99.6%
sub-neg99.6%
remove-double-neg99.6%
+-commutative99.6%
*-commutative99.6%
*-commutative99.6%
distribute-rgt-out99.6%
Simplified99.6%
Taylor expanded in x.re around inf 86.2%
unpow286.2%
Simplified86.2%
expm1-log1p-u28.4%
expm1-udef9.1%
sub-neg9.1%
add-sqr-sqrt9.1%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod8.9%
add-sqr-sqrt10.3%
+-commutative10.3%
Applied egg-rr10.3%
expm1-def29.5%
expm1-log1p89.1%
Simplified89.1%
if -1.16e-63 < x.re < 3.9000000000000002e-53Initial program 88.6%
sqr-neg88.6%
difference-of-squares88.6%
sub-neg88.6%
associate-*l*99.6%
sub-neg99.6%
remove-double-neg99.6%
+-commutative99.6%
*-commutative99.6%
*-commutative99.6%
distribute-rgt-out99.6%
Simplified99.6%
Taylor expanded in x.re around 0 84.1%
distribute-rgt-out--84.1%
metadata-eval84.1%
associate-*r*84.1%
*-commutative84.1%
associate-*r*84.0%
unpow284.0%
metadata-eval84.0%
distribute-rgt-out--84.0%
associate-*l*95.1%
distribute-rgt-out--95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in x.im around 0 84.1%
unpow284.1%
associate-*r*95.2%
Simplified95.2%
if 3.9000000000000002e-53 < x.re Initial program 77.4%
sqr-neg77.4%
difference-of-squares85.8%
sub-neg85.8%
associate-*l*85.8%
sub-neg85.8%
remove-double-neg85.8%
+-commutative85.8%
*-commutative85.8%
*-commutative85.8%
distribute-rgt-out85.8%
Simplified85.8%
Taylor expanded in x.re around inf 78.5%
unpow278.5%
Simplified78.5%
Taylor expanded in x.re around inf 57.9%
+-commutative57.9%
cube-mult57.8%
unpow257.8%
associate-*r*57.8%
distribute-rgt-out91.6%
mul-1-neg91.6%
Simplified91.6%
Final simplification93.0%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.re -23000.0)
(and (not (<= x.re -6.8e-25))
(or (<= x.re -2.15e-60) (not (<= x.re 3.1e-52)))))
(* (* x.re x.re) (+ x.re x.im))
(* -3.0 (* x.im (* x.re x.im)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -23000.0) || (!(x_46_re <= -6.8e-25) && ((x_46_re <= -2.15e-60) || !(x_46_re <= 3.1e-52)))) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
}
return tmp;
}
NOTE: x.im should be positive before calling this function
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 <= (-23000.0d0)) .or. (.not. (x_46re <= (-6.8d-25))) .and. (x_46re <= (-2.15d-60)) .or. (.not. (x_46re <= 3.1d-52))) then
tmp = (x_46re * x_46re) * (x_46re + x_46im)
else
tmp = (-3.0d0) * (x_46im * (x_46re * x_46im))
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -23000.0) || (!(x_46_re <= -6.8e-25) && ((x_46_re <= -2.15e-60) || !(x_46_re <= 3.1e-52)))) {
tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im);
} else {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -23000.0) or (not (x_46_re <= -6.8e-25) and ((x_46_re <= -2.15e-60) or not (x_46_re <= 3.1e-52))): tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im) else: tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -23000.0) || (!(x_46_re <= -6.8e-25) && ((x_46_re <= -2.15e-60) || !(x_46_re <= 3.1e-52)))) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re + x_46_im)); else tmp = Float64(-3.0 * Float64(x_46_im * Float64(x_46_re * x_46_im))); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -23000.0) || (~((x_46_re <= -6.8e-25)) && ((x_46_re <= -2.15e-60) || ~((x_46_re <= 3.1e-52))))) tmp = (x_46_re * x_46_re) * (x_46_re + x_46_im); else tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -23000.0], And[N[Not[LessEqual[x$46$re, -6.8e-25]], $MachinePrecision], Or[LessEqual[x$46$re, -2.15e-60], N[Not[LessEqual[x$46$re, 3.1e-52]], $MachinePrecision]]]], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], N[(-3.0 * N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -23000 \lor \neg \left(x.re \leq -6.8 \cdot 10^{-25}\right) \land \left(x.re \leq -2.15 \cdot 10^{-60} \lor \neg \left(x.re \leq 3.1 \cdot 10^{-52}\right)\right):\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re + x.im\right)\\
\mathbf{else}:\\
\;\;\;\;-3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -23000 or -6.80000000000000003e-25 < x.re < -2.15e-60 or 3.0999999999999999e-52 < x.re Initial program 75.2%
sqr-neg75.2%
difference-of-squares83.6%
sub-neg83.6%
associate-*l*83.6%
sub-neg83.6%
remove-double-neg83.6%
+-commutative83.6%
*-commutative83.6%
*-commutative83.6%
distribute-rgt-out83.6%
Simplified83.6%
Taylor expanded in x.re around inf 75.2%
unpow275.2%
Simplified75.2%
expm1-log1p-u39.9%
expm1-udef31.5%
sub-neg31.5%
add-sqr-sqrt16.9%
sqrt-unprod34.6%
sqr-neg34.6%
sqrt-unprod17.7%
add-sqr-sqrt32.0%
+-commutative32.0%
Applied egg-rr32.0%
expm1-def40.3%
expm1-log1p71.7%
Simplified71.7%
Taylor expanded in x.im around 0 56.2%
unpow256.2%
cube-mult56.1%
distribute-rgt-in87.1%
+-commutative87.1%
Simplified87.1%
if -23000 < x.re < -6.80000000000000003e-25 or -2.15e-60 < x.re < 3.0999999999999999e-52Initial program 89.1%
sqr-neg89.1%
difference-of-squares89.1%
sub-neg89.1%
associate-*l*99.7%
sub-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
*-commutative99.7%
*-commutative99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in x.re around 0 84.8%
distribute-rgt-out--84.8%
metadata-eval84.8%
associate-*r*84.8%
*-commutative84.8%
associate-*r*84.7%
unpow284.7%
metadata-eval84.7%
distribute-rgt-out--84.7%
associate-*l*95.4%
distribute-rgt-out--95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in x.im around 0 84.8%
unpow284.8%
associate-*r*95.4%
Simplified95.4%
Final simplification90.8%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* (* x.re x.re) (+ x.re x.im)))
(t_1 (* -3.0 (* x.im (* x.re x.im)))))
(if (<= x.re -26500.0)
t_0
(if (<= x.re -4e-25)
t_1
(if (<= x.re -7.5e-64)
t_0
(if (<= x.re 5.5e-52) t_1 (* (* x.re x.re) (- x.re x.im))))))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im);
double t_1 = -3.0 * (x_46_im * (x_46_re * x_46_im));
double tmp;
if (x_46_re <= -26500.0) {
tmp = t_0;
} else if (x_46_re <= -4e-25) {
tmp = t_1;
} else if (x_46_re <= -7.5e-64) {
tmp = t_0;
} else if (x_46_re <= 5.5e-52) {
tmp = t_1;
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46re * x_46re) * (x_46re + x_46im)
t_1 = (-3.0d0) * (x_46im * (x_46re * x_46im))
if (x_46re <= (-26500.0d0)) then
tmp = t_0
else if (x_46re <= (-4d-25)) then
tmp = t_1
else if (x_46re <= (-7.5d-64)) then
tmp = t_0
else if (x_46re <= 5.5d-52) then
tmp = t_1
else
tmp = (x_46re * x_46re) * (x_46re - x_46im)
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im);
double t_1 = -3.0 * (x_46_im * (x_46_re * x_46_im));
double tmp;
if (x_46_re <= -26500.0) {
tmp = t_0;
} else if (x_46_re <= -4e-25) {
tmp = t_1;
} else if (x_46_re <= -7.5e-64) {
tmp = t_0;
} else if (x_46_re <= 5.5e-52) {
tmp = t_1;
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im) t_1 = -3.0 * (x_46_im * (x_46_re * x_46_im)) tmp = 0 if x_46_re <= -26500.0: tmp = t_0 elif x_46_re <= -4e-25: tmp = t_1 elif x_46_re <= -7.5e-64: tmp = t_0 elif x_46_re <= 5.5e-52: tmp = t_1 else: tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re + x_46_im)) t_1 = Float64(-3.0 * Float64(x_46_im * Float64(x_46_re * x_46_im))) tmp = 0.0 if (x_46_re <= -26500.0) tmp = t_0; elseif (x_46_re <= -4e-25) tmp = t_1; elseif (x_46_re <= -7.5e-64) tmp = t_0; elseif (x_46_re <= 5.5e-52) tmp = t_1; else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_re * x_46_re) * (x_46_re + x_46_im); t_1 = -3.0 * (x_46_im * (x_46_re * x_46_im)); tmp = 0.0; if (x_46_re <= -26500.0) tmp = t_0; elseif (x_46_re <= -4e-25) tmp = t_1; elseif (x_46_re <= -7.5e-64) tmp = t_0; elseif (x_46_re <= 5.5e-52) tmp = t_1; else tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-3.0 * N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -26500.0], t$95$0, If[LessEqual[x$46$re, -4e-25], t$95$1, If[LessEqual[x$46$re, -7.5e-64], t$95$0, If[LessEqual[x$46$re, 5.5e-52], t$95$1, N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := \left(x.re \cdot x.re\right) \cdot \left(x.re + x.im\right)\\
t_1 := -3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{if}\;x.re \leq -26500:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -4 \cdot 10^{-25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq -7.5 \cdot 10^{-64}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 5.5 \cdot 10^{-52}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\end{array}
\end{array}
if x.re < -26500 or -4.00000000000000015e-25 < x.re < -7.49999999999999949e-64Initial program 73.0%
sqr-neg73.0%
difference-of-squares81.5%
sub-neg81.5%
associate-*l*81.5%
sub-neg81.5%
remove-double-neg81.5%
+-commutative81.5%
*-commutative81.5%
*-commutative81.5%
distribute-rgt-out81.5%
Simplified81.5%
Taylor expanded in x.re around inf 72.0%
unpow272.0%
Simplified72.0%
expm1-log1p-u14.7%
expm1-udef5.5%
sub-neg5.5%
add-sqr-sqrt5.5%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-unprod5.7%
add-sqr-sqrt6.4%
+-commutative6.4%
Applied egg-rr6.4%
expm1-def15.5%
expm1-log1p73.4%
Simplified73.4%
Taylor expanded in x.im around 0 54.4%
unpow254.4%
cube-mult54.3%
distribute-rgt-in90.9%
+-commutative90.9%
Simplified90.9%
if -26500 < x.re < -4.00000000000000015e-25 or -7.49999999999999949e-64 < x.re < 5.5e-52Initial program 89.1%
sqr-neg89.1%
difference-of-squares89.1%
sub-neg89.1%
associate-*l*99.7%
sub-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
*-commutative99.7%
*-commutative99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in x.re around 0 84.8%
distribute-rgt-out--84.8%
metadata-eval84.8%
associate-*r*84.8%
*-commutative84.8%
associate-*r*84.7%
unpow284.7%
metadata-eval84.7%
distribute-rgt-out--84.7%
associate-*l*95.4%
distribute-rgt-out--95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in x.im around 0 84.8%
unpow284.8%
associate-*r*95.4%
Simplified95.4%
if 5.5e-52 < x.re Initial program 77.4%
sqr-neg77.4%
difference-of-squares85.8%
sub-neg85.8%
associate-*l*85.8%
sub-neg85.8%
remove-double-neg85.8%
+-commutative85.8%
*-commutative85.8%
*-commutative85.8%
distribute-rgt-out85.8%
Simplified85.8%
Taylor expanded in x.re around inf 78.5%
unpow278.5%
Simplified78.5%
Taylor expanded in x.re around inf 57.9%
+-commutative57.9%
cube-mult57.8%
unpow257.8%
associate-*r*57.8%
distribute-rgt-out91.6%
mul-1-neg91.6%
Simplified91.6%
Final simplification93.1%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -4.3e+186)
(* x.re (* x.im x.im))
(if (<= x.re 1.22e+96)
(* -3.0 (* x.im (* x.re x.im)))
(* (* x.re x.re) x.im))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -4.3e+186) {
tmp = x_46_re * (x_46_im * x_46_im);
} else if (x_46_re <= 1.22e+96) {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
NOTE: x.im should be positive before calling this function
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.3d+186)) then
tmp = x_46re * (x_46im * x_46im)
else if (x_46re <= 1.22d+96) then
tmp = (-3.0d0) * (x_46im * (x_46re * x_46im))
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -4.3e+186) {
tmp = x_46_re * (x_46_im * x_46_im);
} else if (x_46_re <= 1.22e+96) {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -4.3e+186: tmp = x_46_re * (x_46_im * x_46_im) elif x_46_re <= 1.22e+96: tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -4.3e+186) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); elseif (x_46_re <= 1.22e+96) tmp = Float64(-3.0 * Float64(x_46_im * Float64(x_46_re * x_46_im))); else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -4.3e+186) tmp = x_46_re * (x_46_im * x_46_im); elseif (x_46_re <= 1.22e+96) tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -4.3e+186], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.22e+96], N[(-3.0 * N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -4.3 \cdot 10^{+186}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{elif}\;x.re \leq 1.22 \cdot 10^{+96}:\\
\;\;\;\;-3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.re < -4.3e186Initial program 55.6%
sqr-neg55.6%
difference-of-squares66.7%
sub-neg66.7%
associate-*l*66.7%
sub-neg66.7%
remove-double-neg66.7%
+-commutative66.7%
*-commutative66.7%
*-commutative66.7%
distribute-rgt-out66.7%
Simplified66.7%
add-cube-cbrt66.7%
pow366.7%
Applied egg-rr66.7%
Taylor expanded in x.re around 0 11.6%
mul-1-neg11.6%
unpow211.6%
associate-*r*11.5%
distribute-rgt-neg-in11.5%
distribute-rgt-neg-in11.5%
Simplified11.5%
expm1-log1p-u11.5%
expm1-udef11.7%
*-commutative11.7%
*-commutative11.7%
associate-*l*11.7%
add-sqr-sqrt11.7%
sqrt-unprod11.1%
sqr-neg11.1%
sqrt-prod0.0%
add-sqr-sqrt0.6%
associate-*r*0.6%
*-commutative0.6%
associate-*l*0.6%
*-commutative0.6%
Applied egg-rr0.6%
expm1-def0.8%
expm1-log1p35.5%
associate-*r*35.4%
*-commutative35.4%
Simplified35.4%
if -4.3e186 < x.re < 1.21999999999999992e96Initial program 90.9%
sqr-neg90.9%
difference-of-squares92.1%
sub-neg92.1%
associate-*l*99.1%
sub-neg99.1%
remove-double-neg99.1%
+-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-rgt-out99.1%
Simplified99.1%
Taylor expanded in x.re around 0 64.9%
distribute-rgt-out--64.9%
metadata-eval64.9%
associate-*r*64.9%
*-commutative64.9%
associate-*r*64.9%
unpow264.9%
metadata-eval64.9%
distribute-rgt-out--64.9%
associate-*l*71.9%
distribute-rgt-out--71.9%
metadata-eval71.9%
Simplified71.9%
Taylor expanded in x.im around 0 64.9%
unpow264.9%
associate-*r*71.9%
Simplified71.9%
if 1.21999999999999992e96 < x.re Initial program 66.6%
sqr-neg66.6%
difference-of-squares79.1%
sub-neg79.1%
associate-*l*79.1%
sub-neg79.1%
remove-double-neg79.1%
+-commutative79.1%
*-commutative79.1%
*-commutative79.1%
distribute-rgt-out79.1%
Simplified79.1%
Taylor expanded in x.re around inf 79.1%
unpow279.1%
Simplified79.1%
expm1-log1p-u66.1%
expm1-udef66.1%
sub-neg66.1%
add-sqr-sqrt35.3%
sqrt-unprod66.1%
sqr-neg66.1%
sqrt-unprod30.8%
add-sqr-sqrt66.1%
+-commutative66.1%
Applied egg-rr66.1%
expm1-def66.1%
expm1-log1p66.6%
Simplified66.6%
Taylor expanded in x.im around 0 50.0%
unpow250.0%
cube-mult49.9%
distribute-rgt-in87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in x.re around 0 37.7%
unpow237.7%
Simplified37.7%
Final simplification60.4%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -1.12e+187)
(* x.re (* 3.0 (* x.im x.im)))
(if (<= x.re 1.22e+96)
(* -3.0 (* x.im (* x.re x.im)))
(* (* x.re x.re) x.im))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.12e+187) {
tmp = x_46_re * (3.0 * (x_46_im * x_46_im));
} else if (x_46_re <= 1.22e+96) {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re <= (-1.12d+187)) then
tmp = x_46re * (3.0d0 * (x_46im * x_46im))
else if (x_46re <= 1.22d+96) then
tmp = (-3.0d0) * (x_46im * (x_46re * x_46im))
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.12e+187) {
tmp = x_46_re * (3.0 * (x_46_im * x_46_im));
} else if (x_46_re <= 1.22e+96) {
tmp = -3.0 * (x_46_im * (x_46_re * x_46_im));
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -1.12e+187: tmp = x_46_re * (3.0 * (x_46_im * x_46_im)) elif x_46_re <= 1.22e+96: tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -1.12e+187) tmp = Float64(x_46_re * Float64(3.0 * Float64(x_46_im * x_46_im))); elseif (x_46_re <= 1.22e+96) tmp = Float64(-3.0 * Float64(x_46_im * Float64(x_46_re * x_46_im))); else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -1.12e+187) tmp = x_46_re * (3.0 * (x_46_im * x_46_im)); elseif (x_46_re <= 1.22e+96) tmp = -3.0 * (x_46_im * (x_46_re * x_46_im)); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -1.12e+187], N[(x$46$re * N[(3.0 * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.22e+96], N[(-3.0 * N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.12 \cdot 10^{+187}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.im \cdot x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 1.22 \cdot 10^{+96}:\\
\;\;\;\;-3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.re < -1.12000000000000007e187Initial program 55.6%
sqr-neg55.6%
difference-of-squares66.7%
sub-neg66.7%
associate-*l*66.7%
sub-neg66.7%
remove-double-neg66.7%
+-commutative66.7%
*-commutative66.7%
*-commutative66.7%
distribute-rgt-out66.7%
Simplified66.7%
Taylor expanded in x.re around 0 11.5%
associate-*r*11.5%
neg-mul-111.5%
unpow211.5%
distribute-rgt-neg-in11.5%
Simplified11.5%
cancel-sign-sub-inv11.5%
associate-*l*11.5%
add-sqr-sqrt5.7%
sqrt-unprod6.0%
sqr-neg6.0%
sqrt-unprod0.2%
add-sqr-sqrt0.4%
add-sqr-sqrt0.2%
sqrt-unprod26.7%
sqr-neg26.7%
sqrt-unprod26.4%
add-sqr-sqrt35.6%
associate-*r*35.6%
Applied egg-rr35.6%
associate-*r*35.6%
*-commutative35.6%
*-commutative35.6%
associate-*l*35.6%
*-commutative35.6%
count-235.6%
associate-*r*35.6%
metadata-eval35.6%
distribute-lft-in35.6%
metadata-eval35.6%
distribute-rgt1-in35.6%
metadata-eval35.6%
Simplified35.6%
if -1.12000000000000007e187 < x.re < 1.21999999999999992e96Initial program 90.9%
sqr-neg90.9%
difference-of-squares92.1%
sub-neg92.1%
associate-*l*99.1%
sub-neg99.1%
remove-double-neg99.1%
+-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-rgt-out99.1%
Simplified99.1%
Taylor expanded in x.re around 0 64.9%
distribute-rgt-out--64.9%
metadata-eval64.9%
associate-*r*64.9%
*-commutative64.9%
associate-*r*64.9%
unpow264.9%
metadata-eval64.9%
distribute-rgt-out--64.9%
associate-*l*71.9%
distribute-rgt-out--71.9%
metadata-eval71.9%
Simplified71.9%
Taylor expanded in x.im around 0 64.9%
unpow264.9%
associate-*r*71.9%
Simplified71.9%
if 1.21999999999999992e96 < x.re Initial program 66.6%
sqr-neg66.6%
difference-of-squares79.1%
sub-neg79.1%
associate-*l*79.1%
sub-neg79.1%
remove-double-neg79.1%
+-commutative79.1%
*-commutative79.1%
*-commutative79.1%
distribute-rgt-out79.1%
Simplified79.1%
Taylor expanded in x.re around inf 79.1%
unpow279.1%
Simplified79.1%
expm1-log1p-u66.1%
expm1-udef66.1%
sub-neg66.1%
add-sqr-sqrt35.3%
sqrt-unprod66.1%
sqr-neg66.1%
sqrt-unprod30.8%
add-sqr-sqrt66.1%
+-commutative66.1%
Applied egg-rr66.1%
expm1-def66.1%
expm1-log1p66.6%
Simplified66.6%
Taylor expanded in x.im around 0 50.0%
unpow250.0%
cube-mult49.9%
distribute-rgt-in87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in x.re around 0 37.7%
unpow237.7%
Simplified37.7%
Final simplification60.4%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 5.2e+45) (* (* x.re x.re) x.im) (if (<= x.im 5.5e+152) (* x.re (* x.im x.im)) (* x.im (* x.re (- x.im))))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 5.2e+45) {
tmp = (x_46_re * x_46_re) * x_46_im;
} else if (x_46_im <= 5.5e+152) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_im * (x_46_re * -x_46_im);
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= 5.2d+45) then
tmp = (x_46re * x_46re) * x_46im
else if (x_46im <= 5.5d+152) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = x_46im * (x_46re * -x_46im)
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 5.2e+45) {
tmp = (x_46_re * x_46_re) * x_46_im;
} else if (x_46_im <= 5.5e+152) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = x_46_im * (x_46_re * -x_46_im);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 5.2e+45: tmp = (x_46_re * x_46_re) * x_46_im elif x_46_im <= 5.5e+152: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = x_46_im * (x_46_re * -x_46_im) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 5.2e+45) tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); elseif (x_46_im <= 5.5e+152) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(x_46_im * Float64(x_46_re * Float64(-x_46_im))); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 5.2e+45) tmp = (x_46_re * x_46_re) * x_46_im; elseif (x_46_im <= 5.5e+152) tmp = x_46_re * (x_46_im * x_46_im); else tmp = x_46_im * (x_46_re * -x_46_im); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 5.2e+45], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision], If[LessEqual[x$46$im, 5.5e+152], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 5.2 \cdot 10^{+45}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\mathbf{elif}\;x.im \leq 5.5 \cdot 10^{+152}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\end{array}
\end{array}
if x.im < 5.20000000000000014e45Initial program 90.9%
sqr-neg90.9%
difference-of-squares92.4%
sub-neg92.4%
associate-*l*94.7%
sub-neg94.7%
remove-double-neg94.7%
+-commutative94.7%
*-commutative94.7%
*-commutative94.7%
distribute-rgt-out94.7%
Simplified94.7%
Taylor expanded in x.re around inf 77.2%
unpow277.2%
Simplified77.2%
expm1-log1p-u57.0%
expm1-udef48.6%
sub-neg48.6%
add-sqr-sqrt24.5%
sqrt-unprod46.1%
sqr-neg46.1%
sqrt-unprod24.1%
add-sqr-sqrt43.6%
+-commutative43.6%
Applied egg-rr43.6%
expm1-def51.9%
expm1-log1p76.7%
Simplified76.7%
Taylor expanded in x.im around 0 58.9%
unpow258.9%
cube-mult58.8%
distribute-rgt-in74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in x.re around 0 34.2%
unpow234.2%
Simplified34.2%
if 5.20000000000000014e45 < x.im < 5.4999999999999999e152Initial program 57.0%
sqr-neg57.0%
difference-of-squares57.0%
sub-neg57.0%
associate-*l*56.8%
sub-neg56.8%
remove-double-neg56.8%
+-commutative56.8%
*-commutative56.8%
*-commutative56.8%
distribute-rgt-out56.8%
Simplified56.8%
add-cube-cbrt56.4%
pow356.5%
Applied egg-rr56.5%
Taylor expanded in x.re around 0 8.9%
mul-1-neg8.9%
unpow28.9%
associate-*r*8.9%
distribute-rgt-neg-in8.9%
distribute-rgt-neg-in8.9%
Simplified8.9%
expm1-log1p-u2.5%
expm1-udef1.5%
*-commutative1.5%
*-commutative1.5%
associate-*l*1.5%
add-sqr-sqrt1.5%
sqrt-unprod9.2%
sqr-neg9.2%
sqrt-prod7.5%
add-sqr-sqrt7.7%
associate-*r*7.7%
*-commutative7.7%
associate-*l*7.7%
*-commutative7.7%
Applied egg-rr7.7%
expm1-def7.6%
expm1-log1p44.4%
associate-*r*44.4%
*-commutative44.4%
Simplified44.4%
if 5.4999999999999999e152 < x.im Initial program 41.5%
sqr-neg41.5%
difference-of-squares71.5%
sub-neg71.5%
associate-*l*96.5%
sub-neg96.5%
remove-double-neg96.5%
+-commutative96.5%
*-commutative96.5%
*-commutative96.5%
distribute-rgt-out96.5%
Simplified96.5%
add-cube-cbrt96.4%
pow396.4%
Applied egg-rr96.4%
Taylor expanded in x.re around 0 71.5%
mul-1-neg71.5%
unpow271.5%
associate-*r*74.7%
distribute-rgt-neg-in74.7%
distribute-rgt-neg-in74.7%
Simplified74.7%
Final simplification40.0%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.re -3.8e+181) (* x.re (* x.im x.im)) (* (* x.re x.re) x.im)))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -3.8e+181) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
NOTE: x.im should be positive before calling this function
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 <= (-3.8d+181)) then
tmp = x_46re * (x_46im * x_46im)
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -3.8e+181) {
tmp = x_46_re * (x_46_im * x_46_im);
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -3.8e+181: tmp = x_46_re * (x_46_im * x_46_im) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -3.8e+181) tmp = Float64(x_46_re * Float64(x_46_im * x_46_im)); else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -3.8e+181) tmp = x_46_re * (x_46_im * x_46_im); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -3.8e+181], N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -3.8 \cdot 10^{+181}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.re < -3.8000000000000001e181Initial program 56.8%
sqr-neg56.8%
difference-of-squares67.6%
sub-neg67.6%
associate-*l*67.6%
sub-neg67.6%
remove-double-neg67.6%
+-commutative67.6%
*-commutative67.6%
*-commutative67.6%
distribute-rgt-out67.6%
Simplified67.6%
add-cube-cbrt67.6%
pow367.6%
Applied egg-rr67.6%
Taylor expanded in x.re around 0 11.3%
mul-1-neg11.3%
unpow211.3%
associate-*r*11.3%
distribute-rgt-neg-in11.3%
distribute-rgt-neg-in11.3%
Simplified11.3%
expm1-log1p-u11.3%
expm1-udef11.4%
*-commutative11.4%
*-commutative11.4%
associate-*l*11.4%
add-sqr-sqrt11.4%
sqrt-unprod10.8%
sqr-neg10.8%
sqrt-prod0.0%
add-sqr-sqrt0.6%
associate-*r*0.6%
*-commutative0.6%
associate-*l*0.6%
*-commutative0.6%
Applied egg-rr0.6%
expm1-def0.8%
expm1-log1p34.6%
associate-*r*34.5%
*-commutative34.5%
Simplified34.5%
if -3.8000000000000001e181 < x.re Initial program 85.6%
sqr-neg85.6%
difference-of-squares89.2%
sub-neg89.2%
associate-*l*94.7%
sub-neg94.7%
remove-double-neg94.7%
+-commutative94.7%
*-commutative94.7%
*-commutative94.7%
distribute-rgt-out94.7%
Simplified94.7%
Taylor expanded in x.re around inf 69.9%
unpow269.9%
Simplified69.9%
expm1-log1p-u53.3%
expm1-udef45.8%
sub-neg45.8%
add-sqr-sqrt21.2%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-unprod28.8%
add-sqr-sqrt46.4%
+-commutative46.4%
Applied egg-rr46.4%
expm1-def54.0%
expm1-log1p67.6%
Simplified67.6%
Taylor expanded in x.im around 0 50.3%
unpow250.3%
cube-mult50.2%
distribute-rgt-in59.8%
+-commutative59.8%
Simplified59.8%
Taylor expanded in x.re around 0 28.1%
unpow228.1%
Simplified28.1%
Final simplification29.0%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (* (* x.re x.re) x.im))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (x_46re * x_46re) * x_46im
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return (x_46_re * x_46_re) * x_46_im
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * x_46_re) * x_46_im) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = (x_46_re * x_46_re) * x_46_im; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
\left(x.re \cdot x.re\right) \cdot x.im
\end{array}
Initial program 81.4%
sqr-neg81.4%
difference-of-squares86.1%
sub-neg86.1%
associate-*l*90.8%
sub-neg90.8%
remove-double-neg90.8%
+-commutative90.8%
*-commutative90.8%
*-commutative90.8%
distribute-rgt-out90.8%
Simplified90.8%
Taylor expanded in x.re around inf 68.7%
unpow268.7%
Simplified68.7%
expm1-log1p-u46.4%
expm1-udef40.0%
sub-neg40.0%
add-sqr-sqrt18.9%
sqrt-unprod40.7%
sqr-neg40.7%
sqrt-unprod25.5%
add-sqr-sqrt40.5%
+-commutative40.5%
Applied egg-rr40.5%
expm1-def47.0%
expm1-log1p66.8%
Simplified66.8%
Taylor expanded in x.im around 0 47.7%
unpow247.7%
cube-mult47.6%
distribute-rgt-in64.8%
+-commutative64.8%
Simplified64.8%
Taylor expanded in x.re around 0 29.5%
unpow229.5%
Simplified29.5%
Final simplification29.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 2023283
(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)))