
(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
(let* ((t_0 (/ x.re (- x.re))))
(if (<= x.re -4.8e+103)
(+ (* x.re (* (+ x.re -27.0) (+ x.re x.im))) t_0)
(if (<= x.re 2e+86)
(+ (pow x.re 3.0) (* x.im (* x.re (* x.im -3.0))))
(+ (* x.re (* (- x.re x.im) (+ x.re x.im))) t_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;
double tmp;
if (x_46_re <= -4.8e+103) {
tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0;
} else if (x_46_re <= 2e+86) {
tmp = pow(x_46_re, 3.0) + (x_46_im * (x_46_re * (x_46_im * -3.0)));
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + t_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
if (x_46re <= (-4.8d+103)) then
tmp = (x_46re * ((x_46re + (-27.0d0)) * (x_46re + x_46im))) + t_0
else if (x_46re <= 2d+86) then
tmp = (x_46re ** 3.0d0) + (x_46im * (x_46re * (x_46im * (-3.0d0))))
else
tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) + t_0
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;
double tmp;
if (x_46_re <= -4.8e+103) {
tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0;
} else if (x_46_re <= 2e+86) {
tmp = Math.pow(x_46_re, 3.0) + (x_46_im * (x_46_re * (x_46_im * -3.0)));
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + t_0;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = x_46_re / -x_46_re tmp = 0 if x_46_re <= -4.8e+103: tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0 elif x_46_re <= 2e+86: tmp = math.pow(x_46_re, 3.0) + (x_46_im * (x_46_re * (x_46_im * -3.0))) else: tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + t_0 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)) tmp = 0.0 if (x_46_re <= -4.8e+103) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re + -27.0) * Float64(x_46_re + x_46_im))) + t_0); elseif (x_46_re <= 2e+86) tmp = Float64((x_46_re ^ 3.0) + Float64(x_46_im * Float64(x_46_re * Float64(x_46_im * -3.0)))); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + x_46_im))) + t_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; tmp = 0.0; if (x_46_re <= -4.8e+103) tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0; elseif (x_46_re <= 2e+86) tmp = (x_46_re ^ 3.0) + (x_46_im * (x_46_re * (x_46_im * -3.0))); else tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + t_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 / (-x$46$re)), $MachinePrecision]}, If[LessEqual[x$46$re, -4.8e+103], N[(N[(x$46$re * N[(N[(x$46$re + -27.0), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 2e+86], N[(N[Power[x$46$re, 3.0], $MachinePrecision] + N[(x$46$im * N[(x$46$re * N[(x$46$im * -3.0), $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] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := \frac{x.re}{-x.re}\\
\mathbf{if}\;x.re \leq -4.8 \cdot 10^{+103}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + -27\right) \cdot \left(x.re + x.im\right)\right) + t_0\\
\mathbf{elif}\;x.re \leq 2 \cdot 10^{+86}:\\
\;\;\;\;{x.re}^{3} + x.im \cdot \left(x.re \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) + t_0\\
\end{array}
\end{array}
if x.re < -4.7999999999999997e103Initial program 64.3%
*-commutative64.3%
flip3-+33.3%
associate-*r/33.3%
*-commutative33.3%
count-233.3%
pow233.3%
*-commutative33.3%
*-commutative33.3%
*-commutative33.3%
+-inverses33.3%
Applied egg-rr33.3%
Simplified85.7%
difference-of-squares100.0%
Applied egg-rr100.0%
Simplified88.1%
if -4.7999999999999997e103 < x.re < 2e86Initial program 88.5%
Simplified88.4%
associate-*r*88.5%
associate-*l*88.5%
add-sqr-sqrt65.1%
sqrt-unprod64.0%
associate-*l*64.0%
associate-*r*64.0%
associate-*l*64.0%
associate-*r*64.0%
swap-sqr59.7%
pow259.7%
associate-*r*59.7%
associate-*r*59.7%
swap-sqr59.7%
pow259.7%
pow259.7%
pow-prod-up59.7%
metadata-eval59.7%
metadata-eval59.7%
Applied egg-rr59.7%
associate-*r*59.7%
*-commutative59.7%
metadata-eval59.7%
pow-prod-up59.7%
pow-prod-down59.7%
pow259.7%
unpow259.7%
swap-sqr64.0%
add-sqr-sqrt21.4%
swap-sqr21.4%
unpow221.4%
add-sqr-sqrt21.4%
swap-sqr21.5%
unpow221.5%
metadata-eval21.5%
swap-sqr21.5%
sqrt-unprod16.4%
add-sqr-sqrt45.9%
Applied egg-rr99.8%
if 2e86 < x.re Initial program 67.3%
*-commutative67.3%
flip3-+40.8%
associate-*r/40.8%
*-commutative40.8%
count-240.8%
pow240.8%
*-commutative40.8%
*-commutative40.8%
*-commutative40.8%
+-inverses40.8%
Applied egg-rr40.8%
Simplified81.6%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification97.9%
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 x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))))
(if (<= t_0 1e+300)
t_0
(+ (* x.re (* (- x.re x.im) (+ x.re x.im))) (/ x.re (- x.re))))))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 * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= 1e+300) {
tmp = t_0;
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re);
}
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 * x_46im))) - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))
if (t_0 <= 1d+300) then
tmp = t_0
else
tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) + (x_46re / -x_46re)
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 * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= 1e+300) {
tmp = t_0;
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re);
}
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 * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) tmp = 0 if t_0 <= 1e+300: tmp = t_0 else: tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = 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)))) tmp = 0.0 if (t_0 <= 1e+300) tmp = t_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_re / Float64(-x_46_re))); 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 * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); tmp = 0.0; if (t_0 <= 1e+300) tmp = t_0; else tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re); 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 * 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]}, If[LessEqual[t$95$0, 1e+300], t$95$0, 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$re / (-x$46$re)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := 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)\\
\mathbf{if}\;t_0 \leq 10^{+300}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) + \frac{x.re}{-x.re}\\
\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)) < 1.0000000000000001e300Initial program 93.8%
if 1.0000000000000001e300 < (-.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 53.6%
*-commutative53.6%
flip3-+23.0%
associate-*r/23.0%
*-commutative23.0%
count-223.0%
pow223.0%
*-commutative23.0%
*-commutative23.0%
*-commutative23.0%
+-inverses23.0%
Applied egg-rr23.0%
Simplified72.4%
difference-of-squares90.1%
*-commutative90.1%
Applied egg-rr90.1%
Final simplification92.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)))) (t_1 (/ x.re (- x.re))))
(if (<= x.re -5e+132)
(+ (* x.re (* (+ x.re -27.0) (+ x.re x.im))) t_1)
(if (<= x.re 4e+80)
(- t_0 (* x.im (+ (* x.re x.im) (* x.re x.im))))
(+ t_0 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 - x_46_im) * (x_46_re + x_46_im));
double t_1 = x_46_re / -x_46_re;
double tmp;
if (x_46_re <= -5e+132) {
tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_1;
} else if (x_46_re <= 4e+80) {
tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} else {
tmp = t_0 + 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 - x_46im) * (x_46re + x_46im))
t_1 = x_46re / -x_46re
if (x_46re <= (-5d+132)) then
tmp = (x_46re * ((x_46re + (-27.0d0)) * (x_46re + x_46im))) + t_1
else if (x_46re <= 4d+80) then
tmp = t_0 - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))
else
tmp = t_0 + 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 - x_46_im) * (x_46_re + x_46_im));
double t_1 = x_46_re / -x_46_re;
double tmp;
if (x_46_re <= -5e+132) {
tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_1;
} else if (x_46_re <= 4e+80) {
tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} else {
tmp = t_0 + 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 - x_46_im) * (x_46_re + x_46_im)) t_1 = x_46_re / -x_46_re tmp = 0 if x_46_re <= -5e+132: tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_1 elif x_46_re <= 4e+80: tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) else: tmp = t_0 + t_1 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))) t_1 = Float64(x_46_re / Float64(-x_46_re)) tmp = 0.0 if (x_46_re <= -5e+132) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re + -27.0) * Float64(x_46_re + x_46_im))) + t_1); elseif (x_46_re <= 4e+80) tmp = Float64(t_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 + 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 - x_46_im) * (x_46_re + x_46_im)); t_1 = x_46_re / -x_46_re; tmp = 0.0; if (x_46_re <= -5e+132) tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_1; elseif (x_46_re <= 4e+80) tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); else tmp = t_0 + 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[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re / (-x$46$re)), $MachinePrecision]}, If[LessEqual[x$46$re, -5e+132], N[(N[(x$46$re * N[(N[(x$46$re + -27.0), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x$46$re, 4e+80], N[(t$95$0 - 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 + t$95$1), $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)\\
t_1 := \frac{x.re}{-x.re}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{+132}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + -27\right) \cdot \left(x.re + x.im\right)\right) + t_1\\
\mathbf{elif}\;x.re \leq 4 \cdot 10^{+80}:\\
\;\;\;\;t_0 - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + t_1\\
\end{array}
\end{array}
if x.re < -5.0000000000000001e132Initial program 59.5%
*-commutative59.5%
flip3-+32.4%
associate-*r/32.4%
*-commutative32.4%
count-232.4%
pow232.4%
*-commutative32.4%
*-commutative32.4%
*-commutative32.4%
+-inverses32.4%
Applied egg-rr32.4%
Simplified83.8%
difference-of-squares100.0%
Applied egg-rr100.0%
Simplified91.9%
if -5.0000000000000001e132 < x.re < 4e80Initial program 88.8%
difference-of-squares34.0%
*-commutative34.0%
Applied egg-rr88.7%
if 4e80 < x.re Initial program 68.0%
*-commutative68.0%
flip3-+42.0%
associate-*r/42.0%
*-commutative42.0%
count-242.0%
pow242.0%
*-commutative42.0%
*-commutative42.0%
*-commutative42.0%
+-inverses42.0%
Applied egg-rr42.0%
Simplified82.0%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
Final simplification91.4%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -4.1e+42) (not (<= x.re 9.5e+23))) (+ (* x.re (* x.re (- x.re 27.0))) (/ x.re (- x.re))) (- (* -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 <= -4.1e+42) || !(x_46_re <= 9.5e+23)) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re);
} 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 <= (-4.1d+42)) .or. (.not. (x_46re <= 9.5d+23))) then
tmp = (x_46re * (x_46re * (x_46re - 27.0d0))) + (x_46re / -x_46re)
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 <= -4.1e+42) || !(x_46_re <= 9.5e+23)) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re);
} 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 <= -4.1e+42) or not (x_46_re <= 9.5e+23): tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re) 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 <= -4.1e+42) || !(x_46_re <= 9.5e+23)) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))) + Float64(x_46_re / Float64(-x_46_re))); 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 <= -4.1e+42) || ~((x_46_re <= 9.5e+23))) tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re); 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, -4.1e+42], N[Not[LessEqual[x$46$re, 9.5e+23]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-x$46$re)), $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 -4.1 \cdot 10^{+42} \lor \neg \left(x.re \leq 9.5 \cdot 10^{+23}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right) + \frac{x.re}{-x.re}\\
\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 < -4.1e42 or 9.50000000000000038e23 < x.re Initial program 72.2%
*-commutative72.2%
flip3-+39.2%
associate-*r/39.2%
*-commutative39.2%
count-239.2%
pow239.2%
*-commutative39.2%
*-commutative39.2%
*-commutative39.2%
+-inverses39.2%
Applied egg-rr39.2%
Simplified85.1%
difference-of-squares98.4%
Applied egg-rr98.4%
Simplified85.9%
Taylor expanded in x.im around 0 81.2%
if -4.1e42 < x.re < 9.50000000000000038e23Initial program 86.9%
difference-of-squares23.8%
Applied egg-rr86.9%
Simplified42.5%
Taylor expanded in x.re around 0 46.2%
Final simplification61.5%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -6.5e-15) (not (<= x.re 1.0))) (+ (* x.re (* (- x.re x.im) (+ x.re x.im))) (/ x.re (- x.re))) (- (* -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 <= -6.5e-15) || !(x_46_re <= 1.0)) {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re);
} 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 <= (-6.5d-15)) .or. (.not. (x_46re <= 1.0d0))) then
tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) + (x_46re / -x_46re)
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 <= -6.5e-15) || !(x_46_re <= 1.0)) {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re);
} 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 <= -6.5e-15) or not (x_46_re <= 1.0): tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re) 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 <= -6.5e-15) || !(x_46_re <= 1.0)) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + x_46_im))) + Float64(x_46_re / Float64(-x_46_re))); 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 <= -6.5e-15) || ~((x_46_re <= 1.0))) tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) + (x_46_re / -x_46_re); 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, -6.5e-15], N[Not[LessEqual[x$46$re, 1.0]], $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$re / (-x$46$re)), $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 -6.5 \cdot 10^{-15} \lor \neg \left(x.re \leq 1\right):\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) + \frac{x.re}{-x.re}\\
\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 < -6.49999999999999991e-15 or 1 < x.re Initial program 75.7%
*-commutative75.7%
flip3-+39.0%
associate-*r/37.6%
*-commutative37.6%
count-237.6%
pow237.6%
*-commutative37.6%
*-commutative37.6%
*-commutative37.6%
+-inverses37.6%
Applied egg-rr37.6%
Simplified83.0%
difference-of-squares94.7%
*-commutative94.7%
Applied egg-rr94.7%
if -6.49999999999999991e-15 < x.re < 1Initial program 85.3%
difference-of-squares18.2%
Applied egg-rr85.2%
Simplified40.9%
Taylor expanded in x.re around 0 46.4%
Final simplification70.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))))
(if (<= x.re -1.32e+42)
(+ (* x.re (* (+ x.re -27.0) (+ x.re x.im))) t_0)
(if (<= x.re 1e+24)
(- (* -27.0 (* x.re x.im)) (* x.im (+ (* x.re x.im) (* x.re x.im))))
(+ (* x.re (* x.re (- x.re 27.0))) t_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;
double tmp;
if (x_46_re <= -1.32e+42) {
tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0;
} else if (x_46_re <= 1e+24) {
tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} else {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_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
if (x_46re <= (-1.32d+42)) then
tmp = (x_46re * ((x_46re + (-27.0d0)) * (x_46re + x_46im))) + t_0
else if (x_46re <= 1d+24) then
tmp = ((-27.0d0) * (x_46re * x_46im)) - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))
else
tmp = (x_46re * (x_46re * (x_46re - 27.0d0))) + t_0
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;
double tmp;
if (x_46_re <= -1.32e+42) {
tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0;
} else if (x_46_re <= 1e+24) {
tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
} else {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_0;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = x_46_re / -x_46_re tmp = 0 if x_46_re <= -1.32e+42: tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0 elif x_46_re <= 1e+24: tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) else: tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_0 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)) tmp = 0.0 if (x_46_re <= -1.32e+42) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re + -27.0) * Float64(x_46_re + x_46_im))) + t_0); elseif (x_46_re <= 1e+24) 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)))); else tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))) + t_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; tmp = 0.0; if (x_46_re <= -1.32e+42) tmp = (x_46_re * ((x_46_re + -27.0) * (x_46_re + x_46_im))) + t_0; elseif (x_46_re <= 1e+24) tmp = (-27.0 * (x_46_re * x_46_im)) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); else tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_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 / (-x$46$re)), $MachinePrecision]}, If[LessEqual[x$46$re, -1.32e+42], N[(N[(x$46$re * N[(N[(x$46$re + -27.0), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[x$46$re, 1e+24], 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], N[(N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := \frac{x.re}{-x.re}\\
\mathbf{if}\;x.re \leq -1.32 \cdot 10^{+42}:\\
\;\;\;\;x.re \cdot \left(\left(x.re + -27\right) \cdot \left(x.re + x.im\right)\right) + t_0\\
\mathbf{elif}\;x.re \leq 10^{+24}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right) + t_0\\
\end{array}
\end{array}
if x.re < -1.32e42Initial program 72.1%
*-commutative72.1%
flip3-+37.0%
associate-*r/37.0%
*-commutative37.0%
count-237.0%
pow237.0%
*-commutative37.0%
*-commutative37.0%
*-commutative37.0%
+-inverses37.0%
Applied egg-rr37.0%
Simplified87.3%
difference-of-squares98.4%
Applied egg-rr98.4%
Simplified85.4%
if -1.32e42 < x.re < 9.9999999999999998e23Initial program 86.9%
difference-of-squares23.8%
Applied egg-rr86.9%
Simplified42.5%
Taylor expanded in x.re around 0 46.2%
if 9.9999999999999998e23 < x.re Initial program 72.3%
*-commutative72.3%
flip3-+41.3%
associate-*r/41.3%
*-commutative41.3%
count-241.3%
pow241.3%
*-commutative41.3%
*-commutative41.3%
*-commutative41.3%
+-inverses41.3%
Applied egg-rr41.3%
Simplified83.0%
difference-of-squares98.5%
Applied egg-rr98.5%
Simplified86.3%
Taylor expanded in x.im around 0 82.7%
Final simplification62.7%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (/ x.re (- x.re))))
(if (<= x.im 1.55e+223)
(+ (* x.re (* x.re (- x.re 27.0))) t_0)
(+ (* -27.0 (* x.re x.im)) t_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;
double tmp;
if (x_46_im <= 1.55e+223) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_0;
} else {
tmp = (-27.0 * (x_46_re * x_46_im)) + t_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
if (x_46im <= 1.55d+223) then
tmp = (x_46re * (x_46re * (x_46re - 27.0d0))) + t_0
else
tmp = ((-27.0d0) * (x_46re * x_46im)) + t_0
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;
double tmp;
if (x_46_im <= 1.55e+223) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_0;
} else {
tmp = (-27.0 * (x_46_re * x_46_im)) + t_0;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = x_46_re / -x_46_re tmp = 0 if x_46_im <= 1.55e+223: tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_0 else: tmp = (-27.0 * (x_46_re * x_46_im)) + t_0 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)) tmp = 0.0 if (x_46_im <= 1.55e+223) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))) + t_0); else tmp = Float64(Float64(-27.0 * Float64(x_46_re * x_46_im)) + t_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; tmp = 0.0; if (x_46_im <= 1.55e+223) tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) + t_0; else tmp = (-27.0 * (x_46_re * x_46_im)) + t_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 / (-x$46$re)), $MachinePrecision]}, If[LessEqual[x$46$im, 1.55e+223], N[(N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := \frac{x.re}{-x.re}\\
\mathbf{if}\;x.im \leq 1.55 \cdot 10^{+223}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right) + t_0\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(x.re \cdot x.im\right) + t_0\\
\end{array}
\end{array}
if x.im < 1.54999999999999991e223Initial program 80.6%
*-commutative80.6%
flip3-+33.0%
associate-*r/31.8%
*-commutative31.8%
count-231.8%
pow231.8%
*-commutative31.8%
*-commutative31.8%
*-commutative31.8%
+-inverses31.8%
Applied egg-rr31.8%
Simplified48.5%
difference-of-squares53.5%
Applied egg-rr53.5%
Simplified42.0%
Taylor expanded in x.im around 0 40.6%
if 1.54999999999999991e223 < x.im Initial program 78.1%
*-commutative78.1%
flip3-+17.0%
associate-*r/17.0%
*-commutative17.0%
count-217.0%
pow217.0%
*-commutative17.0%
*-commutative17.0%
*-commutative17.0%
+-inverses17.0%
Applied egg-rr17.0%
Simplified78.1%
difference-of-squares94.8%
Applied egg-rr94.8%
Simplified20.2%
Taylor expanded in x.re around 0 26.4%
Final simplification39.6%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (+ (* x.im (* x.re (- x.re 27.0))) (/ x.re (- x.re))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return (x_46_im * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -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_46im * (x_46re * (x_46re - 27.0d0))) + (x_46re / -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_im * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re);
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return (x_46_im * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re)
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(Float64(x_46_im * Float64(x_46_re * Float64(x_46_re - 27.0))) + Float64(x_46_re / Float64(-x_46_re))) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = (x_46_im * (x_46_re * (x_46_re - 27.0))) + (x_46_re / -x_46_re); end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := N[(N[(x$46$im * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-x$46$re)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
x.im \cdot \left(x.re \cdot \left(x.re - 27\right)\right) + \frac{x.re}{-x.re}
\end{array}
Initial program 80.5%
*-commutative80.5%
flip3-+31.9%
associate-*r/30.8%
*-commutative30.8%
count-230.8%
pow230.8%
*-commutative30.8%
*-commutative30.8%
*-commutative30.8%
+-inverses30.8%
Applied egg-rr30.8%
Simplified50.6%
difference-of-squares56.4%
Applied egg-rr56.4%
Simplified40.5%
Taylor expanded in x.im around inf 14.8%
Final simplification14.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.re (- x.re))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return (-27.0 * (x_46_re * x_46_im)) + (x_46_re / -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 = ((-27.0d0) * (x_46re * x_46im)) + (x_46re / -x_46re)
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_46_re / -x_46_re);
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return (-27.0 * (x_46_re * x_46_im)) + (x_46_re / -x_46_re)
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(Float64(-27.0 * Float64(x_46_re * x_46_im)) + Float64(x_46_re / Float64(-x_46_re))) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = (-27.0 * (x_46_re * x_46_im)) + (x_46_re / -x_46_re); end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := N[(N[(-27.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-x$46$re)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
-27 \cdot \left(x.re \cdot x.im\right) + \frac{x.re}{-x.re}
\end{array}
Initial program 80.5%
*-commutative80.5%
flip3-+31.9%
associate-*r/30.8%
*-commutative30.8%
count-230.8%
pow230.8%
*-commutative30.8%
*-commutative30.8%
*-commutative30.8%
+-inverses30.8%
Applied egg-rr30.8%
Simplified50.6%
difference-of-squares56.4%
Applied egg-rr56.4%
Simplified40.5%
Taylor expanded in x.re around 0 9.2%
Final simplification9.2%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (+ (* x.re (* x.re x.im)) (/ x.re (- x.re))))
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)) + (x_46_re / -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 * (x_46re * x_46im)) + (x_46re / -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_46_re * x_46_im)) + (x_46_re / -x_46_re);
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return (x_46_re * (x_46_re * x_46_im)) + (x_46_re / -x_46_re)
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * Float64(x_46_re * x_46_im)) + Float64(x_46_re / Float64(-x_46_re))) 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)) + (x_46_re / -x_46_re); end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := N[(N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-x$46$re)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
x.re \cdot \left(x.re \cdot x.im\right) + \frac{x.re}{-x.re}
\end{array}
Initial program 80.5%
*-commutative80.5%
flip3-+31.9%
associate-*r/30.8%
*-commutative30.8%
count-230.8%
pow230.8%
*-commutative30.8%
*-commutative30.8%
*-commutative30.8%
+-inverses30.8%
Applied egg-rr30.8%
Simplified50.6%
difference-of-squares56.4%
Applied egg-rr56.4%
Simplified40.5%
Taylor expanded in x.im around inf 11.9%
Taylor expanded in x.re around inf 11.9%
Final simplification11.9%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (* x.im (+ (* x.re -27.0) (/ 0.0 0.0))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return x_46_im * ((x_46_re * -27.0) + (0.0 / 0.0));
}
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_46im * ((x_46re * (-27.0d0)) + (0.0d0 / 0.0d0))
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
return x_46_im * ((x_46_re * -27.0) + (0.0 / 0.0));
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return x_46_im * ((x_46_re * -27.0) + (0.0 / 0.0))
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(Float64(x_46_re * -27.0) + Float64(0.0 / 0.0))) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = x_46_im * ((x_46_re * -27.0) + (0.0 / 0.0)); end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := N[(x$46$im * N[(N[(x$46$re * -27.0), $MachinePrecision] + N[(0.0 / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
x.im \cdot \left(x.re \cdot -27 + \frac{0}{0}\right)
\end{array}
Initial program 80.5%
difference-of-squares56.4%
Applied egg-rr82.8%
Simplified52.5%
Taylor expanded in x.re around 0 31.7%
Simplified31.7%
associate-*l*31.7%
*-commutative31.7%
distribute-lft-out--34.5%
*-commutative34.5%
*-commutative34.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Final simplification0.0%
(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 2024024
(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)))