
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im))))
(t_4 (+ 1.0 (* y.im t_0))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) INFINITY)
(* t_3 (+ (* (cos t_4) (cos 1.0)) (* (sin t_4) (sin 1.0))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_4 = 1.0 + (y_46_im * t_0);
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= ((double) INFINITY)) {
tmp = t_3 * ((cos(t_4) * cos(1.0)) + (sin(t_4) * sin(1.0)));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_4 = Float64(1.0 + Float64(y_46_im * t_0)) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= Inf) tmp = Float64(t_3 * Float64(Float64(cos(t_4) * cos(1.0)) + Float64(sin(t_4) * sin(1.0)))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(1.0 + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$3 * N[(N[(N[Cos[t$95$4], $MachinePrecision] * N[Cos[1.0], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t$95$4], $MachinePrecision] * N[Sin[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_4 := 1 + y.im \cdot t\_0\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq \infty:\\
\;\;\;\;t\_3 \cdot \left(\cos t\_4 \cdot \cos 1 + \sin t\_4 \cdot \sin 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 79.7%
Taylor expanded in y.re around 0 81.2%
*-commutative81.2%
unpow281.2%
unpow281.2%
hypot-undefine81.2%
Simplified81.2%
expm1-log1p-u61.0%
expm1-undefine61.0%
cos-diff59.6%
log1p-undefine59.6%
rem-exp-log59.6%
hypot-undefine59.6%
+-commutative59.6%
hypot-define59.6%
*-commutative59.6%
Applied egg-rr86.0%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
fmm-def0.0%
hypot-define0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) INFINITY)
(* t_3 (cos (+ t_1 (* y.im (pow (cbrt t_0) 3.0)))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= ((double) INFINITY)) {
tmp = t_3 * cos((t_1 + (y_46_im * pow(cbrt(t_0), 3.0))));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= Inf) tmp = Float64(t_3 * cos(Float64(t_1 + Float64(y_46_im * (cbrt(t_0) ^ 3.0))))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$3 * N[Cos[N[(t$95$1 + N[(y$46$im * N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq \infty:\\
\;\;\;\;t\_3 \cdot \cos \left(t\_1 + y.im \cdot {\left(\sqrt[3]{t\_0}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 79.7%
hypot-define79.7%
add-cube-cbrt84.7%
pow383.9%
Applied egg-rr83.9%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
fmm-def0.0%
hypot-define0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define86.2%
*-commutative86.2%
Simplified86.2%
Final simplification84.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) 0.65)
(*
t_3
(fabs
(cos (fma y.re (atan2 x.im x.re) (* y.im (log (hypot x.im x.re)))))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= 0.65) {
tmp = t_3 * fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(hypot(x_46_im, x_46_re))))));
} else {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= 0.65) tmp = Float64(t_3 * abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))); else tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.65], N[(t$95$3 * N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq 0.65:\\
\;\;\;\;t\_3 \cdot \left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < 0.650000000000000022Initial program 77.6%
fma-define77.6%
hypot-define77.6%
*-commutative77.6%
add-sqr-sqrt32.3%
sqrt-unprod84.3%
pow284.3%
Applied egg-rr84.3%
unpow284.3%
rem-sqrt-square84.3%
*-commutative84.3%
hypot-undefine84.3%
unpow284.3%
unpow284.3%
+-commutative84.3%
unpow284.3%
unpow284.3%
hypot-undefine84.3%
Simplified84.3%
if 0.650000000000000022 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 27.7%
fmm-def27.7%
hypot-define27.7%
distribute-rgt-neg-out27.7%
fma-define27.7%
hypot-define84.9%
*-commutative84.9%
Simplified84.9%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 42.3%
fmm-def42.3%
hypot-define42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 3.65e+62)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.re (atan2 x.im x.re))))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.im (log (hypot x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.65e+62) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 3.65e+62) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3.65e+62], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3.65 \cdot 10^{+62}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 3.6499999999999998e62Initial program 41.7%
fmm-def41.7%
hypot-define41.7%
distribute-rgt-neg-out41.7%
fma-define41.7%
hypot-define84.0%
*-commutative84.0%
Simplified84.0%
add-cube-cbrt83.2%
pow381.5%
hypot-define41.6%
*-commutative41.6%
fma-define41.6%
+-commutative41.6%
*-commutative41.6%
fma-define41.6%
*-commutative41.6%
hypot-define81.5%
Applied egg-rr81.5%
Taylor expanded in y.im around 0 85.1%
if 3.6499999999999998e62 < y.re Initial program 44.9%
Taylor expanded in y.re around 0 49.0%
*-commutative49.0%
unpow249.0%
unpow249.0%
hypot-undefine79.7%
Simplified79.7%
Final simplification84.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 1.7e+63)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.re (atan2 x.im x.re))))
(* (cos (* y.im (log (hypot x.im x.re)))) (exp (* y.re t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 1.7e+63) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((y_46_re * t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 1.7e+63) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(y_46_re * t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 1.7e+63], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 1.7 \cdot 10^{+63}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot t\_0}\\
\end{array}
\end{array}
if y.re < 1.6999999999999999e63Initial program 42.0%
fmm-def42.0%
hypot-define42.0%
distribute-rgt-neg-out42.0%
fma-define42.0%
hypot-define84.0%
*-commutative84.0%
Simplified84.0%
add-cube-cbrt83.3%
pow381.6%
hypot-define41.9%
*-commutative41.9%
fma-define41.9%
+-commutative41.9%
*-commutative41.9%
fma-define41.9%
*-commutative41.9%
hypot-define81.6%
Applied egg-rr81.6%
Taylor expanded in y.im around 0 85.2%
if 1.6999999999999999e63 < y.re Initial program 43.8%
Taylor expanded in y.re around 0 47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-undefine79.2%
Simplified79.2%
Taylor expanded in y.re around inf 77.2%
+-commutative77.2%
unpow277.2%
unpow277.2%
hypot-undefine77.2%
Simplified77.2%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -3.5e-5)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))
(if (<= y.re -3.3e-302)
(* t_1 t_0)
(if (<= y.re 6.6e+62)
t_0
(* t_1 (exp (* y.re (log (hypot x.re x.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.5e-5) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= -3.3e-302) {
tmp = t_1 * t_0;
} else if (y_46_re <= 6.6e+62) {
tmp = t_0;
} else {
tmp = t_1 * exp((y_46_re * log(hypot(x_46_re, x_46_im))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.5e-5) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= -3.3e-302) {
tmp = t_1 * t_0;
} else if (y_46_re <= 6.6e+62) {
tmp = t_0;
} else {
tmp = t_1 * Math.exp((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -3.5e-5: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= -3.3e-302: tmp = t_1 * t_0 elif y_46_re <= 6.6e+62: tmp = t_0 else: tmp = t_1 * math.exp((y_46_re * math.log(math.hypot(x_46_re, x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -3.5e-5) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= -3.3e-302) tmp = Float64(t_1 * t_0); elseif (y_46_re <= 6.6e+62) tmp = t_0; else tmp = Float64(t_1 * exp(Float64(y_46_re * log(hypot(x_46_re, x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -3.5e-5) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= -3.3e-302) tmp = t_1 * t_0; elseif (y_46_re <= 6.6e+62) tmp = t_0; else tmp = t_1 * exp((y_46_re * log(hypot(x_46_re, x_46_im)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.5e-5], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -3.3e-302], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 6.6e+62], t$95$0, N[(t$95$1 * N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -3.5 \cdot 10^{-5}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq -3.3 \cdot 10^{-302}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{+62}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\\
\end{array}
\end{array}
if y.re < -3.4999999999999997e-5Initial program 50.0%
Taylor expanded in y.im around 0 87.5%
if -3.4999999999999997e-5 < y.re < -3.3000000000000002e-302Initial program 35.7%
fmm-def35.7%
hypot-define35.7%
distribute-rgt-neg-out35.7%
fma-define35.7%
hypot-define89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y.re around 0 35.7%
*-commutative35.7%
unpow235.7%
unpow235.7%
hypot-undefine89.4%
neg-mul-189.4%
distribute-rgt-neg-in89.4%
Simplified89.4%
if -3.3000000000000002e-302 < y.re < 6.6e62Initial program 41.4%
fmm-def41.4%
hypot-define41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define75.5%
*-commutative75.5%
Simplified75.5%
add-cube-cbrt79.2%
pow376.6%
hypot-define42.5%
*-commutative42.5%
fma-define42.5%
+-commutative42.5%
*-commutative42.5%
fma-define42.5%
*-commutative42.5%
hypot-define76.6%
Applied egg-rr76.6%
Taylor expanded in y.im around 0 83.8%
Taylor expanded in y.re around 0 76.6%
mul-1-neg76.6%
*-commutative76.6%
Simplified76.6%
if 6.6e62 < y.re Initial program 43.8%
Taylor expanded in y.re around 0 47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-undefine79.2%
Simplified79.2%
Taylor expanded in y.re around inf 77.2%
+-commutative77.2%
unpow277.2%
unpow277.2%
hypot-undefine77.2%
Simplified77.2%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -1.35e-6)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re -4e-302)
(* t_0 t_1)
(if (<= y.re 2.7e+63)
t_1
(* t_0 (exp (* y.re (log (hypot x.re x.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.35e-6) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -4e-302) {
tmp = t_0 * t_1;
} else if (y_46_re <= 2.7e+63) {
tmp = t_1;
} else {
tmp = t_0 * exp((y_46_re * log(hypot(x_46_re, x_46_im))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1.35e-6) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -4e-302) {
tmp = t_0 * t_1;
} else if (y_46_re <= 2.7e+63) {
tmp = t_1;
} else {
tmp = t_0 * Math.exp((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_re <= -1.35e-6: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= -4e-302: tmp = t_0 * t_1 elif y_46_re <= 2.7e+63: tmp = t_1 else: tmp = t_0 * math.exp((y_46_re * math.log(math.hypot(x_46_re, x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -1.35e-6) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= -4e-302) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 2.7e+63) tmp = t_1; else tmp = Float64(t_0 * exp(Float64(y_46_re * log(hypot(x_46_re, x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (y_46_re <= -1.35e-6) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= -4e-302) tmp = t_0 * t_1; elseif (y_46_re <= 2.7e+63) tmp = t_1; else tmp = t_0 * exp((y_46_re * log(hypot(x_46_re, x_46_im)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.35e-6], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -4e-302], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 2.7e+63], t$95$1, N[(t$95$0 * N[Exp[N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{-6}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq -4 \cdot 10^{-302}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\\
\end{array}
\end{array}
if y.re < -1.34999999999999999e-6Initial program 50.0%
fmm-def50.0%
hypot-define50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.im around 0 84.4%
unpow284.4%
unpow284.4%
hypot-undefine84.4%
Simplified84.4%
if -1.34999999999999999e-6 < y.re < -3.9999999999999999e-302Initial program 35.7%
fmm-def35.7%
hypot-define35.7%
distribute-rgt-neg-out35.7%
fma-define35.7%
hypot-define89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y.re around 0 35.7%
*-commutative35.7%
unpow235.7%
unpow235.7%
hypot-undefine89.4%
neg-mul-189.4%
distribute-rgt-neg-in89.4%
Simplified89.4%
if -3.9999999999999999e-302 < y.re < 2.70000000000000017e63Initial program 41.4%
fmm-def41.4%
hypot-define41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define75.5%
*-commutative75.5%
Simplified75.5%
add-cube-cbrt79.2%
pow376.6%
hypot-define42.5%
*-commutative42.5%
fma-define42.5%
+-commutative42.5%
*-commutative42.5%
fma-define42.5%
*-commutative42.5%
hypot-define76.6%
Applied egg-rr76.6%
Taylor expanded in y.im around 0 83.8%
Taylor expanded in y.re around 0 76.6%
mul-1-neg76.6%
*-commutative76.6%
Simplified76.6%
if 2.70000000000000017e63 < y.re Initial program 43.8%
Taylor expanded in y.re around 0 47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-undefine79.2%
Simplified79.2%
Taylor expanded in y.re around inf 77.2%
+-commutative77.2%
unpow277.2%
unpow277.2%
hypot-undefine77.2%
Simplified77.2%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(t_1 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -0.00046)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= y.re -1e-302)
(* (cos (* y.im (log (hypot x.im x.re)))) t_0)
(if (<= y.re 2.25e+32) t_0 (* t_1 (pow x.re y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.00046) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -1e-302) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_0;
} else if (y_46_re <= 2.25e+32) {
tmp = t_0;
} else {
tmp = t_1 * pow(x_46_re, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -0.00046) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -1e-302) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_0;
} else if (y_46_re <= 2.25e+32) {
tmp = t_0;
} else {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -0.00046: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= -1e-302: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_0 elif y_46_re <= 2.25e+32: tmp = t_0 else: tmp = t_1 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) t_1 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -0.00046) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= -1e-302) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_0); elseif (y_46_re <= 2.25e+32) tmp = t_0; else tmp = Float64(t_1 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -0.00046) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= -1e-302) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_0; elseif (y_46_re <= 2.25e+32) tmp = t_0; else tmp = t_1 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00046], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1e-302], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2.25e+32], t$95$0, N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.00046:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2.25 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -4.6000000000000001e-4Initial program 50.0%
fmm-def50.0%
hypot-define50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.im around 0 84.4%
unpow284.4%
unpow284.4%
hypot-undefine84.4%
Simplified84.4%
if -4.6000000000000001e-4 < y.re < -9.9999999999999996e-303Initial program 35.7%
fmm-def35.7%
hypot-define35.7%
distribute-rgt-neg-out35.7%
fma-define35.7%
hypot-define89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y.re around 0 35.7%
*-commutative35.7%
unpow235.7%
unpow235.7%
hypot-undefine89.4%
neg-mul-189.4%
distribute-rgt-neg-in89.4%
Simplified89.4%
if -9.9999999999999996e-303 < y.re < 2.2500000000000002e32Initial program 37.7%
fmm-def37.7%
hypot-define37.7%
distribute-rgt-neg-out37.7%
fma-define37.7%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
add-cube-cbrt81.0%
pow378.0%
hypot-define39.0%
*-commutative39.0%
fma-define39.0%
+-commutative39.0%
*-commutative39.0%
fma-define39.0%
*-commutative39.0%
hypot-define78.0%
Applied egg-rr78.0%
Taylor expanded in y.im around 0 83.0%
Taylor expanded in y.re around 0 81.1%
mul-1-neg81.1%
*-commutative81.1%
Simplified81.1%
if 2.2500000000000002e32 < y.re Initial program 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in x.im around 0 61.6%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -3e-7)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 3.5e+36)
(exp (* (atan2 x.im x.re) (- y.im)))
(* t_0 (pow x.re y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -3e-7) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 3.5e+36) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -3e-7) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 3.5e+36) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -3e-7: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 3.5e+36: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -3e-7) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 3.5e+36) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -3e-7) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 3.5e+36) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3e-7], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e+36], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -3 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.9999999999999999e-7Initial program 50.0%
fmm-def50.0%
hypot-define50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.im around 0 84.4%
unpow284.4%
unpow284.4%
hypot-undefine84.4%
Simplified84.4%
if -2.9999999999999999e-7 < y.re < 3.4999999999999998e36Initial program 36.6%
fmm-def36.6%
hypot-define36.6%
distribute-rgt-neg-out36.6%
fma-define36.6%
hypot-define83.6%
*-commutative83.6%
Simplified83.6%
add-cube-cbrt83.9%
pow381.2%
hypot-define37.2%
*-commutative37.2%
fma-define37.2%
+-commutative37.2%
*-commutative37.2%
fma-define37.2%
*-commutative37.2%
hypot-define81.2%
Applied egg-rr81.2%
Taylor expanded in y.im around 0 83.0%
Taylor expanded in y.re around 0 82.2%
mul-1-neg82.2%
*-commutative82.2%
Simplified82.2%
if 3.4999999999999998e36 < y.re Initial program 47.4%
fmm-def47.4%
hypot-define47.4%
distribute-rgt-neg-out47.4%
fma-define47.4%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in x.im around 0 61.6%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1.55e+202)
(* t_0 (pow x.im y.re))
(if (or (<= y.re -4400.0) (not (<= y.re 9.5e+31)))
(* t_0 (pow x.re y.re))
(exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.55e+202) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if ((y_46_re <= -4400.0) || !(y_46_re <= 9.5e+31)) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (y_46re <= (-1.55d+202)) then
tmp = t_0 * (x_46im ** y_46re)
else if ((y_46re <= (-4400.0d0)) .or. (.not. (y_46re <= 9.5d+31))) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.55e+202) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if ((y_46_re <= -4400.0) || !(y_46_re <= 9.5e+31)) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -1.55e+202: tmp = t_0 * math.pow(x_46_im, y_46_re) elif (y_46_re <= -4400.0) or not (y_46_re <= 9.5e+31): tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.55e+202) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif ((y_46_re <= -4400.0) || !(y_46_re <= 9.5e+31)) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -1.55e+202) tmp = t_0 * (x_46_im ^ y_46_re); elseif ((y_46_re <= -4400.0) || ~((y_46_re <= 9.5e+31))) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e+202], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, -4400.0], N[Not[LessEqual[y$46$re, 9.5e+31]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{+202}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq -4400 \lor \neg \left(y.re \leq 9.5 \cdot 10^{+31}\right):\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.54999999999999996e202Initial program 51.9%
fmm-def51.9%
hypot-define51.9%
distribute-rgt-neg-out51.9%
fma-define51.9%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 81.5%
unpow281.5%
unpow281.5%
hypot-undefine81.5%
Simplified81.5%
Taylor expanded in x.re around 0 66.9%
if -1.54999999999999996e202 < y.re < -4400 or 9.5000000000000008e31 < y.re Initial program 47.9%
fmm-def47.9%
hypot-define47.9%
distribute-rgt-neg-out47.9%
fma-define47.9%
hypot-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.im around 0 69.3%
unpow269.3%
unpow269.3%
hypot-undefine69.3%
Simplified69.3%
Taylor expanded in x.im around 0 66.2%
if -4400 < y.re < 9.5000000000000008e31Initial program 36.6%
fmm-def36.6%
hypot-define36.6%
distribute-rgt-neg-out36.6%
fma-define36.6%
hypot-define83.6%
*-commutative83.6%
Simplified83.6%
add-cube-cbrt83.9%
pow381.2%
hypot-define37.2%
*-commutative37.2%
fma-define37.2%
+-commutative37.2%
*-commutative37.2%
fma-define37.2%
*-commutative37.2%
hypot-define81.2%
Applied egg-rr81.2%
Taylor expanded in y.im around 0 83.0%
Taylor expanded in y.re around 0 82.2%
mul-1-neg82.2%
*-commutative82.2%
Simplified82.2%
Final simplification74.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.25e+18) (not (<= y.re 1.7e+78))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.25e+18) || !(y_46_re <= 1.7e+78)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.25d+18)) .or. (.not. (y_46re <= 1.7d+78))) then
tmp = cos((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
else
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.25e+18) || !(y_46_re <= 1.7e+78)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.25e+18) or not (y_46_re <= 1.7e+78): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.25e+18) || !(y_46_re <= 1.7e+78)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.25e+18) || ~((y_46_re <= 1.7e+78))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.25e+18], N[Not[LessEqual[y$46$re, 1.7e+78]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{+18} \lor \neg \left(y.re \leq 1.7 \cdot 10^{+78}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.25e18 or 1.70000000000000004e78 < y.re Initial program 45.6%
fmm-def45.6%
hypot-define45.6%
distribute-rgt-neg-out45.6%
fma-define45.6%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 72.9%
unpow272.9%
unpow272.9%
hypot-undefine72.9%
Simplified72.9%
Taylor expanded in x.re around 0 53.9%
if -1.25e18 < y.re < 1.70000000000000004e78Initial program 40.1%
fmm-def40.1%
hypot-define40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define83.5%
*-commutative83.5%
Simplified83.5%
add-cube-cbrt83.2%
pow380.8%
hypot-define40.0%
*-commutative40.0%
fma-define40.0%
+-commutative40.0%
*-commutative40.0%
fma-define40.0%
*-commutative40.0%
hypot-define80.8%
Applied egg-rr80.8%
Taylor expanded in y.im around 0 83.1%
Taylor expanded in y.re around 0 77.9%
mul-1-neg77.9%
*-commutative77.9%
Simplified77.9%
Final simplification68.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (exp (- y.im)) (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(exp(-y_46_im), atan2(x_46_im, x_46_re));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp(-y_46im) ** atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.exp(-y_46_im), Math.atan2(x_46_im, x_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.exp(-y_46_im), math.atan2(x_46_im, x_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(-y_46_im)) ^ atan(x_46_im, x_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(-y_46_im) ^ atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Exp[(-y$46$im)], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
{\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}
\end{array}
Initial program 42.3%
fmm-def42.3%
hypot-define42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
add-cube-cbrt80.6%
pow379.6%
hypot-define41.1%
*-commutative41.1%
fma-define41.1%
+-commutative41.1%
*-commutative41.1%
fma-define41.1%
*-commutative41.1%
hypot-define79.6%
Applied egg-rr79.6%
Taylor expanded in y.im around 0 81.3%
Taylor expanded in y.re around 0 56.3%
associate-*r*56.3%
exp-prod57.6%
mul-1-neg57.6%
Simplified57.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.6e+17) (not (<= y.re 10000.0))) (+ 1.0 (log (pow x.re y.re))) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.6e+17) || !(y_46_re <= 10000.0)) {
tmp = 1.0 + log(pow(x_46_re, y_46_re));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-2.6d+17)) .or. (.not. (y_46re <= 10000.0d0))) then
tmp = 1.0d0 + log((x_46re ** y_46re))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.6e+17) || !(y_46_re <= 10000.0)) {
tmp = 1.0 + Math.log(Math.pow(x_46_re, y_46_re));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.6e+17) or not (y_46_re <= 10000.0): tmp = 1.0 + math.log(math.pow(x_46_re, y_46_re)) else: tmp = 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.6e+17) || !(y_46_re <= 10000.0)) tmp = Float64(1.0 + log((x_46_re ^ y_46_re))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.6e+17) || ~((y_46_re <= 10000.0))) tmp = 1.0 + log((x_46_re ^ y_46_re)); else tmp = 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.6e+17], N[Not[LessEqual[y$46$re, 10000.0]], $MachinePrecision]], N[(1.0 + N[Log[N[Power[x$46$re, y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+17} \lor \neg \left(y.re \leq 10000\right):\\
\;\;\;\;1 + \log \left({x.re}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -2.6e17 or 1e4 < y.re Initial program 48.4%
fmm-def48.4%
hypot-define48.4%
distribute-rgt-neg-out48.4%
fma-define48.4%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 68.7%
unpow268.7%
unpow268.7%
hypot-undefine68.7%
Simplified68.7%
Taylor expanded in x.re around inf 29.2%
Taylor expanded in y.re around 0 1.2%
+-commutative1.2%
mul-1-neg1.2%
log-rec1.2%
distribute-rgt-neg-in1.2%
distribute-lft-neg-in1.2%
distribute-lft-neg-in1.2%
fma-define1.2%
remove-double-neg1.2%
fma-define1.2%
+-commutative1.2%
Simplified1.2%
+-commutative1.2%
*-un-lft-identity1.2%
fma-define1.2%
*-commutative1.2%
add-log-exp13.3%
pow-to-exp28.2%
Applied egg-rr28.2%
fma-undefine28.2%
*-commutative28.2%
*-rgt-identity28.2%
Simplified28.2%
if -2.6e17 < y.re < 1e4Initial program 36.7%
fmm-def36.7%
hypot-define36.7%
distribute-rgt-neg-out36.7%
fma-define36.7%
hypot-define83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in y.im around 0 39.0%
unpow239.0%
unpow239.0%
hypot-undefine53.2%
Simplified53.2%
Taylor expanded in y.re around 0 50.2%
Final simplification39.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 3.7e+81) (exp (* (atan2 x.im x.re) (- y.im))) (+ 1.0 (log (pow x.re y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.7e+81) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + log(pow(x_46_re, y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 3.7d+81) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = 1.0d0 + log((x_46re ** y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.7e+81) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = 1.0 + Math.log(Math.pow(x_46_re, y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 3.7e+81: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = 1.0 + math.log(math.pow(x_46_re, y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 3.7e+81) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(1.0 + log((x_46_re ^ y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= 3.7e+81) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 1.0 + log((x_46_re ^ y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3.7e+81], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[Log[N[Power[x$46$re, y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3.7 \cdot 10^{+81}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({x.re}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < 3.7000000000000001e81Initial program 43.6%
fmm-def43.6%
hypot-define43.6%
distribute-rgt-neg-out43.6%
fma-define43.6%
hypot-define84.5%
*-commutative84.5%
Simplified84.5%
add-cube-cbrt83.3%
pow381.6%
hypot-define43.1%
*-commutative43.1%
fma-define43.1%
+-commutative43.1%
*-commutative43.1%
fma-define43.1%
*-commutative43.1%
hypot-define81.6%
Applied egg-rr81.6%
Taylor expanded in y.im around 0 84.6%
Taylor expanded in y.re around 0 62.8%
mul-1-neg62.8%
*-commutative62.8%
Simplified62.8%
if 3.7000000000000001e81 < y.re Initial program 35.7%
fmm-def35.7%
hypot-define35.7%
distribute-rgt-neg-out35.7%
fma-define35.7%
hypot-define73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in y.im around 0 57.3%
unpow257.3%
unpow257.3%
hypot-undefine57.3%
Simplified57.3%
Taylor expanded in x.re around inf 31.1%
Taylor expanded in y.re around 0 1.1%
+-commutative1.1%
mul-1-neg1.1%
log-rec1.1%
distribute-rgt-neg-in1.1%
distribute-lft-neg-in1.1%
distribute-lft-neg-in1.1%
fma-define1.1%
remove-double-neg1.1%
fma-define1.1%
+-commutative1.1%
Simplified1.1%
+-commutative1.1%
*-un-lft-identity1.1%
fma-define1.1%
*-commutative1.1%
add-log-exp12.2%
pow-to-exp33.9%
Applied egg-rr33.9%
fma-undefine33.9%
*-commutative33.9%
*-rgt-identity33.9%
Simplified33.9%
Final simplification58.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -2.6e+17) (+ 1.0 (* y.re (log1p (+ x.re -1.0)))) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.6e+17) {
tmp = 1.0 + (y_46_re * log1p((x_46_re + -1.0)));
} else {
tmp = 1.0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -2.6e+17) {
tmp = 1.0 + (y_46_re * Math.log1p((x_46_re + -1.0)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -2.6e+17: tmp = 1.0 + (y_46_re * math.log1p((x_46_re + -1.0))) else: tmp = 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -2.6e+17) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(x_46_re + -1.0)))); else tmp = 1.0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -2.6e+17], N[(1.0 + N[(y$46$re * N[Log[1 + N[(x$46$re + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+17}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(x.re + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -2.6e17Initial program 51.7%
fmm-def51.7%
hypot-define51.7%
distribute-rgt-neg-out51.7%
fma-define51.7%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 83.4%
unpow283.4%
unpow283.4%
hypot-undefine83.4%
Simplified83.4%
Taylor expanded in x.re around inf 26.8%
Taylor expanded in y.re around 0 1.2%
+-commutative1.2%
mul-1-neg1.2%
log-rec1.2%
distribute-rgt-neg-in1.2%
distribute-lft-neg-in1.2%
distribute-lft-neg-in1.2%
fma-define1.2%
remove-double-neg1.2%
fma-define1.2%
+-commutative1.2%
Simplified1.2%
log1p-expm1-u10.6%
expm1-undefine10.6%
add-exp-log22.6%
Applied egg-rr22.6%
if -2.6e17 < y.re Initial program 39.5%
fmm-def39.5%
hypot-define39.5%
distribute-rgt-neg-out39.5%
fma-define39.5%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 44.2%
unpow244.2%
unpow244.2%
hypot-undefine53.8%
Simplified53.8%
Taylor expanded in y.re around 0 34.6%
Final simplification31.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 42.3%
fmm-def42.3%
hypot-define42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 53.4%
unpow253.4%
unpow253.4%
hypot-undefine60.7%
Simplified60.7%
Taylor expanded in y.re around 0 27.2%
herbie shell --seed 2024180
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))