
(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 13 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}
(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.im -3.0) (pow x.re 3.0))
(- (* x.re (* (- x.re x.im) (+ x.re x.im))) (* x.im -2.0))))
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_im * -3.0), pow(x_46_re, 3.0));
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0);
}
return tmp;
}
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_im * -3.0), (x_46_re ^ 3.0)); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + x_46_im))) - Float64(x_46_im * -2.0)); end return tmp end
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$im * -3.0), $MachinePrecision] + N[Power[x$46$re, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\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 \cdot x.im, x.im \cdot -3, {x.re}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) - x.im \cdot -2\\
\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 93.9%
Simplified92.5%
+-commutative92.5%
associate-*r*98.5%
fma-def98.5%
Applied egg-rr98.5%
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%
difference-of-squares19.4%
*-commutative19.4%
Applied egg-rr19.4%
*-commutative19.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified100.0%
Final simplification98.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.im (+ (* x.re x.im) (* x.re x.im)))))
(if (<= (- (* x.re (- (* x.re x.re) (* x.im x.im))) t_0) 2e+271)
(- (* x.re (+ (* x.re (- x.re x.im)) (* x.im (- x.re x.im)))) t_0)
(- (* x.re (* (- x.re x.im) (+ x.re x.im))) (* x.im -2.0)))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - t_0) <= 2e+271) {
tmp = (x_46_re * ((x_46_re * (x_46_re - x_46_im)) + (x_46_im * (x_46_re - x_46_im)))) - t_0;
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.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_46im * ((x_46re * x_46im) + (x_46re * x_46im))
if (((x_46re * ((x_46re * x_46re) - (x_46im * x_46im))) - t_0) <= 2d+271) then
tmp = (x_46re * ((x_46re * (x_46re - x_46im)) + (x_46im * (x_46re - x_46im)))) - t_0
else
tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) - (x_46im * (-2.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im));
double tmp;
if (((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - t_0) <= 2e+271) {
tmp = (x_46_re * ((x_46_re * (x_46_re - x_46_im)) + (x_46_im * (x_46_re - x_46_im)))) - t_0;
} else {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0);
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_im * ((x_46_re * x_46_im) + (x_46_re * x_46_im)) tmp = 0 if ((x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - t_0) <= 2e+271: tmp = (x_46_re * ((x_46_re * (x_46_re - x_46_im)) + (x_46_im * (x_46_re - x_46_im)))) - t_0 else: tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + Float64(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))) - t_0) <= 2e+271) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * Float64(x_46_re - x_46_im)) + Float64(x_46_im * Float64(x_46_re - x_46_im)))) - t_0); else tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + x_46_im))) - Float64(x_46_im * -2.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_im) + (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))) - t_0) <= 2e+271) tmp = (x_46_re * ((x_46_re * (x_46_re - x_46_im)) + (x_46_im * (x_46_re - x_46_im)))) - t_0; else tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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] - t$95$0), $MachinePrecision], 2e+271], N[(N[(x$46$re * N[(N[(x$46$re * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x$46$re * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - t_0 \leq 2 \cdot 10^{+271}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - x.im\right) + x.im \cdot \left(x.re - x.im\right)\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) - x.im \cdot -2\\
\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)) < 1.99999999999999991e271Initial program 97.6%
difference-of-squares97.6%
*-commutative97.6%
Applied egg-rr97.6%
*-commutative97.6%
distribute-lft-in97.0%
distribute-lft-in91.7%
Applied egg-rr91.7%
Simplified97.0%
if 1.99999999999999991e271 < (-.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 47.2%
difference-of-squares55.4%
*-commutative55.4%
Applied egg-rr55.4%
*-commutative55.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified89.1%
Final simplification94.3%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* (- x.re x.im) (+ x.re x.im)))))
(if (<=
(-
(* x.re (- (* x.re x.re) (* x.im x.im)))
(* x.im (+ (* x.re x.im) (* x.re x.im))))
2e+271)
(- t_0 (* x.im (* (* x.re x.im) 2.0)))
(- t_0 (* x.im -2.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_re + 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)))) <= 2e+271) {
tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0));
} else {
tmp = t_0 - (x_46_im * -2.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_46re + x_46im))
if (((x_46re * ((x_46re * x_46re) - (x_46im * x_46im))) - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))) <= 2d+271) then
tmp = t_0 - (x_46im * ((x_46re * x_46im) * 2.0d0))
else
tmp = t_0 - (x_46im * (-2.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_re + 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)))) <= 2e+271) {
tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0));
} else {
tmp = t_0 - (x_46_im * -2.0);
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * ((x_46_re - x_46_im) * (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)))) <= 2e+271: tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0)) else: tmp = t_0 - (x_46_im * -2.0) return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(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)))) <= 2e+271) tmp = Float64(t_0 - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * 2.0))); else tmp = Float64(t_0 - Float64(x_46_im * -2.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_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)))) <= 2e+271) tmp = t_0 - (x_46_im * ((x_46_re * x_46_im) * 2.0)); else tmp = t_0 - (x_46_im * -2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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], 2e+271], N[(t$95$0 - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right)\\
\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 2 \cdot 10^{+271}:\\
\;\;\;\;t_0 - x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 - x.im \cdot -2\\
\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)) < 1.99999999999999991e271Initial program 97.6%
difference-of-squares97.6%
*-commutative97.6%
Applied egg-rr97.6%
*-commutative33.7%
*-un-lft-identity33.7%
*-un-lft-identity33.7%
distribute-rgt-out33.7%
*-commutative33.7%
metadata-eval33.7%
Applied egg-rr97.6%
if 1.99999999999999991e271 < (-.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 47.2%
difference-of-squares55.4%
*-commutative55.4%
Applied egg-rr55.4%
*-commutative55.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified89.1%
Final simplification94.7%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -2e-48) (not (<= x.re 1.75e-90))) (- (* x.re (* (- x.re x.im) (+ x.re x.im))) (* x.im -2.0)) (- (* (* x.re x.im) -27.0) (* x.im (+ (* x.re x.im) (* x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -2e-48) || !(x_46_re <= 1.75e-90)) {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0);
} else {
tmp = ((x_46_re * x_46_im) * -27.0) - (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) :: tmp
if ((x_46re <= (-2d-48)) .or. (.not. (x_46re <= 1.75d-90))) then
tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) - (x_46im * (-2.0d0))
else
tmp = ((x_46re * x_46im) * (-27.0d0)) - (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 tmp;
if ((x_46_re <= -2e-48) || !(x_46_re <= 1.75e-90)) {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0);
} else {
tmp = ((x_46_re * x_46_im) * -27.0) - (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): tmp = 0 if (x_46_re <= -2e-48) or not (x_46_re <= 1.75e-90): tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0) else: tmp = ((x_46_re * x_46_im) * -27.0) - (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) tmp = 0.0 if ((x_46_re <= -2e-48) || !(x_46_re <= 1.75e-90)) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + x_46_im))) - Float64(x_46_im * -2.0)); else tmp = Float64(Float64(Float64(x_46_re * x_46_im) * -27.0) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) + 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 <= -2e-48) || ~((x_46_re <= 1.75e-90))) tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0); else tmp = ((x_46_re * x_46_im) * -27.0) - (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_] := If[Or[LessEqual[x$46$re, -2e-48], N[Not[LessEqual[x$46$re, 1.75e-90]], $MachinePrecision]], N[(N[(x$46$re * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * -27.0), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2 \cdot 10^{-48} \lor \neg \left(x.re \leq 1.75 \cdot 10^{-90}\right):\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) - x.im \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot -27 - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\end{array}
\end{array}
if x.re < -1.9999999999999999e-48 or 1.7499999999999999e-90 < x.re Initial program 77.6%
difference-of-squares81.8%
*-commutative81.8%
Applied egg-rr81.8%
*-commutative81.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified91.5%
if -1.9999999999999999e-48 < x.re < 1.7499999999999999e-90Initial program 86.3%
difference-of-squares86.3%
Applied egg-rr86.3%
Simplified46.8%
Taylor expanded in x.re around 0 50.1%
Final simplification76.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -9000000000000.0) (not (<= x.re 2600000000.0))) (- (* x.re (* x.re (- x.re 27.0))) (* x.im -2.0)) (- (* x.re (* x.im -27.0)) (* x.im (* (* x.re x.im) 2.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -9000000000000.0) || !(x_46_re <= 2600000000.0)) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0);
} else {
tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.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_46re <= (-9000000000000.0d0)) .or. (.not. (x_46re <= 2600000000.0d0))) then
tmp = (x_46re * (x_46re * (x_46re - 27.0d0))) - (x_46im * (-2.0d0))
else
tmp = (x_46re * (x_46im * (-27.0d0))) - (x_46im * ((x_46re * x_46im) * 2.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -9000000000000.0) || !(x_46_re <= 2600000000.0)) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0);
} else {
tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -9000000000000.0) or not (x_46_re <= 2600000000.0): tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0) else: tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -9000000000000.0) || !(x_46_re <= 2600000000.0)) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))) - Float64(x_46_im * -2.0)); else tmp = Float64(Float64(x_46_re * Float64(x_46_im * -27.0)) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * 2.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -9000000000000.0) || ~((x_46_re <= 2600000000.0))) tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0); else tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -9000000000000.0], N[Not[LessEqual[x$46$re, 2600000000.0]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$im * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -9000000000000 \lor \neg \left(x.re \leq 2600000000\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right) - x.im \cdot -2\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot -27\right) - x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\
\end{array}
\end{array}
if x.re < -9e12 or 2.6e9 < x.re Initial program 72.7%
difference-of-squares78.0%
Applied egg-rr78.0%
Simplified71.3%
Taylor expanded in x.im around 0 67.7%
*-commutative78.0%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified83.2%
if -9e12 < x.re < 2.6e9Initial program 89.1%
difference-of-squares89.1%
Applied egg-rr89.1%
Simplified46.0%
Taylor expanded in x.re around 0 47.8%
Simplified47.8%
*-commutative47.8%
*-un-lft-identity47.8%
*-un-lft-identity47.8%
distribute-rgt-out47.8%
*-commutative47.8%
metadata-eval47.8%
Applied egg-rr47.8%
Final simplification66.0%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -2e-48) (not (<= x.re 2.8e-88))) (- (* x.re (* (- x.re x.im) (+ x.re x.im))) (* x.im -2.0)) (- (* x.re (* x.im -27.0)) (* x.im (* (* x.re x.im) 2.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -2e-48) || !(x_46_re <= 2.8e-88)) {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0);
} else {
tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.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_46re <= (-2d-48)) .or. (.not. (x_46re <= 2.8d-88))) then
tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) - (x_46im * (-2.0d0))
else
tmp = (x_46re * (x_46im * (-27.0d0))) - (x_46im * ((x_46re * x_46im) * 2.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -2e-48) || !(x_46_re <= 2.8e-88)) {
tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0);
} else {
tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -2e-48) or not (x_46_re <= 2.8e-88): tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0) else: tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -2e-48) || !(x_46_re <= 2.8e-88)) tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + x_46_im))) - Float64(x_46_im * -2.0)); else tmp = Float64(Float64(x_46_re * Float64(x_46_im * -27.0)) - Float64(x_46_im * Float64(Float64(x_46_re * x_46_im) * 2.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -2e-48) || ~((x_46_re <= 2.8e-88))) tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * -2.0); else tmp = (x_46_re * (x_46_im * -27.0)) - (x_46_im * ((x_46_re * x_46_im) * 2.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -2e-48], N[Not[LessEqual[x$46$re, 2.8e-88]], $MachinePrecision]], N[(N[(x$46$re * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * N[(x$46$im * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(N[(x$46$re * x$46$im), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2 \cdot 10^{-48} \lor \neg \left(x.re \leq 2.8 \cdot 10^{-88}\right):\\
\;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) - x.im \cdot -2\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.im \cdot -27\right) - x.im \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\
\end{array}
\end{array}
if x.re < -1.9999999999999999e-48 or 2.79999999999999976e-88 < x.re Initial program 77.6%
difference-of-squares81.8%
*-commutative81.8%
Applied egg-rr81.8%
*-commutative81.8%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified91.5%
if -1.9999999999999999e-48 < x.re < 2.79999999999999976e-88Initial program 86.3%
difference-of-squares86.3%
Applied egg-rr86.3%
Simplified46.8%
Taylor expanded in x.re around 0 50.1%
Simplified50.1%
*-commutative50.1%
*-un-lft-identity50.1%
*-un-lft-identity50.1%
distribute-rgt-out50.1%
*-commutative50.1%
metadata-eval50.1%
Applied egg-rr50.1%
Final simplification76.8%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -3.8e-86) (not (<= x.re 120.0))) (- (* x.re (* x.re (- x.re 27.0))) (* x.im -2.0)) (* (* x.re x.im) -27.0)))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -3.8e-86) || !(x_46_re <= 120.0)) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0);
} else {
tmp = (x_46_re * x_46_im) * -27.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_46re <= (-3.8d-86)) .or. (.not. (x_46re <= 120.0d0))) then
tmp = (x_46re * (x_46re * (x_46re - 27.0d0))) - (x_46im * (-2.0d0))
else
tmp = (x_46re * x_46im) * (-27.0d0)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -3.8e-86) || !(x_46_re <= 120.0)) {
tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0);
} else {
tmp = (x_46_re * x_46_im) * -27.0;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -3.8e-86) or not (x_46_re <= 120.0): tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0) else: tmp = (x_46_re * x_46_im) * -27.0 return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -3.8e-86) || !(x_46_re <= 120.0)) tmp = Float64(Float64(x_46_re * Float64(x_46_re * Float64(x_46_re - 27.0))) - Float64(x_46_im * -2.0)); else tmp = Float64(Float64(x_46_re * x_46_im) * -27.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -3.8e-86) || ~((x_46_re <= 120.0))) tmp = (x_46_re * (x_46_re * (x_46_re - 27.0))) - (x_46_im * -2.0); else tmp = (x_46_re * x_46_im) * -27.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -3.8e-86], N[Not[LessEqual[x$46$re, 120.0]], $MachinePrecision]], N[(N[(x$46$re * N[(x$46$re * N[(x$46$re - 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * -27.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -3.8 \cdot 10^{-86} \lor \neg \left(x.re \leq 120\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.re - 27\right)\right) - x.im \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot -27\\
\end{array}
\end{array}
if x.re < -3.8e-86 or 120 < x.re Initial program 75.6%
difference-of-squares80.2%
Applied egg-rr80.2%
Simplified66.1%
Taylor expanded in x.im around 0 62.9%
*-commutative80.2%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified73.5%
if -3.8e-86 < x.re < 120Initial program 88.0%
difference-of-squares88.0%
Applied egg-rr88.0%
Simplified48.7%
Taylor expanded in x.re around 0 51.7%
Simplified51.7%
*-commutative51.7%
*-un-lft-identity51.7%
*-un-lft-identity51.7%
distribute-rgt-out51.7%
*-commutative51.7%
metadata-eval51.7%
Applied egg-rr51.7%
Taylor expanded in x.im around 0 32.9%
Final simplification57.0%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re -1.35e+173) (- (* x.re (* x.re -27.0)) (* x.im -2.0)) (if (<= x.re 3.15e+63) (* (* x.re x.im) -27.0) (* x.re (+ x.re -27.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.35e+173) {
tmp = (x_46_re * (x_46_re * -27.0)) - (x_46_im * -2.0);
} else if (x_46_re <= 3.15e+63) {
tmp = (x_46_re * x_46_im) * -27.0;
} else {
tmp = x_46_re * (x_46_re + -27.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_46re <= (-1.35d+173)) then
tmp = (x_46re * (x_46re * (-27.0d0))) - (x_46im * (-2.0d0))
else if (x_46re <= 3.15d+63) then
tmp = (x_46re * x_46im) * (-27.0d0)
else
tmp = x_46re * (x_46re + (-27.0d0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -1.35e+173) {
tmp = (x_46_re * (x_46_re * -27.0)) - (x_46_im * -2.0);
} else if (x_46_re <= 3.15e+63) {
tmp = (x_46_re * x_46_im) * -27.0;
} else {
tmp = x_46_re * (x_46_re + -27.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -1.35e+173: tmp = (x_46_re * (x_46_re * -27.0)) - (x_46_im * -2.0) elif x_46_re <= 3.15e+63: tmp = (x_46_re * x_46_im) * -27.0 else: tmp = x_46_re * (x_46_re + -27.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -1.35e+173) tmp = Float64(Float64(x_46_re * Float64(x_46_re * -27.0)) - Float64(x_46_im * -2.0)); elseif (x_46_re <= 3.15e+63) tmp = Float64(Float64(x_46_re * x_46_im) * -27.0); else tmp = Float64(x_46_re * Float64(x_46_re + -27.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -1.35e+173) tmp = (x_46_re * (x_46_re * -27.0)) - (x_46_im * -2.0); elseif (x_46_re <= 3.15e+63) tmp = (x_46_re * x_46_im) * -27.0; else tmp = x_46_re * (x_46_re + -27.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -1.35e+173], N[(N[(x$46$re * N[(x$46$re * -27.0), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 3.15e+63], N[(N[(x$46$re * x$46$im), $MachinePrecision] * -27.0), $MachinePrecision], N[(x$46$re * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.35 \cdot 10^{+173}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot -27\right) - x.im \cdot -2\\
\mathbf{elif}\;x.re \leq 3.15 \cdot 10^{+63}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re + -27\right)\\
\end{array}
\end{array}
if x.re < -1.3500000000000001e173Initial program 62.9%
difference-of-squares65.7%
Applied egg-rr65.7%
Simplified65.7%
Taylor expanded in x.im around 0 62.9%
*-commutative65.7%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified97.1%
Taylor expanded in x.re around 0 97.1%
Simplified97.1%
if -1.3500000000000001e173 < x.re < 3.1499999999999999e63Initial program 89.9%
difference-of-squares90.5%
Applied egg-rr90.5%
Simplified54.8%
Taylor expanded in x.re around 0 40.8%
Simplified40.8%
*-commutative40.8%
*-un-lft-identity40.8%
*-un-lft-identity40.8%
distribute-rgt-out40.8%
*-commutative40.8%
metadata-eval40.8%
Applied egg-rr40.8%
Taylor expanded in x.im around 0 23.4%
if 3.1499999999999999e63 < x.re Initial program 65.5%
difference-of-squares74.1%
Applied egg-rr74.1%
Simplified66.8%
Taylor expanded in x.im around 0 62.2%
Taylor expanded in x.im around 0 84.3%
Simplified67.0%
Final simplification43.4%
(FPCore (x.re x.im) :precision binary64 (if (<= x.re -7.2e+174) (* x.re x.im) (if (<= x.re 3.2e+63) (* (* x.re x.im) -27.0) (* x.re (+ x.re -27.0)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -7.2e+174) {
tmp = x_46_re * x_46_im;
} else if (x_46_re <= 3.2e+63) {
tmp = (x_46_re * x_46_im) * -27.0;
} else {
tmp = x_46_re * (x_46_re + -27.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_46re <= (-7.2d+174)) then
tmp = x_46re * x_46im
else if (x_46re <= 3.2d+63) then
tmp = (x_46re * x_46im) * (-27.0d0)
else
tmp = x_46re * (x_46re + (-27.0d0))
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+174) {
tmp = x_46_re * x_46_im;
} else if (x_46_re <= 3.2e+63) {
tmp = (x_46_re * x_46_im) * -27.0;
} else {
tmp = x_46_re * (x_46_re + -27.0);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -7.2e+174: tmp = x_46_re * x_46_im elif x_46_re <= 3.2e+63: tmp = (x_46_re * x_46_im) * -27.0 else: tmp = x_46_re * (x_46_re + -27.0) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -7.2e+174) tmp = Float64(x_46_re * x_46_im); elseif (x_46_re <= 3.2e+63) tmp = Float64(Float64(x_46_re * x_46_im) * -27.0); else tmp = Float64(x_46_re * Float64(x_46_re + -27.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_re <= -7.2e+174) tmp = x_46_re * x_46_im; elseif (x_46_re <= 3.2e+63) tmp = (x_46_re * x_46_im) * -27.0; else tmp = x_46_re * (x_46_re + -27.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -7.2e+174], N[(x$46$re * x$46$im), $MachinePrecision], If[LessEqual[x$46$re, 3.2e+63], N[(N[(x$46$re * x$46$im), $MachinePrecision] * -27.0), $MachinePrecision], N[(x$46$re * N[(x$46$re + -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.2 \cdot 10^{+174}:\\
\;\;\;\;x.re \cdot x.im\\
\mathbf{elif}\;x.re \leq 3.2 \cdot 10^{+63}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(x.re + -27\right)\\
\end{array}
\end{array}
if x.re < -7.2000000000000003e174Initial program 62.9%
difference-of-squares65.7%
*-commutative65.7%
Applied egg-rr65.7%
Taylor expanded in x.re around 0 3.3%
Simplified24.7%
if -7.2000000000000003e174 < x.re < 3.20000000000000011e63Initial program 89.9%
difference-of-squares90.5%
Applied egg-rr90.5%
Simplified54.8%
Taylor expanded in x.re around 0 40.8%
Simplified40.8%
*-commutative40.8%
*-un-lft-identity40.8%
*-un-lft-identity40.8%
distribute-rgt-out40.8%
*-commutative40.8%
metadata-eval40.8%
Applied egg-rr40.8%
Taylor expanded in x.im around 0 23.4%
if 3.20000000000000011e63 < x.re Initial program 65.5%
difference-of-squares74.1%
Applied egg-rr74.1%
Simplified66.8%
Taylor expanded in x.im around 0 62.2%
Taylor expanded in x.im around 0 84.3%
Simplified67.0%
Final simplification33.5%
(FPCore (x.re x.im) :precision binary64 (if (<= x.im 2.15e+219) (* x.re x.im) (* (* x.re x.im) -27.0)))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_im <= 2.15e+219) {
tmp = x_46_re * x_46_im;
} else {
tmp = (x_46_re * x_46_im) * -27.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.15d+219) then
tmp = x_46re * x_46im
else
tmp = (x_46re * x_46im) * (-27.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.15e+219) {
tmp = x_46_re * x_46_im;
} else {
tmp = (x_46_re * x_46_im) * -27.0;
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_im <= 2.15e+219: tmp = x_46_re * x_46_im else: tmp = (x_46_re * x_46_im) * -27.0 return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_im <= 2.15e+219) tmp = Float64(x_46_re * x_46_im); else tmp = Float64(Float64(x_46_re * x_46_im) * -27.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if (x_46_im <= 2.15e+219) tmp = x_46_re * x_46_im; else tmp = (x_46_re * x_46_im) * -27.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, 2.15e+219], N[(x$46$re * x$46$im), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * -27.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.15 \cdot 10^{+219}:\\
\;\;\;\;x.re \cdot x.im\\
\mathbf{else}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot -27\\
\end{array}
\end{array}
if x.im < 2.1499999999999999e219Initial program 82.7%
difference-of-squares84.3%
*-commutative84.3%
Applied egg-rr84.3%
Taylor expanded in x.re around 0 41.3%
Simplified23.1%
if 2.1499999999999999e219 < x.im Initial program 50.4%
difference-of-squares69.2%
Applied egg-rr69.2%
Simplified63.7%
Taylor expanded in x.re around 0 70.0%
Simplified70.0%
*-commutative70.0%
*-un-lft-identity70.0%
*-un-lft-identity70.0%
distribute-rgt-out70.0%
*-commutative70.0%
metadata-eval70.0%
Applied egg-rr70.0%
Taylor expanded in x.im around 0 27.5%
Final simplification23.4%
(FPCore (x.re x.im) :precision binary64 (* x.im 2.0))
double code(double x_46_re, double x_46_im) {
return x_46_im * 2.0;
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = x_46im * 2.0d0
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_im * 2.0;
}
def code(x_46_re, x_46_im): return x_46_im * 2.0
function code(x_46_re, x_46_im) return Float64(x_46_im * 2.0) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_im * 2.0; end
code[x$46$re_, x$46$im_] := N[(x$46$im * 2.0), $MachinePrecision]
\begin{array}{l}
\\
x.im \cdot 2
\end{array}
Initial program 80.7%
difference-of-squares83.4%
Applied egg-rr83.4%
Simplified59.0%
Taylor expanded in x.im around 0 58.2%
*-commutative83.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified45.5%
Taylor expanded in x.re around 0 3.6%
Final simplification3.6%
(FPCore (x.re x.im) :precision binary64 (* x.re x.im))
double code(double x_46_re, double x_46_im) {
return 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
end function
public static double code(double x_46_re, double x_46_im) {
return x_46_re * x_46_im;
}
def code(x_46_re, x_46_im): return x_46_re * x_46_im
function code(x_46_re, x_46_im) return Float64(x_46_re * x_46_im) end
function tmp = code(x_46_re, x_46_im) tmp = x_46_re * x_46_im; end
code[x$46$re_, x$46$im_] := N[(x$46$re * x$46$im), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot x.im
\end{array}
Initial program 80.7%
difference-of-squares83.4%
*-commutative83.4%
Applied egg-rr83.4%
Taylor expanded in x.re around 0 43.0%
Simplified23.2%
Final simplification23.2%
(FPCore (x.re x.im) :precision binary64 (- x.im))
double code(double x_46_re, double x_46_im) {
return -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_46im
end function
public static double code(double x_46_re, double x_46_im) {
return -x_46_im;
}
def code(x_46_re, x_46_im): return -x_46_im
function code(x_46_re, x_46_im) return Float64(-x_46_im) end
function tmp = code(x_46_re, x_46_im) tmp = -x_46_im; end
code[x$46$re_, x$46$im_] := (-x$46$im)
\begin{array}{l}
\\
-x.im
\end{array}
Initial program 80.7%
difference-of-squares83.4%
Applied egg-rr83.4%
Simplified59.0%
Taylor expanded in x.im around 0 58.2%
*-commutative83.4%
flip-+0.0%
+-inverses0.0%
+-inverses0.0%
metadata-eval0.0%
+-inverses0.0%
*-commutative0.0%
+-inverses0.0%
*-commutative0.0%
distribute-neg-frac0.0%
*-commutative0.0%
*-commutative0.0%
+-inverses0.0%
Applied egg-rr0.0%
Simplified45.5%
Taylor expanded in x.re around 0 3.6%
Simplified3.6%
Final simplification3.6%
(FPCore (x.re x.im) :precision binary64 (+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im)))))
double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)));
}
real(8) function code(x_46re, x_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
code = ((x_46re * x_46re) * (x_46re - x_46im)) + ((x_46re * x_46im) * (x_46re - (3.0d0 * x_46im)))
end function
public static double code(double x_46_re, double x_46_im) {
return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)));
}
def code(x_46_re, x_46_im): return ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im)))
function code(x_46_re, x_46_im) return Float64(Float64(Float64(x_46_re * x_46_re) * Float64(x_46_re - x_46_im)) + Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re - Float64(3.0 * x_46_im)))) end
function tmp = code(x_46_re, x_46_im) tmp = ((x_46_re * x_46_re) * (x_46_re - x_46_im)) + ((x_46_re * x_46_im) * (x_46_re - (3.0 * x_46_im))); end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re - N[(3.0 * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right) + \left(x.re \cdot x.im\right) \cdot \left(x.re - 3 \cdot x.im\right)
\end{array}
herbie shell --seed 2023318
(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)))