
(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 16 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)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) (- INFINITY))
(* t_3 (fabs (cos (fma y.im (log (hypot x.im x.re)) t_1))))
(*
(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 * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)));
} 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))) <= Float64(-Inf)) tmp = Float64(t_3 * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)))); 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[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $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 \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_1\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)))) < -inf.0Initial program 21.1%
fma-define21.1%
hypot-define21.1%
*-commutative21.1%
add-sqr-sqrt0.0%
sqrt-unprod78.9%
pow278.9%
Applied egg-rr78.9%
unpow278.9%
rem-sqrt-square78.9%
fma-define78.9%
hypot-undefine78.9%
unpow278.9%
unpow278.9%
+-commutative78.9%
+-commutative78.9%
fma-define78.9%
Simplified78.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 43.3%
cancel-sign-sub-inv43.3%
fma-define43.3%
hypot-define43.3%
distribute-lft-neg-in43.3%
distribute-rgt-neg-out43.3%
fma-define43.3%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Final simplification85.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))))))
(if (<=
(*
(exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_2 y.im) t_1)))
(- INFINITY))
(log (* (pow (hypot x.im x.re) y.re) E))
(*
(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 tmp;
if ((exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_2 * y_46_im) + t_1))) <= -((double) INFINITY)) {
tmp = log((pow(hypot(x_46_im, x_46_re), y_46_re) * ((double) M_E)));
} 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)))) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= Float64(-Inf)) tmp = log(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * exp(1))); 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]}, If[LessEqual[N[(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] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-Infinity)], N[Log[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * E), $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)\\
\mathbf{if}\;e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq -\infty:\\
\;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot e\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 21.1%
cancel-sign-sub-inv21.1%
fma-define21.1%
hypot-define21.1%
distribute-lft-neg-in21.1%
distribute-rgt-neg-out21.1%
fma-define21.1%
hypot-define21.1%
*-commutative21.1%
Simplified21.1%
Taylor expanded in y.im around 0 21.5%
unpow221.5%
unpow221.5%
hypot-undefine21.5%
Simplified21.5%
Taylor expanded in y.re around 0 4.5%
unpow24.5%
unpow24.5%
hypot-undefine4.5%
Simplified4.5%
add-log-exp68.8%
+-commutative68.8%
exp-sum68.8%
*-commutative68.8%
exp-to-pow68.8%
Applied egg-rr68.8%
exp-1-e68.8%
Simplified68.8%
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 43.3%
cancel-sign-sub-inv43.3%
fma-define43.3%
hypot-define43.3%
distribute-lft-neg-in43.3%
distribute-rgt-neg-out43.3%
fma-define43.3%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -20.0)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.im t_0)))
(if (<= y.re 6.8e+22)
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(cos (* y.im (+ t_0 (* y.re (/ (atan2 x.im x.re) y.im))))))
(*
(pow (hypot x.im x.re) y.re)
(sqrt (pow (cos (* y.re (atan2 x.im x.re))) 2.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_im, x_46_re));
double tmp;
if (y_46_re <= -20.0) {
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 * t_0));
} else if (y_46_re <= 6.8e+22) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * cos((y_46_im * (t_0 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sqrt(pow(cos((y_46_re * atan2(x_46_im, x_46_re))), 2.0));
}
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.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -20.0) {
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_im * t_0));
} else if (y_46_re <= 6.8e+22) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re))) * Math.cos((y_46_im * (t_0 + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sqrt(Math.pow(Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))), 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -20.0: 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_im * t_0)) elif y_46_re <= 6.8e+22: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) * math.cos((y_46_im * (t_0 + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sqrt(math.pow(math.cos((y_46_re * math.atan2(x_46_im, x_46_re))), 2.0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -20.0) 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 * t_0))); elseif (y_46_re <= 6.8e+22) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * cos(Float64(y_46_im * Float64(t_0 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sqrt((cos(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 2.0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_re <= -20.0) 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 * t_0)); elseif (y_46_re <= 6.8e+22) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))) * cos((y_46_im * (t_0 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im))))); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sqrt((cos((y_46_re * atan2(x_46_im, x_46_re))) ^ 2.0)); end tmp_2 = 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -20.0], 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 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.8e+22], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y$46$im * N[(t$95$0 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sqrt[N[Power[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -20:\\
\;\;\;\;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 t\_0\right)\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{+22}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(y.im \cdot \left(t\_0 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sqrt{{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\
\end{array}
\end{array}
if y.re < -20Initial program 46.7%
Taylor expanded in y.re around 0 50.0%
*-commutative50.0%
unpow250.0%
unpow250.0%
hypot-undefine85.1%
Simplified85.1%
if -20 < y.re < 6.8e22Initial program 46.5%
exp-diff46.5%
exp-to-pow46.5%
hypot-define46.5%
*-commutative46.5%
exp-prod46.2%
fma-define46.2%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around inf 47.0%
unpow247.0%
unpow247.0%
hypot-undefine85.1%
associate-/l*85.1%
Simplified85.1%
if 6.8e22 < y.re Initial program 27.3%
cancel-sign-sub-inv27.3%
fma-define27.3%
hypot-define27.3%
distribute-lft-neg-in27.3%
distribute-rgt-neg-out27.3%
fma-define27.3%
hypot-define68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in y.im around 0 60.7%
unpow260.7%
unpow260.7%
hypot-undefine60.7%
Simplified60.7%
add-sqr-sqrt39.4%
sqrt-unprod78.9%
pow278.9%
Applied egg-rr78.9%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -280000000000.0)
(*
(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)))))
(if (<= y.re 7.6e-17)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (pow (hypot x.im x.re) y.re) (sqrt (pow (cos t_0) 2.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -280000000000.0) {
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))));
} else if (y_46_re <= 7.6e-17) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sqrt(pow(cos(t_0), 2.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -280000000000.0) 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))))); elseif (y_46_re <= 7.6e-17) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sqrt((cos(t_0) ^ 2.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -280000000000.0], 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], If[LessEqual[y$46$re, 7.6e-17], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sqrt[N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -280000000000:\\
\;\;\;\;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)\\
\mathbf{elif}\;y.re \leq 7.6 \cdot 10^{-17}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sqrt{{\cos t\_0}^{2}}\\
\end{array}
\end{array}
if y.re < -2.8e11Initial program 48.2%
Taylor expanded in y.re around 0 53.6%
*-commutative53.6%
unpow253.6%
unpow253.6%
hypot-undefine89.3%
Simplified89.3%
if -2.8e11 < y.re < 7.6000000000000002e-17Initial program 46.4%
cancel-sign-sub-inv46.4%
fma-define46.4%
hypot-define46.4%
distribute-lft-neg-in46.4%
distribute-rgt-neg-out46.4%
fma-define46.4%
hypot-define84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.re around 0 82.3%
neg-mul-182.3%
distribute-rgt-neg-in82.3%
Simplified82.3%
if 7.6000000000000002e-17 < y.re Initial program 28.4%
cancel-sign-sub-inv28.4%
fma-define28.4%
hypot-define28.4%
distribute-lft-neg-in28.4%
distribute-rgt-neg-out28.4%
fma-define28.4%
hypot-define70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in y.im around 0 58.3%
unpow258.3%
unpow258.3%
hypot-undefine60.9%
Simplified60.9%
add-sqr-sqrt42.0%
sqrt-unprod78.5%
pow278.5%
Applied egg-rr78.5%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.56e-12) (not (<= y.re 7.6e-17)))
(*
(pow (hypot x.im x.re) y.re)
(sqrt (pow (cos (* y.re (atan2 x.im x.re))) 2.0)))
(*
(cos (* y.im (log (hypot x.im x.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.56e-12) || !(y_46_re <= 7.6e-17)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sqrt(pow(cos((y_46_re * atan2(x_46_im, x_46_re))), 2.0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_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 tmp;
if ((y_46_re <= -1.56e-12) || !(y_46_re <= 7.6e-17)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sqrt(Math.pow(Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))), 2.0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * 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.56e-12) or not (y_46_re <= 7.6e-17): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sqrt(math.pow(math.cos((y_46_re * math.atan2(x_46_im, x_46_re))), 2.0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * 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.56e-12) || !(y_46_re <= 7.6e-17)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sqrt((cos(Float64(y_46_re * atan(x_46_im, x_46_re))) ^ 2.0))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * 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.56e-12) || ~((y_46_re <= 7.6e-17))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sqrt((cos((y_46_re * atan2(x_46_im, x_46_re))) ^ 2.0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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.56e-12], N[Not[LessEqual[y$46$re, 7.6e-17]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sqrt[N[Power[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.56 \cdot 10^{-12} \lor \neg \left(y.re \leq 7.6 \cdot 10^{-17}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sqrt{{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.56000000000000002e-12 or 7.6000000000000002e-17 < y.re Initial program 37.7%
cancel-sign-sub-inv37.7%
fma-define37.7%
hypot-define37.7%
distribute-lft-neg-in37.7%
distribute-rgt-neg-out37.7%
fma-define37.7%
hypot-define77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y.im around 0 67.6%
unpow267.6%
unpow267.6%
hypot-undefine69.7%
Simplified69.7%
add-sqr-sqrt45.0%
sqrt-unprod80.6%
pow280.6%
Applied egg-rr80.6%
if -1.56000000000000002e-12 < y.re < 7.6000000000000002e-17Initial program 46.2%
cancel-sign-sub-inv46.2%
fma-define46.2%
hypot-define46.2%
distribute-lft-neg-in46.2%
distribute-rgt-neg-out46.2%
fma-define46.2%
hypot-define84.7%
*-commutative84.7%
Simplified84.7%
Taylor expanded in y.re around 0 46.2%
*-commutative46.2%
unpow246.2%
unpow246.2%
hypot-undefine84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
Simplified84.7%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.55e-12)
(* t_0 (cos (* y.re (log (exp (atan2 x.im x.re))))))
(if (<= y.re 9200.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(log (* t_0 E))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.55e-12) {
tmp = t_0 * cos((y_46_re * log(exp(atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 9200.0) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = log((t_0 * ((double) M_E)));
}
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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.55e-12) {
tmp = t_0 * Math.cos((y_46_re * Math.log(Math.exp(Math.atan2(x_46_im, x_46_re)))));
} else if (y_46_re <= 9200.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.log((t_0 * Math.E));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.55e-12: tmp = t_0 * math.cos((y_46_re * math.log(math.exp(math.atan2(x_46_im, x_46_re))))) elif y_46_re <= 9200.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.log((t_0 * math.e)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.55e-12) tmp = Float64(t_0 * cos(Float64(y_46_re * log(exp(atan(x_46_im, x_46_re)))))); elseif (y_46_re <= 9200.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = log(Float64(t_0 * exp(1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.55e-12) tmp = t_0 * cos((y_46_re * log(exp(atan2(x_46_im, x_46_re))))); elseif (y_46_re <= 9200.0) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = log((t_0 * 2.71828182845904523536)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e-12], N[(t$95$0 * N[Cos[N[(y$46$re * N[Log[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9200.0], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Log[N[(t$95$0 * E), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{-12}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \log \left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)\right)\\
\mathbf{elif}\;y.re \leq 9200:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\log \left(t\_0 \cdot e\right)\\
\end{array}
\end{array}
if y.re < -1.5500000000000001e-12Initial program 48.4%
cancel-sign-sub-inv48.4%
fma-define48.4%
hypot-define48.4%
distribute-lft-neg-in48.4%
distribute-rgt-neg-out48.4%
fma-define48.4%
hypot-define85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in y.im around 0 78.3%
unpow278.3%
unpow278.3%
hypot-undefine79.8%
Simplified79.8%
add-log-exp81.4%
Applied egg-rr81.4%
if -1.5500000000000001e-12 < y.re < 9200Initial program 46.3%
cancel-sign-sub-inv46.3%
fma-define46.3%
hypot-define46.3%
distribute-lft-neg-in46.3%
distribute-rgt-neg-out46.3%
fma-define46.3%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.re around 0 46.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
hypot-undefine84.4%
neg-mul-184.4%
distribute-rgt-neg-in84.4%
Simplified84.4%
if 9200 < y.re Initial program 27.1%
cancel-sign-sub-inv27.1%
fma-define27.1%
hypot-define27.1%
distribute-lft-neg-in27.1%
distribute-rgt-neg-out27.1%
fma-define27.1%
hypot-define68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y.im around 0 60.1%
unpow260.1%
unpow260.1%
hypot-undefine60.1%
Simplified60.1%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine4.0%
Simplified4.0%
add-log-exp60.4%
+-commutative60.4%
exp-sum60.4%
*-commutative60.4%
exp-to-pow60.4%
Applied egg-rr60.4%
exp-1-e60.4%
Simplified60.4%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.55e-12)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 39.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(log (* t_0 E))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.55e-12) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 39.0) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = log((t_0 * ((double) M_E)));
}
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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.55e-12) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 39.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.log((t_0 * Math.E));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.55e-12: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 39.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.log((t_0 * math.e)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.55e-12) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 39.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = log(Float64(t_0 * exp(1))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.55e-12) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 39.0) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = log((t_0 * 2.71828182845904523536)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e-12], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 39.0], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Log[N[(t$95$0 * E), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{-12}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 39:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\log \left(t\_0 \cdot e\right)\\
\end{array}
\end{array}
if y.re < -1.5500000000000001e-12Initial program 48.4%
cancel-sign-sub-inv48.4%
fma-define48.4%
hypot-define48.4%
distribute-lft-neg-in48.4%
distribute-rgt-neg-out48.4%
fma-define48.4%
hypot-define85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in y.im around 0 78.3%
unpow278.3%
unpow278.3%
hypot-undefine79.8%
Simplified79.8%
if -1.5500000000000001e-12 < y.re < 39Initial program 46.3%
cancel-sign-sub-inv46.3%
fma-define46.3%
hypot-define46.3%
distribute-lft-neg-in46.3%
distribute-rgt-neg-out46.3%
fma-define46.3%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.re around 0 46.0%
*-commutative46.0%
unpow246.0%
unpow246.0%
hypot-undefine84.4%
neg-mul-184.4%
distribute-rgt-neg-in84.4%
Simplified84.4%
if 39 < y.re Initial program 27.1%
cancel-sign-sub-inv27.1%
fma-define27.1%
hypot-define27.1%
distribute-lft-neg-in27.1%
distribute-rgt-neg-out27.1%
fma-define27.1%
hypot-define68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y.im around 0 60.1%
unpow260.1%
unpow260.1%
hypot-undefine60.1%
Simplified60.1%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine4.0%
Simplified4.0%
add-log-exp60.4%
+-commutative60.4%
exp-sum60.4%
*-commutative60.4%
exp-to-pow60.4%
Applied egg-rr60.4%
exp-1-e60.4%
Simplified60.4%
Final simplification76.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow (hypot x.im x.re) y.re) (cos (* 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) {
return pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * 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.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
\end{array}
Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine60.5%
Simplified60.5%
Final simplification60.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.25e-5) (* (cos (* y.re (atan2 x.im x.re))) (pow x.re y.re)) (+ (log (pow (hypot x.im 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 <= -1.25e-5) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_re, y_46_re);
} else {
tmp = log(pow(hypot(x_46_im, x_46_re), y_46_re)) + 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 <= -1.25e-5) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)) + 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.25e-5: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_re, y_46_re) else: tmp = math.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) + 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 <= -1.25e-5) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_re ^ y_46_re)); else tmp = Float64(log((hypot(x_46_im, x_46_re) ^ y_46_re)) + 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 <= -1.25e-5) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_re ^ y_46_re); else tmp = log((hypot(x_46_im, x_46_re) ^ y_46_re)) + 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.25e-5], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right) + 1\\
\end{array}
\end{array}
if y.re < -1.25000000000000006e-5Initial program 46.7%
cancel-sign-sub-inv46.7%
fma-define46.7%
hypot-define46.7%
distribute-lft-neg-in46.7%
distribute-rgt-neg-out46.7%
fma-define46.7%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.im around 0 77.6%
unpow277.6%
unpow277.6%
hypot-undefine79.2%
Simplified79.2%
Taylor expanded in x.im around 0 56.9%
if -1.25000000000000006e-5 < y.re Initial program 40.0%
cancel-sign-sub-inv40.0%
fma-define40.0%
hypot-define40.0%
distribute-lft-neg-in40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.im around 0 39.8%
unpow239.8%
unpow239.8%
hypot-undefine54.5%
Simplified54.5%
Taylor expanded in y.re around 0 32.0%
unpow232.0%
unpow232.0%
hypot-undefine34.2%
Simplified34.2%
+-commutative34.2%
add-cube-cbrt34.2%
fma-define34.2%
Applied egg-rr54.6%
fma-undefine54.6%
unpow254.6%
unpow354.6%
rem-cube-cbrt54.6%
Simplified54.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -0.00018) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ (log (pow (hypot x.im 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 <= -0.00018) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = log(pow(hypot(x_46_im, x_46_re), y_46_re)) + 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 <= -0.00018) {
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.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)) + 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -0.00018: 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.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) + 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 <= -0.00018) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(log((hypot(x_46_im, x_46_re) ^ y_46_re)) + 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 <= -0.00018) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = log((hypot(x_46_im, x_46_re) ^ y_46_re)) + 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.00018], 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[(N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00018:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right) + 1\\
\end{array}
\end{array}
if y.re < -1.80000000000000011e-4Initial program 47.5%
cancel-sign-sub-inv47.5%
fma-define47.5%
hypot-define47.5%
distribute-lft-neg-in47.5%
distribute-rgt-neg-out47.5%
fma-define47.5%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 78.8%
unpow278.8%
unpow278.8%
hypot-undefine78.8%
Simplified78.8%
Taylor expanded in x.re around 0 54.6%
if -1.80000000000000011e-4 < y.re Initial program 39.8%
cancel-sign-sub-inv39.8%
fma-define39.8%
hypot-define39.8%
distribute-lft-neg-in39.8%
distribute-rgt-neg-out39.8%
fma-define39.8%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 39.6%
unpow239.6%
unpow239.6%
hypot-undefine54.7%
Simplified54.7%
Taylor expanded in y.re around 0 31.8%
unpow231.8%
unpow231.8%
hypot-undefine34.2%
Simplified34.2%
+-commutative34.2%
add-cube-cbrt34.2%
fma-define34.2%
Applied egg-rr54.5%
fma-undefine54.5%
unpow254.5%
unpow354.5%
rem-cube-cbrt54.5%
Simplified54.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ (log (pow (hypot x.im x.re) y.re)) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return log(pow(hypot(x_46_im, x_46_re), y_46_re)) + 1.0;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)) + 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) + 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(log((hypot(x_46_im, x_46_re) ^ y_46_re)) + 1.0) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = log((hypot(x_46_im, x_46_re) ^ y_46_re)) + 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right) + 1
\end{array}
Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine60.5%
Simplified60.5%
Taylor expanded in y.re around 0 24.8%
unpow224.8%
unpow224.8%
hypot-undefine26.8%
Simplified26.8%
+-commutative26.8%
add-cube-cbrt26.8%
fma-define26.8%
Applied egg-rr45.0%
fma-undefine45.0%
unpow245.0%
unpow345.0%
rem-cube-cbrt45.0%
Simplified45.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log (* (pow (hypot x.im x.re) y.re) E)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return log((pow(hypot(x_46_im, x_46_re), y_46_re) * ((double) M_E)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log((Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.E));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.log((math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.e))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return log(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * exp(1))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = log(((hypot(x_46_im, x_46_re) ^ y_46_re) * 2.71828182845904523536)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Log[N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * E), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot e\right)
\end{array}
Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine60.5%
Simplified60.5%
Taylor expanded in y.re around 0 24.8%
unpow224.8%
unpow224.8%
hypot-undefine26.8%
Simplified26.8%
add-log-exp45.0%
+-commutative45.0%
exp-sum45.0%
*-commutative45.0%
exp-to-pow45.0%
Applied egg-rr45.0%
exp-1-e45.0%
Simplified45.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.2e+29)
(+ 1.0 (* y.re (log1p (+ (hypot x.im x.re) -1.0))))
(if (<= y.re 2.4)
(+ 1.0 (* y.re (log (hypot x.im x.re))))
(+ 1.0 (* y.re (log (+ x.re (* 0.5 (/ (pow x.im 2.0) 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 <= -1.2e+29) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_im, x_46_re) + -1.0)));
} else if (y_46_re <= 2.4) {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * log((x_46_re + (0.5 * (pow(x_46_im, 2.0) / x_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 tmp;
if (y_46_re <= -1.2e+29) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_im, x_46_re) + -1.0)));
} else if (y_46_re <= 2.4) {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * Math.log((x_46_re + (0.5 * (Math.pow(x_46_im, 2.0) / x_46_re)))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.2e+29: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_im, x_46_re) + -1.0))) elif y_46_re <= 2.4: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) else: tmp = 1.0 + (y_46_re * math.log((x_46_re + (0.5 * (math.pow(x_46_im, 2.0) / 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 <= -1.2e+29) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_im, x_46_re) + -1.0)))); elseif (y_46_re <= 2.4) tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_re + Float64(0.5 * Float64((x_46_im ^ 2.0) / 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, -1.2e+29], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.4], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$re + N[(0.5 * N[(N[Power[x$46$im, 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+29}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.im, x.re\right) + -1\right)\\
\mathbf{elif}\;y.re \leq 2.4:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(x.re + 0.5 \cdot \frac{{x.im}^{2}}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -1.2e29Initial program 50.0%
cancel-sign-sub-inv50.0%
fma-define50.0%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 79.8%
unpow279.8%
unpow279.8%
hypot-undefine79.8%
Simplified79.8%
Taylor expanded in y.re around 0 2.3%
unpow22.3%
unpow22.3%
hypot-undefine2.4%
Simplified2.4%
log1p-expm1-u16.4%
expm1-undefine16.4%
add-exp-log16.4%
Applied egg-rr16.4%
if -1.2e29 < y.re < 2.39999999999999991Initial program 45.8%
cancel-sign-sub-inv45.8%
fma-define45.8%
hypot-define45.8%
distribute-lft-neg-in45.8%
distribute-rgt-neg-out45.8%
fma-define45.8%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.im around 0 30.5%
unpow230.5%
unpow230.5%
hypot-undefine52.8%
Simplified52.8%
Taylor expanded in y.re around 0 27.4%
unpow227.4%
unpow227.4%
hypot-undefine48.8%
Simplified48.8%
if 2.39999999999999991 < y.re Initial program 27.1%
cancel-sign-sub-inv27.1%
fma-define27.1%
hypot-define27.1%
distribute-lft-neg-in27.1%
distribute-rgt-neg-out27.1%
fma-define27.1%
hypot-define68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y.im around 0 60.1%
unpow260.1%
unpow260.1%
hypot-undefine60.1%
Simplified60.1%
Taylor expanded in y.re around 0 37.5%
unpow237.5%
unpow237.5%
hypot-undefine4.0%
Simplified4.0%
Taylor expanded in x.im around 0 12.7%
Final simplification32.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.15e+29) (+ 1.0 (* y.re (log1p (+ (hypot x.im x.re) -1.0)))) (+ 1.0 (* y.re (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 <= -1.15e+29) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_im, x_46_re) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_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 tmp;
if (y_46_re <= -1.15e+29) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_im, x_46_re) + -1.0)));
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.15e+29: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_im, x_46_re) + -1.0))) else: tmp = 1.0 + (y_46_re * math.log(math.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 <= -1.15e+29) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_im, x_46_re) + -1.0)))); else tmp = Float64(1.0 + Float64(y_46_re * 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, -1.15e+29], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{+29}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.im, x.re\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\end{array}
\end{array}
if y.re < -1.1500000000000001e29Initial program 50.0%
cancel-sign-sub-inv50.0%
fma-define50.0%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 79.8%
unpow279.8%
unpow279.8%
hypot-undefine79.8%
Simplified79.8%
Taylor expanded in y.re around 0 2.3%
unpow22.3%
unpow22.3%
hypot-undefine2.4%
Simplified2.4%
log1p-expm1-u16.4%
expm1-undefine16.4%
add-exp-log16.4%
Applied egg-rr16.4%
if -1.1500000000000001e29 < y.re Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.im around 0 40.7%
unpow240.7%
unpow240.7%
hypot-undefine55.3%
Simplified55.3%
Taylor expanded in y.re around 0 30.9%
unpow230.9%
unpow230.9%
hypot-undefine33.3%
Simplified33.3%
Final simplification29.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log (hypot x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)
\end{array}
Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine60.5%
Simplified60.5%
Taylor expanded in y.re around 0 24.8%
unpow224.8%
unpow224.8%
hypot-undefine26.8%
Simplified26.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 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 49.0%
unpow249.0%
unpow249.0%
hypot-undefine60.5%
Simplified60.5%
Taylor expanded in y.re around 0 25.8%
herbie shell --seed 2024188
(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)))))