
(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 13 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 2.15e+96)
(fma (* x.re_m x.im) (* x.im -3.0) (pow x.re_m 3.0))
(pow x.re_m 3.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 <= 2.15e+96) {
tmp = fma((x_46_re_m * x_46_im), (x_46_im * -3.0), pow(x_46_re_m, 3.0));
} else {
tmp = pow(x_46_re_m, 3.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 <= 2.15e+96) tmp = fma(Float64(x_46_re_m * x_46_im), Float64(x_46_im * -3.0), (x_46_re_m ^ 3.0)); else tmp = x_46_re_m ^ 3.0; end return Float64(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, 2.15e+96], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision] + N[Power[x$46$re$95$m, 3.0], $MachinePrecision]), $MachinePrecision], N[Power[x$46$re$95$m, 3.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 2.15 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(x.re\_m \cdot x.im, x.im \cdot -3, {x.re\_m}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re\_m}^{3}\\
\end{array}
\end{array}
if x.re < 2.15000000000000001e96Initial program 85.5%
Simplified85.0%
associate-*r*85.0%
associate-*l*85.0%
+-commutative85.0%
associate-*r*93.3%
associate-*r*93.4%
fma-define94.7%
Applied egg-rr94.7%
if 2.15000000000000001e96 < x.re Initial program 72.5%
Simplified70.0%
Taylor expanded in x.re around inf 95.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 2.15e+96)
(+ (pow x.re_m 3.0) (* -3.0 (* x.im (* x.re_m x.im))))
(pow x.re_m 3.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 <= 2.15e+96) {
tmp = pow(x_46_re_m, 3.0) + (-3.0 * (x_46_im * (x_46_re_m * x_46_im)));
} else {
tmp = pow(x_46_re_m, 3.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 <= 2.15d+96) then
tmp = (x_46re_m ** 3.0d0) + ((-3.0d0) * (x_46im * (x_46re_m * x_46im)))
else
tmp = x_46re_m ** 3.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 <= 2.15e+96) {
tmp = Math.pow(x_46_re_m, 3.0) + (-3.0 * (x_46_im * (x_46_re_m * x_46_im)));
} else {
tmp = Math.pow(x_46_re_m, 3.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 <= 2.15e+96: tmp = math.pow(x_46_re_m, 3.0) + (-3.0 * (x_46_im * (x_46_re_m * x_46_im))) else: tmp = math.pow(x_46_re_m, 3.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 <= 2.15e+96) tmp = Float64((x_46_re_m ^ 3.0) + Float64(-3.0 * Float64(x_46_im * Float64(x_46_re_m * x_46_im)))); else tmp = x_46_re_m ^ 3.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 <= 2.15e+96) tmp = (x_46_re_m ^ 3.0) + (-3.0 * (x_46_im * (x_46_re_m * x_46_im))); else tmp = x_46_re_m ^ 3.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, 2.15e+96], N[(N[Power[x$46$re$95$m, 3.0], $MachinePrecision] + N[(-3.0 * N[(x$46$im * N[(x$46$re$95$m * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[x$46$re$95$m, 3.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 2.15 \cdot 10^{+96}:\\
\;\;\;\;{x.re\_m}^{3} + -3 \cdot \left(x.im \cdot \left(x.re\_m \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re\_m}^{3}\\
\end{array}
\end{array}
if x.re < 2.15000000000000001e96Initial program 85.5%
Simplified85.0%
add-sqr-sqrt48.8%
pow248.8%
*-commutative48.8%
sqrt-prod28.9%
sqrt-prod14.2%
add-sqr-sqrt34.6%
Applied egg-rr34.6%
unpow234.6%
*-commutative34.6%
associate-*r*34.6%
associate-*r*34.5%
add-sqr-sqrt93.3%
Applied egg-rr93.3%
if 2.15000000000000001e96 < x.re Initial program 72.5%
Simplified70.0%
Taylor expanded in x.re around inf 95.0%
Final simplification93.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 1.9e+157)
(-
(* x.re_m (* (- x.re_m x.im) (+ x.re_m x.im)))
(* x.im (+ (* x.re_m x.im) (* x.re_m x.im))))
(* x.im (+ -2.0 (* x.re_m (/ (+ x.re_m -19683.0) x.im)))))))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.9e+157) {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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.9d+157) then
tmp = (x_46re_m * ((x_46re_m - x_46im) * (x_46re_m + x_46im))) - (x_46im * ((x_46re_m * x_46im) + (x_46re_m * x_46im)))
else
tmp = x_46im * ((-2.0d0) + (x_46re_m * ((x_46re_m + (-19683.0d0)) / x_46im)))
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.9e+157) {
tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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.9e+157: tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))) 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.9e+157) tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m - x_46_im) * 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(x_46_im * Float64(-2.0 + Float64(x_46_re_m * Float64(Float64(x_46_re_m + -19683.0) / x_46_im)))); 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.9e+157) tmp = (x_46_re_m * ((x_46_re_m - x_46_im) * (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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))); 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.9e+157], 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] - 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[(x$46$im * N[(-2.0 + N[(x$46$re$95$m * N[(N[(x$46$re$95$m + -19683.0), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.9 \cdot 10^{+157}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m - x.im\right) \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.im \cdot \left(-2 + x.re\_m \cdot \frac{x.re\_m + -19683}{x.im}\right)\\
\end{array}
\end{array}
if x.re < 1.9e157Initial program 86.2%
difference-of-squares88.0%
*-commutative88.0%
Applied egg-rr88.0%
if 1.9e157 < x.re Initial program 62.1%
difference-of-squares65.5%
Applied egg-rr65.5%
Simplified62.1%
Taylor expanded in x.im around inf 27.6%
unpow227.6%
associate-*l*27.6%
associate-*r/27.6%
distribute-lft-out62.1%
+-commutative62.1%
remove-double-neg62.1%
mul-1-neg62.1%
sub-neg62.1%
*-commutative62.1%
associate-/l*62.1%
*-commutative62.1%
distribute-lft-out--62.1%
sub-neg62.1%
metadata-eval62.1%
sub-neg62.1%
metadata-eval62.1%
+-commutative62.1%
Simplified62.1%
Taylor expanded in x.im around 0 62.1%
Applied egg-rr0.0%
Simplified96.6%
Final simplification88.9%
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.35e+154)
(-
(* x.re_m (- (* x.re_m x.re_m) (* x.im x.im)))
(* x.im (* (* x.re_m x.im) 2.0)))
(* x.im (+ -2.0 (* x.re_m (/ (+ x.re_m -19683.0) x.im)))))))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.35e+154) {
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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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.35d+154) 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_46im * ((-2.0d0) + (x_46re_m * ((x_46re_m + (-19683.0d0)) / x_46im)))
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.35e+154) {
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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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.35e+154: 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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))) 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.35e+154) 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(x_46_im * Float64(-2.0 + Float64(x_46_re_m * Float64(Float64(x_46_re_m + -19683.0) / x_46_im)))); 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.35e+154) 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_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))); 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.35e+154], 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[(x$46$im * N[(-2.0 + N[(x$46$re$95$m * N[(N[(x$46$re$95$m + -19683.0), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.35 \cdot 10^{+154}:\\
\;\;\;\;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.im \cdot \left(-2 + x.re\_m \cdot \frac{x.re\_m + -19683}{x.im}\right)\\
\end{array}
\end{array}
if x.re < 1.35000000000000003e154Initial program 86.2%
*-commutative86.2%
*-un-lft-identity86.2%
*-un-lft-identity86.2%
distribute-rgt-out86.2%
metadata-eval86.2%
Applied egg-rr86.2%
if 1.35000000000000003e154 < x.re Initial program 62.1%
difference-of-squares65.5%
Applied egg-rr65.5%
Simplified62.1%
Taylor expanded in x.im around inf 27.6%
unpow227.6%
associate-*l*27.6%
associate-*r/27.6%
distribute-lft-out62.1%
+-commutative62.1%
remove-double-neg62.1%
mul-1-neg62.1%
sub-neg62.1%
*-commutative62.1%
associate-/l*62.1%
*-commutative62.1%
distribute-lft-out--62.1%
sub-neg62.1%
metadata-eval62.1%
sub-neg62.1%
metadata-eval62.1%
+-commutative62.1%
Simplified62.1%
Taylor expanded in x.im around 0 62.1%
Applied egg-rr0.0%
Simplified96.6%
Final simplification87.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 2.15e+96)
(* x.im (+ (* x.re_m -27.0) (* (* x.re_m x.im) -2.0)))
(* x.im (+ -2.0 (* x.re_m (/ (+ x.re_m -19683.0) x.im)))))))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 <= 2.15e+96) {
tmp = x_46_im * ((x_46_re_m * -27.0) + ((x_46_re_m * x_46_im) * -2.0));
} else {
tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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 <= 2.15d+96) then
tmp = x_46im * ((x_46re_m * (-27.0d0)) + ((x_46re_m * x_46im) * (-2.0d0)))
else
tmp = x_46im * ((-2.0d0) + (x_46re_m * ((x_46re_m + (-19683.0d0)) / x_46im)))
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 <= 2.15e+96) {
tmp = x_46_im * ((x_46_re_m * -27.0) + ((x_46_re_m * x_46_im) * -2.0));
} else {
tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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 <= 2.15e+96: tmp = x_46_im * ((x_46_re_m * -27.0) + ((x_46_re_m * x_46_im) * -2.0)) else: tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))) 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 <= 2.15e+96) tmp = Float64(x_46_im * Float64(Float64(x_46_re_m * -27.0) + Float64(Float64(x_46_re_m * x_46_im) * -2.0))); else tmp = Float64(x_46_im * Float64(-2.0 + Float64(x_46_re_m * Float64(Float64(x_46_re_m + -19683.0) / x_46_im)))); 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 <= 2.15e+96) tmp = x_46_im * ((x_46_re_m * -27.0) + ((x_46_re_m * x_46_im) * -2.0)); else tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))); 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, 2.15e+96], N[(x$46$im * N[(N[(x$46$re$95$m * -27.0), $MachinePrecision] + N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(-2.0 + N[(x$46$re$95$m * N[(N[(x$46$re$95$m + -19683.0), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 2.15 \cdot 10^{+96}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot -27 + \left(x.re\_m \cdot x.im\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-2 + x.re\_m \cdot \frac{x.re\_m + -19683}{x.im}\right)\\
\end{array}
\end{array}
if x.re < 2.15000000000000001e96Initial program 85.5%
difference-of-squares87.4%
Applied egg-rr87.4%
Simplified48.0%
Taylor expanded in x.re around 0 30.2%
associate-*r*30.2%
*-commutative30.2%
Simplified30.2%
Taylor expanded in x.im around 0 33.0%
if 2.15000000000000001e96 < x.re Initial program 72.5%
difference-of-squares75.0%
Applied egg-rr75.0%
Simplified72.5%
Taylor expanded in x.im around inf 44.9%
unpow244.9%
associate-*l*44.9%
associate-*r/47.5%
distribute-lft-out72.5%
+-commutative72.5%
remove-double-neg72.5%
mul-1-neg72.5%
sub-neg72.5%
*-commutative72.5%
associate-/l*72.5%
*-commutative72.5%
distribute-lft-out--72.5%
sub-neg72.5%
metadata-eval72.5%
sub-neg72.5%
metadata-eval72.5%
+-commutative72.5%
Simplified72.5%
Taylor expanded in x.im around 0 70.0%
Applied egg-rr0.0%
Simplified80.9%
Final simplification40.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 2.15e+96)
(* (* x.re_m x.im) (- -27.0 (* x.im 2.0)))
(* x.im (+ -2.0 (* x.re_m (/ (+ x.re_m -19683.0) x.im)))))))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 <= 2.15e+96) {
tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0));
} else {
tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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 <= 2.15d+96) then
tmp = (x_46re_m * x_46im) * ((-27.0d0) - (x_46im * 2.0d0))
else
tmp = x_46im * ((-2.0d0) + (x_46re_m * ((x_46re_m + (-19683.0d0)) / x_46im)))
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 <= 2.15e+96) {
tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0));
} else {
tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)));
}
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 <= 2.15e+96: tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0)) else: tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))) 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 <= 2.15e+96) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(-27.0 - Float64(x_46_im * 2.0))); else tmp = Float64(x_46_im * Float64(-2.0 + Float64(x_46_re_m * Float64(Float64(x_46_re_m + -19683.0) / x_46_im)))); 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 <= 2.15e+96) tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0)); else tmp = x_46_im * (-2.0 + (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im))); 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, 2.15e+96], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(-27.0 - N[(x$46$im * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(-2.0 + N[(x$46$re$95$m * N[(N[(x$46$re$95$m + -19683.0), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 2.15 \cdot 10^{+96}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(-27 - x.im \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(-2 + x.re\_m \cdot \frac{x.re\_m + -19683}{x.im}\right)\\
\end{array}
\end{array}
if x.re < 2.15000000000000001e96Initial program 85.5%
difference-of-squares87.4%
Applied egg-rr87.4%
Simplified48.0%
Taylor expanded in x.re around 0 30.2%
associate-*r*30.2%
*-commutative30.2%
Simplified30.2%
*-commutative85.5%
*-un-lft-identity85.5%
*-un-lft-identity85.5%
distribute-rgt-out85.5%
metadata-eval85.5%
Applied egg-rr30.2%
associate-*l*30.7%
*-commutative30.7%
associate-*r*30.2%
associate-*l*30.2%
*-commutative30.2%
distribute-lft-out--32.5%
Applied egg-rr32.5%
if 2.15000000000000001e96 < x.re Initial program 72.5%
difference-of-squares75.0%
Applied egg-rr75.0%
Simplified72.5%
Taylor expanded in x.im around inf 44.9%
unpow244.9%
associate-*l*44.9%
associate-*r/47.5%
distribute-lft-out72.5%
+-commutative72.5%
remove-double-neg72.5%
mul-1-neg72.5%
sub-neg72.5%
*-commutative72.5%
associate-/l*72.5%
*-commutative72.5%
distribute-lft-out--72.5%
sub-neg72.5%
metadata-eval72.5%
sub-neg72.5%
metadata-eval72.5%
+-commutative72.5%
Simplified72.5%
Taylor expanded in x.im around 0 70.0%
Applied egg-rr0.0%
Simplified80.9%
Final simplification40.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 2.15e+96)
(* (* x.re_m x.im) (- -27.0 (* x.im 2.0)))
(- (* x.re_m (/ (+ x.re_m -19683.0) x.im)) x.im))))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 <= 2.15e+96) {
tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0));
} else {
tmp = (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)) - x_46_im;
}
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 <= 2.15d+96) then
tmp = (x_46re_m * x_46im) * ((-27.0d0) - (x_46im * 2.0d0))
else
tmp = (x_46re_m * ((x_46re_m + (-19683.0d0)) / x_46im)) - x_46im
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 <= 2.15e+96) {
tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0));
} else {
tmp = (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)) - x_46_im;
}
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 <= 2.15e+96: tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0)) else: tmp = (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)) - x_46_im 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 <= 2.15e+96) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(-27.0 - Float64(x_46_im * 2.0))); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m + -19683.0) / x_46_im)) - x_46_im); 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 <= 2.15e+96) tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0)); else tmp = (x_46_re_m * ((x_46_re_m + -19683.0) / x_46_im)) - x_46_im; 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, 2.15e+96], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(-27.0 - N[(x$46$im * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m + -19683.0), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$im), $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 2.15 \cdot 10^{+96}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(-27 - x.im \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \frac{x.re\_m + -19683}{x.im} - x.im\\
\end{array}
\end{array}
if x.re < 2.15000000000000001e96Initial program 85.5%
difference-of-squares87.4%
Applied egg-rr87.4%
Simplified48.0%
Taylor expanded in x.re around 0 30.2%
associate-*r*30.2%
*-commutative30.2%
Simplified30.2%
*-commutative85.5%
*-un-lft-identity85.5%
*-un-lft-identity85.5%
distribute-rgt-out85.5%
metadata-eval85.5%
Applied egg-rr30.2%
associate-*l*30.7%
*-commutative30.7%
associate-*r*30.2%
associate-*l*30.2%
*-commutative30.2%
distribute-lft-out--32.5%
Applied egg-rr32.5%
if 2.15000000000000001e96 < x.re Initial program 72.5%
difference-of-squares75.0%
Applied egg-rr75.0%
Simplified72.5%
Taylor expanded in x.im around inf 44.9%
unpow244.9%
associate-*l*44.9%
associate-*r/47.5%
distribute-lft-out72.5%
+-commutative72.5%
remove-double-neg72.5%
mul-1-neg72.5%
sub-neg72.5%
*-commutative72.5%
associate-/l*72.5%
*-commutative72.5%
distribute-lft-out--72.5%
sub-neg72.5%
metadata-eval72.5%
sub-neg72.5%
metadata-eval72.5%
+-commutative72.5%
Simplified72.5%
Taylor expanded in x.im around 0 70.0%
associate-*r*70.0%
fma-neg70.0%
associate-/l*70.0%
sub-neg70.0%
metadata-eval70.0%
*-commutative70.0%
distribute-rgt-neg-in70.0%
*-commutative70.0%
flip-+0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac20.0%
metadata-eval0.0%
metadata-eval0.0%
metadata-eval0.0%
Applied egg-rr0.0%
Simplified33.3%
Final simplification32.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 2.45e+157)
(* (* x.re_m x.im) (- -27.0 (* x.im 2.0)))
(* (* x.re_m x.im) (+ -27.0 (* x.im 2.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 <= 2.45e+157) {
tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0));
} else {
tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.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 <= 2.45d+157) then
tmp = (x_46re_m * x_46im) * ((-27.0d0) - (x_46im * 2.0d0))
else
tmp = (x_46re_m * x_46im) * ((-27.0d0) + (x_46im * 2.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 <= 2.45e+157) {
tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0));
} else {
tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.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 <= 2.45e+157: tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0)) else: tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.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 <= 2.45e+157) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(-27.0 - Float64(x_46_im * 2.0))); else tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(-27.0 + Float64(x_46_im * 2.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 <= 2.45e+157) tmp = (x_46_re_m * x_46_im) * (-27.0 - (x_46_im * 2.0)); else tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.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, 2.45e+157], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(-27.0 - N[(x$46$im * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(-27.0 + N[(x$46$im * 2.0), $MachinePrecision]), $MachinePrecision]), $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 2.45 \cdot 10^{+157}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(-27 - x.im \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(-27 + x.im \cdot 2\right)\\
\end{array}
\end{array}
if x.re < 2.4500000000000001e157Initial program 86.2%
difference-of-squares88.0%
Applied egg-rr88.0%
Simplified50.5%
Taylor expanded in x.re around 0 28.9%
associate-*r*28.9%
*-commutative28.9%
Simplified28.9%
*-commutative86.2%
*-un-lft-identity86.2%
*-un-lft-identity86.2%
distribute-rgt-out86.2%
metadata-eval86.2%
Applied egg-rr28.9%
associate-*l*29.3%
*-commutative29.3%
associate-*r*28.9%
associate-*l*28.9%
*-commutative28.9%
distribute-lft-out--31.5%
Applied egg-rr31.5%
if 2.4500000000000001e157 < x.re Initial program 62.1%
difference-of-squares65.5%
Applied egg-rr65.5%
Simplified62.1%
Taylor expanded in x.re around 0 4.9%
associate-*r*4.9%
*-commutative4.9%
Simplified4.9%
*-commutative62.1%
*-un-lft-identity62.1%
*-un-lft-identity62.1%
distribute-rgt-out62.1%
metadata-eval62.1%
Applied egg-rr4.9%
Applied egg-rr36.2%
Final simplification32.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.im 6e+183)
(* (* x.re_m x.im) (+ -27.0 (* x.im 2.0)))
(+ x.im (* x.re_m (* x.im -27.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_im <= 6e+183) {
tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.0));
} else {
tmp = x_46_im + (x_46_re_m * (x_46_im * -27.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_46im <= 6d+183) then
tmp = (x_46re_m * x_46im) * ((-27.0d0) + (x_46im * 2.0d0))
else
tmp = x_46im + (x_46re_m * (x_46im * (-27.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_im <= 6e+183) {
tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.0));
} else {
tmp = x_46_im + (x_46_re_m * (x_46_im * -27.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_im <= 6e+183: tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.0)) else: tmp = x_46_im + (x_46_re_m * (x_46_im * -27.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_im <= 6e+183) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(-27.0 + Float64(x_46_im * 2.0))); else tmp = Float64(x_46_im + Float64(x_46_re_m * Float64(x_46_im * -27.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_im <= 6e+183) tmp = (x_46_re_m * x_46_im) * (-27.0 + (x_46_im * 2.0)); else tmp = x_46_im + (x_46_re_m * (x_46_im * -27.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$im, 6e+183], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(-27.0 + N[(x$46$im * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im + N[(x$46$re$95$m * N[(x$46$im * -27.0), $MachinePrecision]), $MachinePrecision]), $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.im \leq 6 \cdot 10^{+183}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(-27 + x.im \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x.im + x.re\_m \cdot \left(x.im \cdot -27\right)\\
\end{array}
\end{array}
if x.im < 5.99999999999999992e183Initial program 84.9%
difference-of-squares85.8%
Applied egg-rr85.8%
Simplified50.4%
Taylor expanded in x.re around 0 21.2%
associate-*r*21.2%
*-commutative21.2%
Simplified21.2%
*-commutative84.9%
*-un-lft-identity84.9%
*-un-lft-identity84.9%
distribute-rgt-out84.9%
metadata-eval84.9%
Applied egg-rr21.2%
Applied egg-rr18.0%
if 5.99999999999999992e183 < x.im Initial program 66.2%
difference-of-squares81.2%
Applied egg-rr81.2%
Simplified69.0%
Taylor expanded in x.re around 0 84.0%
associate-*r*84.0%
*-commutative84.0%
Simplified84.0%
*-commutative66.2%
*-un-lft-identity66.2%
*-un-lft-identity66.2%
distribute-rgt-out66.2%
metadata-eval66.2%
Applied egg-rr84.0%
add-log-exp81.8%
*-commutative81.8%
exp-lft-sqr81.8%
exp-sum81.8%
add-log-exp84.0%
*-commutative84.0%
Applied egg-rr0.0%
Simplified23.3%
Final simplification18.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 (+ x.im (* x.re_m (* x.im -27.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 * (x_46_im + (x_46_re_m * (x_46_im * -27.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 * (x_46im + (x_46re_m * (x_46im * (-27.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 * (x_46_im + (x_46_re_m * (x_46_im * -27.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 * (x_46_im + (x_46_re_m * (x_46_im * -27.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 * Float64(x_46_im + Float64(x_46_re_m * Float64(x_46_im * -27.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 * (x_46_im + (x_46_re_m * (x_46_im * -27.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 * N[(x$46$im + N[(x$46$re$95$m * N[(x$46$im * -27.0), $MachinePrecision]), $MachinePrecision]), $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.im + x.re\_m \cdot \left(x.im \cdot -27\right)\right)
\end{array}
Initial program 83.5%
difference-of-squares85.4%
Applied egg-rr85.4%
Simplified51.8%
Taylor expanded in x.re around 0 26.1%
associate-*r*26.1%
*-commutative26.1%
Simplified26.1%
*-commutative83.5%
*-un-lft-identity83.5%
*-un-lft-identity83.5%
distribute-rgt-out83.5%
metadata-eval83.5%
Applied egg-rr26.1%
add-log-exp22.0%
*-commutative22.0%
exp-lft-sqr22.0%
exp-sum22.0%
add-log-exp26.1%
*-commutative26.1%
Applied egg-rr0.0%
Simplified6.6%
Final simplification6.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 (- -19683.0 x.im)))
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 * (-19683.0 - x_46_im);
}
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 * ((-19683.0d0) - x_46im)
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 * (-19683.0 - x_46_im);
}
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 * (-19683.0 - x_46_im)
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(-19683.0 - x_46_im)) 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 * (-19683.0 - x_46_im); 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[(-19683.0 - x$46$im), $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(-19683 - x.im\right)
\end{array}
Initial program 83.5%
difference-of-squares85.4%
Applied egg-rr85.4%
Simplified51.8%
Taylor expanded in x.re around 0 26.1%
associate-*r*26.1%
*-commutative26.1%
Simplified26.1%
*-commutative83.5%
*-un-lft-identity83.5%
*-un-lft-identity83.5%
distribute-rgt-out83.5%
metadata-eval83.5%
Applied egg-rr26.1%
Taylor expanded in x.im around 0 28.9%
Simplified3.1%
Final simplification3.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 -0.5))
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 * -0.5;
}
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 * (-0.5d0)
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 * -0.5;
}
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 * -0.5
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 * -0.5) 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 * -0.5; 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 * -0.5), $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 -0.5
\end{array}
Initial program 83.5%
Simplified82.7%
associate-*r*82.7%
associate-*l*82.7%
+-commutative82.7%
associate-*r*89.7%
associate-*r*89.7%
fma-define92.0%
Applied egg-rr92.0%
Applied egg-rr2.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 -757.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 * -757.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 * (-757.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 * -757.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 * -757.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 * -757.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 * -757.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 * -757.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 -757
\end{array}
Initial program 83.5%
Simplified82.7%
associate-*r*82.7%
associate-*l*82.7%
+-commutative82.7%
associate-*r*89.7%
associate-*r*89.7%
fma-define92.0%
Applied egg-rr92.0%
Applied egg-rr2.6%
(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 2024139
(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)))