
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (x_46im * x_46re)) * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (x_46im * x_46re)) * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
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 4.4e-105)
(* (* x.re_m x.im) (* x.im -3.0))
(if (<= x.re_m 1.8e+203)
(-
(* 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.re_m (* (+ x.re_m x.im) (+ x.re_m -27.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 <= 4.4e-105) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 1.8e+203) {
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_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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 <= 4.4d-105) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else if (x_46re_m <= 1.8d+203) 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_46re_m * ((x_46re_m + x_46im) * (x_46re_m + (-27.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 <= 4.4e-105) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 1.8e+203) {
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_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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 <= 4.4e-105: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) elif x_46_re_m <= 1.8e+203: 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_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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 <= 4.4e-105) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); elseif (x_46_re_m <= 1.8e+203) 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(Float64(x_46_re_m * Float64(Float64(x_46_re_m + x_46_im) * Float64(x_46_re_m + -27.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 <= 4.4e-105) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); elseif (x_46_re_m <= 1.8e+203) 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_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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, 4.4e-105], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re$95$m, 1.8e+203], 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[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m + x$46$im), $MachinePrecision] * N[(x$46$re$95$m + -27.0), $MachinePrecision]), $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 4.4 \cdot 10^{-105}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{elif}\;x.re\_m \leq 1.8 \cdot 10^{+203}:\\
\;\;\;\;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.re\_m \cdot \left(\left(x.re\_m + x.im\right) \cdot \left(x.re\_m + -27\right)\right) - x.im\\
\end{array}
\end{array}
if x.re < 4.40000000000000008e-105Initial program 85.5%
Simplified83.1%
associate-*r*83.2%
associate-*l*83.2%
+-commutative83.2%
associate-*r*90.3%
associate-*r*90.3%
fma-define92.0%
*-commutative92.0%
Applied egg-rr92.0%
Taylor expanded in x.im around inf 61.1%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
pow261.1%
Applied egg-rr61.1%
*-commutative61.1%
associate-*l*61.0%
associate-*l*68.2%
*-commutative68.2%
add-exp-log48.9%
add-exp-log26.8%
prod-exp26.9%
Applied egg-rr26.9%
exp-sum26.8%
rem-exp-log34.8%
*-commutative34.8%
rem-exp-log68.2%
*-commutative68.2%
Simplified68.2%
if 4.40000000000000008e-105 < x.re < 1.79999999999999991e203Initial program 98.1%
difference-of-squares99.8%
*-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
if 1.79999999999999991e203 < x.re Initial program 48.4%
*-commutative48.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr61.3%
expm1-undefine61.3%
log1p-undefine61.3%
rem-exp-log71.0%
+-commutative71.0%
associate--l+71.0%
metadata-eval71.0%
Simplified71.0%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified93.5%
Final simplification78.3%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<=
(-
(* x.re_m (- (* x.re_m x.re_m) (* x.im x.im)))
(* x.im (+ (* x.re_m x.im) (* x.re_m x.im))))
-5e-300)
(* (* x.re_m x.im) (* x.im -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 * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)))) <= -5e-300) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} 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 * ((x_46re_m * x_46re_m) - (x_46im * x_46im))) - (x_46im * ((x_46re_m * x_46im) + (x_46re_m * x_46im)))) <= (-5d-300)) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
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 * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)))) <= -5e-300) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} 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 * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)))) <= -5e-300: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) 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 (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) + Float64(x_46_re_m * x_46_im)))) <= -5e-300) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); 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 * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re_m * x_46_im) + (x_46_re_m * x_46_im)))) <= -5e-300) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); 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[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] + N[(x$46$re$95$m * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-300], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -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 \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right) - x.im \cdot \left(x.re\_m \cdot x.im + x.re\_m \cdot x.im\right) \leq -5 \cdot 10^{-300}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re\_m}^{3}\\
\end{array}
\end{array}
if (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) < -4.99999999999999996e-300Initial program 94.1%
Simplified90.0%
associate-*r*90.1%
associate-*l*90.0%
+-commutative90.0%
associate-*r*95.7%
associate-*r*95.6%
fma-define95.6%
*-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in x.im around inf 48.7%
associate-*r*48.7%
*-commutative48.7%
Simplified48.7%
pow248.7%
Applied egg-rr48.7%
*-commutative48.7%
associate-*l*48.7%
associate-*l*54.3%
*-commutative54.3%
add-exp-log27.9%
add-exp-log0.4%
prod-exp0.4%
Applied egg-rr0.4%
exp-sum0.4%
rem-exp-log24.1%
*-commutative24.1%
rem-exp-log54.3%
*-commutative54.3%
Simplified54.3%
if -4.99999999999999996e-300 < (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) Initial program 77.5%
sqr-neg77.5%
*-commutative77.5%
fma-neg77.6%
sqr-neg77.6%
*-commutative77.6%
distribute-rgt-neg-in77.6%
*-commutative77.6%
count-277.6%
Simplified77.6%
Taylor expanded in x.re around inf 72.5%
Final simplification65.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 4.7e-105)
(* (* x.re_m x.im) (* x.im -3.0))
(if (<= x.re_m 2.8e+135)
(-
(* x.re_m (- (* x.re_m x.re_m) (* x.im x.im)))
(* x.im (* (* x.re_m x.im) 2.0)))
(+ x.im (* x.re_m (* (+ x.re_m x.im) (+ x.re_m -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_re_m <= 4.7e-105) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 2.8e+135) {
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 + (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -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_46re_m <= 4.7d-105) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else if (x_46re_m <= 2.8d+135) 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 + (x_46re_m * ((x_46re_m + x_46im) * (x_46re_m + (-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_re_m <= 4.7e-105) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 2.8e+135) {
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 + (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -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_re_m <= 4.7e-105: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) elif x_46_re_m <= 2.8e+135: 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 + (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -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_re_m <= 4.7e-105) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); elseif (x_46_re_m <= 2.8e+135) 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(x_46_re_m * Float64(Float64(x_46_re_m + x_46_im) * Float64(x_46_re_m + -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_re_m <= 4.7e-105) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); elseif (x_46_re_m <= 2.8e+135) 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 + (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -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$re$95$m, 4.7e-105], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re$95$m, 2.8e+135], 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[(x$46$re$95$m * N[(N[(x$46$re$95$m + x$46$im), $MachinePrecision] * N[(x$46$re$95$m + -27.0), $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 4.7 \cdot 10^{-105}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{elif}\;x.re\_m \leq 2.8 \cdot 10^{+135}:\\
\;\;\;\;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 + x.re\_m \cdot \left(\left(x.re\_m + x.im\right) \cdot \left(x.re\_m + -27\right)\right)\\
\end{array}
\end{array}
if x.re < 4.69999999999999986e-105Initial program 85.5%
Simplified83.1%
associate-*r*83.2%
associate-*l*83.2%
+-commutative83.2%
associate-*r*90.3%
associate-*r*90.3%
fma-define92.0%
*-commutative92.0%
Applied egg-rr92.0%
Taylor expanded in x.im around inf 61.1%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
pow261.1%
Applied egg-rr61.1%
*-commutative61.1%
associate-*l*61.0%
associate-*l*68.2%
*-commutative68.2%
add-exp-log48.9%
add-exp-log26.8%
prod-exp26.9%
Applied egg-rr26.9%
exp-sum26.8%
rem-exp-log34.8%
*-commutative34.8%
rem-exp-log68.2%
*-commutative68.2%
Simplified68.2%
if 4.69999999999999986e-105 < x.re < 2.80000000000000002e135Initial program 99.8%
Taylor expanded in x.re around 0 99.8%
if 2.80000000000000002e135 < x.re Initial program 58.5%
*-commutative58.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr75.6%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified92.7%
Final simplification77.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 5.4e-101)
(* (* x.re_m x.im) (* x.im -3.0))
(if (<= x.re_m 3.4e+145)
(+ (* x.re_m (- (* x.re_m x.re_m) (* x.im x.im))) (* x.im 0.0))
(- (* x.re_m (* (+ x.re_m x.im) (+ x.re_m -27.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 <= 5.4e-101) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 3.4e+145) {
tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + (x_46_im * 0.0);
} else {
tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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 <= 5.4d-101) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else if (x_46re_m <= 3.4d+145) then
tmp = (x_46re_m * ((x_46re_m * x_46re_m) - (x_46im * x_46im))) + (x_46im * 0.0d0)
else
tmp = (x_46re_m * ((x_46re_m + x_46im) * (x_46re_m + (-27.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 <= 5.4e-101) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 3.4e+145) {
tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + (x_46_im * 0.0);
} else {
tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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 <= 5.4e-101: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) elif x_46_re_m <= 3.4e+145: tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + (x_46_im * 0.0) else: tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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 <= 5.4e-101) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); elseif (x_46_re_m <= 3.4e+145) 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 * 0.0)); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m + x_46_im) * Float64(x_46_re_m + -27.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 <= 5.4e-101) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); elseif (x_46_re_m <= 3.4e+145) tmp = (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) + (x_46_im * 0.0); else tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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, 5.4e-101], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re$95$m, 3.4e+145], 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 * 0.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m + x$46$im), $MachinePrecision] * N[(x$46$re$95$m + -27.0), $MachinePrecision]), $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 5.4 \cdot 10^{-101}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{elif}\;x.re\_m \leq 3.4 \cdot 10^{+145}:\\
\;\;\;\;x.re\_m \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right) + x.im \cdot 0\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m + x.im\right) \cdot \left(x.re\_m + -27\right)\right) - x.im\\
\end{array}
\end{array}
if x.re < 5.4000000000000003e-101Initial program 85.5%
Simplified83.1%
associate-*r*83.2%
associate-*l*83.2%
+-commutative83.2%
associate-*r*90.3%
associate-*r*90.3%
fma-define92.0%
*-commutative92.0%
Applied egg-rr92.0%
Taylor expanded in x.im around inf 61.1%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
pow261.1%
Applied egg-rr61.1%
*-commutative61.1%
associate-*l*61.0%
associate-*l*68.2%
*-commutative68.2%
add-exp-log48.9%
add-exp-log26.8%
prod-exp26.9%
Applied egg-rr26.9%
exp-sum26.8%
rem-exp-log34.8%
*-commutative34.8%
rem-exp-log68.2%
*-commutative68.2%
Simplified68.2%
if 5.4000000000000003e-101 < x.re < 3.3999999999999999e145Initial program 99.8%
*-commutative99.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr88.8%
if 3.3999999999999999e145 < x.re Initial program 57.5%
*-commutative57.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr67.5%
expm1-undefine67.5%
log1p-undefine67.5%
rem-exp-log75.0%
+-commutative75.0%
associate--l+75.0%
metadata-eval75.0%
Simplified75.0%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified92.5%
Final simplification75.8%
x.re\_m = (fabs.f64 x.re)
x.re\_s = (copysign.f64 #s(literal 1 binary64) x.re)
(FPCore (x.re_s x.re_m x.im)
:precision binary64
(*
x.re_s
(if (<= x.re_m 1.85e-16)
(* (* x.re_m x.im) (* x.im -3.0))
(if (<= x.re_m 3.4e+145)
(+ x.im (* x.re_m (- (* x.re_m x.re_m) (* x.im x.im))))
(- (* x.re_m (* (+ x.re_m x.im) (+ x.re_m -27.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.85e-16) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 3.4e+145) {
tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im)));
} else {
tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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.85d-16) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else if (x_46re_m <= 3.4d+145) then
tmp = x_46im + (x_46re_m * ((x_46re_m * x_46re_m) - (x_46im * x_46im)))
else
tmp = (x_46re_m * ((x_46re_m + x_46im) * (x_46re_m + (-27.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.85e-16) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 3.4e+145) {
tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im)));
} else {
tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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.85e-16: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) elif x_46_re_m <= 3.4e+145: tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) else: tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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.85e-16) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); elseif (x_46_re_m <= 3.4e+145) tmp = Float64(x_46_im + Float64(x_46_re_m * Float64(Float64(x_46_re_m * x_46_re_m) - Float64(x_46_im * x_46_im)))); else tmp = Float64(Float64(x_46_re_m * Float64(Float64(x_46_re_m + x_46_im) * Float64(x_46_re_m + -27.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.85e-16) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); elseif (x_46_re_m <= 3.4e+145) tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))); else tmp = (x_46_re_m * ((x_46_re_m + x_46_im) * (x_46_re_m + -27.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.85e-16], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re$95$m, 3.4e+145], N[(x$46$im + 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]), $MachinePrecision], N[(N[(x$46$re$95$m * N[(N[(x$46$re$95$m + x$46$im), $MachinePrecision] * N[(x$46$re$95$m + -27.0), $MachinePrecision]), $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 1.85 \cdot 10^{-16}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{elif}\;x.re\_m \leq 3.4 \cdot 10^{+145}:\\
\;\;\;\;x.im + x.re\_m \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re\_m \cdot \left(\left(x.re\_m + x.im\right) \cdot \left(x.re\_m + -27\right)\right) - x.im\\
\end{array}
\end{array}
if x.re < 1.85e-16Initial program 86.4%
Simplified84.1%
associate-*r*84.2%
associate-*l*84.2%
+-commutative84.2%
associate-*r*90.9%
associate-*r*90.8%
fma-define92.5%
*-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in x.im around inf 60.8%
associate-*r*60.8%
*-commutative60.8%
Simplified60.8%
pow260.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-*l*60.7%
associate-*l*67.4%
*-commutative67.4%
add-exp-log47.6%
add-exp-log25.2%
prod-exp25.3%
Applied egg-rr25.3%
exp-sum25.2%
rem-exp-log34.3%
*-commutative34.3%
rem-exp-log67.4%
*-commutative67.4%
Simplified67.4%
if 1.85e-16 < x.re < 3.3999999999999999e145Initial program 99.8%
*-commutative99.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr96.7%
if 3.3999999999999999e145 < x.re Initial program 57.5%
*-commutative57.5%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr67.5%
expm1-undefine67.5%
log1p-undefine67.5%
rem-exp-log75.0%
+-commutative75.0%
associate--l+75.0%
metadata-eval75.0%
Simplified75.0%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified92.5%
Final simplification75.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.85e-16)
(* (* x.re_m x.im) (* x.im -3.0))
(if (<= x.re_m 1.35e+154)
(+ x.im (* x.re_m (- (* x.re_m x.re_m) (* x.im x.im))))
(* x.im (+ (* x.re_m (- x.re_m 27.0)) -1.0))))))x.re\_m = fabs(x_46_re);
x.re\_s = copysign(1.0, x_46_re);
double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.85e-16) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 1.35e+154) {
tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im)));
} else {
tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.0);
}
return x_46_re_s * tmp;
}
x.re\_m = abs(x_46re)
x.re\_s = copysign(1.0d0, x_46re)
real(8) function code(x_46re_s, x_46re_m, x_46im)
real(8), intent (in) :: x_46re_s
real(8), intent (in) :: x_46re_m
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re_m <= 1.85d-16) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else if (x_46re_m <= 1.35d+154) then
tmp = x_46im + (x_46re_m * ((x_46re_m * x_46re_m) - (x_46im * x_46im)))
else
tmp = x_46im * ((x_46re_m * (x_46re_m - 27.0d0)) + (-1.0d0))
end if
code = x_46re_s * tmp
end function
x.re\_m = Math.abs(x_46_re);
x.re\_s = Math.copySign(1.0, x_46_re);
public static double code(double x_46_re_s, double x_46_re_m, double x_46_im) {
double tmp;
if (x_46_re_m <= 1.85e-16) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else if (x_46_re_m <= 1.35e+154) {
tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im)));
} else {
tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.0);
}
return x_46_re_s * tmp;
}
x.re\_m = math.fabs(x_46_re) x.re\_s = math.copysign(1.0, x_46_re) def code(x_46_re_s, x_46_re_m, x_46_im): tmp = 0 if x_46_re_m <= 1.85e-16: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) elif x_46_re_m <= 1.35e+154: tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))) else: tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.0) return x_46_re_s * tmp
x.re\_m = abs(x_46_re) x.re\_s = copysign(1.0, x_46_re) function code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0 if (x_46_re_m <= 1.85e-16) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); elseif (x_46_re_m <= 1.35e+154) tmp = Float64(x_46_im + Float64(x_46_re_m * Float64(Float64(x_46_re_m * x_46_re_m) - Float64(x_46_im * x_46_im)))); else tmp = Float64(x_46_im * Float64(Float64(x_46_re_m * Float64(x_46_re_m - 27.0)) + -1.0)); end return Float64(x_46_re_s * tmp) end
x.re\_m = abs(x_46_re); x.re\_s = sign(x_46_re) * abs(1.0); function tmp_2 = code(x_46_re_s, x_46_re_m, x_46_im) tmp = 0.0; if (x_46_re_m <= 1.85e-16) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); elseif (x_46_re_m <= 1.35e+154) tmp = x_46_im + (x_46_re_m * ((x_46_re_m * x_46_re_m) - (x_46_im * x_46_im))); else tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.0); end tmp_2 = x_46_re_s * tmp; end
x.re\_m = N[Abs[x$46$re], $MachinePrecision]
x.re\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x$46$re]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$46$re$95$s_, x$46$re$95$m_, x$46$im_] := N[(x$46$re$95$s * If[LessEqual[x$46$re$95$m, 1.85e-16], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re$95$m, 1.35e+154], N[(x$46$im + 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]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re$95$m * N[(x$46$re$95$m - 27.0), $MachinePrecision]), $MachinePrecision] + -1.0), $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.85 \cdot 10^{-16}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{elif}\;x.re\_m \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;x.im + x.re\_m \cdot \left(x.re\_m \cdot x.re\_m - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m - 27\right) + -1\right)\\
\end{array}
\end{array}
if x.re < 1.85e-16Initial program 86.4%
Simplified84.1%
associate-*r*84.2%
associate-*l*84.2%
+-commutative84.2%
associate-*r*90.9%
associate-*r*90.8%
fma-define92.5%
*-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in x.im around inf 60.8%
associate-*r*60.8%
*-commutative60.8%
Simplified60.8%
pow260.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-*l*60.7%
associate-*l*67.4%
*-commutative67.4%
add-exp-log47.6%
add-exp-log25.2%
prod-exp25.3%
Applied egg-rr25.3%
exp-sum25.2%
rem-exp-log34.3%
*-commutative34.3%
rem-exp-log67.4%
*-commutative67.4%
Simplified67.4%
if 1.85e-16 < x.re < 1.35000000000000003e154Initial program 99.8%
*-commutative99.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr96.8%
if 1.35000000000000003e154 < x.re Initial program 56.4%
*-commutative56.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr66.7%
expm1-undefine66.7%
log1p-undefine66.7%
rem-exp-log74.4%
+-commutative74.4%
associate--l+74.4%
metadata-eval74.4%
Simplified74.4%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified92.3%
Taylor expanded in x.im around inf 48.7%
Final simplification68.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 2.55e-15)
(* (* x.re_m x.im) (* x.im -3.0))
(if (<= x.re_m 1.35e+154)
(- (* x.re_m (- (* x.re_m x.re_m) (* x.im x.im))) x.im)
(* x.im (+ (* x.re_m (- x.re_m 27.0)) -1.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.55e-15) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else 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;
} else {
tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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.55d-15) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else if (x_46re_m <= 1.35d+154) then
tmp = (x_46re_m * ((x_46re_m * x_46re_m) - (x_46im * x_46im))) - x_46im
else
tmp = x_46im * ((x_46re_m * (x_46re_m - 27.0d0)) + (-1.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.55e-15) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else 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;
} else {
tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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.55e-15: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) elif 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 else: tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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.55e-15) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); elseif (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))) - x_46_im); else tmp = Float64(x_46_im * Float64(Float64(x_46_re_m * Float64(x_46_re_m - 27.0)) + -1.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.55e-15) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); elseif (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; else tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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.55e-15], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], 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] - x$46$im), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re$95$m * N[(x$46$re$95$m - 27.0), $MachinePrecision]), $MachinePrecision] + -1.0), $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.55 \cdot 10^{-15}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{elif}\;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\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m - 27\right) + -1\right)\\
\end{array}
\end{array}
if x.re < 2.55e-15Initial program 86.4%
Simplified84.1%
associate-*r*84.2%
associate-*l*84.2%
+-commutative84.2%
associate-*r*90.9%
associate-*r*90.8%
fma-define92.5%
*-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in x.im around inf 60.8%
associate-*r*60.8%
*-commutative60.8%
Simplified60.8%
pow260.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-*l*60.7%
associate-*l*67.4%
*-commutative67.4%
add-exp-log47.6%
add-exp-log25.2%
prod-exp25.3%
Applied egg-rr25.3%
exp-sum25.2%
rem-exp-log34.3%
*-commutative34.3%
rem-exp-log67.4%
*-commutative67.4%
Simplified67.4%
if 2.55e-15 < x.re < 1.35000000000000003e154Initial program 99.8%
*-commutative99.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr64.8%
expm1-undefine64.8%
log1p-undefine64.8%
rem-exp-log96.8%
+-commutative96.8%
associate--l+96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in x.im around 0 96.8%
if 1.35000000000000003e154 < x.re Initial program 56.4%
*-commutative56.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr66.7%
expm1-undefine66.7%
log1p-undefine66.7%
rem-exp-log74.4%
+-commutative74.4%
associate--l+74.4%
metadata-eval74.4%
Simplified74.4%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified92.3%
Taylor expanded in x.im around inf 48.7%
Final simplification68.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 3.1e+159)
(* (* x.re_m x.im) (* x.im -3.0))
(* x.im (+ (* x.re_m (- x.re_m 27.0)) -1.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 <= 3.1e+159) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else {
tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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 <= 3.1d+159) then
tmp = (x_46re_m * x_46im) * (x_46im * (-3.0d0))
else
tmp = x_46im * ((x_46re_m * (x_46re_m - 27.0d0)) + (-1.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 <= 3.1e+159) {
tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0);
} else {
tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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 <= 3.1e+159: tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0) else: tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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 <= 3.1e+159) tmp = Float64(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.0)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re_m * Float64(x_46_re_m - 27.0)) + -1.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 <= 3.1e+159) tmp = (x_46_re_m * x_46_im) * (x_46_im * -3.0); else tmp = x_46_im * ((x_46_re_m * (x_46_re_m - 27.0)) + -1.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, 3.1e+159], N[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re$95$m * N[(x$46$re$95$m - 27.0), $MachinePrecision]), $MachinePrecision] + -1.0), $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 3.1 \cdot 10^{+159}:\\
\;\;\;\;\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re\_m \cdot \left(x.re\_m - 27\right) + -1\right)\\
\end{array}
\end{array}
if x.re < 3.0999999999999998e159Initial program 88.7%
Simplified85.1%
associate-*r*85.1%
associate-*l*85.1%
+-commutative85.1%
associate-*r*90.6%
associate-*r*90.6%
fma-define92.0%
*-commutative92.0%
Applied egg-rr92.0%
Taylor expanded in x.im around inf 58.6%
associate-*r*58.6%
*-commutative58.6%
Simplified58.6%
pow258.6%
Applied egg-rr58.6%
*-commutative58.6%
associate-*l*58.5%
associate-*l*64.1%
*-commutative64.1%
add-exp-log43.4%
add-exp-log20.8%
prod-exp20.8%
Applied egg-rr20.8%
exp-sum20.8%
rem-exp-log32.5%
*-commutative32.5%
rem-exp-log64.1%
*-commutative64.1%
Simplified64.1%
if 3.0999999999999998e159 < x.re Initial program 56.4%
*-commutative56.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr66.7%
expm1-undefine66.7%
log1p-undefine66.7%
rem-exp-log74.4%
+-commutative74.4%
associate--l+74.4%
metadata-eval74.4%
Simplified74.4%
difference-of-squares100.0%
+-commutative100.0%
Applied egg-rr100.0%
Simplified92.3%
Taylor expanded in x.im around inf 48.7%
Final simplification61.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 (* (* x.re_m x.im) (* x.im -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) {
return x_46_re_s * ((x_46_re_m * x_46_im) * (x_46_im * -3.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_46re_m * x_46im) * (x_46im * (-3.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_re_m * x_46_im) * (x_46_im * -3.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_re_m * x_46_im) * (x_46_im * -3.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(Float64(x_46_re_m * x_46_im) * Float64(x_46_im * -3.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_re_m * x_46_im) * (x_46_im * -3.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[(N[(x$46$re$95$m * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $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(\left(x.re\_m \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\right)
\end{array}
Initial program 83.8%
Simplified80.7%
associate-*r*80.8%
associate-*l*80.7%
+-commutative80.7%
associate-*r*85.4%
associate-*r*85.4%
fma-define87.3%
*-commutative87.3%
Applied egg-rr87.3%
Taylor expanded in x.im around inf 50.9%
associate-*r*50.9%
*-commutative50.9%
Simplified50.9%
pow250.9%
Applied egg-rr50.9%
*-commutative50.9%
associate-*l*50.9%
associate-*l*55.5%
*-commutative55.5%
add-exp-log38.0%
add-exp-log17.6%
prod-exp17.7%
Applied egg-rr17.7%
exp-sum17.6%
rem-exp-log27.6%
*-commutative27.6%
rem-exp-log55.5%
*-commutative55.5%
Simplified55.5%
Final simplification55.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 (* x.re_m (* (* x.im x.im) -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) {
return x_46_re_s * (x_46_re_m * ((x_46_im * x_46_im) * -3.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_46re_m * ((x_46im * x_46im) * (-3.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_re_m * ((x_46_im * x_46_im) * -3.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_re_m * ((x_46_im * x_46_im) * -3.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_re_m * Float64(Float64(x_46_im * x_46_im) * -3.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_re_m * ((x_46_im * x_46_im) * -3.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$re$95$m * N[(N[(x$46$im * x$46$im), $MachinePrecision] * -3.0), $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.re\_m \cdot \left(\left(x.im \cdot x.im\right) \cdot -3\right)\right)
\end{array}
Initial program 83.8%
Simplified80.7%
associate-*r*80.8%
associate-*l*80.7%
+-commutative80.7%
associate-*r*85.4%
associate-*r*85.4%
fma-define87.3%
*-commutative87.3%
Applied egg-rr87.3%
Taylor expanded in x.im around inf 50.9%
associate-*r*50.9%
*-commutative50.9%
Simplified50.9%
pow250.9%
Applied egg-rr50.9%
Final simplification50.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 (- 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 * -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 * -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 * -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 * -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(-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 * -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 * (-x$46$im)), $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\right)
\end{array}
Initial program 83.8%
*-commutative83.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
distribute-neg-frac0.0%
Applied egg-rr0.0%
Applied egg-rr41.9%
expm1-undefine61.4%
log1p-undefine61.4%
rem-exp-log73.6%
+-commutative73.6%
associate--l+54.1%
metadata-eval54.1%
Simplified54.1%
difference-of-squares60.3%
+-commutative60.3%
Applied egg-rr60.3%
Simplified45.1%
Taylor expanded in x.re around 0 3.6%
neg-mul-13.6%
Simplified3.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 2024145
(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)))