
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
(FPCore (x.re x.im)
:precision binary64
(if (<=
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))
INFINITY)
(- (* x.re (* (* x.re x.im) 3.0)) (pow x.im 3.0))
(- (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
tmp = (x_46_re * ((x_46_re * x_46_im) * 3.0)) - pow(x_46_im, 3.0);
} else {
tmp = -pow(x_46_im, 3.0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Double.POSITIVE_INFINITY) {
tmp = (x_46_re * ((x_46_re * x_46_im) * 3.0)) - Math.pow(x_46_im, 3.0);
} else {
tmp = -Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if ((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= math.inf: tmp = (x_46_re * ((x_46_re * x_46_im) * 3.0)) - math.pow(x_46_im, 3.0) else: tmp = -math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) * 3.0)) - (x_46_im ^ 3.0)); else tmp = Float64(-(x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Inf) tmp = (x_46_re * ((x_46_re * x_46_im) * 3.0)) - (x_46_im ^ 3.0); else tmp = -(x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * 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 * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision], (-N[Power[x$46$im, 3.0], $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;x.re \cdot \left(\left(x.re \cdot x.im\right) \cdot 3\right) - {x.im}^{3}\\
\mathbf{else}:\\
\;\;\;\;-{x.im}^{3}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 90.8%
+-commutative90.8%
*-commutative90.8%
sub-neg90.8%
distribute-lft-in87.3%
associate-+r+87.3%
distribute-rgt-neg-out87.3%
unsub-neg87.3%
associate-*r*96.2%
distribute-rgt-out96.3%
*-commutative96.3%
count-296.3%
distribute-lft1-in96.3%
metadata-eval96.3%
*-commutative96.3%
*-commutative96.3%
associate-*r*96.3%
cube-unmult96.3%
Simplified96.3%
Taylor expanded in x.re around 0 96.3%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
sub-neg0.0%
distribute-lft-in0.0%
associate-+r+0.0%
distribute-rgt-neg-out0.0%
unsub-neg0.0%
associate-*r*0.0%
distribute-rgt-out0.0%
*-commutative0.0%
count-20.0%
distribute-lft1-in0.0%
metadata-eval0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
cube-unmult0.0%
Simplified0.0%
Taylor expanded in x.re around 0 0.0%
Taylor expanded in x.re around 0 72.4%
Final simplification93.6%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))))
(if (<= t_0 INFINITY) t_0 (- (pow x.im 3.0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = -pow(x_46_im, 3.0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = -Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = -math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(-(x_46_im ^ 3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = -(x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, (-N[Power[x$46$im, 3.0], $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-{x.im}^{3}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 90.8%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
sub-neg0.0%
distribute-lft-in0.0%
associate-+r+0.0%
distribute-rgt-neg-out0.0%
unsub-neg0.0%
associate-*r*0.0%
distribute-rgt-out0.0%
*-commutative0.0%
count-20.0%
distribute-lft1-in0.0%
metadata-eval0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
cube-unmult0.0%
Simplified0.0%
Taylor expanded in x.re around 0 0.0%
Taylor expanded in x.re around 0 72.4%
Final simplification88.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0
(+
(* x.im (- (* x.re x.re) (* x.im x.im)))
(* x.re (+ (* x.re x.im) (* x.re x.im))))))
(if (<= t_0 INFINITY) t_0 (* -2.0 (* x.re (* x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = -2.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_0;
} else {
tmp = -2.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))) tmp = 0 if t_0 <= math.inf: tmp = t_0 else: tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) tmp = 0.0 if (t_0 <= Inf) tmp = t_0; else tmp = Float64(-2.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im))); tmp = 0.0; if (t_0 <= Inf) tmp = t_0; else tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(-2.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0Initial program 90.8%
if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) Initial program 0.0%
+-commutative0.0%
*-commutative0.0%
sub-neg0.0%
distribute-lft-in0.0%
associate-+r+0.0%
distribute-rgt-neg-out0.0%
unsub-neg0.0%
associate-*r*0.0%
distribute-rgt-out0.0%
*-commutative0.0%
count-20.0%
distribute-lft1-in0.0%
metadata-eval0.0%
*-commutative0.0%
*-commutative0.0%
associate-*r*0.0%
cube-unmult0.0%
Simplified0.0%
add-cbrt-cube0.0%
pow30.0%
Applied egg-rr0.0%
Taylor expanded in x.re around inf 27.6%
Simplified72.4%
Final simplification88.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -7.2e+130) (not (<= x.re 1.35e+154))) (+ (* x.re (* x.im (+ x.re x.re))) -3.0) (* x.im (+ (- (* x.re x.re) (* x.im x.im)) (+ x.re x.re)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7.2e+130) || !(x_46_re <= 1.35e+154)) {
tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0;
} else {
tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re));
}
return tmp;
}
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.2d+130)) .or. (.not. (x_46re <= 1.35d+154))) then
tmp = (x_46re * (x_46im * (x_46re + x_46re))) + (-3.0d0)
else
tmp = x_46im * (((x_46re * x_46re) - (x_46im * x_46im)) + (x_46re + x_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7.2e+130) || !(x_46_re <= 1.35e+154)) {
tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0;
} else {
tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -7.2e+130) or not (x_46_re <= 1.35e+154): tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0 else: tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -7.2e+130) || !(x_46_re <= 1.35e+154)) tmp = Float64(Float64(x_46_re * Float64(x_46_im * Float64(x_46_re + x_46_re))) + -3.0); else tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) + Float64(x_46_re + x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -7.2e+130) || ~((x_46_re <= 1.35e+154))) tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0; else tmp = x_46_im * (((x_46_re * x_46_re) - (x_46_im * x_46_im)) + (x_46_re + x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -7.2e+130], N[Not[LessEqual[x$46$re, 1.35e+154]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision], N[(x$46$im * N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.2 \cdot 10^{+130} \lor \neg \left(x.re \leq 1.35 \cdot 10^{+154}\right):\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re + x.re\right)\right) + -3\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re \cdot x.re - x.im \cdot x.im\right) + \left(x.re + x.re\right)\right)\\
\end{array}
\end{array}
if x.re < -7.2000000000000002e130 or 1.35000000000000003e154 < x.re Initial program 49.4%
Taylor expanded in x.re around 0 40.0%
Simplified59.2%
*-commutative59.2%
count-259.2%
associate-*r*59.2%
count-259.2%
Applied egg-rr59.2%
if -7.2000000000000002e130 < x.re < 1.35000000000000003e154Initial program 94.2%
*-commutative94.2%
*-commutative94.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+71.2%
distribute-lft-in71.2%
Applied egg-rr71.2%
*-commutative71.2%
distribute-rgt-out71.2%
distribute-lft-out73.4%
Applied egg-rr73.4%
Final simplification69.1%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (- (* x.re x.re) (* x.im x.im))))
(if (<= x.im -4.8e-85)
(* x.im (+ t_0 (+ x.re x.re)))
(if (<= x.im 5.4e+55)
(+ (* (* x.re x.re) x.im) (* x.re (* x.im (+ x.re x.re))))
(+ (* x.im t_0) -3.0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * x_46_re) - (x_46_im * x_46_im);
double tmp;
if (x_46_im <= -4.8e-85) {
tmp = x_46_im * (t_0 + (x_46_re + x_46_re));
} else if (x_46_im <= 5.4e+55) {
tmp = ((x_46_re * x_46_re) * x_46_im) + (x_46_re * (x_46_im * (x_46_re + x_46_re)));
} else {
tmp = (x_46_im * t_0) + -3.0;
}
return tmp;
}
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 * x_46im)
if (x_46im <= (-4.8d-85)) then
tmp = x_46im * (t_0 + (x_46re + x_46re))
else if (x_46im <= 5.4d+55) then
tmp = ((x_46re * x_46re) * x_46im) + (x_46re * (x_46im * (x_46re + x_46re)))
else
tmp = (x_46im * t_0) + (-3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = (x_46_re * x_46_re) - (x_46_im * x_46_im);
double tmp;
if (x_46_im <= -4.8e-85) {
tmp = x_46_im * (t_0 + (x_46_re + x_46_re));
} else if (x_46_im <= 5.4e+55) {
tmp = ((x_46_re * x_46_re) * x_46_im) + (x_46_re * (x_46_im * (x_46_re + x_46_re)));
} else {
tmp = (x_46_im * t_0) + -3.0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = (x_46_re * x_46_re) - (x_46_im * x_46_im) tmp = 0 if x_46_im <= -4.8e-85: tmp = x_46_im * (t_0 + (x_46_re + x_46_re)) elif x_46_im <= 5.4e+55: tmp = ((x_46_re * x_46_re) * x_46_im) + (x_46_re * (x_46_im * (x_46_re + x_46_re))) else: tmp = (x_46_im * t_0) + -3.0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) tmp = 0.0 if (x_46_im <= -4.8e-85) tmp = Float64(x_46_im * Float64(t_0 + Float64(x_46_re + x_46_re))); elseif (x_46_im <= 5.4e+55) tmp = Float64(Float64(Float64(x_46_re * x_46_re) * x_46_im) + Float64(x_46_re * Float64(x_46_im * Float64(x_46_re + x_46_re)))); else tmp = Float64(Float64(x_46_im * t_0) + -3.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = (x_46_re * x_46_re) - (x_46_im * x_46_im); tmp = 0.0; if (x_46_im <= -4.8e-85) tmp = x_46_im * (t_0 + (x_46_re + x_46_re)); elseif (x_46_im <= 5.4e+55) tmp = ((x_46_re * x_46_re) * x_46_im) + (x_46_re * (x_46_im * (x_46_re + x_46_re))); else tmp = (x_46_im * t_0) + -3.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -4.8e-85], N[(x$46$im * N[(t$95$0 + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5.4e+55], N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(x$46$re * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * t$95$0), $MachinePrecision] + -3.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot x.re - x.im \cdot x.im\\
\mathbf{if}\;x.im \leq -4.8 \cdot 10^{-85}:\\
\;\;\;\;x.im \cdot \left(t_0 + \left(x.re + x.re\right)\right)\\
\mathbf{elif}\;x.im \leq 5.4 \cdot 10^{+55}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im + x.re \cdot \left(x.im \cdot \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot t_0 + -3\\
\end{array}
\end{array}
if x.im < -4.8000000000000001e-85Initial program 78.9%
*-commutative78.9%
*-commutative78.9%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+73.5%
distribute-lft-in73.5%
Applied egg-rr73.5%
*-commutative73.5%
distribute-rgt-out73.5%
distribute-lft-out77.9%
Applied egg-rr77.9%
if -4.8000000000000001e-85 < x.im < 5.39999999999999954e55Initial program 83.7%
Taylor expanded in x.re around inf 74.0%
Simplified74.0%
*-commutative21.4%
count-221.4%
associate-*r*21.4%
count-221.4%
Applied egg-rr74.0%
if 5.39999999999999954e55 < x.im Initial program 75.6%
*-commutative75.6%
*-commutative75.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+77.8%
distribute-lft-in77.8%
Applied egg-rr77.8%
+-commutative77.8%
add-cube-cbrt77.8%
fma-def77.8%
Applied egg-rr0.0%
Simplified84.4%
Final simplification77.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -3.5e+19) (not (<= x.im 1.9e-27))) (+ (* x.im (- (* x.re x.re) (* x.im x.im))) -3.0) (* x.im (+ (* x.re x.re) (+ x.re x.re)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -3.5e+19) || !(x_46_im <= 1.9e-27)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -3.0;
} else {
tmp = x_46_im * ((x_46_re * x_46_re) + (x_46_re + x_46_re));
}
return tmp;
}
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 <= (-3.5d+19)) .or. (.not. (x_46im <= 1.9d-27))) then
tmp = (x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + (-3.0d0)
else
tmp = x_46im * ((x_46re * x_46re) + (x_46re + x_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -3.5e+19) || !(x_46_im <= 1.9e-27)) {
tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -3.0;
} else {
tmp = x_46_im * ((x_46_re * x_46_re) + (x_46_re + x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -3.5e+19) or not (x_46_im <= 1.9e-27): tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -3.0 else: tmp = x_46_im * ((x_46_re * x_46_re) + (x_46_re + x_46_re)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -3.5e+19) || !(x_46_im <= 1.9e-27)) tmp = Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + -3.0); else tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) + Float64(x_46_re + x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_im <= -3.5e+19) || ~((x_46_im <= 1.9e-27))) tmp = (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + -3.0; else tmp = x_46_im * ((x_46_re * x_46_re) + (x_46_re + x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -3.5e+19], N[Not[LessEqual[x$46$im, 1.9e-27]], $MachinePrecision]], N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.5 \cdot 10^{+19} \lor \neg \left(x.im \leq 1.9 \cdot 10^{-27}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + -3\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re + \left(x.re + x.re\right)\right)\\
\end{array}
\end{array}
if x.im < -3.5e19 or 1.9e-27 < x.im Initial program 77.6%
*-commutative77.6%
*-commutative77.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.2%
distribute-lft-in72.2%
Applied egg-rr72.2%
+-commutative72.2%
add-cube-cbrt72.2%
fma-def72.2%
Applied egg-rr0.0%
Simplified78.4%
if -3.5e19 < x.im < 1.9e-27Initial program 83.6%
*-commutative83.6%
*-commutative83.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+50.1%
distribute-lft-in50.1%
Applied egg-rr50.1%
*-commutative50.1%
distribute-rgt-out50.1%
distribute-lft-out50.1%
Applied egg-rr50.1%
Taylor expanded in x.re around inf 38.1%
Simplified38.1%
Final simplification58.5%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -6.4e+130) (not (<= x.re 3.6e+196))) (+ (* x.re (* x.im (+ x.re x.re))) -3.0) (* -2.0 (* x.re (* x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -6.4e+130) || !(x_46_re <= 3.6e+196)) {
tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0;
} else {
tmp = -2.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
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 <= (-6.4d+130)) .or. (.not. (x_46re <= 3.6d+196))) then
tmp = (x_46re * (x_46im * (x_46re + x_46re))) + (-3.0d0)
else
tmp = (-2.0d0) * (x_46re * (x_46re * x_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -6.4e+130) || !(x_46_re <= 3.6e+196)) {
tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0;
} else {
tmp = -2.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -6.4e+130) or not (x_46_re <= 3.6e+196): tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0 else: tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -6.4e+130) || !(x_46_re <= 3.6e+196)) tmp = Float64(Float64(x_46_re * Float64(x_46_im * Float64(x_46_re + x_46_re))) + -3.0); else tmp = Float64(-2.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -6.4e+130) || ~((x_46_re <= 3.6e+196))) tmp = (x_46_re * (x_46_im * (x_46_re + x_46_re))) + -3.0; else tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -6.4e+130], N[Not[LessEqual[x$46$re, 3.6e+196]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision], N[(-2.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -6.4 \cdot 10^{+130} \lor \neg \left(x.re \leq 3.6 \cdot 10^{+196}\right):\\
\;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re + x.re\right)\right) + -3\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -6.4e130 or 3.60000000000000007e196 < x.re Initial program 53.4%
Taylor expanded in x.re around 0 42.3%
Simplified63.7%
*-commutative63.7%
count-263.7%
associate-*r*63.7%
count-263.7%
Applied egg-rr63.7%
if -6.4e130 < x.re < 3.60000000000000007e196Initial program 90.8%
+-commutative90.8%
*-commutative90.8%
sub-neg90.8%
distribute-lft-in90.2%
associate-+r+90.2%
distribute-rgt-neg-out90.2%
unsub-neg90.2%
associate-*r*91.8%
distribute-rgt-out91.8%
*-commutative91.8%
count-291.8%
distribute-lft1-in91.8%
metadata-eval91.8%
*-commutative91.8%
*-commutative91.8%
associate-*r*91.8%
cube-unmult91.8%
Simplified91.8%
add-cbrt-cube64.5%
pow364.5%
Applied egg-rr64.5%
Taylor expanded in x.re around inf 41.5%
Simplified28.2%
Final simplification37.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -5.5e+130) (not (<= x.re 3.6e+196))) (+ (* (* x.re x.re) x.im) -3.0) (* -2.0 (* x.re (* x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -5.5e+130) || !(x_46_re <= 3.6e+196)) {
tmp = ((x_46_re * x_46_re) * x_46_im) + -3.0;
} else {
tmp = -2.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
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 <= (-5.5d+130)) .or. (.not. (x_46re <= 3.6d+196))) then
tmp = ((x_46re * x_46re) * x_46im) + (-3.0d0)
else
tmp = (-2.0d0) * (x_46re * (x_46re * x_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -5.5e+130) || !(x_46_re <= 3.6e+196)) {
tmp = ((x_46_re * x_46_re) * x_46_im) + -3.0;
} else {
tmp = -2.0 * (x_46_re * (x_46_re * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -5.5e+130) or not (x_46_re <= 3.6e+196): tmp = ((x_46_re * x_46_re) * x_46_im) + -3.0 else: tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -5.5e+130) || !(x_46_re <= 3.6e+196)) tmp = Float64(Float64(Float64(x_46_re * x_46_re) * x_46_im) + -3.0); else tmp = Float64(-2.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -5.5e+130) || ~((x_46_re <= 3.6e+196))) tmp = ((x_46_re * x_46_re) * x_46_im) + -3.0; else tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -5.5e+130], N[Not[LessEqual[x$46$re, 3.6e+196]], $MachinePrecision]], N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision] + -3.0), $MachinePrecision], N[(-2.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -5.5 \cdot 10^{+130} \lor \neg \left(x.re \leq 3.6 \cdot 10^{+196}\right):\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot x.im + -3\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -5.4999999999999997e130 or 3.60000000000000007e196 < x.re Initial program 53.4%
*-commutative53.4%
*-commutative53.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+41.5%
distribute-lft-in41.5%
Applied egg-rr41.5%
+-commutative41.5%
add-cube-cbrt41.5%
fma-def41.5%
Applied egg-rr0.0%
Simplified48.7%
Taylor expanded in x.re around inf 60.1%
Simplified60.1%
if -5.4999999999999997e130 < x.re < 3.60000000000000007e196Initial program 90.8%
+-commutative90.8%
*-commutative90.8%
sub-neg90.8%
distribute-lft-in90.2%
associate-+r+90.2%
distribute-rgt-neg-out90.2%
unsub-neg90.2%
associate-*r*91.8%
distribute-rgt-out91.8%
*-commutative91.8%
count-291.8%
distribute-lft1-in91.8%
metadata-eval91.8%
*-commutative91.8%
*-commutative91.8%
associate-*r*91.8%
cube-unmult91.8%
Simplified91.8%
add-cbrt-cube64.5%
pow364.5%
Applied egg-rr64.5%
Taylor expanded in x.re around inf 41.5%
Simplified28.2%
Final simplification36.9%
(FPCore (x.re x.im) :precision binary64 (* -2.0 (* x.re (* x.re x.im))))
double code(double x_46_re, double x_46_im) {
return -2.0 * (x_46_re * (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 = (-2.0d0) * (x_46re * (x_46re * x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
return -2.0 * (x_46_re * (x_46_re * x_46_im));
}
def code(x_46_re, x_46_im): return -2.0 * (x_46_re * (x_46_re * x_46_im))
function code(x_46_re, x_46_im) return Float64(-2.0 * Float64(x_46_re * Float64(x_46_re * x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = -2.0 * (x_46_re * (x_46_re * x_46_im)); end
code[x$46$re_, x$46$im_] := N[(-2.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)
\end{array}
Initial program 80.6%
+-commutative80.6%
*-commutative80.6%
sub-neg80.6%
distribute-lft-in77.4%
associate-+r+77.4%
distribute-rgt-neg-out77.4%
unsub-neg77.4%
associate-*r*85.3%
distribute-rgt-out85.4%
*-commutative85.4%
count-285.4%
distribute-lft1-in85.4%
metadata-eval85.4%
*-commutative85.4%
*-commutative85.4%
associate-*r*85.4%
cube-unmult85.4%
Simplified85.4%
add-cbrt-cube64.8%
pow364.8%
Applied egg-rr64.8%
Taylor expanded in x.re around inf 47.9%
Simplified23.2%
Final simplification23.2%
(FPCore (x.re x.im) :precision binary64 (* (* x.re x.re) (- x.im)))
double code(double x_46_re, double x_46_im) {
return (x_46_re * 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
end function
public static double code(double x_46_re, double x_46_im) {
return (x_46_re * x_46_re) * -x_46_im;
}
def code(x_46_re, x_46_im): return (x_46_re * x_46_re) * -x_46_im
function code(x_46_re, x_46_im) return Float64(Float64(x_46_re * x_46_re) * Float64(-x_46_im)) end
function tmp = code(x_46_re, x_46_im) tmp = (x_46_re * x_46_re) * -x_46_im; end
code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$re), $MachinePrecision] * (-x$46$im)), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re\right) \cdot \left(-x.im\right)
\end{array}
Initial program 80.6%
Taylor expanded in x.re around inf 47.9%
Simplified47.9%
Taylor expanded in x.re around 0 47.9%
Simplified22.9%
Final simplification22.9%
(FPCore (x.re x.im) :precision binary64 (* x.re -3.0))
double code(double x_46_re, double x_46_im) {
return x_46_re * -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46re * (-3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_re * -3.0;
}
def code(x_46_re, x_46_im): return x_46_re * -3.0
function code(x_46_re, x_46_im) return Float64(x_46_re * -3.0) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_re * -3.0; end
code[x$46$re_, x$46$im_] := N[(x$46$re * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot -3
\end{array}
Initial program 80.6%
Taylor expanded in x.re around 0 64.3%
Simplified21.1%
*-commutative21.1%
expm1-log1p-u10.8%
expm1-udef9.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified3.2%
Taylor expanded in x.re around inf 3.6%
Final simplification3.6%
(FPCore (x.re x.im) :precision binary64 -10.0)
double code(double x_46_re, double x_46_im) {
return -10.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -10.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -10.0;
}
def code(x_46_re, x_46_im): return -10.0
function code(x_46_re, x_46_im) return -10.0 end
function tmp = code(x_46_re, x_46_im) tmp = -10.0; end
code[x$46$re_, x$46$im_] := -10.0
\begin{array}{l}
\\
-10
\end{array}
Initial program 80.6%
+-commutative80.6%
*-commutative80.6%
sub-neg80.6%
distribute-lft-in77.4%
associate-+r+77.4%
distribute-rgt-neg-out77.4%
unsub-neg77.4%
associate-*r*85.3%
distribute-rgt-out85.4%
*-commutative85.4%
count-285.4%
distribute-lft1-in85.4%
metadata-eval85.4%
*-commutative85.4%
*-commutative85.4%
associate-*r*85.4%
cube-unmult85.4%
Simplified85.4%
associate-*r*85.4%
associate-*l*85.4%
flip--19.4%
div-inv19.4%
swap-sqr19.3%
pow219.3%
metadata-eval19.3%
pow-prod-up19.3%
metadata-eval19.3%
associate-*l*19.2%
associate-*r*19.2%
fma-def19.2%
Applied egg-rr19.2%
Simplified2.5%
Final simplification2.5%
(FPCore (x.re x.im) :precision binary64 -3.0)
double code(double x_46_re, double x_46_im) {
return -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = -3.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return -3.0;
}
def code(x_46_re, x_46_im): return -3.0
function code(x_46_re, x_46_im) return -3.0 end
function tmp = code(x_46_re, x_46_im) tmp = -3.0; end
code[x$46$re_, x$46$im_] := -3.0
\begin{array}{l}
\\
-3
\end{array}
Initial program 80.6%
Taylor expanded in x.re around 0 64.3%
Simplified21.1%
*-commutative21.1%
expm1-log1p-u10.8%
expm1-udef9.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified3.2%
Taylor expanded in x.re around 0 2.5%
Final simplification2.5%
(FPCore (x.re x.im) :precision binary64 0.1)
double code(double x_46_re, double x_46_im) {
return 0.1;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 0.1d0
end function
public static double code(double x_46_re, double x_46_im) {
return 0.1;
}
def code(x_46_re, x_46_im): return 0.1
function code(x_46_re, x_46_im) return 0.1 end
function tmp = code(x_46_re, x_46_im) tmp = 0.1; end
code[x$46$re_, x$46$im_] := 0.1
\begin{array}{l}
\\
0.1
\end{array}
Initial program 80.6%
+-commutative80.6%
*-commutative80.6%
sub-neg80.6%
distribute-lft-in77.4%
associate-+r+77.4%
distribute-rgt-neg-out77.4%
unsub-neg77.4%
associate-*r*85.3%
distribute-rgt-out85.4%
*-commutative85.4%
count-285.4%
distribute-lft1-in85.4%
metadata-eval85.4%
*-commutative85.4%
*-commutative85.4%
associate-*r*85.4%
cube-unmult85.4%
Simplified85.4%
sub-neg85.4%
associate-*r*85.4%
associate-*l*85.4%
flip3-+12.1%
associate-*r*11.7%
associate-*r*11.6%
unpow-prod-down5.8%
pow25.8%
pow-pow5.8%
metadata-eval5.8%
Applied egg-rr5.9%
Simplified2.8%
Final simplification2.8%
(FPCore (x.re x.im) :precision binary64 10.0)
double code(double x_46_re, double x_46_im) {
return 10.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = 10.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return 10.0;
}
def code(x_46_re, x_46_im): return 10.0
function code(x_46_re, x_46_im) return 10.0 end
function tmp = code(x_46_re, x_46_im) tmp = 10.0; end
code[x$46$re_, x$46$im_] := 10.0
\begin{array}{l}
\\
10
\end{array}
Initial program 80.6%
+-commutative80.6%
*-commutative80.6%
sub-neg80.6%
distribute-lft-in77.4%
associate-+r+77.4%
distribute-rgt-neg-out77.4%
unsub-neg77.4%
associate-*r*85.3%
distribute-rgt-out85.4%
*-commutative85.4%
count-285.4%
distribute-lft1-in85.4%
metadata-eval85.4%
*-commutative85.4%
*-commutative85.4%
associate-*r*85.4%
cube-unmult85.4%
Simplified85.4%
associate-*r*85.4%
associate-*l*85.4%
flip--19.4%
swap-sqr19.3%
pow219.3%
metadata-eval19.3%
pow-prod-up19.3%
metadata-eval19.3%
associate-*l*19.3%
associate-*r*19.2%
fma-def19.2%
Applied egg-rr19.2%
Simplified2.8%
Final simplification2.8%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = ((x_46re * x_46im) * (2.0d0 * x_46re)) + ((x_46im * (x_46re - x_46im)) * (x_46re + x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_im) * Float64(2.0 * x_46_re)) + Float64(Float64(x_46_im * Float64(x_46_re - x_46_im)) * Float64(x_46_re + x_46_im))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im)); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(2.0 * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.im\right) \cdot \left(2 \cdot x.re\right) + \left(x.im \cdot \left(x.re - x.im\right)\right) \cdot \left(x.re + x.im\right)
\end{array}
herbie shell --seed 2023173
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:herbie-target
(+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im)))
(+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))