
(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 11 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.re -7.5e+154)
(* x.re (* x.re (* x.im 3.0)))
(if (<= x.re 7.7e+149)
(fma (* x.re x.re) (* x.im 3.0) (- (pow x.im 3.0)))
(* x.re (* 3.0 (* x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -7.5e+154) {
tmp = x_46_re * (x_46_re * (x_46_im * 3.0));
} else if (x_46_re <= 7.7e+149) {
tmp = fma((x_46_re * x_46_re), (x_46_im * 3.0), -pow(x_46_im, 3.0));
} else {
tmp = x_46_re * (3.0 * (x_46_re * x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -7.5e+154) tmp = Float64(x_46_re * Float64(x_46_re * Float64(x_46_im * 3.0))); elseif (x_46_re <= 7.7e+149) tmp = fma(Float64(x_46_re * x_46_re), Float64(x_46_im * 3.0), Float64(-(x_46_im ^ 3.0))); else tmp = Float64(x_46_re * Float64(3.0 * Float64(x_46_re * x_46_im))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -7.5e+154], N[(x$46$re * N[(x$46$re * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 7.7e+149], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$im * 3.0), $MachinePrecision] + (-N[Power[x$46$im, 3.0], $MachinePrecision])), $MachinePrecision], N[(x$46$re * N[(3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+154}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right)\\
\mathbf{elif}\;x.re \leq 7.7 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(x.re \cdot x.re, x.im \cdot 3, -{x.im}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -7.5000000000000004e154Initial program 48.6%
add-log-exp48.6%
*-un-lft-identity48.6%
log-prod48.6%
metadata-eval48.6%
add-log-exp48.6%
*-commutative48.6%
difference-of-squares69.6%
associate-*r*92.0%
Applied egg-rr92.0%
Taylor expanded in x.im around 0 69.6%
distribute-lft1-in69.6%
metadata-eval69.6%
*-commutative69.6%
associate-*r*69.6%
metadata-eval69.6%
distribute-lft1-in69.6%
unpow269.6%
associate-*l*92.0%
distribute-lft1-in92.0%
metadata-eval92.0%
*-commutative92.0%
Simplified92.0%
if -7.5000000000000004e154 < x.re < 7.69999999999999998e149Initial program 89.6%
Taylor expanded in x.re around 0 89.6%
Simplified99.9%
if 7.69999999999999998e149 < x.re Initial program 65.8%
add-log-exp61.8%
*-un-lft-identity61.8%
log-prod61.8%
metadata-eval61.8%
add-log-exp65.8%
*-commutative65.8%
difference-of-squares74.5%
associate-*r*86.9%
Applied egg-rr86.9%
Taylor expanded in x.im around 0 74.5%
distribute-lft1-in74.5%
metadata-eval74.5%
*-commutative74.5%
associate-*r*74.5%
metadata-eval74.5%
distribute-lft1-in74.5%
unpow274.5%
associate-*l*86.9%
distribute-lft1-in86.9%
metadata-eval86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in x.re around 0 87.0%
Final simplification97.5%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -7.5e+154)
(* x.re (* x.re (* x.im 3.0)))
(if (<= x.re 6.5e+149)
(fma x.im (* x.re (+ x.re x.re)) (* x.im (- (* x.re x.re) (* x.im x.im))))
(* x.re (* 3.0 (* x.re x.im))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -7.5e+154) {
tmp = x_46_re * (x_46_re * (x_46_im * 3.0));
} else if (x_46_re <= 6.5e+149) {
tmp = fma(x_46_im, (x_46_re * (x_46_re + x_46_re)), (x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))));
} else {
tmp = x_46_re * (3.0 * (x_46_re * x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -7.5e+154) tmp = Float64(x_46_re * Float64(x_46_re * Float64(x_46_im * 3.0))); elseif (x_46_re <= 6.5e+149) tmp = fma(x_46_im, Float64(x_46_re * Float64(x_46_re + x_46_re)), Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)))); else tmp = Float64(x_46_re * Float64(3.0 * Float64(x_46_re * x_46_im))); end return tmp end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -7.5e+154], N[(x$46$re * N[(x$46$re * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6.5e+149], N[(x$46$im * N[(x$46$re * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision] + N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re * N[(3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+154}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right)\\
\mathbf{elif}\;x.re \leq 6.5 \cdot 10^{+149}:\\
\;\;\;\;\mathsf{fma}\left(x.im, x.re \cdot \left(x.re + x.re\right), x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -7.5000000000000004e154Initial program 48.6%
add-log-exp48.6%
*-un-lft-identity48.6%
log-prod48.6%
metadata-eval48.6%
add-log-exp48.6%
*-commutative48.6%
difference-of-squares69.6%
associate-*r*92.0%
Applied egg-rr92.0%
Taylor expanded in x.im around 0 69.6%
distribute-lft1-in69.6%
metadata-eval69.6%
*-commutative69.6%
associate-*r*69.6%
metadata-eval69.6%
distribute-lft1-in69.6%
unpow269.6%
associate-*l*92.0%
distribute-lft1-in92.0%
metadata-eval92.0%
*-commutative92.0%
Simplified92.0%
if -7.5000000000000004e154 < x.re < 6.50000000000000015e149Initial program 89.6%
add-cube-cbrt89.0%
pow389.0%
*-commutative89.0%
difference-of-squares89.0%
associate-*r*89.0%
Applied egg-rr89.0%
Taylor expanded in x.re around 0 89.0%
Simplified89.0%
+-commutative89.0%
associate-*l*89.0%
fma-def99.3%
unpow399.3%
add-cube-cbrt99.8%
associate-*l*99.8%
difference-of-squares99.8%
Applied egg-rr99.8%
if 6.50000000000000015e149 < x.re Initial program 65.8%
add-log-exp61.8%
*-un-lft-identity61.8%
log-prod61.8%
metadata-eval61.8%
add-log-exp65.8%
*-commutative65.8%
difference-of-squares74.5%
associate-*r*86.9%
Applied egg-rr86.9%
Taylor expanded in x.im around 0 74.5%
distribute-lft1-in74.5%
metadata-eval74.5%
*-commutative74.5%
associate-*r*74.5%
metadata-eval74.5%
distribute-lft1-in74.5%
unpow274.5%
associate-*l*86.9%
distribute-lft1-in86.9%
metadata-eval86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in x.re around 0 87.0%
Final simplification97.5%
(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.im) (* x.im (+ x.re x.im))) (* (* x.re x.im) (+ x.re x.re)))
(* x.im (* x.im (- x.im)))))
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_im) * (x_46_im * (x_46_re + x_46_im))) + ((x_46_re * x_46_im) * (x_46_re + x_46_re));
} else {
tmp = x_46_im * (x_46_im * -x_46_im);
}
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_im) * (x_46_im * (x_46_re + x_46_im))) + ((x_46_re * x_46_im) * (x_46_re + x_46_re));
} else {
tmp = x_46_im * (x_46_im * -x_46_im);
}
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_im) * (x_46_im * (x_46_re + x_46_im))) + ((x_46_re * x_46_im) * (x_46_re + x_46_re)) else: tmp = x_46_im * (x_46_im * -x_46_im) 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(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_re + x_46_im))) + Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re + x_46_re))); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); 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_im) * (x_46_im * (x_46_re + x_46_im))) + ((x_46_re * x_46_im) * (x_46_re + x_46_re)); else tmp = x_46_im * (x_46_im * -x_46_im); 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[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re + x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $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:\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + \left(x.re \cdot x.im\right) \cdot \left(x.re + x.re\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-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 94.7%
add-cube-cbrt94.1%
pow394.2%
*-commutative94.2%
difference-of-squares94.2%
associate-*r*99.3%
Applied egg-rr99.3%
Taylor expanded in x.re around 0 94.2%
Simplified99.3%
unpow399.3%
add-cube-cbrt99.8%
*-commutative99.8%
+-commutative99.8%
Applied egg-rr99.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%
expm1-log1p-u0.0%
expm1-udef0.0%
Applied egg-rr0.0%
Simplified55.6%
Taylor expanded in x.re around 0 72.2%
Simplified72.2%
Final simplification95.9%
(FPCore (x.re x.im)
:precision binary64
(if (or (<= x.re -1.7e+72)
(not
(or (<= x.re -3.4e+23)
(and (not (<= x.re -5.6e-64)) (<= x.re 4.9e+60)))))
(* x.im (* 3.0 (* x.re x.re)))
(* x.im (* x.im (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -1.7e+72) || !((x_46_re <= -3.4e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 4.9e+60)))) {
tmp = x_46_im * (3.0 * (x_46_re * x_46_re));
} else {
tmp = x_46_im * (x_46_im * -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 <= (-1.7d+72)) .or. (.not. (x_46re <= (-3.4d+23)) .or. (.not. (x_46re <= (-5.6d-64))) .and. (x_46re <= 4.9d+60))) then
tmp = x_46im * (3.0d0 * (x_46re * x_46re))
else
tmp = x_46im * (x_46im * -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 <= -1.7e+72) || !((x_46_re <= -3.4e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 4.9e+60)))) {
tmp = x_46_im * (3.0 * (x_46_re * x_46_re));
} else {
tmp = x_46_im * (x_46_im * -x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -1.7e+72) or not ((x_46_re <= -3.4e+23) or (not (x_46_re <= -5.6e-64) and (x_46_re <= 4.9e+60))): tmp = x_46_im * (3.0 * (x_46_re * x_46_re)) else: tmp = x_46_im * (x_46_im * -x_46_im) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -1.7e+72) || !((x_46_re <= -3.4e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 4.9e+60)))) tmp = Float64(x_46_im * Float64(3.0 * Float64(x_46_re * x_46_re))); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -1.7e+72) || ~(((x_46_re <= -3.4e+23) || (~((x_46_re <= -5.6e-64)) && (x_46_re <= 4.9e+60))))) tmp = x_46_im * (3.0 * (x_46_re * x_46_re)); else tmp = x_46_im * (x_46_im * -x_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -1.7e+72], N[Not[Or[LessEqual[x$46$re, -3.4e+23], And[N[Not[LessEqual[x$46$re, -5.6e-64]], $MachinePrecision], LessEqual[x$46$re, 4.9e+60]]]], $MachinePrecision]], N[(x$46$im * N[(3.0 * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.7 \cdot 10^{+72} \lor \neg \left(x.re \leq -3.4 \cdot 10^{+23} \lor \neg \left(x.re \leq -5.6 \cdot 10^{-64}\right) \land x.re \leq 4.9 \cdot 10^{+60}\right):\\
\;\;\;\;x.im \cdot \left(3 \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -1.6999999999999999e72 or -3.39999999999999992e23 < x.re < -5.60000000000000008e-64 or 4.9000000000000003e60 < x.re Initial program 67.6%
Taylor expanded in x.im around 0 70.9%
Simplified70.9%
if -1.6999999999999999e72 < x.re < -3.39999999999999992e23 or -5.60000000000000008e-64 < x.re < 4.9000000000000003e60Initial program 93.9%
expm1-log1p-u67.2%
expm1-udef48.3%
Applied egg-rr0.0%
Simplified92.5%
Taylor expanded in x.re around 0 91.5%
Simplified91.5%
Final simplification81.7%
(FPCore (x.re x.im)
:precision binary64
(if (<= x.re -8e+71)
(* x.im (* x.re (* x.re 3.0)))
(if (or (<= x.re -7e+23) (and (not (<= x.re -5.6e-64)) (<= x.re 4e+59)))
(* x.im (* x.im (- x.im)))
(* x.im (* 3.0 (* x.re x.re))))))
double code(double x_46_re, double x_46_im) {
double tmp;
if (x_46_re <= -8e+71) {
tmp = x_46_im * (x_46_re * (x_46_re * 3.0));
} else if ((x_46_re <= -7e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 4e+59))) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = x_46_im * (3.0 * (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 <= (-8d+71)) then
tmp = x_46im * (x_46re * (x_46re * 3.0d0))
else if ((x_46re <= (-7d+23)) .or. (.not. (x_46re <= (-5.6d-64))) .and. (x_46re <= 4d+59)) then
tmp = x_46im * (x_46im * -x_46im)
else
tmp = x_46im * (3.0d0 * (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 <= -8e+71) {
tmp = x_46_im * (x_46_re * (x_46_re * 3.0));
} else if ((x_46_re <= -7e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 4e+59))) {
tmp = x_46_im * (x_46_im * -x_46_im);
} else {
tmp = x_46_im * (3.0 * (x_46_re * x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if x_46_re <= -8e+71: tmp = x_46_im * (x_46_re * (x_46_re * 3.0)) elif (x_46_re <= -7e+23) or (not (x_46_re <= -5.6e-64) and (x_46_re <= 4e+59)): tmp = x_46_im * (x_46_im * -x_46_im) else: tmp = x_46_im * (3.0 * (x_46_re * x_46_re)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if (x_46_re <= -8e+71) tmp = Float64(x_46_im * Float64(x_46_re * Float64(x_46_re * 3.0))); elseif ((x_46_re <= -7e+23) || (!(x_46_re <= -5.6e-64) && (x_46_re <= 4e+59))) tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); else tmp = Float64(x_46_im * Float64(3.0 * 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 <= -8e+71) tmp = x_46_im * (x_46_re * (x_46_re * 3.0)); elseif ((x_46_re <= -7e+23) || (~((x_46_re <= -5.6e-64)) && (x_46_re <= 4e+59))) tmp = x_46_im * (x_46_im * -x_46_im); else tmp = x_46_im * (3.0 * (x_46_re * x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -8e+71], N[(x$46$im * N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, -7e+23], And[N[Not[LessEqual[x$46$re, -5.6e-64]], $MachinePrecision], LessEqual[x$46$re, 4e+59]]], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(3.0 * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -8 \cdot 10^{+71}:\\
\;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)\\
\mathbf{elif}\;x.re \leq -7 \cdot 10^{+23} \lor \neg \left(x.re \leq -5.6 \cdot 10^{-64}\right) \land x.re \leq 4 \cdot 10^{+59}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(3 \cdot \left(x.re \cdot x.re\right)\right)\\
\end{array}
\end{array}
if x.re < -8.0000000000000003e71Initial program 55.1%
add-log-exp37.5%
*-un-lft-identity37.5%
log-prod37.5%
metadata-eval37.5%
add-log-exp55.1%
*-commutative55.1%
difference-of-squares69.2%
associate-*r*84.1%
Applied egg-rr84.1%
Taylor expanded in x.im around 0 69.1%
distribute-lft1-in69.1%
metadata-eval69.1%
*-commutative69.1%
unpow269.1%
associate-*r*69.2%
*-commutative69.2%
Simplified69.2%
if -8.0000000000000003e71 < x.re < -7.0000000000000004e23 or -5.60000000000000008e-64 < x.re < 3.99999999999999989e59Initial program 93.9%
expm1-log1p-u67.2%
expm1-udef48.3%
Applied egg-rr0.0%
Simplified92.5%
Taylor expanded in x.re around 0 91.5%
Simplified91.5%
if -7.0000000000000004e23 < x.re < -5.60000000000000008e-64 or 3.99999999999999989e59 < x.re Initial program 78.5%
Taylor expanded in x.im around 0 72.4%
Simplified72.4%
Final simplification81.7%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* 3.0 (* x.re x.im)))) (t_1 (* x.im (* x.im (- x.im)))))
(if (<= x.re -7.5e+71)
t_0
(if (<= x.re -2.65e+23)
t_1
(if (<= x.re -5.6e-64)
(* x.im (* 3.0 (* x.re x.re)))
(if (<= x.re 2.85e+60) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (3.0 * (x_46_re * x_46_im));
double t_1 = x_46_im * (x_46_im * -x_46_im);
double tmp;
if (x_46_re <= -7.5e+71) {
tmp = t_0;
} else if (x_46_re <= -2.65e+23) {
tmp = t_1;
} else if (x_46_re <= -5.6e-64) {
tmp = x_46_im * (3.0 * (x_46_re * x_46_re));
} else if (x_46_re <= 2.85e+60) {
tmp = t_1;
} else {
tmp = t_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) :: t_1
real(8) :: tmp
t_0 = x_46re * (3.0d0 * (x_46re * x_46im))
t_1 = x_46im * (x_46im * -x_46im)
if (x_46re <= (-7.5d+71)) then
tmp = t_0
else if (x_46re <= (-2.65d+23)) then
tmp = t_1
else if (x_46re <= (-5.6d-64)) then
tmp = x_46im * (3.0d0 * (x_46re * x_46re))
else if (x_46re <= 2.85d+60) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (3.0 * (x_46_re * x_46_im));
double t_1 = x_46_im * (x_46_im * -x_46_im);
double tmp;
if (x_46_re <= -7.5e+71) {
tmp = t_0;
} else if (x_46_re <= -2.65e+23) {
tmp = t_1;
} else if (x_46_re <= -5.6e-64) {
tmp = x_46_im * (3.0 * (x_46_re * x_46_re));
} else if (x_46_re <= 2.85e+60) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * (3.0 * (x_46_re * x_46_im)) t_1 = x_46_im * (x_46_im * -x_46_im) tmp = 0 if x_46_re <= -7.5e+71: tmp = t_0 elif x_46_re <= -2.65e+23: tmp = t_1 elif x_46_re <= -5.6e-64: tmp = x_46_im * (3.0 * (x_46_re * x_46_re)) elif x_46_re <= 2.85e+60: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(3.0 * Float64(x_46_re * x_46_im))) t_1 = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))) tmp = 0.0 if (x_46_re <= -7.5e+71) tmp = t_0; elseif (x_46_re <= -2.65e+23) tmp = t_1; elseif (x_46_re <= -5.6e-64) tmp = Float64(x_46_im * Float64(3.0 * Float64(x_46_re * x_46_re))); elseif (x_46_re <= 2.85e+60) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_re * (3.0 * (x_46_re * x_46_im)); t_1 = x_46_im * (x_46_im * -x_46_im); tmp = 0.0; if (x_46_re <= -7.5e+71) tmp = t_0; elseif (x_46_re <= -2.65e+23) tmp = t_1; elseif (x_46_re <= -5.6e-64) tmp = x_46_im * (3.0 * (x_46_re * x_46_re)); elseif (x_46_re <= 2.85e+60) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -7.5e+71], t$95$0, If[LessEqual[x$46$re, -2.65e+23], t$95$1, If[LessEqual[x$46$re, -5.6e-64], N[(x$46$im * N[(3.0 * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.85e+60], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right)\\
t_1 := x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{if}\;x.re \leq -7.5 \cdot 10^{+71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -2.65 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq -5.6 \cdot 10^{-64}:\\
\;\;\;\;x.im \cdot \left(3 \cdot \left(x.re \cdot x.re\right)\right)\\
\mathbf{elif}\;x.re \leq 2.85 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.re < -7.50000000000000007e71 or 2.84999999999999989e60 < x.re Initial program 60.5%
add-log-exp38.6%
*-un-lft-identity38.6%
log-prod38.6%
metadata-eval38.6%
add-log-exp60.5%
*-commutative60.5%
difference-of-squares70.5%
associate-*r*81.9%
Applied egg-rr81.9%
Taylor expanded in x.im around 0 70.5%
distribute-lft1-in70.5%
metadata-eval70.5%
*-commutative70.5%
associate-*r*70.5%
metadata-eval70.5%
distribute-lft1-in70.5%
unpow270.5%
associate-*l*81.8%
distribute-lft1-in81.8%
metadata-eval81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x.re around 0 81.8%
if -7.50000000000000007e71 < x.re < -2.6500000000000001e23 or -5.60000000000000008e-64 < x.re < 2.84999999999999989e60Initial program 93.9%
expm1-log1p-u67.2%
expm1-udef48.3%
Applied egg-rr0.0%
Simplified92.5%
Taylor expanded in x.re around 0 91.5%
Simplified91.5%
if -2.6500000000000001e23 < x.re < -5.60000000000000008e-64Initial program 99.7%
Taylor expanded in x.im around 0 72.6%
Simplified72.6%
Final simplification86.1%
(FPCore (x.re x.im)
:precision binary64
(let* ((t_0 (* x.re (* 3.0 (* x.re x.im)))) (t_1 (* x.im (* x.im (- x.im)))))
(if (<= x.re -8.2e+71)
t_0
(if (<= x.re -2.7e+23)
t_1
(if (<= x.re -5.6e-64)
(* (* x.re x.re) (* x.im 3.0))
(if (<= x.re 4e+59) t_1 t_0))))))
double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (3.0 * (x_46_re * x_46_im));
double t_1 = x_46_im * (x_46_im * -x_46_im);
double tmp;
if (x_46_re <= -8.2e+71) {
tmp = t_0;
} else if (x_46_re <= -2.7e+23) {
tmp = t_1;
} else if (x_46_re <= -5.6e-64) {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
} else if (x_46_re <= 4e+59) {
tmp = t_1;
} else {
tmp = t_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) :: t_1
real(8) :: tmp
t_0 = x_46re * (3.0d0 * (x_46re * x_46im))
t_1 = x_46im * (x_46im * -x_46im)
if (x_46re <= (-8.2d+71)) then
tmp = t_0
else if (x_46re <= (-2.7d+23)) then
tmp = t_1
else if (x_46re <= (-5.6d-64)) then
tmp = (x_46re * x_46re) * (x_46im * 3.0d0)
else if (x_46re <= 4d+59) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
double t_0 = x_46_re * (3.0 * (x_46_re * x_46_im));
double t_1 = x_46_im * (x_46_im * -x_46_im);
double tmp;
if (x_46_re <= -8.2e+71) {
tmp = t_0;
} else if (x_46_re <= -2.7e+23) {
tmp = t_1;
} else if (x_46_re <= -5.6e-64) {
tmp = (x_46_re * x_46_re) * (x_46_im * 3.0);
} else if (x_46_re <= 4e+59) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im): t_0 = x_46_re * (3.0 * (x_46_re * x_46_im)) t_1 = x_46_im * (x_46_im * -x_46_im) tmp = 0 if x_46_re <= -8.2e+71: tmp = t_0 elif x_46_re <= -2.7e+23: tmp = t_1 elif x_46_re <= -5.6e-64: tmp = (x_46_re * x_46_re) * (x_46_im * 3.0) elif x_46_re <= 4e+59: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im) t_0 = Float64(x_46_re * Float64(3.0 * Float64(x_46_re * x_46_im))) t_1 = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))) tmp = 0.0 if (x_46_re <= -8.2e+71) tmp = t_0; elseif (x_46_re <= -2.7e+23) tmp = t_1; elseif (x_46_re <= -5.6e-64) tmp = Float64(Float64(x_46_re * x_46_re) * Float64(x_46_im * 3.0)); elseif (x_46_re <= 4e+59) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im) t_0 = x_46_re * (3.0 * (x_46_re * x_46_im)); t_1 = x_46_im * (x_46_im * -x_46_im); tmp = 0.0; if (x_46_re <= -8.2e+71) tmp = t_0; elseif (x_46_re <= -2.7e+23) tmp = t_1; elseif (x_46_re <= -5.6e-64) tmp = (x_46_re * x_46_re) * (x_46_im * 3.0); elseif (x_46_re <= 4e+59) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -8.2e+71], t$95$0, If[LessEqual[x$46$re, -2.7e+23], t$95$1, If[LessEqual[x$46$re, -5.6e-64], N[(N[(x$46$re * x$46$re), $MachinePrecision] * N[(x$46$im * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 4e+59], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right)\\
t_1 := x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\mathbf{if}\;x.re \leq -8.2 \cdot 10^{+71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x.re \leq -2.7 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq -5.6 \cdot 10^{-64}:\\
\;\;\;\;\left(x.re \cdot x.re\right) \cdot \left(x.im \cdot 3\right)\\
\mathbf{elif}\;x.re \leq 4 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x.re < -8.2000000000000004e71 or 3.99999999999999989e59 < x.re Initial program 60.5%
add-log-exp38.6%
*-un-lft-identity38.6%
log-prod38.6%
metadata-eval38.6%
add-log-exp60.5%
*-commutative60.5%
difference-of-squares70.5%
associate-*r*81.9%
Applied egg-rr81.9%
Taylor expanded in x.im around 0 70.5%
distribute-lft1-in70.5%
metadata-eval70.5%
*-commutative70.5%
associate-*r*70.5%
metadata-eval70.5%
distribute-lft1-in70.5%
unpow270.5%
associate-*l*81.8%
distribute-lft1-in81.8%
metadata-eval81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in x.re around 0 81.8%
if -8.2000000000000004e71 < x.re < -2.6999999999999999e23 or -5.60000000000000008e-64 < x.re < 3.99999999999999989e59Initial program 93.9%
expm1-log1p-u67.2%
expm1-udef48.3%
Applied egg-rr0.0%
Simplified92.5%
Taylor expanded in x.re around 0 91.5%
Simplified91.5%
if -2.6999999999999999e23 < x.re < -5.60000000000000008e-64Initial program 99.7%
Taylor expanded in x.re around inf 72.7%
Simplified72.7%
Final simplification86.1%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.im -7.8e-48) (not (<= x.im 9.5e-97))) (* x.im (- (* x.re x.re) (* x.im x.im))) (* x.re (* 3.0 (* x.re x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_im <= -7.8e-48) || !(x_46_im <= 9.5e-97)) {
tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im));
} else {
tmp = x_46_re * (3.0 * (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_46im <= (-7.8d-48)) .or. (.not. (x_46im <= 9.5d-97))) then
tmp = x_46im * ((x_46re * x_46re) - (x_46im * x_46im))
else
tmp = x_46re * (3.0d0 * (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_im <= -7.8e-48) || !(x_46_im <= 9.5e-97)) {
tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im));
} else {
tmp = x_46_re * (3.0 * (x_46_re * x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_im <= -7.8e-48) or not (x_46_im <= 9.5e-97): tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)) else: tmp = x_46_re * (3.0 * (x_46_re * x_46_im)) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_im <= -7.8e-48) || !(x_46_im <= 9.5e-97)) tmp = Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))); else tmp = Float64(x_46_re * Float64(3.0 * 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_im <= -7.8e-48) || ~((x_46_im <= 9.5e-97))) tmp = x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im)); else tmp = x_46_re * (3.0 * (x_46_re * x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$im, -7.8e-48], N[Not[LessEqual[x$46$im, 9.5e-97]], $MachinePrecision]], 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[(3.0 * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -7.8 \cdot 10^{-48} \lor \neg \left(x.im \leq 9.5 \cdot 10^{-97}\right):\\
\;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right)\\
\end{array}
\end{array}
if x.im < -7.800000000000001e-48 or 9.5000000000000001e-97 < x.im Initial program 77.4%
expm1-log1p-u43.5%
expm1-udef34.3%
Applied egg-rr0.0%
Simplified81.5%
if -7.800000000000001e-48 < x.im < 9.5000000000000001e-97Initial program 88.0%
add-log-exp50.1%
*-un-lft-identity50.1%
log-prod50.1%
metadata-eval50.1%
add-log-exp88.0%
*-commutative88.0%
difference-of-squares88.0%
associate-*r*99.8%
Applied egg-rr99.8%
Taylor expanded in x.im around 0 82.1%
distribute-lft1-in82.1%
metadata-eval82.1%
*-commutative82.1%
associate-*r*82.1%
metadata-eval82.1%
distribute-lft1-in82.1%
unpow282.1%
associate-*l*93.9%
distribute-lft1-in93.9%
metadata-eval93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in x.re around 0 93.9%
Final simplification86.2%
(FPCore (x.re x.im) :precision binary64 (if (or (<= x.re -7e+153) (not (<= x.re 4.5e+149))) (* x.re (* x.re x.im)) (* x.im (* x.im (- x.im)))))
double code(double x_46_re, double x_46_im) {
double tmp;
if ((x_46_re <= -7e+153) || !(x_46_re <= 4.5e+149)) {
tmp = x_46_re * (x_46_re * x_46_im);
} else {
tmp = x_46_im * (x_46_im * -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 <= (-7d+153)) .or. (.not. (x_46re <= 4.5d+149))) then
tmp = x_46re * (x_46re * x_46im)
else
tmp = x_46im * (x_46im * -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 <= -7e+153) || !(x_46_re <= 4.5e+149)) {
tmp = x_46_re * (x_46_re * x_46_im);
} else {
tmp = x_46_im * (x_46_im * -x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im): tmp = 0 if (x_46_re <= -7e+153) or not (x_46_re <= 4.5e+149): tmp = x_46_re * (x_46_re * x_46_im) else: tmp = x_46_im * (x_46_im * -x_46_im) return tmp
function code(x_46_re, x_46_im) tmp = 0.0 if ((x_46_re <= -7e+153) || !(x_46_re <= 4.5e+149)) tmp = Float64(x_46_re * Float64(x_46_re * x_46_im)); else tmp = Float64(x_46_im * Float64(x_46_im * Float64(-x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im) tmp = 0.0; if ((x_46_re <= -7e+153) || ~((x_46_re <= 4.5e+149))) tmp = x_46_re * (x_46_re * x_46_im); else tmp = x_46_im * (x_46_im * -x_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_] := If[Or[LessEqual[x$46$re, -7e+153], N[Not[LessEqual[x$46$re, 4.5e+149]], $MachinePrecision]], N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * (-x$46$im)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -7 \cdot 10^{+153} \lor \neg \left(x.re \leq 4.5 \cdot 10^{+149}\right):\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.im\right)\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(-x.im\right)\right)\\
\end{array}
\end{array}
if x.re < -6.9999999999999998e153 or 4.49999999999999982e149 < x.re Initial program 55.8%
expm1-log1p-u27.9%
expm1-udef27.9%
Applied egg-rr0.0%
Simplified54.5%
Taylor expanded in x.re around inf 70.6%
Simplified70.6%
Taylor expanded in x.im around 0 70.6%
Simplified73.1%
if -6.9999999999999998e153 < x.re < 4.49999999999999982e149Initial program 89.5%
expm1-log1p-u65.0%
expm1-udef42.3%
Applied egg-rr0.0%
Simplified77.0%
Taylor expanded in x.re around 0 72.8%
Simplified72.8%
Final simplification72.9%
(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 81.3%
expm1-log1p-u56.0%
expm1-udef38.8%
Applied egg-rr0.0%
Simplified71.6%
Taylor expanded in x.re around inf 34.1%
Simplified34.1%
Final simplification34.1%
(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(x_46_re * Float64(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); end
code[x$46$re_, x$46$im_] := N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x.re \cdot \left(x.re \cdot x.im\right)
\end{array}
Initial program 81.3%
expm1-log1p-u56.0%
expm1-udef38.8%
Applied egg-rr0.0%
Simplified71.6%
Taylor expanded in x.re around inf 34.1%
Simplified34.1%
Taylor expanded in x.im around 0 34.1%
Simplified34.6%
Final simplification34.6%
(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 2023174
(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)))