
(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 -2e+121)
(* (* x.re (+ x.re -27.0)) (+ x.re x.im))
(if (<= x.re 5e+98)
(fma (* x.re x.im) (* x.im -3.0) (pow x.re 3.0))
(- (* x.re (* (+ x.re x.im) (- x.re x.im))) (* x.im -3.0)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -2e+121) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else if (x_46_re <= 5e+98) {
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_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
}
return tmp;
}
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -2e+121) tmp = Float64(Float64(x_46_re * Float64(x_46_re + -27.0)) * Float64(x_46_re + x_46_im)); elseif (x_46_re <= 5e+98) 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 * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))) - Float64(x_46_im * -3.0)); 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, -2e+121], N[(N[(x$46$re * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5e+98], 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 * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2 \cdot 10^{+121}:\\
\;\;\;\;\left(x.re \cdot \left(x.re + -27\right)\right) \cdot \left(x.re + x.im\right)\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(x.re \cdot x.im, x.im \cdot -3, {x.re}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right) - x.im \cdot -3\\
\end{array}
\end{array}
if x.re < -2.00000000000000007e121Initial program 57.6%
difference-of-squares66.7%
Applied egg-rr66.7%
Simplified57.6%
Taylor expanded in x.im around 0 42.4%
sub-neg42.4%
metadata-eval42.4%
associate-*r*51.5%
*-commutative51.5%
sub-neg51.5%
metadata-eval51.5%
distribute-rgt-out78.8%
unpow278.8%
distribute-lft-in90.9%
Simplified90.9%
Taylor expanded in x.im around 0 42.4%
Simplified90.9%
if -2.00000000000000007e121 < x.re < 4.9999999999999998e98Initial program 92.7%
Simplified92.8%
associate-*r*92.9%
associate-*l*92.8%
+-commutative92.8%
associate-*r*99.7%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
if 4.9999999999999998e98 < x.re Initial program 58.3%
difference-of-squares66.7%
*-commutative66.7%
Applied egg-rr66.7%
expm1-log1p-u36.1%
expm1-udef36.1%
*-commutative36.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.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 -2e+121)
(* (* x.re (+ x.re -27.0)) (+ x.re x.im))
(if (<= x.re 5e+98)
(+ (pow x.re 3.0) (* -3.0 (* x.im (* x.re x.im))))
(- (* x.re (* (+ x.re x.im) (- x.re x.im))) (* x.im -3.0)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -2e+121) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else if (x_46_re <= 5e+98) {
tmp = pow(x_46_re, 3.0) + (-3.0 * (x_46_im * (x_46_re * x_46_im)));
} else {
tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
}
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 <= (-2d+121)) then
tmp = (x_46re * (x_46re + (-27.0d0))) * (x_46re + x_46im)
else if (x_46re <= 5d+98) then
tmp = (x_46re ** 3.0d0) + ((-3.0d0) * (x_46im * (x_46re * x_46im)))
else
tmp = (x_46re * ((x_46re + x_46im) * (x_46re - x_46im))) - (x_46im * (-3.0d0))
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 <= -2e+121) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else if (x_46_re <= 5e+98) {
tmp = Math.pow(x_46_re, 3.0) + (-3.0 * (x_46_im * (x_46_re * x_46_im)));
} else {
tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -2e+121: tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im) elif x_46_re <= 5e+98: tmp = math.pow(x_46_re, 3.0) + (-3.0 * (x_46_im * (x_46_re * x_46_im))) else: tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -2e+121) tmp = Float64(Float64(x_46_re * Float64(x_46_re + -27.0)) * Float64(x_46_re + x_46_im)); elseif (x_46_re <= 5e+98) tmp = Float64((x_46_re ^ 3.0) + Float64(-3.0 * Float64(x_46_im * Float64(x_46_re * x_46_im)))); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))) - Float64(x_46_im * -3.0)); 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 <= -2e+121) tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im); elseif (x_46_re <= 5e+98) tmp = (x_46_re ^ 3.0) + (-3.0 * (x_46_im * (x_46_re * x_46_im))); else tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0); 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, -2e+121], N[(N[(x$46$re * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5e+98], N[(N[Power[x$46$re, 3.0], $MachinePrecision] + N[(-3.0 * N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2 \cdot 10^{+121}:\\
\;\;\;\;\left(x.re \cdot \left(x.re + -27\right)\right) \cdot \left(x.re + x.im\right)\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{+98}:\\
\;\;\;\;{x.re}^{3} + -3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right) - x.im \cdot -3\\
\end{array}
\end{array}
if x.re < -2.00000000000000007e121Initial program 57.6%
difference-of-squares66.7%
Applied egg-rr66.7%
Simplified57.6%
Taylor expanded in x.im around 0 42.4%
sub-neg42.4%
metadata-eval42.4%
associate-*r*51.5%
*-commutative51.5%
sub-neg51.5%
metadata-eval51.5%
distribute-rgt-out78.8%
unpow278.8%
distribute-lft-in90.9%
Simplified90.9%
Taylor expanded in x.im around 0 42.4%
Simplified90.9%
if -2.00000000000000007e121 < x.re < 4.9999999999999998e98Initial program 92.7%
Simplified92.8%
add-sqr-sqrt66.9%
pow266.9%
*-commutative66.9%
sqrt-prod47.7%
sqrt-prod25.5%
add-sqr-sqrt51.1%
Applied egg-rr51.1%
unpow251.1%
*-commutative51.1%
associate-*r*51.2%
associate-*r*51.2%
add-sqr-sqrt99.7%
*-commutative99.7%
Applied egg-rr99.7%
if 4.9999999999999998e98 < x.re Initial program 58.3%
difference-of-squares66.7%
*-commutative66.7%
Applied egg-rr66.7%
expm1-log1p-u36.1%
expm1-udef36.1%
*-commutative36.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification98.6%
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.im) (- x.re x.im)))))
(if (<=
(-
(* x.re (- (* x.re x.re) (* x.im x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
5e+306)
(- t_0 (* x.im (* (* x.re x.im) 2.0)))
(- t_0 (* x.im -3.0)))))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_im) * (x_46_re - 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)))) <= 5e+306) {
tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0));
} else {
tmp = t_0 - (x_46_im * -3.0);
}
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_46im) * (x_46re - x_46im))
if (((x_46re * ((x_46re * x_46re) - (x_46im * x_46im))) - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))) <= 5d+306) then
tmp = t_0 - (x_46im * ((x_46re * x_46im) * 2.0d0))
else
tmp = t_0 - (x_46im * (-3.0d0))
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_im) * (x_46_re - 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)))) <= 5e+306) {
tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0));
} else {
tmp = t_0 - (x_46_im * -3.0);
}
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_im) * (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)))) <= 5e+306: tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0)) else: tmp = t_0 - (x_46_im * -3.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(Float64(x_46_re + x_46_im) * Float64(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)))) <= 5e+306) tmp = Float64(t_0 - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * 2.0))); else tmp = Float64(t_0 - Float64(x_46_im * -3.0)); 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_im) * (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)))) <= 5e+306) tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0)); else tmp = t_0 - (x_46_im * -3.0); 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[(x$46$re * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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], 5e+306], N[(t$95$0 - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := x.re \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)\\
\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 5 \cdot 10^{+306}:\\
\;\;\;\;t_0 - x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - x.im \cdot -3\\
\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)) < 4.99999999999999993e306Initial program 96.2%
difference-of-squares96.2%
*-commutative96.2%
Applied egg-rr96.2%
*-un-lft-identity96.2%
*-commutative96.2%
*-un-lft-identity96.2%
distribute-rgt-out96.2%
metadata-eval96.2%
Applied egg-rr96.2%
if 4.99999999999999993e306 < (-.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 50.6%
difference-of-squares59.0%
*-commutative59.0%
Applied egg-rr59.0%
expm1-log1p-u29.7%
expm1-udef29.7%
*-commutative29.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified90.9%
Final simplification94.7%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -2.5e-86) (not (<= x.re 1.2e-18))) (- (* x.re (* (+ x.re x.im) (- x.re x.im))) (* x.im -3.0)) (* (* x.im x.im) (- (- x.re) (* x.re 2.0)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -2.5e-86) || !(x_46_re <= 1.2e-18)) {
tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
} else {
tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0));
}
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 <= (-2.5d-86)) .or. (.not. (x_46re <= 1.2d-18))) then
tmp = (x_46re * ((x_46re + x_46im) * (x_46re - x_46im))) - (x_46im * (-3.0d0))
else
tmp = (x_46im * x_46im) * (-x_46re - (x_46re * 2.0d0))
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 <= -2.5e-86) || !(x_46_re <= 1.2e-18)) {
tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
} else {
tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -2.5e-86) or not (x_46_re <= 1.2e-18): tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0) else: tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -2.5e-86) || !(x_46_re <= 1.2e-18)) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re - x_46_im))) - Float64(x_46_im * -3.0)); else tmp = Float64(Float64(x_46_im * x_46_im) * Float64(Float64(-x_46_re) - Float64(x_46_re * 2.0))); 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 <= -2.5e-86) || ~((x_46_re <= 1.2e-18))) tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0); else tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0)); 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, -2.5e-86], N[Not[LessEqual[x$46$re, 1.2e-18]], $MachinePrecision]], N[(N[(x$46$re * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[((-x$46$re) - N[(x$46$re * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.5 \cdot 10^{-86} \lor \neg \left(x.re \leq 1.2 \cdot 10^{-18}\right):\\
\;\;\;\;x.re \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right) - x.im \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(\left(-x.re\right) - x.re \cdot 2\right)\\
\end{array}
\end{array}
if x.re < -2.4999999999999999e-86 or 1.19999999999999997e-18 < x.re Initial program 77.4%
difference-of-squares81.6%
*-commutative81.6%
Applied egg-rr81.6%
expm1-log1p-u52.2%
expm1-udef50.8%
*-commutative50.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified86.5%
if -2.4999999999999999e-86 < x.re < 1.19999999999999997e-18Initial program 90.8%
Taylor expanded in x.im around inf 81.0%
unpow281.0%
Applied egg-rr81.0%
Final simplification84.0%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -5.2e+44) (not (<= x.re 5.5e+55))) (* (* x.re (+ x.re -27.0)) (+ x.re x.im)) (* (* x.im x.im) (- (- x.re) (* x.re 2.0)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -5.2e+44) || !(x_46_re <= 5.5e+55)) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else {
tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0));
}
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 <= (-5.2d+44)) .or. (.not. (x_46re <= 5.5d+55))) then
tmp = (x_46re * (x_46re + (-27.0d0))) * (x_46re + x_46im)
else
tmp = (x_46im * x_46im) * (-x_46re - (x_46re * 2.0d0))
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 <= -5.2e+44) || !(x_46_re <= 5.5e+55)) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else {
tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -5.2e+44) or not (x_46_re <= 5.5e+55): tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im) else: tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -5.2e+44) || !(x_46_re <= 5.5e+55)) tmp = Float64(Float64(x_46_re * Float64(x_46_re + -27.0)) * Float64(x_46_re + x_46_im)); else tmp = Float64(Float64(x_46_im * x_46_im) * Float64(Float64(-x_46_re) - Float64(x_46_re * 2.0))); 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 <= -5.2e+44) || ~((x_46_re <= 5.5e+55))) tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im); else tmp = (x_46_im * x_46_im) * (-x_46_re - (x_46_re * 2.0)); 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, -5.2e+44], N[Not[LessEqual[x$46$re, 5.5e+55]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[((-x$46$re) - N[(x$46$re * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5.2 \cdot 10^{+44} \lor \neg \left(x.re \leq 5.5 \cdot 10^{+55}\right):\\
\;\;\;\;\left(x.re \cdot \left(x.re + -27\right)\right) \cdot \left(x.re + x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(\left(-x.re\right) - x.re \cdot 2\right)\\
\end{array}
\end{array}
if x.re < -5.1999999999999998e44 or 5.5000000000000004e55 < x.re Initial program 68.1%
difference-of-squares74.7%
Applied egg-rr74.7%
Simplified66.1%
Taylor expanded in x.im around 0 53.8%
sub-neg53.8%
metadata-eval53.8%
associate-*r*60.4%
*-commutative60.4%
sub-neg60.4%
metadata-eval60.4%
distribute-rgt-out79.1%
unpow279.1%
distribute-lft-in90.1%
Simplified90.1%
Taylor expanded in x.im around 0 53.8%
Simplified90.1%
if -5.1999999999999998e44 < x.re < 5.5000000000000004e55Initial program 91.8%
Taylor expanded in x.im around inf 71.7%
unpow271.7%
Applied egg-rr71.7%
Final simplification78.3%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 2.9e+222) (* (* x.re (+ x.re -27.0)) (+ x.re x.im)) (* -27.0 (* 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 <= 2.9e+222) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else {
tmp = -27.0 * (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 <= 2.9d+222) then
tmp = (x_46re * (x_46re + (-27.0d0))) * (x_46re + x_46im)
else
tmp = (-27.0d0) * (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 <= 2.9e+222) {
tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im);
} else {
tmp = -27.0 * (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 <= 2.9e+222: tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im) else: tmp = -27.0 * (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 <= 2.9e+222) tmp = Float64(Float64(x_46_re * Float64(x_46_re + -27.0)) * Float64(x_46_re + x_46_im)); else tmp = Float64(-27.0 * 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_im <= 2.9e+222) tmp = (x_46_re * (x_46_re + -27.0)) * (x_46_re + x_46_im); else tmp = -27.0 * (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, 2.9e+222], N[(N[(x$46$re * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.9 \cdot 10^{+222}:\\
\;\;\;\;\left(x.re \cdot \left(x.re + -27\right)\right) \cdot \left(x.re + x.im\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 2.89999999999999981e222Initial program 83.9%
difference-of-squares85.6%
Applied egg-rr85.6%
Simplified51.2%
Taylor expanded in x.im around 0 36.1%
sub-neg36.1%
metadata-eval36.1%
associate-*r*38.6%
*-commutative38.6%
sub-neg38.6%
metadata-eval38.6%
distribute-rgt-out45.7%
unpow245.7%
distribute-lft-in49.5%
Simplified49.5%
Taylor expanded in x.im around 0 36.1%
Simplified49.5%
if 2.89999999999999981e222 < x.im Initial program 75.4%
difference-of-squares87.9%
Applied egg-rr87.9%
Simplified51.3%
Taylor expanded in x.im around 0 20.7%
sub-neg20.7%
metadata-eval20.7%
associate-*r*20.7%
*-commutative20.7%
sub-neg20.7%
metadata-eval20.7%
distribute-rgt-out20.7%
unpow220.7%
distribute-lft-in27.0%
Simplified27.0%
Taylor expanded in x.re around 0 58.2%
Simplified58.2%
Final simplification50.0%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 3.6e+221) (* (+ x.re -27.0) (* x.re (+ x.re x.im))) (* -27.0 (* 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 <= 3.6e+221) {
tmp = (x_46_re + -27.0) * (x_46_re * (x_46_re + x_46_im));
} else {
tmp = -27.0 * (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 <= 3.6d+221) then
tmp = (x_46re + (-27.0d0)) * (x_46re * (x_46re + x_46im))
else
tmp = (-27.0d0) * (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 <= 3.6e+221) {
tmp = (x_46_re + -27.0) * (x_46_re * (x_46_re + x_46_im));
} else {
tmp = -27.0 * (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 <= 3.6e+221: tmp = (x_46_re + -27.0) * (x_46_re * (x_46_re + x_46_im)) else: tmp = -27.0 * (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 <= 3.6e+221) tmp = Float64(Float64(x_46_re + -27.0) * Float64(x_46_re * Float64(x_46_re + x_46_im))); else tmp = Float64(-27.0 * 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_im <= 3.6e+221) tmp = (x_46_re + -27.0) * (x_46_re * (x_46_re + x_46_im)); else tmp = -27.0 * (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, 3.6e+221], N[(N[(x$46$re + -27.0), $MachinePrecision] * N[(x$46$re * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 3.6 \cdot 10^{+221}:\\
\;\;\;\;\left(x.re + -27\right) \cdot \left(x.re \cdot \left(x.re + x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 3.60000000000000009e221Initial program 83.9%
difference-of-squares85.6%
Applied egg-rr85.6%
Simplified51.2%
Taylor expanded in x.im around 0 36.1%
sub-neg36.1%
metadata-eval36.1%
associate-*r*38.6%
*-commutative38.6%
sub-neg38.6%
metadata-eval38.6%
distribute-rgt-out45.7%
unpow245.7%
distribute-lft-in49.5%
Simplified49.5%
if 3.60000000000000009e221 < x.im Initial program 75.4%
difference-of-squares87.9%
Applied egg-rr87.9%
Simplified51.3%
Taylor expanded in x.im around 0 20.7%
sub-neg20.7%
metadata-eval20.7%
associate-*r*20.7%
*-commutative20.7%
sub-neg20.7%
metadata-eval20.7%
distribute-rgt-out20.7%
unpow220.7%
distribute-lft-in27.0%
Simplified27.0%
Taylor expanded in x.re around 0 58.2%
Simplified58.2%
Final simplification50.0%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.28e+216) (* x.im (* x.re (- x.re 27.0))) (* -27.0 (* 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 <= 1.28e+216) {
tmp = x_46_im * (x_46_re * (x_46_re - 27.0));
} else {
tmp = -27.0 * (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 <= 1.28d+216) then
tmp = x_46im * (x_46re * (x_46re - 27.0d0))
else
tmp = (-27.0d0) * (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 <= 1.28e+216) {
tmp = x_46_im * (x_46_re * (x_46_re - 27.0));
} else {
tmp = -27.0 * (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 <= 1.28e+216: tmp = x_46_im * (x_46_re * (x_46_re - 27.0)) else: tmp = -27.0 * (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 <= 1.28e+216) tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_re - 27.0))); else tmp = Float64(-27.0 * 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_im <= 1.28e+216) tmp = x_46_im * (x_46_re * (x_46_re - 27.0)); else tmp = -27.0 * (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, 1.28e+216], N[(x$46$im * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.28 \cdot 10^{+216}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re - 27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 1.2799999999999999e216Initial program 84.2%
difference-of-squares85.9%
Applied egg-rr85.9%
Simplified51.4%
Taylor expanded in x.im around 0 36.3%
sub-neg36.3%
metadata-eval36.3%
associate-*r*38.8%
*-commutative38.8%
sub-neg38.8%
metadata-eval38.8%
distribute-rgt-out45.9%
unpow245.9%
distribute-lft-in49.7%
Simplified49.7%
Taylor expanded in x.im around inf 32.1%
if 1.2799999999999999e216 < x.im Initial program 71.3%
difference-of-squares83.1%
Applied egg-rr83.1%
Simplified49.4%
Taylor expanded in x.im around 0 19.7%
sub-neg19.7%
metadata-eval19.7%
associate-*r*19.7%
*-commutative19.7%
sub-neg19.7%
metadata-eval19.7%
distribute-rgt-out19.7%
unpow219.7%
distribute-lft-in25.6%
Simplified25.6%
Taylor expanded in x.re around 0 55.0%
Simplified55.0%
Final simplification33.6%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 3.6e+214) (* x.re (* x.re x.im)) (* -27.0 (* 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 <= 3.6e+214) {
tmp = x_46_re * (x_46_re * x_46_im);
} else {
tmp = -27.0 * (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 <= 3.6d+214) then
tmp = x_46re * (x_46re * x_46im)
else
tmp = (-27.0d0) * (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 <= 3.6e+214) {
tmp = x_46_re * (x_46_re * x_46_im);
} else {
tmp = -27.0 * (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 <= 3.6e+214: tmp = x_46_re * (x_46_re * x_46_im) else: tmp = -27.0 * (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 <= 3.6e+214) tmp = Float64(x_46_re * Float64(x_46_re * x_46_im)); else tmp = Float64(-27.0 * 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_im <= 3.6e+214) tmp = x_46_re * (x_46_re * x_46_im); else tmp = -27.0 * (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, 3.6e+214], N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 3.6 \cdot 10^{+214}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 3.6000000000000001e214Initial program 84.2%
difference-of-squares85.9%
Applied egg-rr85.9%
Simplified51.4%
Taylor expanded in x.im around 0 36.3%
sub-neg36.3%
metadata-eval36.3%
associate-*r*38.8%
*-commutative38.8%
sub-neg38.8%
metadata-eval38.8%
distribute-rgt-out45.9%
unpow245.9%
distribute-lft-in49.7%
Simplified49.7%
Taylor expanded in x.im around inf 32.1%
Simplified27.8%
Taylor expanded in x.re around inf 29.0%
if 3.6000000000000001e214 < x.im Initial program 71.3%
difference-of-squares83.1%
Applied egg-rr83.1%
Simplified49.4%
Taylor expanded in x.im around 0 19.7%
sub-neg19.7%
metadata-eval19.7%
associate-*r*19.7%
*-commutative19.7%
sub-neg19.7%
metadata-eval19.7%
distribute-rgt-out19.7%
unpow219.7%
distribute-lft-in25.6%
Simplified25.6%
Taylor expanded in x.re around 0 55.0%
Simplified55.0%
Final simplification30.7%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (* -27.0 (* x.re x.im)))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return -27.0 * (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 = (-27.0d0) * (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 -27.0 * (x_46_re * x_46_im);
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return -27.0 * (x_46_re * x_46_im)
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(-27.0 * Float64(x_46_re * x_46_im)) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = -27.0 * (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[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
-27 \cdot \left(x.re \cdot x.im\right)
\end{array}
Initial program 83.4%
difference-of-squares85.7%
Applied egg-rr85.7%
Simplified51.2%
Taylor expanded in x.im around 0 35.2%
sub-neg35.2%
metadata-eval35.2%
associate-*r*37.5%
*-commutative37.5%
sub-neg37.5%
metadata-eval37.5%
distribute-rgt-out44.1%
unpow244.1%
distribute-lft-in48.1%
Simplified48.1%
Taylor expanded in x.re around 0 24.9%
Simplified24.9%
Final simplification24.9%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (- x.re))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return -x_46_re;
}
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
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.im = abs(x.im) def code(x_46_re, x_46_im): return -x_46_re
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(-x_46_re) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = -x_46_re; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := (-x$46$re)
\begin{array}{l}
x.im = |x.im|\\
\\
-x.re
\end{array}
Initial program 83.4%
Simplified81.5%
Taylor expanded in x.re around 0 53.5%
Simplified3.4%
Final simplification3.4%
(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 2023333
(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)))