
(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}
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(x_46_im * Float64(x_46_re * Float64(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), x.im \cdot \left(x.re \cdot \left(\left(-x.im\right) - 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%
unpow329.0%
mul-1-neg29.0%
unpow229.0%
distribute-rgt-neg-in29.0%
distribute-lft-in80.6%
sub-neg80.6%
*-commutative80.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%
unpow329.0%
mul-1-neg29.0%
unpow229.0%
distribute-rgt-neg-in29.0%
distribute-lft-in80.6%
sub-neg80.6%
*-commutative80.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 7.8e+153) (* x.re (+ (* x.re x.re) (* (* x.im x.im) -3.0))) (- (* x.im (* x.re (- (- x.im) x.im))) (* x.im (* x.re x.im)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 7.8e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0));
} else {
tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (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_46im <= 7.8d+153) then
tmp = x_46re * ((x_46re * x_46re) + ((x_46im * x_46im) * (-3.0d0)))
else
tmp = (x_46im * (x_46re * (-x_46im - x_46im))) - (x_46im * (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_im <= 7.8e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0));
} else {
tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (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_im <= 7.8e+153: tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0)) else: tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (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_im <= 7.8e+153) tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) + Float64(Float64(x_46_im * x_46_im) * -3.0))); else tmp = Float64(Float64(x_46_im * Float64(x_46_re * Float64(Float64(-x_46_im) - x_46_im))) - Float64(x_46_im * 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_im <= 7.8e+153) tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0)); else tmp = (x_46_im * (x_46_re * (-x_46_im - x_46_im))) - (x_46_im * (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$im, 7.8e+153], N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(N[(x$46$im * x$46$im), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * N[(x$46$re * N[((-x$46$im) - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 7.8 \cdot 10^{+153}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re + \left(x.im \cdot x.im\right) \cdot -3\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(\left(-x.im\right) - x.im\right)\right) - x.im \cdot \left(x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.im < 7.79999999999999966e153Initial program 88.0%
sqr-neg88.0%
difference-of-squares91.1%
sub-neg91.1%
associate-*l*94.4%
sub-neg94.4%
remove-double-neg94.4%
+-commutative94.4%
*-commutative94.4%
*-commutative94.4%
distribute-rgt-out94.4%
Simplified94.4%
cancel-sign-sub-inv94.4%
fma-def94.4%
*-commutative94.4%
Applied egg-rr94.4%
fma-udef94.4%
Applied egg-rr94.4%
cancel-sign-sub-inv94.4%
associate-*r*94.4%
*-commutative94.4%
associate-*r*91.1%
count-291.1%
associate-*r*91.1%
cancel-sign-sub-inv91.1%
*-commutative91.1%
associate-*r*91.1%
distribute-rgt-out95.1%
+-commutative95.1%
distribute-lft-neg-in95.1%
metadata-eval95.1%
Simplified95.1%
distribute-lft-in91.1%
*-commutative91.1%
+-commutative91.1%
difference-of-squares88.0%
associate-*r*88.0%
Applied egg-rr88.0%
associate-*l*88.0%
distribute-lft-in92.0%
unpow292.0%
sub-neg92.0%
mul-1-neg92.0%
unpow292.0%
associate-+r+92.0%
unpow292.0%
distribute-rgt-out92.0%
metadata-eval92.0%
*-commutative92.0%
unpow292.0%
unpow292.0%
unpow292.0%
Simplified92.0%
if 7.79999999999999966e153 < x.im Initial program 49.3%
sqr-neg49.3%
difference-of-squares64.4%
sub-neg64.4%
associate-*l*78.7%
sub-neg78.7%
remove-double-neg78.7%
+-commutative78.7%
*-commutative78.7%
*-commutative78.7%
distribute-rgt-out78.7%
Simplified78.7%
Taylor expanded in x.re around 0 64.4%
associate-*r*64.4%
mul-1-neg64.4%
unpow264.4%
Simplified64.4%
Taylor expanded in x.re around 0 64.4%
unpow264.4%
associate-*r*64.4%
neg-mul-164.4%
associate-*r*78.7%
*-commutative78.7%
distribute-lft-neg-out78.7%
*-commutative78.7%
Simplified78.7%
Final simplification90.3%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 7.8e+153) (* x.re (+ (* x.re x.re) (* (* x.im x.im) -3.0))) (* (* x.re x.im) (* x.im -3.0))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 7.8e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0));
} else {
tmp = (x_46_re * x_46_im) * (x_46_im * -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_46im <= 7.8d+153) then
tmp = x_46re * ((x_46re * x_46re) + ((x_46im * x_46im) * (-3.0d0)))
else
tmp = (x_46re * x_46im) * (x_46im * (-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_im <= 7.8e+153) {
tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0));
} else {
tmp = (x_46_re * x_46_im) * (x_46_im * -3.0);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 7.8e+153: tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0)) else: tmp = (x_46_re * x_46_im) * (x_46_im * -3.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 7.8e+153) tmp = Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) + Float64(Float64(x_46_im * x_46_im) * -3.0))); else tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_im * -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_im <= 7.8e+153) tmp = x_46_re * ((x_46_re * x_46_re) + ((x_46_im * x_46_im) * -3.0)); else tmp = (x_46_re * x_46_im) * (x_46_im * -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[LessEqual[x$46$im, 7.8e+153], N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(N[(x$46$im * x$46$im), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 7.8 \cdot 10^{+153}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re + \left(x.im \cdot x.im\right) \cdot -3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\end{array}
\end{array}
if x.im < 7.79999999999999966e153Initial program 88.0%
sqr-neg88.0%
difference-of-squares91.1%
sub-neg91.1%
associate-*l*94.4%
sub-neg94.4%
remove-double-neg94.4%
+-commutative94.4%
*-commutative94.4%
*-commutative94.4%
distribute-rgt-out94.4%
Simplified94.4%
cancel-sign-sub-inv94.4%
fma-def94.4%
*-commutative94.4%
Applied egg-rr94.4%
fma-udef94.4%
Applied egg-rr94.4%
cancel-sign-sub-inv94.4%
associate-*r*94.4%
*-commutative94.4%
associate-*r*91.1%
count-291.1%
associate-*r*91.1%
cancel-sign-sub-inv91.1%
*-commutative91.1%
associate-*r*91.1%
distribute-rgt-out95.1%
+-commutative95.1%
distribute-lft-neg-in95.1%
metadata-eval95.1%
Simplified95.1%
distribute-lft-in91.1%
*-commutative91.1%
+-commutative91.1%
difference-of-squares88.0%
associate-*r*88.0%
Applied egg-rr88.0%
associate-*l*88.0%
distribute-lft-in92.0%
unpow292.0%
sub-neg92.0%
mul-1-neg92.0%
unpow292.0%
associate-+r+92.0%
unpow292.0%
distribute-rgt-out92.0%
metadata-eval92.0%
*-commutative92.0%
unpow292.0%
unpow292.0%
unpow292.0%
Simplified92.0%
if 7.79999999999999966e153 < x.im Initial program 49.3%
sqr-neg49.3%
difference-of-squares64.4%
sub-neg64.4%
associate-*l*78.7%
sub-neg78.7%
remove-double-neg78.7%
+-commutative78.7%
*-commutative78.7%
*-commutative78.7%
distribute-rgt-out78.7%
Simplified78.7%
cancel-sign-sub-inv78.7%
fma-def78.7%
*-commutative78.7%
Applied egg-rr78.7%
Taylor expanded in x.re around 0 64.4%
unpow264.4%
unpow264.4%
distribute-rgt-out64.4%
metadata-eval64.4%
associate-*r*64.4%
*-commutative64.4%
associate-*l*78.7%
*-commutative78.7%
Simplified78.7%
Final simplification90.3%
NOTE: x.im should be positive before calling this function
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -7e-86)
(* x.re (* x.re x.re))
(if (<= x.re 4.8e+14)
(* (* x.re x.im) (* x.im -3.0))
(* (* 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 <= -7e-86) {
tmp = x_46_re * (x_46_re * x_46_re);
} else if (x_46_re <= 4.8e+14) {
tmp = (x_46_re * x_46_im) * (x_46_im * -3.0);
} else {
tmp = (x_46_re * 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 <= (-7d-86)) then
tmp = x_46re * (x_46re * x_46re)
else if (x_46re <= 4.8d+14) then
tmp = (x_46re * x_46im) * (x_46im * (-3.0d0))
else
tmp = (x_46re * 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 <= -7e-86) {
tmp = x_46_re * (x_46_re * x_46_re);
} else if (x_46_re <= 4.8e+14) {
tmp = (x_46_re * x_46_im) * (x_46_im * -3.0);
} 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 <= -7e-86: tmp = x_46_re * (x_46_re * x_46_re) elif x_46_re <= 4.8e+14: tmp = (x_46_re * x_46_im) * (x_46_im * -3.0) 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 (x_46_re <= -7e-86) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); elseif (x_46_re <= 4.8e+14) tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_im * -3.0)); 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 <= -7e-86) tmp = x_46_re * (x_46_re * x_46_re); elseif (x_46_re <= 4.8e+14) tmp = (x_46_re * x_46_im) * (x_46_im * -3.0); 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[x$46$re, -7e-86], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 4.8e+14], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $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 \leq -7 \cdot 10^{-86}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{elif}\;x.re \leq 4.8 \cdot 10^{+14}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right)\\
\end{array}
\end{array}
if x.re < -7.00000000000000041e-86Initial program 76.5%
sqr-neg76.5%
difference-of-squares82.6%
sub-neg82.6%
associate-*l*82.6%
sub-neg82.6%
remove-double-neg82.6%
+-commutative82.6%
*-commutative82.6%
*-commutative82.6%
distribute-rgt-out82.6%
Simplified82.6%
cancel-sign-sub-inv82.6%
fma-def82.6%
*-commutative82.6%
Applied egg-rr82.6%
fma-udef82.6%
Applied egg-rr82.6%
cancel-sign-sub-inv82.6%
associate-*r*82.6%
*-commutative82.6%
associate-*r*82.6%
count-282.6%
associate-*r*82.6%
cancel-sign-sub-inv82.6%
*-commutative82.6%
associate-*r*82.6%
distribute-rgt-out91.2%
+-commutative91.2%
distribute-lft-neg-in91.2%
metadata-eval91.2%
Simplified91.2%
Taylor expanded in x.re around inf 72.6%
unpow272.6%
Simplified72.6%
if -7.00000000000000041e-86 < x.re < 4.8e14Initial 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%
unpow282.1%
unpow282.1%
distribute-rgt-out82.1%
metadata-eval82.1%
associate-*r*82.1%
*-commutative82.1%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
if 4.8e14 < x.re Initial program 82.6%
sqr-neg82.6%
difference-of-squares92.7%
sub-neg92.7%
associate-*l*92.7%
sub-neg92.7%
remove-double-neg92.7%
+-commutative92.7%
*-commutative92.7%
*-commutative92.7%
distribute-rgt-out92.7%
Simplified92.7%
Taylor expanded in x.re around inf 82.0%
unpow282.0%
Simplified82.0%
Taylor expanded in x.re around inf 62.5%
unpow362.5%
mul-1-neg62.5%
unpow262.5%
distribute-rgt-neg-in62.5%
distribute-lft-in84.3%
sub-neg84.3%
*-commutative84.3%
Simplified84.3%
Final simplification84.4%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.75e-12) (* x.re (* x.re x.re)) (* -3.0 (* 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.75e-12) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = -3.0 * (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.75d-12) then
tmp = x_46re * (x_46re * x_46re)
else
tmp = (-3.0d0) * (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.75e-12) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = -3.0 * (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.75e-12: tmp = x_46_re * (x_46_re * x_46_re) else: tmp = -3.0 * (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.75e-12) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); else tmp = Float64(-3.0 * 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.75e-12) tmp = x_46_re * (x_46_re * x_46_re); else tmp = -3.0 * (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.75e-12], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(-3.0 * N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;-3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.im < 1.75e-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%
cancel-sign-sub-inv94.2%
fma-def94.2%
*-commutative94.2%
Applied egg-rr94.2%
fma-udef94.2%
Applied egg-rr94.2%
cancel-sign-sub-inv94.2%
associate-*r*94.2%
*-commutative94.2%
associate-*r*90.5%
count-290.5%
associate-*r*90.5%
cancel-sign-sub-inv90.5%
*-commutative90.5%
associate-*r*90.5%
distribute-rgt-out94.5%
+-commutative94.5%
distribute-lft-neg-in94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in x.re around inf 69.2%
unpow269.2%
Simplified69.2%
if 1.75e-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%
cancel-sign-sub-inv86.4%
fma-def86.5%
*-commutative86.5%
Applied egg-rr86.5%
fma-udef86.4%
Applied egg-rr86.4%
cancel-sign-sub-inv86.4%
associate-*r*86.4%
*-commutative86.4%
associate-*r*78.6%
count-278.6%
associate-*r*78.6%
cancel-sign-sub-inv78.6%
*-commutative78.6%
associate-*r*78.5%
distribute-rgt-out80.3%
+-commutative80.3%
distribute-lft-neg-in80.3%
metadata-eval80.3%
Simplified80.3%
distribute-lft-in78.5%
*-commutative78.5%
+-commutative78.5%
difference-of-squares70.2%
associate-*r*70.2%
Applied egg-rr70.2%
associate-*l*70.2%
distribute-lft-in71.9%
unpow271.9%
sub-neg71.9%
mul-1-neg71.9%
unpow271.9%
associate-+r+71.9%
unpow271.9%
distribute-rgt-out71.9%
metadata-eval71.9%
*-commutative71.9%
unpow271.9%
unpow271.9%
unpow271.9%
Simplified71.9%
Taylor expanded in x.re around 0 66.9%
unpow266.9%
Simplified66.9%
Final simplification68.6%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.75e-12) (* x.re (* x.re x.re)) (* x.im (* (* x.re x.im) -3.0))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.75e-12) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = x_46_im * ((x_46_re * x_46_im) * -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_46im <= 1.75d-12) then
tmp = x_46re * (x_46re * x_46re)
else
tmp = x_46im * ((x_46re * x_46im) * (-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_im <= 1.75e-12) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = x_46_im * ((x_46_re * x_46_im) * -3.0);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 1.75e-12: tmp = x_46_re * (x_46_re * x_46_re) else: tmp = x_46_im * ((x_46_re * x_46_im) * -3.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 1.75e-12) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * -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_im <= 1.75e-12) tmp = x_46_re * (x_46_re * x_46_re); else tmp = x_46_im * ((x_46_re * x_46_im) * -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[LessEqual[x$46$im, 1.75e-12], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot -3\right)\\
\end{array}
\end{array}
if x.im < 1.75e-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%
cancel-sign-sub-inv94.2%
fma-def94.2%
*-commutative94.2%
Applied egg-rr94.2%
fma-udef94.2%
Applied egg-rr94.2%
cancel-sign-sub-inv94.2%
associate-*r*94.2%
*-commutative94.2%
associate-*r*90.5%
count-290.5%
associate-*r*90.5%
cancel-sign-sub-inv90.5%
*-commutative90.5%
associate-*r*90.5%
distribute-rgt-out94.5%
+-commutative94.5%
distribute-lft-neg-in94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in x.re around inf 69.2%
unpow269.2%
Simplified69.2%
if 1.75e-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 66.9%
distribute-rgt-out--66.9%
metadata-eval66.9%
unpow266.9%
associate-*r*66.9%
*-commutative66.9%
associate-*l*74.8%
Simplified74.8%
Taylor expanded in x.im around 0 74.7%
Final simplification70.5%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 1.32e-12) (* x.re (* x.re x.re)) (* x.im (* x.re (* x.im -3.0)))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 1.32e-12) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = x_46_im * (x_46_re * (x_46_im * -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_46im <= 1.32d-12) then
tmp = x_46re * (x_46re * x_46re)
else
tmp = x_46im * (x_46re * (x_46im * (-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_im <= 1.32e-12) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = x_46_im * (x_46_re * (x_46_im * -3.0));
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 1.32e-12: tmp = x_46_re * (x_46_re * x_46_re) else: tmp = x_46_im * (x_46_re * (x_46_im * -3.0)) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 1.32e-12) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); else tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_im * -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_im <= 1.32e-12) tmp = x_46_re * (x_46_re * x_46_re); else tmp = x_46_im * (x_46_re * (x_46_im * -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[LessEqual[x$46$im, 1.32e-12], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$re * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.32 \cdot 10^{-12}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.im \cdot -3\right)\right)\\
\end{array}
\end{array}
if x.im < 1.32e-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%
cancel-sign-sub-inv94.2%
fma-def94.2%
*-commutative94.2%
Applied egg-rr94.2%
fma-udef94.2%
Applied egg-rr94.2%
cancel-sign-sub-inv94.2%
associate-*r*94.2%
*-commutative94.2%
associate-*r*90.5%
count-290.5%
associate-*r*90.5%
cancel-sign-sub-inv90.5%
*-commutative90.5%
associate-*r*90.5%
distribute-rgt-out94.5%
+-commutative94.5%
distribute-lft-neg-in94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in x.re around inf 69.2%
unpow269.2%
Simplified69.2%
if 1.32e-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 66.9%
distribute-rgt-out--66.9%
metadata-eval66.9%
unpow266.9%
associate-*r*66.9%
*-commutative66.9%
associate-*l*74.8%
Simplified74.8%
Final simplification70.5%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 8.4e-13) (* x.re (* x.re x.re)) (* (* x.re x.im) (* x.im -3.0))))
x.im = abs(x.im);
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 8.4e-13) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = (x_46_re * x_46_im) * (x_46_im * -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_46im <= 8.4d-13) then
tmp = x_46re * (x_46re * x_46re)
else
tmp = (x_46re * x_46im) * (x_46im * (-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_im <= 8.4e-13) {
tmp = x_46_re * (x_46_re * x_46_re);
} else {
tmp = (x_46_re * x_46_im) * (x_46_im * -3.0);
}
return tmp;
}
x.im = abs(x.im) def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 8.4e-13: tmp = x_46_re * (x_46_re * x_46_re) else: tmp = (x_46_re * x_46_im) * (x_46_im * -3.0) return tmp
x.im = abs(x.im) function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 8.4e-13) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); else tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_im * -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_im <= 8.4e-13) tmp = x_46_re * (x_46_re * x_46_re); else tmp = (x_46_re * x_46_im) * (x_46_im * -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[LessEqual[x$46$im, 8.4e-13], N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$im * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x.im = |x.im|\\
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 8.4 \cdot 10^{-13}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.im \cdot -3\right)\\
\end{array}
\end{array}
if x.im < 8.39999999999999955e-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%
cancel-sign-sub-inv94.2%
fma-def94.2%
*-commutative94.2%
Applied egg-rr94.2%
fma-udef94.2%
Applied egg-rr94.2%
cancel-sign-sub-inv94.2%
associate-*r*94.2%
*-commutative94.2%
associate-*r*90.5%
count-290.5%
associate-*r*90.5%
cancel-sign-sub-inv90.5%
*-commutative90.5%
associate-*r*90.5%
distribute-rgt-out94.5%
+-commutative94.5%
distribute-lft-neg-in94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in x.re around inf 69.2%
unpow269.2%
Simplified69.2%
if 8.39999999999999955e-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%
cancel-sign-sub-inv86.4%
fma-def86.5%
*-commutative86.5%
Applied egg-rr86.5%
Taylor expanded in x.re around 0 66.9%
unpow266.9%
unpow266.9%
distribute-rgt-out66.9%
metadata-eval66.9%
associate-*r*66.9%
*-commutative66.9%
associate-*l*74.8%
*-commutative74.8%
Simplified74.8%
Final simplification70.5%
NOTE: x.im should be positive before calling this function (FPCore (x.re x.im) :precision binary64 (if (<= x.im 2.2e+180) (* x.re (* x.re 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_im <= 2.2e+180) {
tmp = x_46_re * (x_46_re * x_46_re);
} 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_46im <= 2.2d+180) then
tmp = x_46re * (x_46re * x_46re)
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_im <= 2.2e+180) {
tmp = x_46_re * (x_46_re * x_46_re);
} 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_im <= 2.2e+180: tmp = x_46_re * (x_46_re * x_46_re) 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_im <= 2.2e+180) tmp = Float64(x_46_re * Float64(x_46_re * x_46_re)); 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_im <= 2.2e+180) tmp = x_46_re * (x_46_re * x_46_re); 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$im, 2.2e+180], N[(x$46$re * N[(x$46$re * x$46$re), $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.im \leq 2.2 \cdot 10^{+180}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im\\
\end{array}
\end{array}
if x.im < 2.1999999999999999e180Initial program 84.8%
sqr-neg84.8%
difference-of-squares88.2%
sub-neg88.2%
associate-*l*93.0%
sub-neg93.0%
remove-double-neg93.0%
+-commutative93.0%
*-commutative93.0%
*-commutative93.0%
distribute-rgt-out93.0%
Simplified93.0%
cancel-sign-sub-inv93.0%
fma-def93.0%
*-commutative93.0%
Applied egg-rr93.0%
fma-udef93.0%
Applied egg-rr93.0%
cancel-sign-sub-inv93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*88.2%
count-288.2%
associate-*r*88.2%
cancel-sign-sub-inv88.2%
*-commutative88.2%
associate-*r*88.2%
distribute-rgt-out92.0%
+-commutative92.0%
distribute-lft-neg-in92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in x.re around inf 63.4%
unpow263.4%
Simplified63.4%
if 2.1999999999999999e180 < x.im Initial program 63.8%
sqr-neg63.8%
difference-of-squares82.0%
sub-neg82.0%
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 inf 64.6%
unpow264.6%
Simplified64.6%
Taylor expanded in x.re around inf 27.7%
unpow327.7%
mul-1-neg27.7%
unpow227.7%
distribute-rgt-neg-in27.7%
distribute-lft-in45.9%
sub-neg45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in x.re around 0 41.3%
unpow241.3%
associate-*r*41.3%
mul-1-neg41.3%
Simplified41.3%
expm1-log1p-u0.2%
expm1-udef0.3%
add-sqr-sqrt0.2%
sqrt-unprod23.9%
sqr-neg23.9%
sqrt-unprod23.9%
add-sqr-sqrt23.9%
associate-*l*23.9%
Applied egg-rr23.9%
expm1-def24.0%
expm1-log1p24.0%
associate-*r*24.0%
*-commutative24.0%
Simplified24.0%
Final simplification60.0%
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 inf 70.7%
unpow270.7%
Simplified70.7%
Taylor expanded in x.re around inf 50.3%
unpow350.2%
mul-1-neg50.2%
unpow250.2%
distribute-rgt-neg-in50.2%
distribute-lft-in65.9%
sub-neg65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in x.re around 0 34.6%
unpow234.6%
associate-*r*34.6%
mul-1-neg34.6%
Simplified34.6%
expm1-log1p-u25.3%
expm1-udef25.2%
add-sqr-sqrt10.1%
sqrt-unprod22.4%
sqr-neg22.4%
sqrt-unprod20.5%
add-sqr-sqrt20.5%
associate-*l*20.2%
Applied egg-rr20.2%
expm1-def20.2%
expm1-log1p28.1%
associate-*r*29.9%
*-commutative29.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)))