
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
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_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
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_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) 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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); 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$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\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.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
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_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
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_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) 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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); 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$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(*
x.im_s
(if (<= x.im_m 1.5e+85)
(- (* x.re (* x.im_m (* x.re 3.0))) (pow x.im_m 3.0))
(+ (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re))) -1.0))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 1.5e+85) {
tmp = (x_46_re * (x_46_im_m * (x_46_re * 3.0))) - pow(x_46_im_m, 3.0);
} else {
tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: tmp
if (x_46im_m <= 1.5d+85) then
tmp = (x_46re * (x_46im_m * (x_46re * 3.0d0))) - (x_46im_m ** 3.0d0)
else
tmp = (x_46im_m * ((x_46re - x_46im_m) * (x_46im_m + x_46re))) + (-1.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 1.5e+85) {
tmp = (x_46_re * (x_46_im_m * (x_46_re * 3.0))) - Math.pow(x_46_im_m, 3.0);
} else {
tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): tmp = 0 if x_46_im_m <= 1.5e+85: tmp = (x_46_re * (x_46_im_m * (x_46_re * 3.0))) - math.pow(x_46_im_m, 3.0) else: tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0 if (x_46_im_m <= 1.5e+85) tmp = Float64(Float64(x_46_re * Float64(x_46_im_m * Float64(x_46_re * 3.0))) - (x_46_im_m ^ 3.0)); else tmp = Float64(Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0; if (x_46_im_m <= 1.5e+85) tmp = (x_46_re * (x_46_im_m * (x_46_re * 3.0))) - (x_46_im_m ^ 3.0); else tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 1.5e+85], N[(N[(x$46$re * N[(x$46$im$95$m * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im$95$m, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 1.5 \cdot 10^{+85}:\\
\;\;\;\;x.re \cdot \left(x.im\_m \cdot \left(x.re \cdot 3\right)\right) - {x.im\_m}^{3}\\
\mathbf{else}:\\
\;\;\;\;x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right) + -1\\
\end{array}
\end{array}
if x.im < 1.5e85Initial program 85.1%
Simplified92.4%
if 1.5e85 < x.im Initial program 69.0%
difference-of-squares73.8%
*-commutative73.8%
Applied egg-rr73.8%
*-commutative73.8%
count-273.8%
*-commutative73.8%
Applied egg-rr73.8%
*-commutative73.8%
count-273.8%
*-commutative73.8%
expm1-log1p-u73.8%
expm1-undefine73.8%
*-commutative73.8%
*-commutative73.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification93.6%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(let* ((t_0 (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re))))
(t_1
(+
(* x.im_m (- (* x.re x.re) (* x.im_m x.im_m)))
(* x.re (+ (* x.im_m x.re) (* x.im_m x.re))))))
(*
x.im_s
(if (<= t_1 2e+288)
(+ t_0 (* x.re (* (* x.im_m x.re) 2.0)))
(if (<= t_1 INFINITY)
(fma (* x.im_m x.re) (* x.re 3.0) -1.0)
(+ t_0 -1.0))))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double t_1 = (x_46_im_m * ((x_46_re * x_46_re) - (x_46_im_m * x_46_im_m))) + (x_46_re * ((x_46_im_m * x_46_re) + (x_46_im_m * x_46_re)));
double tmp;
if (t_1 <= 2e+288) {
tmp = t_0 + (x_46_re * ((x_46_im_m * x_46_re) * 2.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma((x_46_im_m * x_46_re), (x_46_re * 3.0), -1.0);
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) t_0 = Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) t_1 = Float64(Float64(x_46_im_m * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im_m * x_46_im_m))) + Float64(x_46_re * Float64(Float64(x_46_im_m * x_46_re) + Float64(x_46_im_m * x_46_re)))) tmp = 0.0 if (t_1 <= 2e+288) tmp = Float64(t_0 + Float64(x_46_re * Float64(Float64(x_46_im_m * x_46_re) * 2.0))); elseif (t_1 <= Inf) tmp = fma(Float64(x_46_im_m * x_46_re), Float64(x_46_re * 3.0), -1.0); else tmp = Float64(t_0 + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := Block[{t$95$0 = N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im$95$m * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im$95$m * x$46$im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] + N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$46$im$95$s * If[LessEqual[t$95$1, 2e+288], N[(t$95$0 + N[(x$46$re * N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision] + -1.0), $MachinePrecision], N[(t$95$0 + -1.0), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
\begin{array}{l}
t_0 := x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right)\\
t_1 := x.im\_m \cdot \left(x.re \cdot x.re - x.im\_m \cdot x.im\_m\right) + x.re \cdot \left(x.im\_m \cdot x.re + x.im\_m \cdot x.re\right)\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;t\_0 + x.re \cdot \left(\left(x.im\_m \cdot x.re\right) \cdot 2\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x.im\_m \cdot x.re, x.re \cdot 3, -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1\\
\end{array}
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < 2e288Initial program 94.6%
difference-of-squares94.6%
*-commutative94.6%
Applied egg-rr94.6%
*-commutative94.6%
count-294.6%
*-commutative94.6%
Applied egg-rr94.6%
if 2e288 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 82.8%
Simplified95.7%
associate-*r*95.6%
fma-neg95.6%
Applied egg-rr95.6%
*-un-lft-identity95.6%
add-sqr-sqrt64.4%
sqrt-unprod96.2%
sqr-neg96.2%
sqrt-unprod56.1%
add-sqr-sqrt56.1%
Applied egg-rr56.1%
Simplified56.3%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
difference-of-squares37.0%
*-commutative37.0%
Applied egg-rr37.0%
*-commutative37.0%
count-237.0%
*-commutative37.0%
Applied egg-rr37.0%
*-commutative37.0%
count-237.0%
*-commutative37.0%
expm1-log1p-u7.4%
expm1-undefine7.4%
*-commutative7.4%
*-commutative7.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification88.0%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(*
x.im_s
(if (<= x.im_m 1.6e+85)
(- (* x.re (* 3.0 (* x.im_m x.re))) (pow x.im_m 3.0))
(+ (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re))) -1.0))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 1.6e+85) {
tmp = (x_46_re * (3.0 * (x_46_im_m * x_46_re))) - pow(x_46_im_m, 3.0);
} else {
tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: tmp
if (x_46im_m <= 1.6d+85) then
tmp = (x_46re * (3.0d0 * (x_46im_m * x_46re))) - (x_46im_m ** 3.0d0)
else
tmp = (x_46im_m * ((x_46re - x_46im_m) * (x_46im_m + x_46re))) + (-1.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 1.6e+85) {
tmp = (x_46_re * (3.0 * (x_46_im_m * x_46_re))) - Math.pow(x_46_im_m, 3.0);
} else {
tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): tmp = 0 if x_46_im_m <= 1.6e+85: tmp = (x_46_re * (3.0 * (x_46_im_m * x_46_re))) - math.pow(x_46_im_m, 3.0) else: tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0 if (x_46_im_m <= 1.6e+85) tmp = Float64(Float64(x_46_re * Float64(3.0 * Float64(x_46_im_m * x_46_re))) - (x_46_im_m ^ 3.0)); else tmp = Float64(Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0; if (x_46_im_m <= 1.6e+85) tmp = (x_46_re * (3.0 * (x_46_im_m * x_46_re))) - (x_46_im_m ^ 3.0); else tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 1.6e+85], N[(N[(x$46$re * N[(3.0 * N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im$95$m, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 1.6 \cdot 10^{+85}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.im\_m \cdot x.re\right)\right) - {x.im\_m}^{3}\\
\mathbf{else}:\\
\;\;\;\;x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right) + -1\\
\end{array}
\end{array}
if x.im < 1.60000000000000009e85Initial program 85.1%
Simplified92.4%
Taylor expanded in x.im around 0 92.4%
if 1.60000000000000009e85 < x.im Initial program 69.0%
difference-of-squares73.8%
*-commutative73.8%
Applied egg-rr73.8%
*-commutative73.8%
count-273.8%
*-commutative73.8%
Applied egg-rr73.8%
*-commutative73.8%
count-273.8%
*-commutative73.8%
expm1-log1p-u73.8%
expm1-undefine73.8%
*-commutative73.8%
*-commutative73.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification93.6%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(let* ((t_0 (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re)))))
(*
x.im_s
(if (<=
(+
(* x.im_m (- (* x.re x.re) (* x.im_m x.im_m)))
(* x.re (+ (* x.im_m x.re) (* x.im_m x.re))))
1e+305)
(+ t_0 (* x.re (* (* x.im_m x.re) 2.0)))
(+ t_0 -1.0)))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double tmp;
if (((x_46_im_m * ((x_46_re * x_46_re) - (x_46_im_m * x_46_im_m))) + (x_46_re * ((x_46_im_m * x_46_re) + (x_46_im_m * x_46_re)))) <= 1e+305) {
tmp = t_0 + (x_46_re * ((x_46_im_m * x_46_re) * 2.0));
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im_m * ((x_46re - x_46im_m) * (x_46im_m + x_46re))
if (((x_46im_m * ((x_46re * x_46re) - (x_46im_m * x_46im_m))) + (x_46re * ((x_46im_m * x_46re) + (x_46im_m * x_46re)))) <= 1d+305) then
tmp = t_0 + (x_46re * ((x_46im_m * x_46re) * 2.0d0))
else
tmp = t_0 + (-1.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double tmp;
if (((x_46_im_m * ((x_46_re * x_46_re) - (x_46_im_m * x_46_im_m))) + (x_46_re * ((x_46_im_m * x_46_re) + (x_46_im_m * x_46_re)))) <= 1e+305) {
tmp = t_0 + (x_46_re * ((x_46_im_m * x_46_re) * 2.0));
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re)) tmp = 0 if ((x_46_im_m * ((x_46_re * x_46_re) - (x_46_im_m * x_46_im_m))) + (x_46_re * ((x_46_im_m * x_46_re) + (x_46_im_m * x_46_re)))) <= 1e+305: tmp = t_0 + (x_46_re * ((x_46_im_m * x_46_re) * 2.0)) else: tmp = t_0 + -1.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) t_0 = Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) tmp = 0.0 if (Float64(Float64(x_46_im_m * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im_m * x_46_im_m))) + Float64(x_46_re * Float64(Float64(x_46_im_m * x_46_re) + Float64(x_46_im_m * x_46_re)))) <= 1e+305) tmp = Float64(t_0 + Float64(x_46_re * Float64(Float64(x_46_im_m * x_46_re) * 2.0))); else tmp = Float64(t_0 + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re)); tmp = 0.0; if (((x_46_im_m * ((x_46_re * x_46_re) - (x_46_im_m * x_46_im_m))) + (x_46_re * ((x_46_im_m * x_46_re) + (x_46_im_m * x_46_re)))) <= 1e+305) tmp = t_0 + (x_46_re * ((x_46_im_m * x_46_re) * 2.0)); else tmp = t_0 + -1.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := Block[{t$95$0 = N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$46$im$95$s * If[LessEqual[N[(N[(x$46$im$95$m * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im$95$m * x$46$im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] + N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+305], N[(t$95$0 + N[(x$46$re * N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + -1.0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
\begin{array}{l}
t_0 := x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right)\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \cdot \left(x.re \cdot x.re - x.im\_m \cdot x.im\_m\right) + x.re \cdot \left(x.im\_m \cdot x.re + x.im\_m \cdot x.re\right) \leq 10^{+305}:\\
\;\;\;\;t\_0 + x.re \cdot \left(\left(x.im\_m \cdot x.re\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1\\
\end{array}
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < 9.9999999999999994e304Initial program 94.7%
difference-of-squares94.7%
*-commutative94.7%
Applied egg-rr94.7%
*-commutative94.7%
count-294.7%
*-commutative94.7%
Applied egg-rr94.7%
if 9.9999999999999994e304 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 51.7%
difference-of-squares65.4%
*-commutative65.4%
Applied egg-rr65.4%
*-commutative65.4%
count-265.4%
*-commutative65.4%
Applied egg-rr65.4%
*-commutative65.4%
count-265.4%
*-commutative65.4%
expm1-log1p-u42.1%
expm1-undefine42.1%
*-commutative42.1%
*-commutative42.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified88.7%
Final simplification93.0%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(let* ((t_0 (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re)))))
(*
x.im_s
(if (<= x.im_m 2.8e-93)
(+ (* x.re (* (* x.im_m x.re) 2.0)) (* x.im_m (* x.re (+ x.im_m x.re))))
(if (<= x.im_m 300000.0) (- t_0 (* x.im_m x.re)) (+ t_0 -1.0))))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double tmp;
if (x_46_im_m <= 2.8e-93) {
tmp = (x_46_re * ((x_46_im_m * x_46_re) * 2.0)) + (x_46_im_m * (x_46_re * (x_46_im_m + x_46_re)));
} else if (x_46_im_m <= 300000.0) {
tmp = t_0 - (x_46_im_m * x_46_re);
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im_m * ((x_46re - x_46im_m) * (x_46im_m + x_46re))
if (x_46im_m <= 2.8d-93) then
tmp = (x_46re * ((x_46im_m * x_46re) * 2.0d0)) + (x_46im_m * (x_46re * (x_46im_m + x_46re)))
else if (x_46im_m <= 300000.0d0) then
tmp = t_0 - (x_46im_m * x_46re)
else
tmp = t_0 + (-1.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double tmp;
if (x_46_im_m <= 2.8e-93) {
tmp = (x_46_re * ((x_46_im_m * x_46_re) * 2.0)) + (x_46_im_m * (x_46_re * (x_46_im_m + x_46_re)));
} else if (x_46_im_m <= 300000.0) {
tmp = t_0 - (x_46_im_m * x_46_re);
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re)) tmp = 0 if x_46_im_m <= 2.8e-93: tmp = (x_46_re * ((x_46_im_m * x_46_re) * 2.0)) + (x_46_im_m * (x_46_re * (x_46_im_m + x_46_re))) elif x_46_im_m <= 300000.0: tmp = t_0 - (x_46_im_m * x_46_re) else: tmp = t_0 + -1.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) t_0 = Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) tmp = 0.0 if (x_46_im_m <= 2.8e-93) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_im_m * x_46_re) * 2.0)) + Float64(x_46_im_m * Float64(x_46_re * Float64(x_46_im_m + x_46_re)))); elseif (x_46_im_m <= 300000.0) tmp = Float64(t_0 - Float64(x_46_im_m * x_46_re)); else tmp = Float64(t_0 + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re)); tmp = 0.0; if (x_46_im_m <= 2.8e-93) tmp = (x_46_re * ((x_46_im_m * x_46_re) * 2.0)) + (x_46_im_m * (x_46_re * (x_46_im_m + x_46_re))); elseif (x_46_im_m <= 300000.0) tmp = t_0 - (x_46_im_m * x_46_re); else tmp = t_0 + -1.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := Block[{t$95$0 = N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 2.8e-93], N[(N[(x$46$re * N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x$46$im$95$m * N[(x$46$re * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im$95$m, 300000.0], N[(t$95$0 - N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + -1.0), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
\begin{array}{l}
t_0 := x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right)\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;x.re \cdot \left(\left(x.im\_m \cdot x.re\right) \cdot 2\right) + x.im\_m \cdot \left(x.re \cdot \left(x.im\_m + x.re\right)\right)\\
\mathbf{elif}\;x.im\_m \leq 300000:\\
\;\;\;\;t\_0 - x.im\_m \cdot x.re\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1\\
\end{array}
\end{array}
\end{array}
if x.im < 2.79999999999999998e-93Initial program 82.9%
difference-of-squares87.4%
*-commutative87.4%
Applied egg-rr87.4%
*-commutative87.4%
count-287.4%
*-commutative87.4%
Applied egg-rr87.4%
Taylor expanded in x.re around inf 63.1%
if 2.79999999999999998e-93 < x.im < 3e5Initial program 92.5%
difference-of-squares92.6%
*-commutative92.6%
Applied egg-rr92.6%
*-commutative92.6%
count-292.6%
*-commutative92.6%
Applied egg-rr92.6%
*-commutative92.6%
count-292.6%
flip-+0.0%
difference-of-squares0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
flip-+71.8%
distribute-lft-in71.8%
*-commutative71.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified64.1%
if 3e5 < x.im Initial program 76.7%
difference-of-squares80.3%
*-commutative80.3%
Applied egg-rr80.3%
*-commutative80.3%
count-280.3%
*-commutative80.3%
Applied egg-rr80.3%
*-commutative80.3%
count-280.3%
*-commutative80.3%
expm1-log1p-u80.0%
expm1-undefine80.0%
*-commutative80.0%
*-commutative80.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified97.0%
Final simplification70.6%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(let* ((t_0 (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re)))))
(*
x.im_s
(if (<= x.im_m 3.2e-93)
(* 3.0 (* x.im_m (* x.re x.re)))
(if (<= x.im_m 200000.0) (- t_0 (* x.im_m x.re)) (+ t_0 -1.0))))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double tmp;
if (x_46_im_m <= 3.2e-93) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else if (x_46_im_m <= 200000.0) {
tmp = t_0 - (x_46_im_m * x_46_re);
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im_m * ((x_46re - x_46im_m) * (x_46im_m + x_46re))
if (x_46im_m <= 3.2d-93) then
tmp = 3.0d0 * (x_46im_m * (x_46re * x_46re))
else if (x_46im_m <= 200000.0d0) then
tmp = t_0 - (x_46im_m * x_46re)
else
tmp = t_0 + (-1.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re));
double tmp;
if (x_46_im_m <= 3.2e-93) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else if (x_46_im_m <= 200000.0) {
tmp = t_0 - (x_46_im_m * x_46_re);
} else {
tmp = t_0 + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re)) tmp = 0 if x_46_im_m <= 3.2e-93: tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)) elif x_46_im_m <= 200000.0: tmp = t_0 - (x_46_im_m * x_46_re) else: tmp = t_0 + -1.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) t_0 = Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) tmp = 0.0 if (x_46_im_m <= 3.2e-93) tmp = Float64(3.0 * Float64(x_46_im_m * Float64(x_46_re * x_46_re))); elseif (x_46_im_m <= 200000.0) tmp = Float64(t_0 - Float64(x_46_im_m * x_46_re)); else tmp = Float64(t_0 + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) t_0 = x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re)); tmp = 0.0; if (x_46_im_m <= 3.2e-93) tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)); elseif (x_46_im_m <= 200000.0) tmp = t_0 - (x_46_im_m * x_46_re); else tmp = t_0 + -1.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := Block[{t$95$0 = N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 3.2e-93], N[(3.0 * N[(x$46$im$95$m * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im$95$m, 200000.0], N[(t$95$0 - N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + -1.0), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
\begin{array}{l}
t_0 := x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right)\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 3.2 \cdot 10^{-93}:\\
\;\;\;\;3 \cdot \left(x.im\_m \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{elif}\;x.im\_m \leq 200000:\\
\;\;\;\;t\_0 - x.im\_m \cdot x.re\\
\mathbf{else}:\\
\;\;\;\;t\_0 + -1\\
\end{array}
\end{array}
\end{array}
if x.im < 3.1999999999999999e-93Initial program 82.9%
Simplified90.7%
Taylor expanded in x.re around inf 60.8%
pow260.8%
Applied egg-rr60.8%
if 3.1999999999999999e-93 < x.im < 2e5Initial program 92.5%
difference-of-squares92.6%
*-commutative92.6%
Applied egg-rr92.6%
*-commutative92.6%
count-292.6%
*-commutative92.6%
Applied egg-rr92.6%
*-commutative92.6%
count-292.6%
flip-+0.0%
difference-of-squares0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
flip-+71.8%
distribute-lft-in71.8%
*-commutative71.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified64.1%
if 2e5 < x.im Initial program 76.7%
difference-of-squares80.3%
*-commutative80.3%
Applied egg-rr80.3%
*-commutative80.3%
count-280.3%
*-commutative80.3%
Applied egg-rr80.3%
*-commutative80.3%
count-280.3%
*-commutative80.3%
expm1-log1p-u80.0%
expm1-undefine80.0%
*-commutative80.0%
*-commutative80.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified97.0%
Final simplification69.0%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(*
x.im_s
(if (<= x.im_m 3.2e-31)
(* 3.0 (* x.im_m (* x.re x.re)))
(+ (* x.im_m (* (- x.re x.im_m) (+ x.im_m x.re))) -1.0))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 3.2e-31) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else {
tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: tmp
if (x_46im_m <= 3.2d-31) then
tmp = 3.0d0 * (x_46im_m * (x_46re * x_46re))
else
tmp = (x_46im_m * ((x_46re - x_46im_m) * (x_46im_m + x_46re))) + (-1.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 3.2e-31) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else {
tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): tmp = 0 if x_46_im_m <= 3.2e-31: tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)) else: tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0 if (x_46_im_m <= 3.2e-31) tmp = Float64(3.0 * Float64(x_46_im_m * Float64(x_46_re * x_46_re))); else tmp = Float64(Float64(x_46_im_m * Float64(Float64(x_46_re - x_46_im_m) * Float64(x_46_im_m + x_46_re))) + -1.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0; if (x_46_im_m <= 3.2e-31) tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)); else tmp = (x_46_im_m * ((x_46_re - x_46_im_m) * (x_46_im_m + x_46_re))) + -1.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 3.2e-31], N[(3.0 * N[(x$46$im$95$m * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im$95$m * N[(N[(x$46$re - x$46$im$95$m), $MachinePrecision] * N[(x$46$im$95$m + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 3.2 \cdot 10^{-31}:\\
\;\;\;\;3 \cdot \left(x.im\_m \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im\_m \cdot \left(\left(x.re - x.im\_m\right) \cdot \left(x.im\_m + x.re\right)\right) + -1\\
\end{array}
\end{array}
if x.im < 3.20000000000000018e-31Initial program 84.0%
Simplified91.6%
Taylor expanded in x.re around inf 59.1%
pow259.1%
Applied egg-rr59.1%
if 3.20000000000000018e-31 < x.im Initial program 77.6%
difference-of-squares80.8%
*-commutative80.8%
Applied egg-rr80.8%
*-commutative80.8%
count-280.8%
*-commutative80.8%
Applied egg-rr80.8%
*-commutative80.8%
count-280.8%
*-commutative80.8%
expm1-log1p-u80.5%
expm1-undefine80.5%
*-commutative80.5%
*-commutative80.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified92.4%
Final simplification67.1%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(*
x.im_s
(if (<= x.im_m 4.8e+218)
(* 3.0 (* x.im_m (* x.re x.re)))
(- -1.0 (* x.re (* x.im_m x.re))))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 4.8e+218) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else {
tmp = -1.0 - (x_46_re * (x_46_im_m * x_46_re));
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: tmp
if (x_46im_m <= 4.8d+218) then
tmp = 3.0d0 * (x_46im_m * (x_46re * x_46re))
else
tmp = (-1.0d0) - (x_46re * (x_46im_m * x_46re))
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 4.8e+218) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else {
tmp = -1.0 - (x_46_re * (x_46_im_m * x_46_re));
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): tmp = 0 if x_46_im_m <= 4.8e+218: tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)) else: tmp = -1.0 - (x_46_re * (x_46_im_m * x_46_re)) return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0 if (x_46_im_m <= 4.8e+218) tmp = Float64(3.0 * Float64(x_46_im_m * Float64(x_46_re * x_46_re))); else tmp = Float64(-1.0 - Float64(x_46_re * Float64(x_46_im_m * x_46_re))); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0; if (x_46_im_m <= 4.8e+218) tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)); else tmp = -1.0 - (x_46_re * (x_46_im_m * x_46_re)); end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 4.8e+218], N[(3.0 * N[(x$46$im$95$m * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 - N[(x$46$re * N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 4.8 \cdot 10^{+218}:\\
\;\;\;\;3 \cdot \left(x.im\_m \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 - x.re \cdot \left(x.im\_m \cdot x.re\right)\\
\end{array}
\end{array}
if x.im < 4.79999999999999961e218Initial program 83.7%
Simplified89.4%
Taylor expanded in x.re around inf 54.4%
pow254.4%
Applied egg-rr54.4%
if 4.79999999999999961e218 < x.im Initial program 64.7%
difference-of-squares64.7%
*-commutative64.7%
Applied egg-rr64.7%
Taylor expanded in x.re around inf 64.7%
+-commutative64.7%
*-commutative64.7%
fma-define70.6%
*-commutative70.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*l*0.0%
Applied egg-rr0.0%
Simplified100.0%
Taylor expanded in x.im around 0 38.4%
neg-mul-138.4%
Simplified38.4%
Final simplification53.3%
x.im\_m = (fabs.f64 x.im)
x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im)
(FPCore (x.im_s x.re x.im_m)
:precision binary64
(*
x.im_s
(if (<= x.im_m 1e+222)
(* 3.0 (* x.im_m (* x.re x.re)))
(- -3.0 (* x.im_m x.re)))))x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 1e+222) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else {
tmp = -3.0 - (x_46_im_m * x_46_re);
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: tmp
if (x_46im_m <= 1d+222) then
tmp = 3.0d0 * (x_46im_m * (x_46re * x_46re))
else
tmp = (-3.0d0) - (x_46im_m * x_46re)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_im_m <= 1e+222) {
tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re));
} else {
tmp = -3.0 - (x_46_im_m * x_46_re);
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): tmp = 0 if x_46_im_m <= 1e+222: tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)) else: tmp = -3.0 - (x_46_im_m * x_46_re) return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0 if (x_46_im_m <= 1e+222) tmp = Float64(3.0 * Float64(x_46_im_m * Float64(x_46_re * x_46_re))); else tmp = Float64(-3.0 - Float64(x_46_im_m * x_46_re)); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0; if (x_46_im_m <= 1e+222) tmp = 3.0 * (x_46_im_m * (x_46_re * x_46_re)); else tmp = -3.0 - (x_46_im_m * x_46_re); end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * If[LessEqual[x$46$im$95$m, 1e+222], N[(3.0 * N[(x$46$im$95$m * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-3.0 - N[(x$46$im$95$m * x$46$re), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.im\_m \leq 10^{+222}:\\
\;\;\;\;3 \cdot \left(x.im\_m \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-3 - x.im\_m \cdot x.re\\
\end{array}
\end{array}
if x.im < 1e222Initial program 83.7%
Simplified89.4%
Taylor expanded in x.re around inf 54.4%
pow254.4%
Applied egg-rr54.4%
if 1e222 < x.im Initial program 64.7%
Taylor expanded in x.re around 0 64.7%
Simplified1.0%
*-commutative64.7%
count-264.7%
*-commutative64.7%
Applied egg-rr1.0%
*-commutative64.7%
count-264.7%
flip-+0.0%
difference-of-squares0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
flip-+70.6%
distribute-lft-in70.6%
*-commutative70.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified13.8%
distribute-lft-neg-out13.8%
*-commutative13.8%
unsub-neg13.8%
Applied egg-rr13.8%
Final simplification51.7%
x.im\_m = (fabs.f64 x.im) x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im) (FPCore (x.im_s x.re x.im_m) :precision binary64 (* x.im_s (if (<= x.re 2.6e+172) (* x.im_m (- x.re)) (+ (* x.im_m x.re) -3.0))))
x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_re <= 2.6e+172) {
tmp = x_46_im_m * -x_46_re;
} else {
tmp = (x_46_im_m * x_46_re) + -3.0;
}
return x_46_im_s * tmp;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
real(8) :: tmp
if (x_46re <= 2.6d+172) then
tmp = x_46im_m * -x_46re
else
tmp = (x_46im_m * x_46re) + (-3.0d0)
end if
code = x_46im_s * tmp
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
double tmp;
if (x_46_re <= 2.6e+172) {
tmp = x_46_im_m * -x_46_re;
} else {
tmp = (x_46_im_m * x_46_re) + -3.0;
}
return x_46_im_s * tmp;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): tmp = 0 if x_46_re <= 2.6e+172: tmp = x_46_im_m * -x_46_re else: tmp = (x_46_im_m * x_46_re) + -3.0 return x_46_im_s * tmp
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0 if (x_46_re <= 2.6e+172) tmp = Float64(x_46_im_m * Float64(-x_46_re)); else tmp = Float64(Float64(x_46_im_m * x_46_re) + -3.0); end return Float64(x_46_im_s * tmp) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp_2 = code(x_46_im_s, x_46_re, x_46_im_m) tmp = 0.0; if (x_46_re <= 2.6e+172) tmp = x_46_im_m * -x_46_re; else tmp = (x_46_im_m * x_46_re) + -3.0; end tmp_2 = x_46_im_s * tmp; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * If[LessEqual[x$46$re, 2.6e+172], N[(x$46$im$95$m * (-x$46$re)), $MachinePrecision], N[(N[(x$46$im$95$m * x$46$re), $MachinePrecision] + -3.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \begin{array}{l}
\mathbf{if}\;x.re \leq 2.6 \cdot 10^{+172}:\\
\;\;\;\;x.im\_m \cdot \left(-x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im\_m \cdot x.re + -3\\
\end{array}
\end{array}
if x.re < 2.6e172Initial program 86.9%
Taylor expanded in x.re around 0 69.8%
Simplified12.1%
*-commutative88.3%
count-288.3%
*-commutative88.3%
Applied egg-rr12.1%
*-commutative88.3%
count-288.3%
flip-+0.0%
difference-of-squares0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
flip-+68.2%
distribute-lft-in68.2%
*-commutative68.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified6.8%
Taylor expanded in x.im around inf 21.8%
mul-1-neg21.8%
*-commutative21.8%
distribute-lft-neg-in21.8%
Simplified21.8%
if 2.6e172 < x.re Initial program 57.6%
Taylor expanded in x.re around 0 54.9%
Simplified77.9%
*-commutative75.6%
count-275.6%
*-commutative75.6%
Applied egg-rr77.9%
*-commutative75.6%
count-275.6%
flip-+0.0%
difference-of-squares0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
flip-+29.2%
distribute-lft-in29.2%
*-commutative29.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified8.1%
neg-sub08.1%
sub-neg8.1%
add-sqr-sqrt2.9%
sqrt-unprod14.2%
sqr-neg14.2%
sqrt-unprod11.4%
add-sqr-sqrt33.9%
Applied egg-rr33.9%
+-lft-identity33.9%
Simplified33.9%
Final simplification23.7%
x.im\_m = (fabs.f64 x.im) x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im) (FPCore (x.im_s x.re x.im_m) :precision binary64 (* x.im_s (* x.im_m (- x.re))))
x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
return x_46_im_s * (x_46_im_m * -x_46_re);
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
code = x_46im_s * (x_46im_m * -x_46re)
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
return x_46_im_s * (x_46_im_m * -x_46_re);
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): return x_46_im_s * (x_46_im_m * -x_46_re)
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) return Float64(x_46_im_s * Float64(x_46_im_m * Float64(-x_46_re))) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp = code(x_46_im_s, x_46_re, x_46_im_m) tmp = x_46_im_s * (x_46_im_m * -x_46_re); end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * N[(x$46$im$95$m * (-x$46$re)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot \left(x.im\_m \cdot \left(-x.re\right)\right)
\end{array}
Initial program 82.4%
Taylor expanded in x.re around 0 67.5%
Simplified22.1%
*-commutative86.3%
count-286.3%
*-commutative86.3%
Applied egg-rr22.1%
*-commutative86.3%
count-286.3%
flip-+0.0%
difference-of-squares0.0%
*-commutative0.0%
+-inverses0.0%
+-inverses0.0%
associate-*r/0.0%
+-inverses0.0%
+-inverses0.0%
flip-+62.3%
distribute-lft-in62.3%
*-commutative62.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified7.0%
Taylor expanded in x.im around inf 19.7%
mul-1-neg19.7%
*-commutative19.7%
distribute-lft-neg-in19.7%
Simplified19.7%
Final simplification19.7%
x.im\_m = (fabs.f64 x.im) x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im) (FPCore (x.im_s x.re x.im_m) :precision binary64 (* x.im_s 2.0))
x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
return x_46_im_s * 2.0;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
code = x_46im_s * 2.0d0
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
return x_46_im_s * 2.0;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): return x_46_im_s * 2.0
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) return Float64(x_46_im_s * 2.0) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp = code(x_46_im_s, x_46_re, x_46_im_m) tmp = x_46_im_s * 2.0; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * 2.0), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot 2
\end{array}
Initial program 82.4%
Taylor expanded in x.re around 0 67.5%
Simplified22.1%
*-commutative86.3%
count-286.3%
*-commutative86.3%
Applied egg-rr22.1%
add-sqr-sqrt8.9%
sqrt-unprod13.9%
pow213.9%
+-commutative13.9%
*-commutative13.9%
fma-define13.9%
*-commutative13.9%
count-213.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified2.7%
x.im\_m = (fabs.f64 x.im) x.im\_s = (copysign.f64 #s(literal 1 binary64) x.im) (FPCore (x.im_s x.re x.im_m) :precision binary64 (* x.im_s -3.0))
x.im\_m = fabs(x_46_im);
x.im\_s = copysign(1.0, x_46_im);
double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
return x_46_im_s * -3.0;
}
x.im\_m = abs(x_46im)
x.im\_s = copysign(1.0d0, x_46im)
real(8) function code(x_46im_s, x_46re, x_46im_m)
real(8), intent (in) :: x_46im_s
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im_m
code = x_46im_s * (-3.0d0)
end function
x.im\_m = Math.abs(x_46_im);
x.im\_s = Math.copySign(1.0, x_46_im);
public static double code(double x_46_im_s, double x_46_re, double x_46_im_m) {
return x_46_im_s * -3.0;
}
x.im\_m = math.fabs(x_46_im) x.im\_s = math.copysign(1.0, x_46_im) def code(x_46_im_s, x_46_re, x_46_im_m): return x_46_im_s * -3.0
x.im\_m = abs(x_46_im) x.im\_s = copysign(1.0, x_46_im) function code(x_46_im_s, x_46_re, x_46_im_m) return Float64(x_46_im_s * -3.0) end
x.im\_m = abs(x_46_im); x.im\_s = sign(x_46_im) * abs(1.0); function tmp = code(x_46_im_s, x_46_re, x_46_im_m) tmp = x_46_im_s * -3.0; end
x.im\_m = N[Abs[x$46$im], $MachinePrecision]
x.im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$im$95$s_, x$46$re_, x$46$im$95$m_] := N[(x$46$im$95$s * -3.0), $MachinePrecision]
\begin{array}{l}
x.im\_m = \left|x.im\right|
\\
x.im\_s = \mathsf{copysign}\left(1, x.im\right)
\\
x.im\_s \cdot -3
\end{array}
Initial program 82.4%
Taylor expanded in x.re around 0 67.5%
Simplified22.1%
*-commutative86.3%
count-286.3%
*-commutative86.3%
Applied egg-rr22.1%
Taylor expanded in x.re around 0 2.8%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - 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_46im) * (2.0d0 * x_46re)) + ((x_46im * (x_46re - 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_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_im) * Float64(2.0 * x_46_re)) + Float64(Float64(x_46_im * Float64(x_46_re - x_46_im)) * Float64(x_46_re + x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im)); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(2.0 * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.im\right) \cdot \left(2 \cdot x.re\right) + \left(x.im \cdot \left(x.re - x.im\right)\right) \cdot \left(x.re + x.im\right)
\end{array}
herbie shell --seed 2024110
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:alt
(+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im)))
(+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))