
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im) :precision binary64 (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
def code(x_46_re, x_46_im): return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
function code(x_46_re, x_46_im) return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re); end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\end{array}
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+102) (not (<= x.im 1e+71))) (* x.im (+ (* (- x.re x.im) (+ x.im x.re)) (+ x.re x.re))) (- (* (* x.re (* x.im x.re)) 3.0) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+102) || !(x_46_im <= 1e+71)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - pow(x_46_im, 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) :: tmp
if ((x_46im <= (-5d+102)) .or. (.not. (x_46im <= 1d+71))) then
tmp = x_46im * (((x_46re - x_46im) * (x_46im + x_46re)) + (x_46re + x_46re))
else
tmp = ((x_46re * (x_46im * x_46re)) * 3.0d0) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+102) || !(x_46_im <= 1e+71)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -5e+102) or not (x_46_im <= 1e+71): tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)) else: tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -5e+102) || !(x_46_im <= 1e+71)) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)) + Float64(x_46_re + x_46_re))); else tmp = Float64(Float64(Float64(x_46_re * Float64(x_46_im * x_46_re)) * 3.0) - (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 <= -5e+102) || ~((x_46_im <= 1e+71))) tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)); else tmp = ((x_46_re * (x_46_im * x_46_re)) * 3.0) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -5e+102], N[Not[LessEqual[x$46$im, 1e+71]], $MachinePrecision]], N[(x$46$im * N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re * N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5 \cdot 10^{+102} \lor \neg \left(x.im \leq 10^{+71}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right) + \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot \left(x.im \cdot x.re\right)\right) \cdot 3 - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -5e102 or 1e71 < x.im Initial program 71.1%
*-commutative71.1%
*-commutative71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+77.8%
distribute-lft-in77.8%
Applied egg-rr77.8%
*-commutative77.8%
distribute-rgt-out77.8%
distribute-lft-out84.4%
Applied egg-rr84.4%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 1e71Initial program 93.0%
+-commutative93.0%
*-commutative93.0%
sub-neg93.0%
distribute-lft-in93.0%
associate-+r+93.0%
distribute-rgt-neg-out93.0%
unsub-neg93.0%
Simplified99.8%
Final simplification99.9%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -5e+102) (not (<= x.im 1e+71))) (* x.im (+ (* (- x.re x.im) (+ x.im x.re)) (+ x.re x.re))) (- (* x.re (* (* x.im x.re) 3.0)) (pow x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+102) || !(x_46_im <= 1e+71)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - pow(x_46_im, 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) :: tmp
if ((x_46im <= (-5d+102)) .or. (.not. (x_46im <= 1d+71))) then
tmp = x_46im * (((x_46re - x_46im) * (x_46im + x_46re)) + (x_46re + x_46re))
else
tmp = (x_46re * ((x_46im * x_46re) * 3.0d0)) - (x_46im ** 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -5e+102) || !(x_46_im <= 1e+71)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - Math.pow(x_46_im, 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -5e+102) or not (x_46_im <= 1e+71): tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)) else: tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - math.pow(x_46_im, 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -5e+102) || !(x_46_im <= 1e+71)) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)) + Float64(x_46_re + x_46_re))); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) * 3.0)) - (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 <= -5e+102) || ~((x_46_im <= 1e+71))) tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)); else tmp = (x_46_re * ((x_46_im * x_46_re) * 3.0)) - (x_46_im ^ 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -5e+102], N[Not[LessEqual[x$46$im, 1e+71]], $MachinePrecision]], N[(x$46$im * N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(N[(x$46$im * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5 \cdot 10^{+102} \lor \neg \left(x.im \leq 10^{+71}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right) + \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.im \cdot x.re\right) \cdot 3\right) - {x.im}^{3}\\
\end{array}
\end{array}
if x.im < -5e102 or 1e71 < x.im Initial program 71.1%
*-commutative71.1%
*-commutative71.1%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+77.8%
distribute-lft-in77.8%
Applied egg-rr77.8%
*-commutative77.8%
distribute-rgt-out77.8%
distribute-lft-out84.4%
Applied egg-rr84.4%
difference-of-squares100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -5e102 < x.im < 1e71Initial program 93.0%
+-commutative93.0%
*-commutative93.0%
sub-neg93.0%
distribute-lft-in93.0%
associate-+r+93.0%
distribute-rgt-neg-out93.0%
unsub-neg93.0%
associate-*r*99.7%
distribute-rgt-out99.6%
*-commutative99.6%
count-299.6%
distribute-lft1-in99.6%
metadata-eval99.6%
*-commutative99.6%
*-commutative99.6%
associate-*r*99.6%
cube-unmult99.7%
Simplified99.7%
Taylor expanded in x.re around 0 99.8%
Final simplification99.8%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (+ (* x.im x.re) (* x.im x.re)))))
(if (<= (+ (* x.im (- (* x.re x.re) (* x.im x.im))) t_0) 5e+291)
(+ t_0 (* x.im (* (- x.re x.im) (+ x.im x.re))))
(+ (+ x.im x.im) (* (+ x.im x.re) (* x.im (- x.re x.im)))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re));
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_0) <= 5e+291) {
tmp = t_0 + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (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) :: t_0
real(8) :: tmp
t_0 = x_46re * ((x_46im * x_46re) + (x_46im * x_46re))
if (((x_46im * ((x_46re * x_46re) - (x_46im * x_46im))) + t_0) <= 5d+291) then
tmp = t_0 + (x_46im * ((x_46re - x_46im) * (x_46im + x_46re)))
else
tmp = (x_46im + x_46im) + ((x_46im + x_46re) * (x_46im * (x_46re - x_46im)))
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_im * x_46_re) + (x_46_im * x_46_re));
double tmp;
if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_0) <= 5e+291) {
tmp = t_0 + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re)));
} else {
tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re)) tmp = 0 if ((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_0) <= 5e+291: tmp = t_0 + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))) else: tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(Float64(x_46_im * x_46_re) + Float64(x_46_im * x_46_re))) tmp = 0.0 if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + t_0) <= 5e+291) tmp = Float64(t_0 + Float64(x_46_im * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)))); else tmp = Float64(Float64(x_46_im + x_46_im) + Float64(Float64(x_46_im + x_46_re) * Float64(x_46_im * 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_re * ((x_46_im * x_46_re) + (x_46_im * x_46_re)); tmp = 0.0; if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + t_0) <= 5e+291) tmp = t_0 + (x_46_im * ((x_46_re - x_46_im) * (x_46_im + x_46_re))); else tmp = (x_46_im + x_46_im) + ((x_46_im + x_46_re) * (x_46_im * (x_46_re - x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(N[(x$46$im * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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] + t$95$0), $MachinePrecision], 5e+291], N[(t$95$0 + N[(x$46$im * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] + N[(N[(x$46$im + x$46$re), $MachinePrecision] * N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(x.im \cdot x.re + x.im \cdot x.re\right)\\
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + t_0 \leq 5 \cdot 10^{+291}:\\
\;\;\;\;t_0 + x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + x.im\right) + \left(x.im + x.re\right) \cdot \left(x.im \cdot \left(x.re - 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)) < 5.0000000000000001e291Initial program 96.1%
difference-of-squares64.9%
*-commutative64.9%
Applied egg-rr96.1%
if 5.0000000000000001e291 < (+.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 61.2%
+-commutative61.2%
*-commutative61.2%
fma-def70.0%
*-commutative70.0%
distribute-rgt-out70.0%
*-commutative70.0%
Simplified70.0%
fma-udef61.2%
distribute-lft-in61.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+68.8%
distribute-lft-in68.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+76.3%
*-commutative76.3%
difference-of-squares94.1%
associate-*l*94.8%
Applied egg-rr94.8%
Final simplification95.7%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -1.08e-70) (not (<= x.im 5.6e-41))) (* x.im (+ (* (- x.re x.im) (+ x.im x.re)) (+ x.re x.re))) (* (* x.re x.re) (* x.im 3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.08e-70) || !(x_46_im <= 5.6e-41)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_re * x_46_re) * (x_46_im * 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) :: tmp
if ((x_46im <= (-1.08d-70)) .or. (.not. (x_46im <= 5.6d-41))) then
tmp = x_46im * (((x_46re - x_46im) * (x_46im + x_46re)) + (x_46re + x_46re))
else
tmp = (x_46re * x_46re) * (x_46im * 3.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -1.08e-70) || !(x_46_im <= 5.6e-41)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -1.08e-70) or not (x_46_im <= 5.6e-41): tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)) else: tmp = (x_46_re * x_46_re) * (x_46_im * 3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -1.08e-70) || !(x_46_im <= 5.6e-41)) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)) + Float64(x_46_re + x_46_re))); else tmp = Float64(Float64(x_46_re * x_46_re) * 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 <= -1.08e-70) || ~((x_46_im <= 5.6e-41))) tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)); else tmp = (x_46_re * x_46_re) * (x_46_im * 3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -1.08e-70], N[Not[LessEqual[x$46$im, 5.6e-41]], $MachinePrecision]], N[(x$46$im * N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.08 \cdot 10^{-70} \lor \neg \left(x.im \leq 5.6 \cdot 10^{-41}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right) + \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.im \cdot 3\right)\\
\end{array}
\end{array}
if x.im < -1.0800000000000001e-70 or 5.6000000000000003e-41 < x.im Initial program 84.0%
*-commutative84.0%
*-commutative84.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+79.8%
distribute-lft-in79.8%
Applied egg-rr79.8%
*-commutative79.8%
distribute-rgt-out79.8%
distribute-lft-out84.7%
Applied egg-rr84.7%
difference-of-squares93.2%
*-commutative93.2%
Applied egg-rr93.2%
if -1.0800000000000001e-70 < x.im < 5.6000000000000003e-41Initial program 87.7%
Taylor expanded in x.re around inf 84.9%
Simplified84.9%
*-commutative84.9%
distribute-rgt-out84.9%
*-commutative84.9%
Applied egg-rr84.9%
Taylor expanded in x.re around 0 84.9%
Simplified84.9%
Final simplification90.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -6.6e-71) (not (<= x.im 2.15e-42))) (* x.im (+ (* (- x.re x.im) (+ x.im x.re)) (+ x.re x.re))) (+ (* x.im (* x.re x.re)) (* x.re (* x.im (+ x.re x.re))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -6.6e-71) || !(x_46_im <= 2.15e-42)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_im * (x_46_re * x_46_re)) + (x_46_re * (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_46im <= (-6.6d-71)) .or. (.not. (x_46im <= 2.15d-42))) then
tmp = x_46im * (((x_46re - x_46im) * (x_46im + x_46re)) + (x_46re + x_46re))
else
tmp = (x_46im * (x_46re * x_46re)) + (x_46re * (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_im <= -6.6e-71) || !(x_46_im <= 2.15e-42)) {
tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re));
} else {
tmp = (x_46_im * (x_46_re * x_46_re)) + (x_46_re * (x_46_im * (x_46_re + x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -6.6e-71) or not (x_46_im <= 2.15e-42): tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)) else: tmp = (x_46_im * (x_46_re * x_46_re)) + (x_46_re * (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_im <= -6.6e-71) || !(x_46_im <= 2.15e-42)) tmp = Float64(x_46_im * Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im + x_46_re)) + Float64(x_46_re + x_46_re))); else tmp = Float64(Float64(x_46_im * Float64(x_46_re * x_46_re)) + Float64(x_46_re * Float64(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_im <= -6.6e-71) || ~((x_46_im <= 2.15e-42))) tmp = x_46_im * (((x_46_re - x_46_im) * (x_46_im + x_46_re)) + (x_46_re + x_46_re)); else tmp = (x_46_im * (x_46_re * x_46_re)) + (x_46_re * (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$im, -6.6e-71], N[Not[LessEqual[x$46$im, 2.15e-42]], $MachinePrecision]], N[(x$46$im * N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im + x$46$re), $MachinePrecision]), $MachinePrecision] + N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(x$46$im * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -6.6 \cdot 10^{-71} \lor \neg \left(x.im \leq 2.15 \cdot 10^{-42}\right):\\
\;\;\;\;x.im \cdot \left(\left(x.re - x.im\right) \cdot \left(x.im + x.re\right) + \left(x.re + x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re\right) + x.re \cdot \left(x.im \cdot \left(x.re + x.re\right)\right)\\
\end{array}
\end{array}
if x.im < -6.6000000000000003e-71 or 2.1500000000000001e-42 < x.im Initial program 84.0%
*-commutative84.0%
*-commutative84.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+79.8%
distribute-lft-in79.8%
Applied egg-rr79.8%
*-commutative79.8%
distribute-rgt-out79.8%
distribute-lft-out84.7%
Applied egg-rr84.7%
difference-of-squares93.2%
*-commutative93.2%
Applied egg-rr93.2%
if -6.6000000000000003e-71 < x.im < 2.1500000000000001e-42Initial program 87.7%
Taylor expanded in x.re around inf 84.9%
Simplified84.9%
*-commutative84.9%
distribute-rgt-out84.9%
*-commutative84.9%
Applied egg-rr84.9%
Final simplification90.2%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.im -5.4e+168)
(+ (* x.im (/ x.im 0.1111111111111111)) -3.0)
(if (<= x.im 1.45e+165)
(* (* x.re x.re) (* x.im 3.0))
(* x.im (+ (+ x.re x.re) -3.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -5.4e+168) {
tmp = (x_46_im * (x_46_im / 0.1111111111111111)) + -3.0;
} else if (x_46_im <= 1.45e+165) {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
} else {
tmp = x_46_im * ((x_46_re + x_46_re) + -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) :: tmp
if (x_46im <= (-5.4d+168)) then
tmp = (x_46im * (x_46im / 0.1111111111111111d0)) + (-3.0d0)
else if (x_46im <= 1.45d+165) then
tmp = (x_46re * x_46re) * (x_46im * 3.0d0)
else
tmp = x_46im * ((x_46re + x_46re) + (-3.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= -5.4e+168) {
tmp = (x_46_im * (x_46_im / 0.1111111111111111)) + -3.0;
} else if (x_46_im <= 1.45e+165) {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
} else {
tmp = x_46_im * ((x_46_re + x_46_re) + -3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= -5.4e+168: tmp = (x_46_im * (x_46_im / 0.1111111111111111)) + -3.0 elif x_46_im <= 1.45e+165: tmp = (x_46_re * x_46_re) * (x_46_im * 3.0) else: tmp = x_46_im * ((x_46_re + x_46_re) + -3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= -5.4e+168) tmp = Float64(Float64(x_46_im * Float64(x_46_im / 0.1111111111111111)) + -3.0); elseif (x_46_im <= 1.45e+165) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_im * 3.0)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_re) + -3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= -5.4e+168) tmp = (x_46_im * (x_46_im / 0.1111111111111111)) + -3.0; elseif (x_46_im <= 1.45e+165) tmp = (x_46_re * x_46_re) * (x_46_im * 3.0); else tmp = x_46_im * ((x_46_re + x_46_re) + -3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -5.4e+168], N[(N[(x$46$im * N[(x$46$im / 0.1111111111111111), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision], If[LessEqual[x$46$im, 1.45e+165], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re + x$46$re), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -5.4 \cdot 10^{+168}:\\
\;\;\;\;x.im \cdot \frac{x.im}{0.1111111111111111} + -3\\
\mathbf{elif}\;x.im \leq 1.45 \cdot 10^{+165}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.im \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.re\right) + -3\right)\\
\end{array}
\end{array}
if x.im < -5.40000000000000031e168Initial program 67.9%
Taylor expanded in x.re around 0 67.9%
Simplified4.6%
Applied egg-rr0.0%
Simplified100.0%
associate-/l*100.0%
associate-/r/100.0%
Applied egg-rr100.0%
if -5.40000000000000031e168 < x.im < 1.45000000000000003e165Initial program 91.7%
Taylor expanded in x.re around inf 62.9%
Simplified62.9%
*-commutative62.9%
distribute-rgt-out62.9%
*-commutative62.9%
Applied egg-rr62.9%
Taylor expanded in x.re around 0 62.9%
Simplified62.9%
if 1.45000000000000003e165 < x.im Initial program 58.6%
*-commutative58.6%
*-commutative58.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.4%
distribute-lft-in72.4%
Applied egg-rr72.4%
*-commutative72.4%
distribute-rgt-out72.4%
distribute-lft-out75.9%
Applied egg-rr75.9%
Taylor expanded in x.re around 0 93.1%
Simplified22.3%
Final simplification62.3%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 2.3e+166) (* 3.0 (* x.im (* x.re x.re))) (* x.im (+ (+ x.re x.re) -3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.3e+166) {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
} else {
tmp = x_46_im * ((x_46_re + x_46_re) + -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) :: tmp
if (x_46im <= 2.3d+166) then
tmp = 3.0d0 * (x_46im * (x_46re * x_46re))
else
tmp = x_46im * ((x_46re + x_46re) + (-3.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.3e+166) {
tmp = 3.0 * (x_46_im * (x_46_re * x_46_re));
} else {
tmp = x_46_im * ((x_46_re + x_46_re) + -3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 2.3e+166: tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)) else: tmp = x_46_im * ((x_46_re + x_46_re) + -3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 2.3e+166) tmp = Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))); else tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_re) + -3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 2.3e+166) tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)); else tmp = x_46_im * ((x_46_re + x_46_re) + -3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 2.3e+166], N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re + x$46$re), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.3 \cdot 10^{+166}:\\
\;\;\;\;3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.re\right) + -3\right)\\
\end{array}
\end{array}
if x.im < 2.30000000000000008e166Initial program 88.7%
+-commutative88.7%
*-commutative88.7%
sub-neg88.7%
distribute-lft-in86.5%
associate-+r+86.5%
distribute-rgt-neg-out86.5%
unsub-neg86.5%
associate-*r*91.4%
distribute-rgt-out91.4%
*-commutative91.4%
count-291.4%
distribute-lft1-in91.4%
metadata-eval91.4%
*-commutative91.4%
*-commutative91.4%
associate-*r*91.3%
cube-unmult91.4%
Simplified91.4%
Taylor expanded in x.re around 0 91.5%
sub-neg91.5%
associate-*r*91.5%
*-commutative91.5%
Applied egg-rr91.5%
unsub-neg91.5%
associate-*l*91.4%
Applied egg-rr91.4%
Taylor expanded in x.re around inf 55.2%
Simplified55.2%
if 2.30000000000000008e166 < x.im Initial program 58.6%
*-commutative58.6%
*-commutative58.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.4%
distribute-lft-in72.4%
Applied egg-rr72.4%
*-commutative72.4%
distribute-rgt-out72.4%
distribute-lft-out75.9%
Applied egg-rr75.9%
Taylor expanded in x.re around 0 93.1%
Simplified22.3%
Final simplification51.4%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 5.8e+165) (* (* x.re x.re) (* x.im 3.0)) (* x.im (+ (+ x.re x.re) -3.0))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 5.8e+165) {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
} else {
tmp = x_46_im * ((x_46_re + x_46_re) + -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) :: tmp
if (x_46im <= 5.8d+165) then
tmp = (x_46re * x_46re) * (x_46im * 3.0d0)
else
tmp = x_46im * ((x_46re + x_46re) + (-3.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 5.8e+165) {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
} else {
tmp = x_46_im * ((x_46_re + x_46_re) + -3.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 5.8e+165: tmp = (x_46_re * x_46_re) * (x_46_im * 3.0) else: tmp = x_46_im * ((x_46_re + x_46_re) + -3.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 5.8e+165) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_im * 3.0)); else tmp = Float64(x_46_im * Float64(Float64(x_46_re + x_46_re) + -3.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 5.8e+165) tmp = (x_46_re * x_46_re) * (x_46_im * 3.0); else tmp = x_46_im * ((x_46_re + x_46_re) + -3.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 5.8e+165], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(N[(x$46$re + x$46$re), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 5.8 \cdot 10^{+165}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.im \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(\left(x.re + x.re\right) + -3\right)\\
\end{array}
\end{array}
if x.im < 5.80000000000000011e165Initial program 88.7%
Taylor expanded in x.re around inf 55.2%
Simplified55.2%
*-commutative55.2%
distribute-rgt-out55.2%
*-commutative55.2%
Applied egg-rr55.2%
Taylor expanded in x.re around 0 55.2%
Simplified55.2%
if 5.80000000000000011e165 < x.im Initial program 58.6%
*-commutative58.6%
*-commutative58.6%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+72.4%
distribute-lft-in72.4%
Applied egg-rr72.4%
*-commutative72.4%
distribute-rgt-out72.4%
distribute-lft-out75.9%
Applied egg-rr75.9%
Taylor expanded in x.re around 0 93.1%
Simplified22.3%
Final simplification51.5%
(FPCore (x.re x.im) :precision binary64 (* 3.0 (* x.im (* x.re x.re))))
double code(double x_46_re, double x_46_im) {
return 3.0 * (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 = 3.0d0 * (x_46im * (x_46re * x_46re))
end function
public static double code(double x_46_re, double x_46_im) {
return 3.0 * (x_46_im * (x_46_re * x_46_re));
}
def code(x_46_re, x_46_im): return 3.0 * (x_46_im * (x_46_re * x_46_re))
function code(x_46_re, x_46_im) return Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))) end
function tmp = code(x_46_re, x_46_im) tmp = 3.0 * (x_46_im * (x_46_re * x_46_re)); end
code[x$46$re_, x$46$im_] := N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)
\end{array}
Initial program 85.3%
+-commutative85.3%
*-commutative85.3%
sub-neg85.3%
distribute-lft-in83.4%
associate-+r+83.4%
distribute-rgt-neg-out83.4%
unsub-neg83.4%
associate-*r*87.7%
distribute-rgt-out87.7%
*-commutative87.7%
count-287.7%
distribute-lft1-in87.7%
metadata-eval87.7%
*-commutative87.7%
*-commutative87.7%
associate-*r*87.6%
cube-unmult87.7%
Simplified87.7%
Taylor expanded in x.re around 0 87.7%
sub-neg87.7%
associate-*r*87.8%
*-commutative87.8%
Applied egg-rr87.8%
unsub-neg87.8%
associate-*l*87.7%
Applied egg-rr87.7%
Taylor expanded in x.re around inf 49.8%
Simplified49.8%
Final simplification49.8%
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.re x.re)))
double code(double x_46_re, double x_46_im) {
return 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_46im * (x_46re * x_46re)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * (x_46_re * x_46_re);
}
def code(x_46_re, x_46_im): return x_46_im * (x_46_re * x_46_re)
function code(x_46_re, x_46_im) return Float64(x_46_im * Float64(x_46_re * x_46_re)) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * (x_46_re * x_46_re); end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot \left(x.re \cdot x.re\right)
\end{array}
Initial program 85.3%
Taylor expanded in x.re around inf 49.8%
Simplified49.8%
*-commutative49.8%
*-commutative49.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+27.3%
distribute-lft-in27.3%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
+-inverses0.0%
flip-+22.5%
Applied egg-rr22.5%
Taylor expanded in x.re around inf 33.5%
Simplified33.5%
Final simplification33.5%
(FPCore (x.re x.im) :precision binary64 (* x.im -3.0))
double code(double x_46_re, double x_46_im) {
return x_46_im * -3.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * (-3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * -3.0;
}
def code(x_46_re, x_46_im): return x_46_im * -3.0
function code(x_46_re, x_46_im) return Float64(x_46_im * -3.0) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * -3.0; end
code[x$46$re_, x$46$im_] := N[(x$46$im * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot -3
\end{array}
Initial program 85.3%
Taylor expanded in x.re around 0 68.0%
Simplified25.4%
Taylor expanded in x.re around 0 4.4%
Final simplification4.4%
(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 85.3%
+-commutative85.3%
*-commutative85.3%
sub-neg85.3%
distribute-lft-in83.4%
associate-+r+83.4%
distribute-rgt-neg-out83.4%
unsub-neg83.4%
associate-*r*87.7%
distribute-rgt-out87.7%
*-commutative87.7%
count-287.7%
distribute-lft1-in87.7%
metadata-eval87.7%
*-commutative87.7%
*-commutative87.7%
associate-*r*87.6%
cube-unmult87.7%
Simplified87.7%
Taylor expanded in x.re around 0 87.7%
Taylor expanded in x.re around inf 49.8%
Simplified2.6%
Final simplification2.6%
(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 85.3%
+-commutative85.3%
*-commutative85.3%
sub-neg85.3%
distribute-lft-in83.4%
associate-+r+83.4%
distribute-rgt-neg-out83.4%
unsub-neg83.4%
associate-*r*87.7%
distribute-rgt-out87.7%
*-commutative87.7%
count-287.7%
distribute-lft1-in87.7%
metadata-eval87.7%
*-commutative87.7%
*-commutative87.7%
associate-*r*87.6%
cube-unmult87.7%
Simplified87.7%
sub-neg87.7%
associate-*r*87.7%
associate-*l*87.8%
flip3-+18.1%
associate-*r*17.0%
associate-*r*17.0%
unpow-prod-down10.7%
pow210.7%
pow-pow10.7%
metadata-eval10.7%
Applied egg-rr10.7%
Simplified2.9%
Final simplification2.9%
(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 2023195
(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)))