
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (x_46im * x_46re)) * x_46im)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\end{array}
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<=
(-
(* x.re (- (* x.re x.re) (* x.im x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(fma
(- x.re x.im)
(* x.re (+ x.re x.im))
(* (- x.im) (* x.re (+ x.im x.im))))
(* (* x.re x.re) (- x.re x.im))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = fma((x_46_re - x_46_im), (x_46_re * (x_46_re + x_46_im)), (-x_46_im * (x_46_re * (x_46_im + x_46_im))));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = fma(Float64(x_46_re - x_46_im), Float64(x_46_re * Float64(x_46_re + x_46_im)), Float64(Float64(-x_46_im) * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision] + N[((-x$46$im) * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x.re - x.im, x.re \cdot \left(x.re + x.im\right), \left(-x.im\right) \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\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)) < +inf.0Initial program 94.4%
sqr-neg94.4%
difference-of-squares94.4%
sub-neg94.4%
associate-*l*99.8%
sub-neg99.8%
remove-double-neg99.8%
+-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-rgt-out99.8%
Simplified99.8%
cancel-sign-sub-inv99.8%
fma-def99.8%
*-commutative99.8%
Applied egg-rr99.8%
if +inf.0 < (-.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 0.0%
sqr-neg0.0%
difference-of-squares38.7%
sub-neg38.7%
associate-*l*38.7%
sub-neg38.7%
remove-double-neg38.7%
+-commutative38.7%
*-commutative38.7%
*-commutative38.7%
distribute-rgt-out38.7%
Simplified38.7%
Taylor expanded in x.re around inf 19.4%
unpow219.4%
Simplified19.4%
Taylor expanded in x.re around inf 29.0%
+-commutative29.0%
mul-1-neg29.0%
unpow229.0%
distribute-lft-neg-out29.0%
cube-mult29.0%
distribute-rgt-in80.6%
sub-neg80.6%
Simplified80.6%
Final simplification97.5%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<=
(-
(* x.re (- (* x.re x.re) (* x.im x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(- (* (- x.re x.im) (* x.re (+ x.re x.im))) (* x.im (* x.re (+ x.im x.im))))
(* (* x.re x.re) (- x.re x.im))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Double.POSITIVE_INFINITY) {
tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
} else {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if ((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= math.inf: tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im))) else: tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re * Float64(x_46_re + x_46_im))) - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im)))); else tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Inf) tmp = ((x_46_re - x_46_im) * (x_46_re * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im))); else tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.re \cdot \left(x.re + x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\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)) < +inf.0Initial program 94.4%
sqr-neg94.4%
difference-of-squares94.4%
sub-neg94.4%
associate-*l*99.8%
sub-neg99.8%
remove-double-neg99.8%
+-commutative99.8%
*-commutative99.8%
*-commutative99.8%
distribute-rgt-out99.8%
Simplified99.8%
if +inf.0 < (-.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 0.0%
sqr-neg0.0%
difference-of-squares38.7%
sub-neg38.7%
associate-*l*38.7%
sub-neg38.7%
remove-double-neg38.7%
+-commutative38.7%
*-commutative38.7%
*-commutative38.7%
distribute-rgt-out38.7%
Simplified38.7%
Taylor expanded in x.re around inf 19.4%
unpow219.4%
Simplified19.4%
Taylor expanded in x.re around inf 29.0%
+-commutative29.0%
mul-1-neg29.0%
unpow229.0%
distribute-lft-neg-out29.0%
cube-mult29.0%
distribute-rgt-in80.6%
sub-neg80.6%
Simplified80.6%
Final simplification97.5%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.05e+72) (+ (* x.re (- (* x.re x.re) (* x.im x.im))) (* x.im (* x.im (* x.re -2.0)))) (- (* (* x.re x.im) (- x.re x.im)) (* x.im (* x.re (+ x.im x.im))))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.05e+72) {
tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im * (x_46_im * (x_46_re * -2.0)));
} else {
tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= 1.05d+72) then
tmp = (x_46re * ((x_46re * x_46re) - (x_46im * x_46im))) + (x_46im * (x_46im * (x_46re * (-2.0d0))))
else
tmp = ((x_46re * x_46im) * (x_46re - x_46im)) - (x_46im * (x_46re * (x_46im + x_46im)))
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.05e+72) {
tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im * (x_46_im * (x_46_re * -2.0)));
} else {
tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 1.05e+72: tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im * (x_46_im * (x_46_re * -2.0))) else: tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im))) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 1.05e+72) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -2.0)))); else tmp = Float64(Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re - x_46_im)) - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im)))); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 1.05e+72) tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_im * (x_46_im * (x_46_re * -2.0))); else tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im))); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 1.05e+72], N[(N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(x$46$im * N[(x$46$re * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.05 \cdot 10^{+72}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.im \cdot \left(x.im \cdot \left(x.re \cdot -2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re - x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\end{array}
\end{array}
if x.im < 1.0500000000000001e72Initial program 87.8%
sqr-neg87.8%
*-commutative87.8%
fma-neg87.8%
sqr-neg87.8%
+-commutative87.8%
*-commutative87.8%
*-commutative87.8%
distribute-lft-out87.8%
associate-*r*87.8%
distribute-rgt-neg-in87.8%
distribute-neg-out87.8%
neg-mul-187.8%
neg-mul-187.8%
distribute-rgt-out87.8%
metadata-eval87.8%
Simplified87.8%
fma-udef87.8%
associate-*l*87.8%
Applied egg-rr87.8%
if 1.0500000000000001e72 < x.im Initial program 61.3%
sqr-neg61.3%
difference-of-squares72.1%
sub-neg72.1%
associate-*l*82.4%
sub-neg82.4%
remove-double-neg82.4%
+-commutative82.4%
*-commutative82.4%
*-commutative82.4%
distribute-rgt-out82.4%
Simplified82.4%
Taylor expanded in x.re around 0 82.4%
*-commutative82.4%
Simplified82.4%
Final simplification86.8%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.6e-12) (* (* x.re x.re) (- x.re x.im)) (- (* (* x.re x.im) (- x.re x.im)) (* x.im (* x.re (+ x.im x.im))))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.6e-12) {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
} else {
tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46im <= 1.6d-12) then
tmp = (x_46re * x_46re) * (x_46re - x_46im)
else
tmp = ((x_46re * x_46im) * (x_46re - x_46im)) - (x_46im * (x_46re * (x_46im + x_46im)))
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.6e-12) {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
} else {
tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 1.6e-12: tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) else: tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im))) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 1.6e-12) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); else tmp = Float64(Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re - x_46_im)) - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im)))); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 1.6e-12) tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); else tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - (x_46_im * (x_46_re * (x_46_im + x_46_im))); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 1.6e-12], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.6 \cdot 10^{-12}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re - x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\end{array}
\end{array}
if x.im < 1.6e-12Initial program 86.9%
sqr-neg86.9%
difference-of-squares90.5%
sub-neg90.5%
associate-*l*94.2%
sub-neg94.2%
remove-double-neg94.2%
+-commutative94.2%
*-commutative94.2%
*-commutative94.2%
distribute-rgt-out94.2%
Simplified94.2%
Taylor expanded in x.re around inf 77.2%
unpow277.2%
Simplified77.2%
Taylor expanded in x.re around inf 59.0%
+-commutative59.0%
mul-1-neg59.0%
unpow259.0%
distribute-lft-neg-out59.0%
cube-mult58.9%
distribute-rgt-in73.7%
sub-neg73.7%
Simplified73.7%
if 1.6e-12 < x.im Initial program 70.2%
sqr-neg70.2%
difference-of-squares78.6%
sub-neg78.6%
associate-*l*86.4%
sub-neg86.4%
remove-double-neg86.4%
+-commutative86.4%
*-commutative86.4%
*-commutative86.4%
distribute-rgt-out86.4%
Simplified86.4%
Taylor expanded in x.re around 0 83.2%
*-commutative83.2%
Simplified83.2%
Final simplification75.9%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (* x.re (+ x.im x.im)))))
(if (<= x.im 8.8e-13)
(- (* (* x.re x.re) (- x.re x.im)) t_0)
(- (* (* x.re x.im) (- x.re x.im)) t_0))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_re * (x_46_im + x_46_im));
double tmp;
if (x_46_im <= 8.8e-13) {
tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) - t_0;
} else {
tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - t_0;
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = x_46im * (x_46re * (x_46im + x_46im))
if (x_46im <= 8.8d-13) then
tmp = ((x_46re * x_46re) * (x_46re - x_46im)) - t_0
else
tmp = ((x_46re * x_46im) * (x_46re - x_46im)) - t_0
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * (x_46_re * (x_46_im + x_46_im));
double tmp;
if (x_46_im <= 8.8e-13) {
tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) - t_0;
} else {
tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - t_0;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = x_46_im * (x_46_re * (x_46_im + x_46_im)) tmp = 0 if x_46_im <= 8.8e-13: tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) - t_0 else: tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - t_0 return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im))) tmp = 0.0 if (x_46_im <= 8.8e-13) tmp = Float64(Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)) - t_0); else tmp = Float64(Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re - x_46_im)) - t_0); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_im * (x_46_re * (x_46_im + x_46_im)); tmp = 0.0; if (x_46_im <= 8.8e-13) tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) - t_0; else tmp = ((x_46_re * x_46_im) * (x_46_re - x_46_im)) - t_0; end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, 8.8e-13], N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\
\mathbf{if}\;x.im \leq 8.8 \cdot 10^{-13}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re - x.im\right) - t_0\\
\end{array}
\end{array}
if x.im < 8.79999999999999986e-13Initial program 86.9%
sqr-neg86.9%
difference-of-squares90.5%
sub-neg90.5%
associate-*l*94.2%
sub-neg94.2%
remove-double-neg94.2%
+-commutative94.2%
*-commutative94.2%
*-commutative94.2%
distribute-rgt-out94.2%
Simplified94.2%
Taylor expanded in x.re around inf 77.2%
unpow277.2%
Simplified77.2%
if 8.79999999999999986e-13 < x.im Initial program 70.2%
sqr-neg70.2%
difference-of-squares78.6%
sub-neg78.6%
associate-*l*86.4%
sub-neg86.4%
remove-double-neg86.4%
+-commutative86.4%
*-commutative86.4%
*-commutative86.4%
distribute-rgt-out86.4%
Simplified86.4%
Taylor expanded in x.re around 0 83.2%
*-commutative83.2%
Simplified83.2%
Final simplification78.6%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* x.re (- x.im)))))
(if (<= x.re -5.9e+147)
t_0
(if (<= x.re -1.08e-243)
(* x.re (* x.re x.im))
(if (<= x.re 6e+150) t_0 (* (* x.re x.re) x.im))))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_re * -x_46_im);
double tmp;
if (x_46_re <= -5.9e+147) {
tmp = t_0;
} else if (x_46_re <= -1.08e-243) {
tmp = x_46_re * (x_46_re * x_46_im);
} else if (x_46_re <= 6e+150) {
tmp = t_0;
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: t_0
real(8) :: tmp
t_0 = x_46re * (x_46re * -x_46im)
if (x_46re <= (-5.9d+147)) then
tmp = t_0
else if (x_46re <= (-1.08d-243)) then
tmp = x_46re * (x_46re * x_46im)
else if (x_46re <= 6d+150) then
tmp = t_0
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (x_46_re * -x_46_im);
double tmp;
if (x_46_re <= -5.9e+147) {
tmp = t_0;
} else if (x_46_re <= -1.08e-243) {
tmp = x_46_re * (x_46_re * x_46_im);
} else if (x_46_re <= 6e+150) {
tmp = t_0;
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): t_0 = x_46_re * (x_46_re * -x_46_im) tmp = 0 if x_46_re <= -5.9e+147: tmp = t_0 elif x_46_re <= -1.08e-243: tmp = x_46_re * (x_46_re * x_46_im) elif x_46_re <= 6e+150: tmp = t_0 else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(x_46_re * Float64(-x_46_im))) tmp = 0.0 if (x_46_re <= -5.9e+147) tmp = t_0; elseif (x_46_re <= -1.08e-243) tmp = Float64(x_46_re * Float64(x_46_re * x_46_im)); elseif (x_46_re <= 6e+150) tmp = t_0; else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_re * (x_46_re * -x_46_im); tmp = 0.0; if (x_46_re <= -5.9e+147) tmp = t_0; elseif (x_46_re <= -1.08e-243) tmp = x_46_re * (x_46_re * x_46_im); elseif (x_46_re <= 6e+150) tmp = t_0; else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5.9e+147], t$95$0, If[LessEqual[x$46$re, -1.08e-243], N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6e+150], t$95$0, N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\mathbf{if}\;x.re \leq -5.9 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -1.08 \cdot 10^{-243}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im\right)\\
\mathbf{elif}\;x.re \leq 6 \cdot 10^{+150}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.re < -5.9000000000000001e147 or -1.08e-243 < x.re < 6.00000000000000025e150Initial program 79.7%
sqr-neg79.7%
difference-of-squares83.3%
sub-neg83.3%
associate-*l*90.6%
sub-neg90.6%
remove-double-neg90.6%
+-commutative90.6%
*-commutative90.6%
*-commutative90.6%
distribute-rgt-out90.6%
Simplified90.6%
Taylor expanded in x.re around inf 67.1%
unpow267.1%
Simplified67.1%
Taylor expanded in x.re around inf 51.1%
+-commutative51.1%
mul-1-neg51.1%
unpow251.1%
distribute-lft-neg-out51.1%
cube-mult51.0%
distribute-rgt-in65.9%
sub-neg65.9%
Simplified65.9%
Taylor expanded in x.re around 0 34.8%
Simplified31.5%
if -5.9000000000000001e147 < x.re < -1.08e-243Initial program 96.3%
sqr-neg96.3%
difference-of-squares96.3%
sub-neg96.3%
associate-*l*98.5%
sub-neg98.5%
remove-double-neg98.5%
+-commutative98.5%
*-commutative98.5%
*-commutative98.5%
distribute-rgt-out98.5%
Simplified98.5%
Taylor expanded in x.re around 0 67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in x.re around inf 19.7%
unpow219.7%
Simplified19.7%
Taylor expanded in x.im around 0 19.7%
unpow219.7%
*-commutative19.7%
associate-*l*19.7%
Simplified19.7%
if 6.00000000000000025e150 < x.re Initial program 66.7%
sqr-neg66.7%
difference-of-squares86.1%
sub-neg86.1%
associate-*l*86.1%
sub-neg86.1%
remove-double-neg86.1%
+-commutative86.1%
*-commutative86.1%
*-commutative86.1%
distribute-rgt-out86.1%
Simplified86.1%
Taylor expanded in x.re around 0 41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in x.re around inf 41.7%
unpow241.7%
Simplified41.7%
Final simplification29.3%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -7.8e-86) (not (<= x.re 1.05e+14))) (* (* x.re x.re) (- x.re x.im)) (* x.im (* x.im (* x.re -3.0)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7.8e-86) || !(x_46_re <= 1.05e+14)) {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if ((x_46re <= (-7.8d-86)) .or. (.not. (x_46re <= 1.05d+14))) then
tmp = (x_46re * x_46re) * (x_46re - x_46im)
else
tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7.8e-86) || !(x_46_re <= 1.05e+14)) {
tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im);
} else {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -7.8e-86) or not (x_46_re <= 1.05e+14): tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im) else: tmp = x_46_im * (x_46_im * (x_46_re * -3.0)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -7.8e-86) || !(x_46_re <= 1.05e+14)) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0))); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -7.8e-86) || ~((x_46_re <= 1.05e+14))) tmp = (x_46_re * x_46_re) * (x_46_re - x_46_im); else tmp = x_46_im * (x_46_im * (x_46_re * -3.0)); end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -7.8e-86], N[Not[LessEqual[x$46$re, 1.05e+14]], $MachinePrecision]], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.8 \cdot 10^{-86} \lor \neg \left(x.re \leq 1.05 \cdot 10^{+14}\right):\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.re < -7.8000000000000003e-86 or 1.05e14 < x.re Initial program 79.3%
sqr-neg79.3%
difference-of-squares87.3%
sub-neg87.3%
associate-*l*87.3%
sub-neg87.3%
remove-double-neg87.3%
+-commutative87.3%
*-commutative87.3%
*-commutative87.3%
distribute-rgt-out87.3%
Simplified87.3%
Taylor expanded in x.re around inf 77.7%
unpow277.7%
Simplified77.7%
Taylor expanded in x.re around inf 57.2%
+-commutative57.2%
mul-1-neg57.2%
unpow257.2%
distribute-lft-neg-out57.2%
cube-mult57.1%
distribute-rgt-in83.8%
sub-neg83.8%
Simplified83.8%
if -7.8000000000000003e-86 < x.re < 1.05e14Initial program 88.3%
sqr-neg88.3%
difference-of-squares88.3%
sub-neg88.3%
associate-*l*99.7%
sub-neg99.7%
remove-double-neg99.7%
+-commutative99.7%
*-commutative99.7%
*-commutative99.7%
distribute-rgt-out99.7%
Simplified99.7%
cancel-sign-sub-inv99.7%
fma-def99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x.re around 0 82.1%
distribute-rgt-out82.1%
metadata-eval82.1%
associate-*r*82.1%
*-commutative82.1%
associate-*r*82.1%
unpow282.1%
metadata-eval82.1%
distribute-rgt-out--82.1%
associate-*l*93.4%
distribute-rgt-out--93.4%
metadata-eval93.4%
Simplified93.4%
Final simplification87.8%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -1.75e+146)
(* x.re (* x.re (- x.im)))
(if (<= x.re 1.5e+152)
(* x.im (* x.im (* x.re -3.0)))
(* (* x.re x.re) x.im))))x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.75e+146) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else if (x_46_re <= 1.5e+152) {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8) :: tmp
if (x_46re <= (-1.75d+146)) then
tmp = x_46re * (x_46re * -x_46im)
else if (x_46re <= 1.5d+152) then
tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
else
tmp = (x_46re * x_46re) * x_46im
end if
code = tmp
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.75e+146) {
tmp = x_46_re * (x_46_re * -x_46_im);
} else if (x_46_re <= 1.5e+152) {
tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
} else {
tmp = (x_46_re * x_46_re) * x_46_im;
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -1.75e+146: tmp = x_46_re * (x_46_re * -x_46_im) elif x_46_re <= 1.5e+152: tmp = x_46_im * (x_46_im * (x_46_re * -3.0)) else: tmp = (x_46_re * x_46_re) * x_46_im return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -1.75e+146) tmp = Float64(x_46_re * Float64(x_46_re * Float64(-x_46_im))); elseif (x_46_re <= 1.5e+152) tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0))); else tmp = Float64(Float64(x_46_re * x_46_re) * x_46_im); end return tmp end
x.im = abs(x.im) function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -1.75e+146) tmp = x_46_re * (x_46_re * -x_46_im); elseif (x_46_re <= 1.5e+152) tmp = x_46_im * (x_46_im * (x_46_re * -3.0)); else tmp = (x_46_re * x_46_re) * x_46_im; end tmp_2 = tmp; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -1.75e+146], N[(x$46$re * N[(x$46$re * (-x$46$im)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.5e+152], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.75 \cdot 10^{+146}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(-x.im\right)\right)\\
\mathbf{elif}\;x.re \leq 1.5 \cdot 10^{+152}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.re < -1.7500000000000001e146Initial program 52.6%
sqr-neg52.6%
difference-of-squares65.8%
sub-neg65.8%
associate-*l*65.8%
sub-neg65.8%
remove-double-neg65.8%
+-commutative65.8%
*-commutative65.8%
*-commutative65.8%
distribute-rgt-out65.8%
Simplified65.8%
Taylor expanded in x.re around inf 60.5%
unpow260.5%
Simplified60.5%
Taylor expanded in x.re around inf 42.1%
+-commutative42.1%
mul-1-neg42.1%
unpow242.1%
distribute-lft-neg-out42.1%
cube-mult42.1%
distribute-rgt-in94.7%
sub-neg94.7%
Simplified94.7%
Taylor expanded in x.re around 0 47.4%
Simplified35.2%
if -1.7500000000000001e146 < x.re < 1.49999999999999995e152Initial program 92.6%
sqr-neg92.6%
difference-of-squares92.6%
sub-neg92.6%
associate-*l*99.2%
sub-neg99.2%
remove-double-neg99.2%
+-commutative99.2%
*-commutative99.2%
*-commutative99.2%
distribute-rgt-out99.2%
Simplified99.2%
cancel-sign-sub-inv99.2%
fma-def99.2%
*-commutative99.2%
Applied egg-rr99.2%
Taylor expanded in x.re around 0 64.2%
distribute-rgt-out64.2%
metadata-eval64.2%
associate-*r*64.2%
*-commutative64.2%
associate-*r*64.3%
unpow264.3%
metadata-eval64.3%
distribute-rgt-out--64.3%
associate-*l*70.8%
distribute-rgt-out--70.8%
metadata-eval70.8%
Simplified70.8%
if 1.49999999999999995e152 < x.re Initial program 66.7%
sqr-neg66.7%
difference-of-squares86.1%
sub-neg86.1%
associate-*l*86.1%
sub-neg86.1%
remove-double-neg86.1%
+-commutative86.1%
*-commutative86.1%
*-commutative86.1%
distribute-rgt-out86.1%
Simplified86.1%
Taylor expanded in x.re around 0 41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in x.re around inf 41.7%
unpow241.7%
Simplified41.7%
Final simplification61.4%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (* (* x.re x.re) x.im))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
NOTE: x.im should be positive before calling this function
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (x_46re * x_46re) * x_46im
end function
x.im = Math.abs(x.im);
public static double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * x_46_im;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): return (x_46_re * x_46_re) * x_46_im
x.im = abs(x.im) function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * x_46_re) * x_46_im) end
x.im = abs(x.im) function tmp = code(x_46_re, x_46_im) tmp = (x_46_re * x_46_re) * x_46_im; end
NOTE: x.im should be positive before calling this function code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]
\begin{array}{l}
x.im = |x.im|\\
\\
\left(x.re \cdot x.re\right) \cdot x.im
\end{array}
Initial program 83.0%
sqr-neg83.0%
difference-of-squares87.7%
sub-neg87.7%
associate-*l*92.4%
sub-neg92.4%
remove-double-neg92.4%
+-commutative92.4%
*-commutative92.4%
*-commutative92.4%
distribute-rgt-out92.4%
Simplified92.4%
Taylor expanded in x.re around 0 61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in x.re around inf 29.9%
unpow229.9%
Simplified29.9%
Final simplification29.9%
(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 2023279
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))