
(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 13 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.im x.re))))
(if (<= y.re -0.036)
(*
(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 1e+106)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.im (+ t_0 (* y.re (/ (atan2 x.im x.re) y.im))))))
(pow (hypot 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(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -0.036) {
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 <= 1e+106) {
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_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);
}
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 <= -0.036) 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 <= 1e+106) 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_im * Float64(t_0 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.036], 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, 1e+106], 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$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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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 -0.036:\\
\;\;\;\;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 10^{+106}:\\
\;\;\;\;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.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}\\
\end{array}
\end{array}
if y.re < -0.0359999999999999973Initial program 32.8%
Taylor expanded in y.re around 0 41.4%
unpow241.4%
unpow241.4%
hypot-undefine91.5%
Simplified91.5%
if -0.0359999999999999973 < y.re < 1.00000000000000009e106Initial program 42.0%
cancel-sign-sub-inv42.0%
fma-define42.0%
hypot-define42.0%
distribute-lft-neg-in42.0%
distribute-rgt-neg-out42.0%
fma-define42.0%
hypot-define85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in y.im around inf 41.3%
unpow241.3%
unpow241.3%
hypot-undefine84.5%
associate-/l*84.5%
Simplified84.5%
if 1.00000000000000009e106 < y.re Initial program 38.3%
exp-diff29.8%
exp-to-pow29.8%
hypot-define29.8%
*-commutative29.8%
exp-prod29.8%
fma-define29.8%
hypot-define48.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in y.im around 0 72.4%
unpow272.4%
unpow272.4%
hypot-undefine72.4%
Simplified72.4%
Taylor expanded in y.re around 0 80.9%
Final simplification85.4%
(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 (* y.im (log (hypot x.im x.re)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) INFINITY)
(* t_3 (- (cos t_4) (* y.re (* (atan2 x.im x.re) (sin t_4)))))
(*
(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 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= ((double) INFINITY)) {
tmp = t_3 * (cos(t_4) - (y_46_re * (atan2(x_46_im, x_46_re) * sin(t_4))));
} 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(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= Inf) tmp = Float64(t_3 * Float64(cos(t_4) - Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * sin(t_4))))); 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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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[(N[Cos[t$95$4], $MachinePrecision] - N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Sin[t$95$4], $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}\\
t_4 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq \infty:\\
\;\;\;\;t\_3 \cdot \left(\cos t\_4 - y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sin t\_4\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 76.6%
Taylor expanded in y.re around 0 83.5%
mul-1-neg83.5%
unsub-neg83.5%
unpow283.5%
unpow283.5%
hypot-undefine83.5%
*-commutative83.5%
unpow283.5%
unpow283.5%
Simplified83.5%
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%
cancel-sign-sub-inv0.0%
fma-define0.0%
hypot-define0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define86.6%
*-commutative86.6%
Simplified86.6%
Final simplification85.0%
(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 (* 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))) <= ((double) INFINITY)) {
tmp = t_3 * cos((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))) <= Inf) tmp = Float64(t_3 * cos(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], Infinity], N[(t$95$3 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $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(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\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 76.6%
Taylor expanded in y.re around 0 82.0%
unpow282.0%
unpow282.0%
hypot-undefine82.0%
Simplified82.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%
cancel-sign-sub-inv0.0%
fma-define0.0%
hypot-define0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define86.6%
*-commutative86.6%
Simplified86.6%
Final simplification84.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re)))))
(if (<= y.re -2.4e-16)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos t_0))
(if (<= y.re 1.8e-15)
(/ (cos (pow (cbrt t_0) 3.0)) (pow (exp y.im) (atan2 x.im x.re)))
(pow (hypot 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 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -2.4e-16) {
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(t_0);
} else if (y_46_re <= 1.8e-15) {
tmp = cos(pow(cbrt(t_0), 3.0)) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = pow(hypot(x_46_im, 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 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -2.4e-16) {
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(t_0);
} else if (y_46_re <= 1.8e-15) {
tmp = Math.cos(Math.pow(Math.cbrt(t_0), 3.0)) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -2.4e-16) 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(t_0)); elseif (y_46_re <= 1.8e-15) tmp = Float64(cos((cbrt(t_0) ^ 3.0)) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.4e-16], 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[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.8e-15], N[(N[Cos[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -2.4 \cdot 10^{-16}:\\
\;\;\;\;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 t\_0\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\cos \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.40000000000000005e-16Initial program 32.8%
Taylor expanded in y.re around 0 40.6%
unpow240.6%
unpow240.6%
hypot-undefine86.2%
Simplified86.2%
if -2.40000000000000005e-16 < y.re < 1.8000000000000001e-15Initial program 44.4%
exp-diff44.4%
exp-to-pow44.4%
hypot-define44.4%
*-commutative44.4%
exp-prod44.1%
fma-define44.1%
hypot-define87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in y.re around 0 44.4%
unpow244.4%
unpow244.4%
hypot-undefine87.6%
exp-prod87.3%
Simplified87.3%
add-cube-cbrt91.6%
pow390.1%
Applied egg-rr90.1%
if 1.8000000000000001e-15 < y.re Initial program 36.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-define29.7%
*-commutative29.7%
exp-prod28.4%
fma-define28.4%
hypot-define51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in y.im around 0 66.4%
unpow266.4%
unpow266.4%
hypot-undefine68.4%
Simplified68.4%
Taylor expanded in y.re around 0 75.2%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.005)
(*
(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 1.55e-15)
(*
(cos (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(pow (hypot 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 tmp;
if (y_46_re <= -0.005) {
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 <= 1.55e-15) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(hypot(x_46_im, 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 <= -0.005) 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 <= 1.55e-15) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.005], 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, 1.55e-15], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.005:\\
\;\;\;\;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 1.55 \cdot 10^{-15}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\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}\\
\end{array}
\end{array}
if y.re < -0.0050000000000000001Initial program 32.8%
Taylor expanded in y.re around 0 41.4%
unpow241.4%
unpow241.4%
hypot-undefine91.5%
Simplified91.5%
if -0.0050000000000000001 < y.re < 1.5499999999999999e-15Initial program 43.9%
cancel-sign-sub-inv43.9%
fma-define43.9%
hypot-define43.9%
distribute-lft-neg-in43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in y.re around 0 85.6%
neg-mul-185.6%
*-commutative85.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
if 1.5499999999999999e-15 < y.re Initial program 36.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-define29.7%
*-commutative29.7%
exp-prod28.4%
fma-define28.4%
hypot-define51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in y.im around 0 66.4%
unpow266.4%
unpow266.4%
hypot-undefine68.4%
Simplified68.4%
Taylor expanded in y.re around 0 75.2%
Final simplification83.9%
(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 -5.5e-14)
(log (pow E t_0))
(if (<= y.re 1.65e-15)
(*
(cos (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
t_0))))
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 <= -5.5e-14) {
tmp = log(pow(((double) M_E), t_0));
} else if (y_46_re <= 1.65e-15) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
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 <= -5.5e-14) tmp = log((exp(1) ^ t_0)); elseif (y_46_re <= 1.65e-15) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = t_0; end return 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, -5.5e-14], N[Log[N[Power[E, t$95$0], $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.65e-15], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\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 -5.5 \cdot 10^{-14}:\\
\;\;\;\;\log \left({e}^{t\_0}\right)\\
\mathbf{elif}\;y.re \leq 1.65 \cdot 10^{-15}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -5.49999999999999991e-14Initial program 31.7%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod28.6%
fma-define28.6%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 79.6%
unpow279.6%
unpow279.6%
hypot-undefine82.9%
Simplified82.9%
add-log-exp82.8%
exp-prod82.9%
Applied egg-rr82.9%
Taylor expanded in y.re around 0 84.4%
exp-1-e84.4%
Simplified84.4%
if -5.49999999999999991e-14 < y.re < 1.65e-15Initial program 44.9%
cancel-sign-sub-inv44.9%
fma-define44.9%
hypot-define44.9%
distribute-lft-neg-in44.9%
distribute-rgt-neg-out44.9%
fma-define44.9%
hypot-define87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y.re around 0 87.7%
neg-mul-187.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
Simplified87.7%
if 1.65e-15 < y.re Initial program 36.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-define29.7%
*-commutative29.7%
exp-prod28.4%
fma-define28.4%
hypot-define51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in y.im around 0 66.4%
unpow266.4%
unpow266.4%
hypot-undefine68.4%
Simplified68.4%
Taylor expanded in y.re around 0 75.2%
Final simplification83.3%
(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 -2e-14)
(log (pow E t_0))
(if (<= y.re 1.8e-15)
(/
(cos (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (atan2 x.im x.re)))
t_0))))
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 <= -2e-14) {
tmp = log(pow(((double) M_E), t_0));
} else if (y_46_re <= 1.8e-15) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2e-14) {
tmp = Math.log(Math.pow(Math.E, t_0));
} else if (y_46_re <= 1.8e-15) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
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 <= -2e-14: tmp = math.log(math.pow(math.e, t_0)) elif y_46_re <= 1.8e-15: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 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 <= -2e-14) tmp = log((exp(1) ^ t_0)); elseif (y_46_re <= 1.8e-15) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = t_0; 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 <= -2e-14) tmp = log((2.71828182845904523536 ^ t_0)); elseif (y_46_re <= 1.8e-15) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0; 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, -2e-14], N[Log[N[Power[E, t$95$0], $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.8e-15], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\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 -2 \cdot 10^{-14}:\\
\;\;\;\;\log \left({e}^{t\_0}\right)\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2e-14Initial program 31.7%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod28.6%
fma-define28.6%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 79.6%
unpow279.6%
unpow279.6%
hypot-undefine82.9%
Simplified82.9%
add-log-exp82.8%
exp-prod82.9%
Applied egg-rr82.9%
Taylor expanded in y.re around 0 84.4%
exp-1-e84.4%
Simplified84.4%
if -2e-14 < y.re < 1.8000000000000001e-15Initial program 44.9%
exp-diff44.9%
exp-to-pow44.9%
hypot-define44.9%
*-commutative44.9%
exp-prod44.6%
fma-define44.6%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.re around 0 44.9%
unpow244.9%
unpow244.9%
hypot-undefine87.7%
exp-prod87.5%
Simplified87.5%
if 1.8000000000000001e-15 < y.re Initial program 36.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-define29.7%
*-commutative29.7%
exp-prod28.4%
fma-define28.4%
hypot-define51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in y.im around 0 66.4%
unpow266.4%
unpow266.4%
hypot-undefine68.4%
Simplified68.4%
Taylor expanded in y.re around 0 75.2%
Final simplification83.2%
(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 -1e-14)
(log (pow E t_0))
(if (<= y.re 1.8e-15) (/ 1.0 (pow (exp y.im) (atan2 x.im x.re))) t_0))))
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 <= -1e-14) {
tmp = log(pow(((double) M_E), t_0));
} else if (y_46_re <= 1.8e-15) {
tmp = 1.0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1e-14) {
tmp = Math.log(Math.pow(Math.E, t_0));
} else if (y_46_re <= 1.8e-15) {
tmp = 1.0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
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 <= -1e-14: tmp = math.log(math.pow(math.e, t_0)) elif y_46_re <= 1.8e-15: tmp = 1.0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 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 <= -1e-14) tmp = log((exp(1) ^ t_0)); elseif (y_46_re <= 1.8e-15) tmp = Float64(1.0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = t_0; 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 <= -1e-14) tmp = log((2.71828182845904523536 ^ t_0)); elseif (y_46_re <= 1.8e-15) tmp = 1.0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0; 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, -1e-14], N[Log[N[Power[E, t$95$0], $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, 1.8e-15], N[(1.0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\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 \cdot 10^{-14}:\\
\;\;\;\;\log \left({e}^{t\_0}\right)\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.99999999999999999e-15Initial program 31.7%
exp-diff28.6%
exp-to-pow28.6%
hypot-define28.6%
*-commutative28.6%
exp-prod28.6%
fma-define28.6%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 79.6%
unpow279.6%
unpow279.6%
hypot-undefine82.9%
Simplified82.9%
add-log-exp82.8%
exp-prod82.9%
Applied egg-rr82.9%
Taylor expanded in y.re around 0 84.4%
exp-1-e84.4%
Simplified84.4%
if -9.99999999999999999e-15 < y.re < 1.8000000000000001e-15Initial program 44.9%
exp-diff44.9%
exp-to-pow44.9%
hypot-define44.9%
*-commutative44.9%
exp-prod44.6%
fma-define44.6%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.re around 0 44.9%
unpow244.9%
unpow244.9%
hypot-undefine87.7%
exp-prod87.5%
Simplified87.5%
Taylor expanded in y.im around 0 82.6%
if 1.8000000000000001e-15 < y.re Initial program 36.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-define29.7%
*-commutative29.7%
exp-prod28.4%
fma-define28.4%
hypot-define51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in y.im around 0 66.4%
unpow266.4%
unpow266.4%
hypot-undefine68.4%
Simplified68.4%
Taylor expanded in y.re around 0 75.2%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.1e-13) (not (<= y.re 1.8e-15))) (pow (hypot x.im x.re) y.re) (/ 1.0 (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) {
double tmp;
if ((y_46_re <= -1.1e-13) || !(y_46_re <= 1.8e-15)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 / pow(exp(y_46_im), atan2(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.1e-13) || !(y_46_re <= 1.8e-15)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 / Math.pow(Math.exp(y_46_im), Math.atan2(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.1e-13) or not (y_46_re <= 1.8e-15): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 1.0 / math.pow(math.exp(y_46_im), math.atan2(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.1e-13) || !(y_46_re <= 1.8e-15)) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64(1.0 / (exp(y_46_im) ^ atan(x_46_im, x_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 <= -1.1e-13) || ~((y_46_re <= 1.8e-15))) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 1.0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); 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.1e-13], N[Not[LessEqual[y$46$re, 1.8e-15]], $MachinePrecision]], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(1.0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{-13} \lor \neg \left(y.re \leq 1.8 \cdot 10^{-15}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.re < -1.09999999999999998e-13 or 1.8000000000000001e-15 < y.re Initial program 34.3%
exp-diff29.2%
exp-to-pow29.2%
hypot-define29.2%
*-commutative29.2%
exp-prod28.5%
fma-define28.5%
hypot-define58.4%
*-commutative58.4%
Simplified58.4%
Taylor expanded in y.im around 0 72.5%
unpow272.5%
unpow272.5%
hypot-undefine75.1%
Simplified75.1%
Taylor expanded in y.re around 0 79.5%
if -1.09999999999999998e-13 < y.re < 1.8000000000000001e-15Initial program 44.9%
exp-diff44.9%
exp-to-pow44.9%
hypot-define44.9%
*-commutative44.9%
exp-prod44.6%
fma-define44.6%
hypot-define87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in y.re around 0 44.9%
unpow244.9%
unpow244.9%
hypot-undefine87.7%
exp-prod87.5%
Simplified87.5%
Taylor expanded in y.im around 0 82.6%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.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);
}
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);
}
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)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(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) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 39.2%
exp-diff36.5%
exp-to-pow36.5%
hypot-define36.5%
*-commutative36.5%
exp-prod36.0%
fma-define36.0%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 57.5%
unpow257.5%
unpow257.5%
hypot-undefine67.4%
Simplified67.4%
Taylor expanded in y.re around 0 69.7%
Final simplification69.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -2e-311) (- 1.0 (* y.re (log (/ -1.0 x.im)))) (+ 1.0 (* y.re (log x.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2e-311) {
tmp = 1.0 - (y_46_re * log((-1.0 / x_46_im)));
} else {
tmp = 1.0 + (y_46_re * log(x_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 (x_46im <= (-2d-311)) then
tmp = 1.0d0 - (y_46re * log(((-1.0d0) / x_46im)))
else
tmp = 1.0d0 + (y_46re * log(x_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 (x_46_im <= -2e-311) {
tmp = 1.0 - (y_46_re * Math.log((-1.0 / x_46_im)));
} else {
tmp = 1.0 + (y_46_re * Math.log(x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -2e-311: tmp = 1.0 - (y_46_re * math.log((-1.0 / x_46_im))) else: tmp = 1.0 + (y_46_re * math.log(x_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -2e-311) tmp = Float64(1.0 - Float64(y_46_re * log(Float64(-1.0 / x_46_im)))); else tmp = Float64(1.0 + Float64(y_46_re * log(x_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 (x_46_im <= -2e-311) tmp = 1.0 - (y_46_re * log((-1.0 / x_46_im))); else tmp = 1.0 + (y_46_re * log(x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -2e-311], N[(1.0 - N[(y$46$re * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2 \cdot 10^{-311}:\\
\;\;\;\;1 - y.re \cdot \log \left(\frac{-1}{x.im}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log x.im\\
\end{array}
\end{array}
if x.im < -1.9999999999999e-311Initial program 36.9%
exp-diff34.7%
exp-to-pow34.7%
hypot-define34.7%
*-commutative34.7%
exp-prod33.8%
fma-define33.8%
hypot-define73.4%
*-commutative73.4%
Simplified73.4%
Taylor expanded in y.im around 0 56.5%
unpow256.5%
unpow256.5%
hypot-undefine67.5%
Simplified67.5%
Taylor expanded in y.re around 0 26.9%
unpow226.9%
unpow226.9%
hypot-undefine32.0%
Simplified32.0%
Taylor expanded in x.im around -inf 31.5%
mul-1-neg31.5%
*-commutative31.5%
distribute-rgt-neg-in31.5%
Simplified31.5%
if -1.9999999999999e-311 < x.im Initial program 42.0%
exp-diff38.6%
exp-to-pow38.6%
hypot-define38.6%
*-commutative38.6%
exp-prod38.5%
fma-define38.5%
hypot-define70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in y.im around 0 58.7%
unpow258.7%
unpow258.7%
hypot-undefine67.2%
Simplified67.2%
Taylor expanded in y.re around 0 29.3%
unpow229.3%
unpow229.3%
hypot-undefine29.2%
Simplified29.2%
Taylor expanded in x.re around 0 29.1%
Final simplification30.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -9e-289) (+ 1.0 (* y.re (log x.re))) (+ 1.0 (* y.re (log x.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -9e-289) {
tmp = 1.0 + (y_46_re * log(x_46_re));
} else {
tmp = 1.0 + (y_46_re * log(x_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 (x_46im <= (-9d-289)) then
tmp = 1.0d0 + (y_46re * log(x_46re))
else
tmp = 1.0d0 + (y_46re * log(x_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 (x_46_im <= -9e-289) {
tmp = 1.0 + (y_46_re * Math.log(x_46_re));
} else {
tmp = 1.0 + (y_46_re * Math.log(x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -9e-289: tmp = 1.0 + (y_46_re * math.log(x_46_re)) else: tmp = 1.0 + (y_46_re * math.log(x_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -9e-289) tmp = Float64(1.0 + Float64(y_46_re * log(x_46_re))); else tmp = Float64(1.0 + Float64(y_46_re * log(x_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 (x_46_im <= -9e-289) tmp = 1.0 + (y_46_re * log(x_46_re)); else tmp = 1.0 + (y_46_re * log(x_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -9e-289], N[(1.0 + N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -9 \cdot 10^{-289}:\\
\;\;\;\;1 + y.re \cdot \log x.re\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log x.im\\
\end{array}
\end{array}
if x.im < -9.0000000000000003e-289Initial program 36.9%
exp-diff34.7%
exp-to-pow34.7%
hypot-define34.7%
*-commutative34.7%
exp-prod33.9%
fma-define33.9%
hypot-define72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in y.im around 0 56.3%
unpow256.3%
unpow256.3%
hypot-undefine67.5%
Simplified67.5%
Taylor expanded in y.re around 0 26.8%
unpow226.8%
unpow226.8%
hypot-undefine31.9%
Simplified31.9%
Taylor expanded in x.im around 0 13.2%
if -9.0000000000000003e-289 < x.im Initial program 41.8%
exp-diff38.5%
exp-to-pow38.5%
hypot-define38.5%
*-commutative38.5%
exp-prod38.4%
fma-define38.4%
hypot-define70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in y.im around 0 58.9%
unpow258.9%
unpow258.9%
hypot-undefine67.2%
Simplified67.2%
Taylor expanded in y.re around 0 29.5%
unpow229.5%
unpow229.5%
hypot-undefine29.4%
Simplified29.4%
Taylor expanded in x.re around 0 28.4%
Final simplification20.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log x.im))))
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(x_46_im));
}
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 + (y_46re * log(x_46im))
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 + (y_46_re * Math.log(x_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(x_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(x_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(x_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log x.im
\end{array}
Initial program 39.2%
exp-diff36.5%
exp-to-pow36.5%
hypot-define36.5%
*-commutative36.5%
exp-prod36.0%
fma-define36.0%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 57.5%
unpow257.5%
unpow257.5%
hypot-undefine67.4%
Simplified67.4%
Taylor expanded in y.re around 0 28.0%
unpow228.0%
unpow228.0%
hypot-undefine30.7%
Simplified30.7%
Taylor expanded in x.re around 0 13.3%
Final simplification13.3%
herbie shell --seed 2024050
(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)))))