
(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 14 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 -5.5e+102)
(* x.re (* (+ x.re x.im) (+ x.re -27.0)))
(if (<= x.re 5e+101)
(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 <= -5.5e+102) {
tmp = x_46_re * ((x_46_re + x_46_im) * (x_46_re + -27.0));
} else if (x_46_re <= 5e+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_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 <= -5.5e+102) tmp = Float64(x_46_re * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re + -27.0))); elseif (x_46_re <= 5e+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 * 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, -5.5e+102], N[(x$46$re * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 5e+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 * 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 -5.5 \cdot 10^{+102}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re + -27\right)\right)\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{+101}:\\
\;\;\;\;\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 < -5.49999999999999981e102Initial program 53.3%
difference-of-squares64.4%
Applied egg-rr64.4%
Simplified51.1%
Applied egg-rr86.7%
if -5.49999999999999981e102 < x.re < 4.99999999999999989e101Initial program 89.8%
Simplified89.8%
+-commutative89.8%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
if 4.99999999999999989e101 < x.re Initial program 62.8%
difference-of-squares72.1%
*-commutative72.1%
Applied egg-rr72.1%
*-commutative72.1%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-neg-frac0.0%
flip-+69.8%
neg-sub069.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification97.5%
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.im))))
(if (<= (- (* x.re t_0) (* x.im (+ (* x.re x.im) (* x.re x.im)))) 5e+256)
(fma x.re t_0 (* x.im (* (* x.re x.im) -2.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 t_0 = (x_46_re * x_46_re) - (x_46_im * x_46_im);
double tmp;
if (((x_46_re * t_0) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= 5e+256) {
tmp = fma(x_46_re, t_0, (x_46_im * ((x_46_re * x_46_im) * -2.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) t_0 = Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) tmp = 0.0 if (Float64(Float64(x_46_re * t_0) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= 5e+256) tmp = fma(x_46_re, t_0, Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * -2.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_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x$46$re * t$95$0), $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+256], N[(x$46$re * t$95$0 + N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * -2.0), $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}
t_0 := x.re \cdot x.re - x.im \cdot x.im\\
\mathbf{if}\;x.re \cdot t_0 - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq 5 \cdot 10^{+256}:\\
\;\;\;\;\mathsf{fma}\left(x.re, t_0, x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot -2\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 (-.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)) < 5.00000000000000015e256Initial program 95.5%
Simplified95.5%
if 5.00000000000000015e256 < (-.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 44.8%
difference-of-squares55.5%
*-commutative55.5%
Applied egg-rr55.5%
*-commutative55.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-neg-frac0.0%
flip-+59.1%
neg-sub059.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified88.9%
Final simplification93.3%
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+256)
(- 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+256) {
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+256) 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+256) {
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+256: 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+256) 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+256) 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+256], 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^{+256}:\\
\;\;\;\;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)) < 5.00000000000000015e256Initial program 95.5%
difference-of-squares95.5%
*-commutative95.5%
Applied egg-rr95.5%
*-commutative29.5%
*-un-lft-identity29.5%
*-un-lft-identity29.5%
distribute-rgt-out29.5%
metadata-eval29.5%
Applied egg-rr95.5%
if 5.00000000000000015e256 < (-.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 44.8%
difference-of-squares55.5%
*-commutative55.5%
Applied egg-rr55.5%
*-commutative55.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-neg-frac0.0%
flip-+59.1%
neg-sub059.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified88.9%
Final simplification93.3%
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.im 1.85e-156)
(+ (* x.re x.im) t_0)
(if (<= x.im 5.1e+49)
(-
(* x.re (* x.re (- x.re 27.0)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
(- 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_im <= 1.85e-156) {
tmp = (x_46_re * x_46_im) + t_0;
} else if (x_46_im <= 5.1e+49) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} 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_46im <= 1.85d-156) then
tmp = (x_46re * x_46im) + t_0
else if (x_46im <= 5.1d+49) then
tmp = (x_46re * (x_46re * (x_46re - 27.0d0))) - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))
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_im <= 1.85e-156) {
tmp = (x_46_re * x_46_im) + t_0;
} else if (x_46_im <= 5.1e+49) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} 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_im <= 1.85e-156: tmp = (x_46_re * x_46_im) + t_0 elif x_46_im <= 5.1e+49: tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) 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 (x_46_im <= 1.85e-156) tmp = Float64(Float64(x_46_re * x_46_im) + t_0); elseif (x_46_im <= 5.1e+49) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))); 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_im <= 1.85e-156) tmp = (x_46_re * x_46_im) + t_0; elseif (x_46_im <= 5.1e+49) tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); 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[x$46$im, 1.85e-156], N[(N[(x$46$re * x$46$im), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 5.1e+49], N[(N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $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], 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.im \leq 1.85 \cdot 10^{-156}:\\
\;\;\;\;x.re \cdot x.im + t_0\\
\mathbf{elif}\;x.im \leq 5.1 \cdot 10^{+49}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - x.im \cdot -3\\
\end{array}
\end{array}
if x.im < 1.85e-156Initial program 82.2%
difference-of-squares85.8%
*-commutative85.8%
Applied egg-rr85.8%
Taylor expanded in x.re around 0 85.8%
Simplified67.7%
if 1.85e-156 < x.im < 5.09999999999999956e49Initial program 100.0%
difference-of-squares100.0%
Applied egg-rr100.0%
Simplified46.4%
Taylor expanded in x.im around 0 55.3%
if 5.09999999999999956e49 < x.im Initial program 55.2%
difference-of-squares60.7%
*-commutative60.7%
Applied egg-rr60.7%
*-commutative60.7%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-neg-frac0.0%
flip-+24.4%
neg-sub024.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified61.7%
Final simplification64.8%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -2.2e-58) (not (<= x.re 6.1e-61))) (- (* x.re (* (+ x.re x.im) (- x.re x.im))) (* x.im -3.0)) (- (* -27.0 (* x.re x.im)) (* x.im (+ (* x.re 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 <= -2.2e-58) || !(x_46_re <= 6.1e-61)) {
tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
} else {
tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * 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 <= (-2.2d-58)) .or. (.not. (x_46re <= 6.1d-61))) then
tmp = (x_46re * ((x_46re + x_46im) * (x_46re - x_46im))) - (x_46im * (-3.0d0))
else
tmp = ((-27.0d0) * (x_46re * x_46im)) - (x_46im * ((x_46re * 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 <= -2.2e-58) || !(x_46_re <= 6.1e-61)) {
tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0);
} else {
tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * 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 <= -2.2e-58) or not (x_46_re <= 6.1e-61): tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0) else: tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * 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 <= -2.2e-58) || !(x_46_re <= 6.1e-61)) 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(-27.0 * Float64(x_46_re * x_46_im)) - Float64(x_46_im * Float64(Float64(x_46_re * 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 <= -2.2e-58) || ~((x_46_re <= 6.1e-61))) tmp = (x_46_re * ((x_46_re + x_46_im) * (x_46_re - x_46_im))) - (x_46_im * -3.0); else tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * 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, -2.2e-58], N[Not[LessEqual[x$46$re, 6.1e-61]], $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[(-27.0 * N[(x$46$re * x$46$im), $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]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.2 \cdot 10^{-58} \lor \neg \left(x.re \leq 6.1 \cdot 10^{-61}\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}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < -2.20000000000000006e-58 or 6.1000000000000001e-61 < x.re Initial program 74.7%
difference-of-squares80.6%
*-commutative80.6%
Applied egg-rr80.6%
*-commutative80.6%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-neg-frac0.0%
flip-+65.5%
neg-sub065.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified90.4%
if -2.20000000000000006e-58 < x.re < 6.1000000000000001e-61Initial program 85.1%
difference-of-squares85.1%
Applied egg-rr85.1%
Simplified35.1%
Taylor expanded in x.re around 0 39.1%
Final simplification70.0%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -3.6e-58) (not (<= x.re 6.1e-61))) (- (* x.re (* (+ x.re x.im) (- x.re x.im))) (* x.im -3.0)) (- (* x.im (* x.re -27.0)) (* x.im (* (* x.re x.im) 2.0)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -3.6e-58) || !(x_46_re <= 6.1e-61)) {
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_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 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 <= (-3.6d-58)) .or. (.not. (x_46re <= 6.1d-61))) then
tmp = (x_46re * ((x_46re + x_46im) * (x_46re - x_46im))) - (x_46im * (-3.0d0))
else
tmp = (x_46im * (x_46re * (-27.0d0))) - (x_46im * ((x_46re * x_46im) * 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 <= -3.6e-58) || !(x_46_re <= 6.1e-61)) {
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_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -3.6e-58) or not (x_46_re <= 6.1e-61): 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_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -3.6e-58) || !(x_46_re <= 6.1e-61)) 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 * Float64(x_46_re * -27.0)) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * 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 <= -3.6e-58) || ~((x_46_re <= 6.1e-61))) 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_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 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, -3.6e-58], N[Not[LessEqual[x$46$re, 6.1e-61]], $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 * N[(x$46$re * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -3.6 \cdot 10^{-58} \lor \neg \left(x.re \leq 6.1 \cdot 10^{-61}\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}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot -27\right) - x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\
\end{array}
\end{array}
if x.re < -3.60000000000000009e-58 or 6.1000000000000001e-61 < x.re Initial program 74.7%
difference-of-squares80.6%
*-commutative80.6%
Applied egg-rr80.6%
*-commutative80.6%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
distribute-neg-frac0.0%
flip-+65.5%
neg-sub065.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified90.4%
if -3.60000000000000009e-58 < x.re < 6.1000000000000001e-61Initial program 85.1%
difference-of-squares85.1%
Applied egg-rr85.1%
Simplified35.1%
Taylor expanded in x.re around 0 39.1%
associate-*r*39.1%
*-commutative39.1%
associate-*l*39.1%
*-commutative39.1%
Simplified39.1%
*-commutative39.1%
*-un-lft-identity39.1%
*-un-lft-identity39.1%
distribute-rgt-out39.1%
metadata-eval39.1%
Applied egg-rr39.1%
Final simplification70.0%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* x.re -27.0))) (t_1 (* x.im (* x.re (- x.re 27.0)))))
(if (<= x.re -3.5e+149)
t_0
(if (<= x.re -6e-160)
t_1
(if (<= x.re 1.9e-180)
t_0
(if (<= x.re 1.1e+157) (* -27.0 (* x.re x.im)) t_1))))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_re * -27.0);
double t_1 = x_46_im * (x_46_re * (x_46_re - 27.0));
double tmp;
if (x_46_re <= -3.5e+149) {
tmp = t_0;
} else if (x_46_re <= -6e-160) {
tmp = t_1;
} else if (x_46_re <= 1.9e-180) {
tmp = t_0;
} else if (x_46_re <= 1.1e+157) {
tmp = -27.0 * (x_46_re * x_46_im);
} else {
tmp = t_1;
}
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 * (-27.0d0))
t_1 = x_46im * (x_46re * (x_46re - 27.0d0))
if (x_46re <= (-3.5d+149)) then
tmp = t_0
else if (x_46re <= (-6d-160)) then
tmp = t_1
else if (x_46re <= 1.9d-180) then
tmp = t_0
else if (x_46re <= 1.1d+157) then
tmp = (-27.0d0) * (x_46re * x_46im)
else
tmp = t_1
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 * -27.0);
double t_1 = x_46_im * (x_46_re * (x_46_re - 27.0));
double tmp;
if (x_46_re <= -3.5e+149) {
tmp = t_0;
} else if (x_46_re <= -6e-160) {
tmp = t_1;
} else if (x_46_re <= 1.9e-180) {
tmp = t_0;
} else if (x_46_re <= 1.1e+157) {
tmp = -27.0 * (x_46_re * x_46_im);
} else {
tmp = t_1;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = x_46_re * (x_46_re * -27.0) t_1 = x_46_im * (x_46_re * (x_46_re - 27.0)) tmp = 0 if x_46_re <= -3.5e+149: tmp = t_0 elif x_46_re <= -6e-160: tmp = t_1 elif x_46_re <= 1.9e-180: tmp = t_0 elif x_46_re <= 1.1e+157: tmp = -27.0 * (x_46_re * x_46_im) else: tmp = t_1 return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(x_46_re * -27.0)) t_1 = Float64(x_46_im * Float64(x_46_re * Float64(x_46_re - 27.0))) tmp = 0.0 if (x_46_re <= -3.5e+149) tmp = t_0; elseif (x_46_re <= -6e-160) tmp = t_1; elseif (x_46_re <= 1.9e-180) tmp = t_0; elseif (x_46_re <= 1.1e+157) tmp = Float64(-27.0 * Float64(x_46_re * x_46_im)); else tmp = t_1; 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 * -27.0); t_1 = x_46_im * (x_46_re * (x_46_re - 27.0)); tmp = 0.0; if (x_46_re <= -3.5e+149) tmp = t_0; elseif (x_46_re <= -6e-160) tmp = t_1; elseif (x_46_re <= 1.9e-180) tmp = t_0; elseif (x_46_re <= 1.1e+157) tmp = -27.0 * (x_46_re * x_46_im); else tmp = t_1; 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[(x$46$re * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -3.5e+149], t$95$0, If[LessEqual[x$46$re, -6e-160], t$95$1, If[LessEqual[x$46$re, 1.9e-180], t$95$0, If[LessEqual[x$46$re, 1.1e+157], N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot -27\right)\\
t_1 := x.im \cdot \left(x.re \cdot \left(x.re - 27\right)\right)\\
\mathbf{if}\;x.re \leq -3.5 \cdot 10^{+149}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -6 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq 1.9 \cdot 10^{-180}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq 1.1 \cdot 10^{+157}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x.re < -3.50000000000000011e149 or -5.99999999999999993e-160 < x.re < 1.9e-180Initial program 65.2%
difference-of-squares70.6%
Applied egg-rr70.6%
Simplified49.2%
Applied egg-rr61.3%
Taylor expanded in x.im around 0 64.8%
Taylor expanded in x.re around 0 63.9%
*-commutative63.9%
Simplified63.9%
if -3.50000000000000011e149 < x.re < -5.99999999999999993e-160 or 1.1000000000000001e157 < x.re Initial program 82.2%
difference-of-squares85.2%
Applied egg-rr85.2%
Simplified50.1%
Applied egg-rr50.1%
Taylor expanded in x.im around inf 23.4%
if 1.9e-180 < x.re < 1.1000000000000001e157Initial program 93.9%
difference-of-squares95.5%
Applied egg-rr95.5%
Simplified43.0%
Applied egg-rr30.2%
Taylor expanded in x.re around 0 18.2%
Final simplification36.8%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 2.2e+129) (* x.re (* x.re (- x.re 27.0))) (- (* x.im (* x.re -27.0)) (* x.im (* (* x.re x.im) 2.0)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.2e+129) {
tmp = x_46_re * (x_46_re * (x_46_re - 27.0));
} else {
tmp = (x_46_im * (x_46_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 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_46im <= 2.2d+129) then
tmp = x_46re * (x_46re * (x_46re - 27.0d0))
else
tmp = (x_46im * (x_46re * (-27.0d0))) - (x_46im * ((x_46re * x_46im) * 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_im <= 2.2e+129) {
tmp = x_46_re * (x_46_re * (x_46_re - 27.0));
} else {
tmp = (x_46_im * (x_46_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 2.2e+129: tmp = x_46_re * (x_46_re * (x_46_re - 27.0)) else: tmp = (x_46_im * (x_46_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 2.2e+129) tmp = Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))); else tmp = Float64(Float64(x_46_im * Float64(x_46_re * -27.0)) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * 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_im <= 2.2e+129) tmp = x_46_re * (x_46_re * (x_46_re - 27.0)); else tmp = (x_46_im * (x_46_re * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 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[LessEqual[x$46$im, 2.2e+129], N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * N[(x$46$re * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.2 \cdot 10^{+129}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot -27\right) - x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\
\end{array}
\end{array}
if x.im < 2.1999999999999999e129Initial program 83.6%
difference-of-squares86.3%
Applied egg-rr86.3%
Simplified49.9%
Applied egg-rr53.6%
Taylor expanded in x.im around 0 52.5%
if 2.1999999999999999e129 < x.im Initial program 50.9%
difference-of-squares59.1%
Applied egg-rr59.1%
Simplified37.3%
Taylor expanded in x.re around 0 58.9%
associate-*r*58.9%
*-commutative58.9%
associate-*l*58.9%
*-commutative58.9%
Simplified58.9%
*-commutative58.9%
*-un-lft-identity58.9%
*-un-lft-identity58.9%
distribute-rgt-out58.9%
metadata-eval58.9%
Applied egg-rr58.9%
Final simplification53.4%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im 7e-14)
(* x.re (* x.re (- x.re 27.0)))
(if (<= x.im 1.78e+227)
(* x.re (* (+ x.re x.im) (+ x.re -27.0)))
(* (+ x.re x.im) (* x.re -27.0)))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 7e-14) {
tmp = x_46_re * (x_46_re * (x_46_re - 27.0));
} else if (x_46_im <= 1.78e+227) {
tmp = x_46_re * ((x_46_re + x_46_im) * (x_46_re + -27.0));
} else {
tmp = (x_46_re + x_46_im) * (x_46_re * -27.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_46im <= 7d-14) then
tmp = x_46re * (x_46re * (x_46re - 27.0d0))
else if (x_46im <= 1.78d+227) then
tmp = x_46re * ((x_46re + x_46im) * (x_46re + (-27.0d0)))
else
tmp = (x_46re + x_46im) * (x_46re * (-27.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_im <= 7e-14) {
tmp = x_46_re * (x_46_re * (x_46_re - 27.0));
} else if (x_46_im <= 1.78e+227) {
tmp = x_46_re * ((x_46_re + x_46_im) * (x_46_re + -27.0));
} else {
tmp = (x_46_re + x_46_im) * (x_46_re * -27.0);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 7e-14: tmp = x_46_re * (x_46_re * (x_46_re - 27.0)) elif x_46_im <= 1.78e+227: tmp = x_46_re * ((x_46_re + x_46_im) * (x_46_re + -27.0)) else: tmp = (x_46_re + x_46_im) * (x_46_re * -27.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 7e-14) tmp = Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))); elseif (x_46_im <= 1.78e+227) tmp = Float64(x_46_re * Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re + -27.0))); else tmp = Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re * -27.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_im <= 7e-14) tmp = x_46_re * (x_46_re * (x_46_re - 27.0)); elseif (x_46_im <= 1.78e+227) tmp = x_46_re * ((x_46_re + x_46_im) * (x_46_re + -27.0)); else tmp = (x_46_re + x_46_im) * (x_46_re * -27.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$im, 7e-14], N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.78e+227], N[(x$46$re * N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 7 \cdot 10^{-14}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right)\\
\mathbf{elif}\;x.im \leq 1.78 \cdot 10^{+227}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + x.im\right) \cdot \left(x.re + -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re + x.im\right) \cdot \left(x.re \cdot -27\right)\\
\end{array}
\end{array}
if x.im < 7.0000000000000005e-14Initial program 84.3%
difference-of-squares87.4%
Applied egg-rr87.4%
Simplified53.2%
Applied egg-rr55.3%
Taylor expanded in x.im around 0 54.2%
if 7.0000000000000005e-14 < x.im < 1.77999999999999995e227Initial program 65.8%
difference-of-squares67.8%
Applied egg-rr67.8%
Simplified32.2%
Applied egg-rr33.3%
if 1.77999999999999995e227 < x.im Initial program 54.9%
difference-of-squares68.2%
Applied egg-rr68.2%
Simplified37.3%
Applied egg-rr28.5%
Taylor expanded in x.re around 0 48.5%
Simplified48.5%
Final simplification49.7%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 9.5e+234) (* x.re (* 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 <= 9.5e+234) {
tmp = x_46_re * (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 <= 9.5d+234) then
tmp = x_46re * (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 <= 9.5e+234) {
tmp = x_46_re * (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 <= 9.5e+234: tmp = x_46_re * (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 <= 9.5e+234) tmp = Float64(x_46_re * 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 <= 9.5e+234) tmp = x_46_re * (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, 9.5e+234], N[(x$46$re * 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 9.5 \cdot 10^{+234}:\\
\;\;\;\;x.re \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 < 9.49999999999999938e234Initial program 80.1%
difference-of-squares83.0%
Applied egg-rr83.0%
Simplified48.6%
Applied egg-rr50.4%
Taylor expanded in x.im around 0 48.4%
if 9.49999999999999938e234 < x.im Initial program 58.1%
difference-of-squares72.4%
Applied egg-rr72.4%
Simplified38.6%
Applied egg-rr30.2%
Taylor expanded in x.re around 0 51.6%
Final simplification48.6%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 2.9e+190) (* x.re (* x.re (- x.re 27.0))) (* (+ x.re x.im) (* x.re -27.0))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.9e+190) {
tmp = x_46_re * (x_46_re * (x_46_re - 27.0));
} else {
tmp = (x_46_re + x_46_im) * (x_46_re * -27.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_46im <= 2.9d+190) then
tmp = x_46re * (x_46re * (x_46re - 27.0d0))
else
tmp = (x_46re + x_46im) * (x_46re * (-27.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_im <= 2.9e+190) {
tmp = x_46_re * (x_46_re * (x_46_re - 27.0));
} else {
tmp = (x_46_re + x_46_im) * (x_46_re * -27.0);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 2.9e+190: tmp = x_46_re * (x_46_re * (x_46_re - 27.0)) else: tmp = (x_46_re + x_46_im) * (x_46_re * -27.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 2.9e+190) tmp = Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))); else tmp = Float64(Float64(x_46_re + x_46_im) * Float64(x_46_re * -27.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_im <= 2.9e+190) tmp = x_46_re * (x_46_re * (x_46_re - 27.0)); else tmp = (x_46_re + x_46_im) * (x_46_re * -27.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$im, 2.9e+190], N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re + x$46$im), $MachinePrecision] * N[(x$46$re * -27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.9 \cdot 10^{+190}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re + x.im\right) \cdot \left(x.re \cdot -27\right)\\
\end{array}
\end{array}
if x.im < 2.89999999999999989e190Initial program 81.4%
difference-of-squares84.4%
Applied egg-rr84.4%
Simplified48.6%
Applied egg-rr51.2%
Taylor expanded in x.im around 0 49.6%
if 2.89999999999999989e190 < x.im Initial program 52.4%
difference-of-squares61.4%
Applied egg-rr61.4%
Simplified41.8%
Applied egg-rr29.5%
Taylor expanded in x.re around 0 34.5%
Simplified34.5%
Final simplification48.3%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 5.6e+235) (* 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 <= 5.6e+235) {
tmp = 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 <= 5.6d+235) then
tmp = 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 <= 5.6e+235) {
tmp = 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 <= 5.6e+235: tmp = 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 <= 5.6e+235) tmp = 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 <= 5.6e+235) tmp = 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, 5.6e+235], N[(x$46$re * N[(x$46$re * -27.0), $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 5.6 \cdot 10^{+235}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 5.60000000000000052e235Initial program 80.1%
difference-of-squares83.0%
Applied egg-rr83.0%
Simplified48.6%
Applied egg-rr50.4%
Taylor expanded in x.im around 0 48.4%
Taylor expanded in x.re around 0 28.5%
*-commutative28.5%
Simplified28.5%
if 5.60000000000000052e235 < x.im Initial program 58.1%
difference-of-squares72.4%
Applied egg-rr72.4%
Simplified38.6%
Applied egg-rr30.2%
Taylor expanded in x.re around 0 51.6%
Final simplification29.8%
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 78.9%
difference-of-squares82.4%
Applied egg-rr82.4%
Simplified48.1%
Applied egg-rr49.3%
Taylor expanded in x.re around 0 22.2%
Final simplification22.2%
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 78.9%
Simplified73.8%
Taylor expanded in x.re around 0 52.5%
Simplified3.3%
Final simplification3.3%
(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 2023305
(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)))