
(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 15 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}
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 5e+98)
(-
(- (pow x.re_m 3.0) (* x.im (* x.re_m x.im)))
(* x.im (* (* x.re_m x.im) 2.0)))
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5e+98) {
tmp = (pow(x_46_re_m, 3.0) - (x_46_im * (x_46_re_m * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 5d+98) then
tmp = ((x_46re_m ** 3.0d0) - (x_46im * (x_46re_m * x_46im))) - (x_46im * ((x_46re_m * x_46im) * 2.0d0))
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5e+98) {
tmp = (Math.pow(x_46_re_m, 3.0) - (x_46_im * (x_46_re_m * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 5e+98: tmp = (math.pow(x_46_re_m, 3.0) - (x_46_im * (x_46_re_m * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0)) else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 5e+98) tmp = Float64(Float64((x_46_re_m ^ 3.0) - Float64(x_46_im * Float64(x_46_re_m * x_46_im))) - Float64(x_46_im * Float64(Float64(x_46_re_m * x_46_im) * 2.0))); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 5e+98) tmp = ((x_46_re_m ^ 3.0) - (x_46_im * (x_46_re_m * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0)); else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 5e+98], N[(N[(N[Power[x$46$re$95$m, 3.0], $MachinePrecision] - N[(x$46$im * N[(x$46$re$95$m * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\left({x.re\_m}^{3} - x.im \cdot \left(x.re\_m \cdot x.im\right)\right) - x.im \cdot \left(\left(x.re\_m \cdot x.im\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 4.9999999999999998e98Initial program 85.7%
difference-of-squares88.1%
*-commutative88.1%
Applied egg-rr88.1%
Taylor expanded in x.im around 0 90.1%
+-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
*-commutative90.1%
distribute-rgt1-in90.1%
metadata-eval90.1%
mul0-lft90.1%
mul0-lft90.1%
neg-sub090.1%
distribute-lft-neg-in90.1%
Applied egg-rr90.1%
*-un-lft-identity90.1%
*-commutative90.1%
*-un-lft-identity90.1%
distribute-rgt-out90.1%
metadata-eval90.1%
Applied egg-rr90.1%
if 4.9999999999999998e98 < x.re Initial program 59.5%
*-commutative59.5%
*-commutative59.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr71.4%
difference-of-squares66.7%
*-commutative66.7%
Applied egg-rr100.0%
Final simplification91.7%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 8.5e+98)
(+ (pow x.re_m 3.0) (* (* x.re_m (* x.im x.im)) -3.0))
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 8.5e+98) {
tmp = pow(x_46_re_m, 3.0) + ((x_46_re_m * (x_46_im * x_46_im)) * -3.0);
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 8.5d+98) then
tmp = (x_46re_m ** 3.0d0) + ((x_46re_m * (x_46im * x_46im)) * (-3.0d0))
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 8.5e+98) {
tmp = Math.pow(x_46_re_m, 3.0) + ((x_46_re_m * (x_46_im * x_46_im)) * -3.0);
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 8.5e+98: tmp = math.pow(x_46_re_m, 3.0) + ((x_46_re_m * (x_46_im * x_46_im)) * -3.0) else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 8.5e+98) tmp = Float64((x_46_re_m ^ 3.0) + Float64(Float64(x_46_re_m * Float64(x_46_im * x_46_im)) * -3.0)); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 8.5e+98) tmp = (x_46_re_m ^ 3.0) + ((x_46_re_m * (x_46_im * x_46_im)) * -3.0); else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 8.5e+98], N[(N[Power[x$46$re$95$m, 3.0], $MachinePrecision] + N[(N[(x$46$re$95$m * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 8.5 \cdot 10^{+98}:\\
\;\;\;\;{x.re\_m}^{3} + \left(x.re\_m \cdot \left(x.im \cdot x.im\right)\right) \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 8.4999999999999996e98Initial program 85.7%
Simplified83.9%
if 8.4999999999999996e98 < x.re Initial program 59.5%
*-commutative59.5%
*-commutative59.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr71.4%
difference-of-squares66.7%
*-commutative66.7%
Applied egg-rr100.0%
Final simplification86.6%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 5e+98)
(+ (pow x.re_m 3.0) (* x.re_m (* x.im (* x.im -3.0))))
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5e+98) {
tmp = pow(x_46_re_m, 3.0) + (x_46_re_m * (x_46_im * (x_46_im * -3.0)));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 5d+98) then
tmp = (x_46re_m ** 3.0d0) + (x_46re_m * (x_46im * (x_46im * (-3.0d0))))
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5e+98) {
tmp = Math.pow(x_46_re_m, 3.0) + (x_46_re_m * (x_46_im * (x_46_im * -3.0)));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 5e+98: tmp = math.pow(x_46_re_m, 3.0) + (x_46_re_m * (x_46_im * (x_46_im * -3.0))) else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 5e+98) tmp = Float64((x_46_re_m ^ 3.0) + Float64(x_46_re_m * Float64(x_46_im * Float64(x_46_im * -3.0)))); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 5e+98) tmp = (x_46_re_m ^ 3.0) + (x_46_re_m * (x_46_im * (x_46_im * -3.0))); else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 5e+98], N[(N[Power[x$46$re$95$m, 3.0], $MachinePrecision] + N[(x$46$re$95$m * N[(x$46$im * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 5 \cdot 10^{+98}:\\
\;\;\;\;{x.re\_m}^{3} + x.re\_m \cdot \left(x.im \cdot \left(x.im \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 4.9999999999999998e98Initial program 85.7%
Simplified83.9%
if 4.9999999999999998e98 < x.re Initial program 59.5%
*-commutative59.5%
*-commutative59.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr71.4%
difference-of-squares66.7%
*-commutative66.7%
Applied egg-rr100.0%
Final simplification86.5%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(let* ((t_0 (* x.im (+ (* x.re_m x.im) (* x.re_m x.im)))))
(*
x.re_s
(if (<= x.re_m 8.8e-85)
(- (* x.re_m (* x.im (- x.re_m x.im))) t_0)
(if (<= x.re_m 8.2e+37)
(- (* x.re_m (* x.re_m (+ x.re_m x.im))) t_0)
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double t_0 = x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im));
double tmp;
if (x_46_re_m <= 8.8e-85) {
tmp = (x_46_re_m * (x_46_im * (x_46_re_m - x_46_im))) - t_0;
} else if (x_46_re_m <= 8.2e+37) {
tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - t_0;
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im * ((x_46re_m * x_46im) + (x_46re_m * x_46im))
if (x_46re_m <= 8.8d-85) then
tmp = (x_46re_m * (x_46im * (x_46re_m - x_46im))) - t_0
else if (x_46re_m <= 8.2d+37) then
tmp = (x_46re_m * (x_46re_m * (x_46re_m + x_46im))) - t_0
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double t_0 = x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im));
double tmp;
if (x_46_re_m <= 8.8e-85) {
tmp = (x_46_re_m * (x_46_im * (x_46_re_m - x_46_im))) - t_0;
} else if (x_46_re_m <= 8.2e+37) {
tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - t_0;
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): t_0 = x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)) tmp = 0 if x_46_re_m <= 8.8e-85: tmp = (x_46_re_m * (x_46_im * (x_46_re_m - x_46_im))) - t_0 elif x_46_re_m <= 8.2e+37: tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - t_0 else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) t_0 = Float64(x_46_im * Float64(Float64(x_46_re_m * x_46_im) + Float64(x_46_re_m * x_46_im))) tmp = 0.0 if (x_46_re_m <= 8.8e-85) tmp = Float64(Float64(x_46_re_m * Float64(x_46_im * Float64(x_46_re_m - x_46_im))) - t_0); elseif (x_46_re_m <= 8.2e+37) tmp = Float64(Float64(x_46_re_m * Float64(x_46_re_m * Float64(x_46_re_m + x_46_im))) - t_0); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) t_0 = x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)); tmp = 0.0; if (x_46_re_m <= 8.8e-85) tmp = (x_46_re_m * (x_46_im * (x_46_re_m - x_46_im))) - t_0; elseif (x_46_re_m <= 8.2e+37) tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - t_0; else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] + N[(x$46$re$95$m * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 8.8e-85], N[(N[(x$46$re$95$m * N[(x$46$im * N[(x$46$re$95$m - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x$46$re$95$m, 8.2e+37], N[(N[(x$46$re$95$m * N[(x$46$re$95$m * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re\_m \cdot x.im + x.re\_m \cdot x.im\right)\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 8.8 \cdot 10^{-85}:\\
\;\;\;\;x.re\_m \cdot \left(x.im \cdot \left(x.re\_m - x.im\right)\right) - t\_0\\
\mathbf{elif}\;x.re\_m \leq 8.2 \cdot 10^{+37}:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot \left(x.re\_m + x.im\right)\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
\end{array}
if x.re < 8.8e-85Initial program 82.6%
difference-of-squares85.5%
*-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in x.re around 0 64.7%
if 8.8e-85 < x.re < 8.1999999999999996e37Initial program 96.5%
difference-of-squares96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in x.re around inf 79.9%
if 8.1999999999999996e37 < x.re Initial program 70.2%
*-commutative70.2%
*-commutative70.2%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr73.2%
difference-of-squares75.4%
*-commutative75.4%
Applied egg-rr94.2%
Final simplification73.0%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 1.25e-108)
(- x.re_m x.re_m)
(if (<= x.re_m 500000.0)
(- (* x.re_m (- (* x.re_m x.re_m) (* x.im x.im))) (* x.im -27.0))
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0)))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.25e-108) {
tmp = x_46_re_m - x_46_re_m;
} else if (x_46_re_m <= 500000.0) {
tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * -27.0);
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 1.25d-108) then
tmp = x_46re_m - x_46re_m
else if (x_46re_m <= 500000.0d0) then
tmp = (x_46re_m * ((x_46re_m * x_46re_m) - (x_46im * x_46im))) - (x_46im * (-27.0d0))
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.25e-108) {
tmp = x_46_re_m - x_46_re_m;
} else if (x_46_re_m <= 500000.0) {
tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * -27.0);
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 1.25e-108: tmp = x_46_re_m - x_46_re_m elif x_46_re_m <= 500000.0: tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * -27.0) else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 1.25e-108) tmp = Float64(x_46_re_m - x_46_re_m); elseif (x_46_re_m <= 500000.0) tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m * x_46_re_m) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * -27.0)); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 1.25e-108) tmp = x_46_re_m - x_46_re_m; elseif (x_46_re_m <= 500000.0) tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * -27.0); else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 1.25e-108], N[(x$46$re$95$m - x$46$re$95$m), $MachinePrecision], If[LessEqual[x$46$re$95$m, 500000.0], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m * x$46$re$95$m), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 1.25 \cdot 10^{-108}:\\
\;\;\;\;x.re\_m - x.re\_m\\
\mathbf{elif}\;x.re\_m \leq 500000:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right) - x.im \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 1.25e-108Initial program 82.0%
Simplified79.6%
associate-*r*79.6%
associate-*l*79.6%
+-commutative79.6%
associate-*l*79.6%
associate-*r*79.6%
associate-*r*87.0%
fma-define89.4%
Applied egg-rr89.4%
Applied egg-rr24.8%
if 1.25e-108 < x.re < 5e5Initial program 96.0%
*-un-lft-identity96.0%
*-commutative96.0%
fma-define96.0%
Applied egg-rr96.0%
Simplified53.2%
Taylor expanded in x.im around 0 52.3%
*-commutative52.3%
Simplified52.3%
if 5e5 < x.re Initial program 74.6%
*-commutative74.6%
*-commutative74.6%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr75.9%
difference-of-squares79.0%
*-commutative79.0%
Applied egg-rr93.8%
Final simplification45.5%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 5e+98)
(-
(* x.re_m (- (* x.re_m x.re_m) (* x.im x.im)))
(* x.im (* (* x.re_m x.im) 2.0)))
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5e+98) {
tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 5d+98) then
tmp = (x_46re_m * ((x_46re_m * x_46re_m) - (x_46im * x_46im))) - (x_46im * ((x_46re_m * x_46im) * 2.0d0))
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5e+98) {
tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 5e+98: tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0)) else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 5e+98) tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m * x_46_re_m) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * Float64(Float64(x_46_re_m * x_46_im) * 2.0))); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 5e+98) tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) * 2.0)); else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 5e+98], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m * x$46$re$95$m), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 5 \cdot 10^{+98}:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right) - x.im \cdot \left(\left(x.re\_m \cdot x.im\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 4.9999999999999998e98Initial program 85.7%
*-un-lft-identity90.1%
*-commutative90.1%
*-un-lft-identity90.1%
distribute-rgt-out90.1%
metadata-eval90.1%
Applied egg-rr85.7%
if 4.9999999999999998e98 < x.re Initial program 59.5%
*-commutative59.5%
*-commutative59.5%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr71.4%
difference-of-squares66.7%
*-commutative66.7%
Applied egg-rr100.0%
Final simplification88.1%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 8.5e+37)
(-
(* x.re_m (* x.re_m (+ x.re_m x.im)))
(* x.im (+ (* x.re_m x.im) (* x.re_m x.im))))
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 8.5e+37) {
tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 8.5d+37) then
tmp = (x_46re_m * (x_46re_m * (x_46re_m + x_46im))) - (x_46im * ((x_46re_m * x_46im) + (x_46re_m * x_46im)))
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 8.5e+37) {
tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)));
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 8.5e+37: tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im))) else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 8.5e+37) tmp = Float64(Float64(x_46_re_m * Float64(x_46_re_m * Float64(x_46_re_m + x_46_im))) - Float64(x_46_im * Float64(Float64(x_46_re_m * x_46_im) + Float64(x_46_re_m * x_46_im)))); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 8.5e+37) tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m + x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im))); else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 8.5e+37], N[(N[(x$46$re$95$m * N[(x$46$re$95$m * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] + N[(x$46$re$95$m * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 8.5 \cdot 10^{+37}:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot \left(x.re\_m + x.im\right)\right) - x.im \cdot \left(x.re\_m \cdot x.im + x.re\_m \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 8.4999999999999999e37Initial program 84.7%
difference-of-squares87.2%
*-commutative87.2%
Applied egg-rr87.2%
Taylor expanded in x.re around inf 65.9%
if 8.4999999999999999e37 < x.re Initial program 70.2%
*-commutative70.2%
*-commutative70.2%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr73.2%
difference-of-squares75.4%
*-commutative75.4%
Applied egg-rr94.2%
Final simplification72.2%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 5.8e-111)
(- x.re_m x.re_m)
(- (* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5.8e-111) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 5.8d-111) then
tmp = x_46re_m - x_46re_m
else
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 5.8e-111) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 5.8e-111: tmp = x_46_re_m - x_46_re_m else: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 5.8e-111) tmp = Float64(x_46_re_m - x_46_re_m); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * Float64(x_46_re_m + x_46_im))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 5.8e-111) tmp = x_46_re_m - x_46_re_m; else tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (x_46_re_m + x_46_im))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 5.8e-111], N[(x$46$re$95$m - x$46$re$95$m), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m - x$46$im), $MachinePrecision] * N[(x$46$re$95$m + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 5.8 \cdot 10^{-111}:\\
\;\;\;\;x.re\_m - x.re\_m\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \cdot \left(x.re\_m + x.im\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 5.80000000000000003e-111Initial program 82.0%
Simplified79.6%
associate-*r*79.6%
associate-*l*79.6%
+-commutative79.6%
associate-*l*79.6%
associate-*r*79.6%
associate-*r*87.0%
fma-define89.4%
Applied egg-rr89.4%
Applied egg-rr24.8%
if 5.80000000000000003e-111 < x.re Initial program 80.4%
*-commutative80.4%
*-commutative80.4%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr65.3%
difference-of-squares83.6%
*-commutative83.6%
Applied egg-rr78.3%
Final simplification44.0%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 1.7e-92)
(- x.re_m x.re_m)
(- (* x.re_m (* x.re_m (- x.re_m 27.0))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.7e-92) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 1.7d-92) then
tmp = x_46re_m - x_46re_m
else
tmp = (x_46re_m * (x_46re_m * (x_46re_m - 27.0d0))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.7e-92) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 1.7e-92: tmp = x_46_re_m - x_46_re_m else: tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 1.7e-92) tmp = Float64(x_46_re_m - x_46_re_m); else tmp = Float64(Float64(x_46_re_m * Float64(x_46_re_m * Float64(x_46_re_m - 27.0))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 1.7e-92) tmp = x_46_re_m - x_46_re_m; else tmp = (x_46_re_m * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 1.7e-92], N[(x$46$re$95$m - x$46$re$95$m), $MachinePrecision], N[(N[(x$46$re$95$m * N[(x$46$re$95$m * N[(x$46$re$95$m - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 1.7 \cdot 10^{-92}:\\
\;\;\;\;x.re\_m - x.re\_m\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot \left(x.re\_m - 27\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 1.7000000000000001e-92Initial program 82.6%
Simplified80.2%
associate-*r*80.2%
associate-*l*80.2%
+-commutative80.2%
associate-*l*80.2%
associate-*r*80.2%
associate-*r*87.4%
fma-define89.7%
Applied egg-rr89.7%
Applied egg-rr24.2%
if 1.7000000000000001e-92 < x.re Initial program 79.3%
*-commutative79.3%
*-commutative79.3%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr66.3%
difference-of-squares80.1%
Applied egg-rr80.1%
Simplified61.0%
Taylor expanded in x.im around 0 57.1%
Final simplification35.4%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 1.6e-92)
(- x.re_m x.re_m)
(- (* x.im (* x.re_m (- x.re_m 27.0))) 9.0))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.6e-92) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = (x_46_im * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 1.6d-92) then
tmp = x_46re_m - x_46re_m
else
tmp = (x_46im * (x_46re_m * (x_46re_m - 27.0d0))) - 9.0d0
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.6e-92) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = (x_46_im * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 1.6e-92: tmp = x_46_re_m - x_46_re_m else: tmp = (x_46_im * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0 return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 1.6e-92) tmp = Float64(x_46_re_m - x_46_re_m); else tmp = Float64(Float64(x_46_im * Float64(x_46_re_m * Float64(x_46_re_m - 27.0))) - 9.0); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 1.6e-92) tmp = x_46_re_m - x_46_re_m; else tmp = (x_46_im * (x_46_re_m * (x_46_re_m - 27.0))) - 9.0; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 1.6e-92], N[(x$46$re$95$m - x$46$re$95$m), $MachinePrecision], N[(N[(x$46$im * N[(x$46$re$95$m * N[(x$46$re$95$m - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 9.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 1.6 \cdot 10^{-92}:\\
\;\;\;\;x.re\_m - x.re\_m\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m - 27\right)\right) - 9\\
\end{array}
\end{array}
if x.re < 1.5999999999999998e-92Initial program 82.6%
Simplified80.2%
associate-*r*80.2%
associate-*l*80.2%
+-commutative80.2%
associate-*l*80.2%
associate-*r*80.2%
associate-*r*87.4%
fma-define89.7%
Applied egg-rr89.7%
Applied egg-rr24.2%
if 1.5999999999999998e-92 < x.re Initial program 79.3%
*-commutative79.3%
*-commutative79.3%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
associate-*r/0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Applied egg-rr66.3%
difference-of-squares80.1%
Applied egg-rr80.1%
Simplified61.0%
Taylor expanded in x.im around inf 20.8%
x.re\_m = (fabs.f64 x.re) x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re) (FPCore (x.re_s x.re_m x.im) :precision binary64 (* x.re_s (if (<= x.re_m 3.6e-67) (- x.re_m x.re_m) (* x.re_m x.re_m))))
x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 3.6e-67) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = x_46_re_m * x_46_re_m;
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 3.6d-67) then
tmp = x_46re_m - x_46re_m
else
tmp = x_46re_m * x_46re_m
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 3.6e-67) {
tmp = x_46_re_m - x_46_re_m;
} else {
tmp = x_46_re_m * x_46_re_m;
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 3.6e-67: tmp = x_46_re_m - x_46_re_m else: tmp = x_46_re_m * x_46_re_m return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 3.6e-67) tmp = Float64(x_46_re_m - x_46_re_m); else tmp = Float64(x_46_re_m * x_46_re_m); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 3.6e-67) tmp = x_46_re_m - x_46_re_m; else tmp = x_46_re_m * x_46_re_m; end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 3.6e-67], N[(x$46$re$95$m - x$46$re$95$m), $MachinePrecision], N[(x$46$re$95$m * x$46$re$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re\_m \leq 3.6 \cdot 10^{-67}:\\
\;\;\;\;x.re\_m - x.re\_m\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot x.re\_m\\
\end{array}
\end{array}
if x.re < 3.59999999999999999e-67Initial program 82.7%
Simplified80.4%
associate-*r*80.4%
associate-*l*80.5%
+-commutative80.5%
associate-*l*80.4%
associate-*r*80.4%
associate-*r*87.9%
fma-define90.2%
Applied egg-rr90.2%
Applied egg-rr23.3%
if 3.59999999999999999e-67 < x.re Initial program 78.6%
Simplified77.4%
associate-*r*77.4%
associate-*l*77.4%
+-commutative77.4%
associate-*l*77.4%
associate-*r*77.4%
associate-*r*77.5%
fma-define81.2%
Applied egg-rr81.2%
Applied egg-rr39.3%
x.re\_m = (fabs.f64 x.re) x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re) (FPCore (x.re_s x.re_m x.im) :precision binary64 (* x.re_s (* x.re_m x.re_m)))
x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * (x_46_re_m * x_46_re_m);
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
code = x_46re_s * (x_46re_m * x_46re_m)
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * (x_46_re_m * x_46_re_m);
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): return x_46_re_s * (x_46_re_m * x_46_re_m)
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) return Float64(x_46_re_s * Float64(x_46_re_m * x_46_re_m)) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp = code(x_46_re_s, x_46_re_m, x_46_im) tmp = x_46_re_s * (x_46_re_m * x_46_re_m); end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * N[(x$46$re$95$m * x$46$re$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \left(x.re\_m \cdot x.re\_m\right)
\end{array}
Initial program 81.4%
Simplified79.5%
associate-*r*79.5%
associate-*l*79.5%
+-commutative79.5%
associate-*l*79.5%
associate-*r*79.5%
associate-*r*84.6%
fma-define87.4%
Applied egg-rr87.4%
Applied egg-rr27.3%
x.re\_m = (fabs.f64 x.re) x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re) (FPCore (x.re_s x.re_m x.im) :precision binary64 (* x.re_s (* x.re_m -0.3333333333333333)))
x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * (x_46_re_m * -0.3333333333333333);
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
code = x_46re_s * (x_46re_m * (-0.3333333333333333d0))
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * (x_46_re_m * -0.3333333333333333);
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): return x_46_re_s * (x_46_re_m * -0.3333333333333333)
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) return Float64(x_46_re_s * Float64(x_46_re_m * -0.3333333333333333)) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp = code(x_46_re_s, x_46_re_m, x_46_im) tmp = x_46_re_s * (x_46_re_m * -0.3333333333333333); end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * N[(x$46$re$95$m * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \left(x.re\_m \cdot -0.3333333333333333\right)
\end{array}
Initial program 81.4%
Simplified79.5%
associate-*r*79.5%
associate-*l*79.5%
+-commutative79.5%
associate-*l*79.5%
associate-*r*79.5%
associate-*r*84.6%
fma-define87.4%
Applied egg-rr87.4%
Applied egg-rr3.2%
*-rgt-identity3.2%
associate-/l*3.2%
metadata-eval3.2%
Simplified3.2%
x.re\_m = (fabs.f64 x.re) x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re) (FPCore (x.re_s x.re_m x.im) :precision binary64 (* x.re_s (- x.re_m)))
x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * -x_46_re_m;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
code = x_46re_s * -x_46re_m
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * -x_46_re_m;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): return x_46_re_s * -x_46_re_m
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) return Float64(x_46_re_s * Float64(-x_46_re_m)) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp = code(x_46_re_s, x_46_re_m, x_46_im) tmp = x_46_re_s * -x_46_re_m; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * (-x$46$re$95$m)), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot \left(-x.re\_m\right)
\end{array}
Initial program 81.4%
Simplified79.5%
associate-*r*79.5%
associate-*l*79.5%
+-commutative79.5%
associate-*l*79.5%
associate-*r*79.5%
associate-*r*84.6%
fma-define87.4%
Applied egg-rr87.4%
Applied egg-rr3.2%
x.re\_m = (fabs.f64 x.re) x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re) (FPCore (x.re_s x.re_m x.im) :precision binary64 (* x.re_s -729.0))
x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * -729.0;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
code = x_46re_s * (-729.0d0)
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
return x_46_re_s * -729.0;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): return x_46_re_s * -729.0
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) return Float64(x_46_re_s * -729.0) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp = code(x_46_re_s, x_46_re_m, x_46_im) tmp = x_46_re_s * -729.0; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * -729.0), $MachinePrecision]
\begin{array}{l}
x.re\_m = \left|x.re\right|
\\
x.re\_s = \mathsf{copysign}\left(1, x.re\right)
\\
x.re\_s \cdot -729
\end{array}
Initial program 81.4%
*-un-lft-identity81.4%
*-commutative81.4%
fma-define81.4%
Applied egg-rr81.4%
Simplified45.9%
Applied egg-rr31.3%
*-commutative31.3%
associate-*r/46.9%
*-inverses46.9%
*-rgt-identity46.9%
+-commutative46.9%
Simplified46.9%
Taylor expanded in x.re around 0 2.7%
(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 2024170
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:alt
(! :herbie-platform default (+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3 x.im)))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))