
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 19 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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 (* (atan2 x.im x.re) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (/ -1.0 x.re)))
(t_3 (- (log x.re))))
(if (<= x.re -8.5e-25)
(* (exp (- (fma t_2 y.re t_0))) (sin (fma (- y.im) t_2 t_1)))
(if (<= x.re 52.0)
(*
(fma
(* (log (sqrt (fma x.re x.re (* x.im x.im)))) (cos t_1))
y.im
(sin t_1))
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(* (exp (- (fma t_3 y.re t_0))) (sin (fma (- y.im) t_3 t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log((-1.0 / x_46_re));
double t_3 = -log(x_46_re);
double tmp;
if (x_46_re <= -8.5e-25) {
tmp = exp(-fma(t_2, y_46_re, t_0)) * sin(fma(-y_46_im, t_2, t_1));
} else if (x_46_re <= 52.0) {
tmp = fma((log(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im)))) * cos(t_1)), y_46_im, sin(t_1)) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = exp(-fma(t_3, y_46_re, t_0)) * sin(fma(-y_46_im, t_3, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(Float64(-1.0 / x_46_re)) t_3 = Float64(-log(x_46_re)) tmp = 0.0 if (x_46_re <= -8.5e-25) tmp = Float64(exp(Float64(-fma(t_2, y_46_re, t_0))) * sin(fma(Float64(-y_46_im), t_2, t_1))); elseif (x_46_re <= 52.0) tmp = Float64(fma(Float64(log(sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)))) * cos(t_1)), y_46_im, sin(t_1)) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(exp(Float64(-fma(t_3, y_46_re, t_0))) * sin(fma(Float64(-y_46_im), t_3, t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = (-N[Log[x$46$re], $MachinePrecision])}, If[LessEqual[x$46$re, -8.5e-25], N[(N[Exp[(-N[(t$95$2 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[((-y$46$im) * t$95$2 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 52.0], N[(N[(N[(N[Log[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] * y$46$im + N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[(-N[(t$95$3 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[((-y$46$im) * t$95$3 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
t_3 := -\log x.re\\
\mathbf{if}\;x.re \leq -8.5 \cdot 10^{-25}:\\
\;\;\;\;e^{-\mathsf{fma}\left(t\_2, y.re, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.re \leq 52:\\
\;\;\;\;\mathsf{fma}\left(\log \left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right) \cdot \cos t\_1, y.im, \sin t\_1\right) \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{-\mathsf{fma}\left(t\_3, y.re, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_3, t\_1\right)\right)\\
\end{array}
\end{array}
if x.re < -8.49999999999999981e-25Initial program 27.8%
Taylor expanded in x.re around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites79.1%
if -8.49999999999999981e-25 < x.re < 52Initial program 55.5%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.1%
if 52 < x.re Initial program 27.4%
Taylor expanded in x.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
Applied rewrites74.9%
Final simplification71.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -9.6e-165)
(*
(sin (fma y.re (atan2 x.im x.re) (* t_2 (- y.im))))
(exp (- (* (- y.re) t_2) t_0)))
(if (<= x.im 4e+14)
(*
(sin t_1)
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(*
(* (exp (* (atan2 x.im x.re) (- y.im))) (pow x.im y.re))
(sin (fma (log x.im) 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -9.6e-165) {
tmp = sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_2 * -y_46_im))) * exp(((-y_46_re * t_2) - t_0));
} else if (x_46_im <= 4e+14) {
tmp = sin(t_1) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = (exp((atan2(x_46_im, x_46_re) * -y_46_im)) * pow(x_46_im, y_46_re)) * sin(fma(log(x_46_im), y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -9.6e-165) tmp = Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_2 * Float64(-y_46_im)))) * exp(Float64(Float64(Float64(-y_46_re) * t_2) - t_0))); elseif (x_46_im <= 4e+14) tmp = Float64(sin(t_1) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * (x_46_im ^ y_46_re)) * sin(fma(log(x_46_im), 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -9.6e-165], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$2 * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[((-y$46$re) * t$95$2), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4e+14], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -9.6 \cdot 10^{-165}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_2 \cdot \left(-y.im\right)\right)\right) \cdot e^{\left(-y.re\right) \cdot t\_2 - t\_0}\\
\mathbf{elif}\;x.im \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\sin t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot {x.im}^{y.re}\right) \cdot \sin \left(\mathsf{fma}\left(\log x.im, y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -9.6000000000000009e-165Initial program 37.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6447.3
Applied rewrites47.3%
Taylor expanded in y.re around 0
Applied rewrites46.3%
Taylor expanded in x.im around -inf
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-atan2.f64N/A
Applied rewrites78.1%
if -9.6000000000000009e-165 < x.im < 4e14Initial program 48.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.3
Applied rewrites63.3%
if 4e14 < x.im Initial program 30.5%
Taylor expanded in x.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
sub-negN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
Applied rewrites70.7%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -9.6e-165)
(* (exp (- (fma t_2 y.re t_0))) (sin (fma (- y.im) t_2 t_1)))
(if (<= x.im 4e+14)
(*
(sin t_1)
(exp (- (* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re) t_0)))
(*
(* (exp (* (atan2 x.im x.re) (- y.im))) (pow x.im y.re))
(sin (fma (log x.im) 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -9.6e-165) {
tmp = exp(-fma(t_2, y_46_re, t_0)) * sin(fma(-y_46_im, t_2, t_1));
} else if (x_46_im <= 4e+14) {
tmp = sin(t_1) * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - t_0));
} else {
tmp = (exp((atan2(x_46_im, x_46_re) * -y_46_im)) * pow(x_46_im, y_46_re)) * sin(fma(log(x_46_im), y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -9.6e-165) tmp = Float64(exp(Float64(-fma(t_2, y_46_re, t_0))) * sin(fma(Float64(-y_46_im), t_2, t_1))); elseif (x_46_im <= 4e+14) tmp = Float64(sin(t_1) * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - t_0))); else tmp = Float64(Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * (x_46_im ^ y_46_re)) * sin(fma(log(x_46_im), 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -9.6e-165], N[(N[Exp[(-N[(t$95$2 * y$46$re + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[((-y$46$im) * t$95$2 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4e+14], N[(N[Sin[t$95$1], $MachinePrecision] * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Log[x$46$im], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -9.6 \cdot 10^{-165}:\\
\;\;\;\;e^{-\mathsf{fma}\left(t\_2, y.re, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(-y.im, t\_2, t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 4 \cdot 10^{+14}:\\
\;\;\;\;\sin t\_1 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot {x.im}^{y.re}\right) \cdot \sin \left(\mathsf{fma}\left(\log x.im, y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -9.6000000000000009e-165Initial program 37.5%
Taylor expanded in x.im around -inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-log.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
sub-negN/A
Applied rewrites78.1%
if -9.6000000000000009e-165 < x.im < 4e14Initial program 48.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6463.3
Applied rewrites63.3%
if 4e14 < x.im Initial program 30.5%
Taylor expanded in x.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
sub-negN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
neg-mul-1N/A
Applied rewrites70.7%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1
(*
t_0
(exp
(-
(* (log (sqrt (+ (* x.im x.im) (* x.re x.re)))) y.re)
(* (atan2 x.im x.re) y.im))))))
(if (<= y.re -0.00034)
t_1
(if (<= y.re 0.085)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_0)
(if (<= y.re 3.7e+119)
(*
(*
(fma
(* (* y.re y.re) -0.16666666666666666)
(pow (atan2 x.im x.re) 3.0)
(atan2 x.im x.re))
y.re)
(pow (sqrt (fma x.re x.re (* x.im x.im))) y.re))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = t_0 * exp(((log(sqrt(((x_46_im * x_46_im) + (x_46_re * x_46_re)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -0.00034) {
tmp = t_1;
} else if (y_46_re <= 0.085) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else if (y_46_re <= 3.7e+119) {
tmp = (fma(((y_46_re * y_46_re) * -0.16666666666666666), pow(atan2(x_46_im, x_46_re), 3.0), atan2(x_46_im, x_46_re)) * y_46_re) * pow(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im))), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64(t_0 * exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_im * x_46_im) + Float64(x_46_re * x_46_re)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))) tmp = 0.0 if (y_46_re <= -0.00034) tmp = t_1; elseif (y_46_re <= 0.085) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_0); elseif (y_46_re <= 3.7e+119) tmp = Float64(Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.16666666666666666), (atan(x_46_im, x_46_re) ^ 3.0), atan(x_46_im, x_46_re)) * y_46_re) * (sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))) ^ y_46_re)); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.00034], t$95$1, If[LessEqual[y$46$re, 0.085], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 3.7e+119], N[(N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision] * N[Power[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := t\_0 \cdot e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.re \leq -0.00034:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 0.085:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+119}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.16666666666666666, {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -3.4e-4 or 3.7e119 < y.re Initial program 34.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
if -3.4e-4 < y.re < 0.0850000000000000061Initial program 48.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.0
Applied rewrites44.0%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6460.2
Applied rewrites60.2%
if 0.0850000000000000061 < y.re < 3.7e119Initial program 31.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.7
Applied rewrites51.7%
Taylor expanded in y.re around 0
Applied rewrites79.3%
Final simplification69.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (pow (sqrt (fma x.re x.re (* x.im x.im))) y.re))
(t_2 (fma x.im x.im (* x.re x.re)))
(t_3 (* t_2 t_2)))
(if (<= y.re -6.2e-14)
(* t_1 t_0)
(if (<= y.re 0.085)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_0)
(if (<= y.re 3.7e+119)
(*
(*
(fma
(* (* y.re y.re) -0.16666666666666666)
(pow (atan2 x.im x.re) 3.0)
(atan2 x.im x.re))
y.re)
t_1)
(* (pow (* t_3 t_3) (* 0.25 (* 0.5 y.re))) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = pow(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im))), y_46_re);
double t_2 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double t_3 = t_2 * t_2;
double tmp;
if (y_46_re <= -6.2e-14) {
tmp = t_1 * t_0;
} else if (y_46_re <= 0.085) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
} else if (y_46_re <= 3.7e+119) {
tmp = (fma(((y_46_re * y_46_re) * -0.16666666666666666), pow(atan2(x_46_im, x_46_re), 3.0), atan2(x_46_im, x_46_re)) * y_46_re) * t_1;
} else {
tmp = pow((t_3 * t_3), (0.25 * (0.5 * y_46_re))) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))) ^ y_46_re t_2 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) t_3 = Float64(t_2 * t_2) tmp = 0.0 if (y_46_re <= -6.2e-14) tmp = Float64(t_1 * t_0); elseif (y_46_re <= 0.085) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_0); elseif (y_46_re <= 3.7e+119) tmp = Float64(Float64(fma(Float64(Float64(y_46_re * y_46_re) * -0.16666666666666666), (atan(x_46_im, x_46_re) ^ 3.0), atan(x_46_im, x_46_re)) * y_46_re) * t_1); else tmp = Float64((Float64(t_3 * t_3) ^ Float64(0.25 * Float64(0.5 * y_46_re))) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -6.2e-14], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 0.085], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 3.7e+119], N[(N[(N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[Power[N[(t$95$3 * t$95$3), $MachinePrecision], N[(0.25 * N[(0.5 * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := {\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re}\\
t_2 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
t_3 := t\_2 \cdot t\_2\\
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{-14}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{elif}\;y.re \leq 0.085:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+119}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(y.re \cdot y.re\right) \cdot -0.16666666666666666, {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot y.re\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_3 \cdot t\_3\right)}^{\left(0.25 \cdot \left(0.5 \cdot y.re\right)\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -6.20000000000000009e-14Initial program 36.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
if -6.20000000000000009e-14 < y.re < 0.0850000000000000061Initial program 48.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.7
Applied rewrites44.7%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6461.2
Applied rewrites61.2%
if 0.0850000000000000061 < y.re < 3.7e119Initial program 31.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.7
Applied rewrites51.7%
Taylor expanded in y.re around 0
Applied rewrites79.3%
if 3.7e119 < y.re Initial program 29.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6466.0
Applied rewrites66.0%
Applied rewrites66.0%
Applied rewrites66.0%
Final simplification68.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma x.im x.im (* x.re x.re)))
(t_1 (* t_0 t_0))
(t_2 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -6.2e-14)
(* (pow (sqrt (fma x.re x.re (* x.im x.im))) y.re) t_2)
(if (<= y.re 1.25)
(* (exp (* (atan2 x.im x.re) (- y.im))) t_2)
(* (pow (* t_1 t_1) (* 0.25 (* 0.5 y.re))) t_2)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double t_1 = t_0 * t_0;
double t_2 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -6.2e-14) {
tmp = pow(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im))), y_46_re) * t_2;
} else if (y_46_re <= 1.25) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_2;
} else {
tmp = pow((t_1 * t_1), (0.25 * (0.5 * y_46_re))) * t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) t_1 = Float64(t_0 * t_0) t_2 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -6.2e-14) tmp = Float64((sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))) ^ y_46_re) * t_2); elseif (y_46_re <= 1.25) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_2); else tmp = Float64((Float64(t_1 * t_1) ^ Float64(0.25 * Float64(0.5 * y_46_re))) * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6.2e-14], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.25], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[Power[N[(t$95$1 * t$95$1), $MachinePrecision], N[(0.25 * N[(0.5 * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
t_1 := t\_0 \cdot t\_0\\
t_2 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{-14}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot t\_2\\
\mathbf{elif}\;y.re \leq 1.25:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left(t\_1 \cdot t\_1\right)}^{\left(0.25 \cdot \left(0.5 \cdot y.re\right)\right)} \cdot t\_2\\
\end{array}
\end{array}
if y.re < -6.20000000000000009e-14Initial program 36.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.4
Applied rewrites78.4%
if -6.20000000000000009e-14 < y.re < 1.25Initial program 48.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.7
Applied rewrites44.7%
Taylor expanded in y.im around inf
neg-mul-1N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f6461.2
Applied rewrites61.2%
if 1.25 < y.re Initial program 30.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6460.3
Applied rewrites60.3%
Applied rewrites60.3%
Applied rewrites60.3%
Final simplification65.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re 3.2e+193)
(*
(pow (sqrt (fma x.re x.re (* x.im x.im))) y.re)
(sin (* (atan2 x.im x.re) y.re)))
(* (exp (* (log x.re) y.re)) (sin (* (log 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 (x_46_re <= 3.2e+193) {
tmp = pow(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im))), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = exp((log(x_46_re) * y_46_re)) * sin((log(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 (x_46_re <= 3.2e+193) tmp = Float64((sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(exp(Float64(log(x_46_re) * y_46_re)) * sin(Float64(log(x_46_re) * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 3.2e+193], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[Log[x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 3.2 \cdot 10^{+193}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log x.re \cdot y.re} \cdot \sin \left(\log x.re \cdot y.im\right)\\
\end{array}
\end{array}
if x.re < 3.20000000000000013e193Initial program 43.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6451.2
Applied rewrites51.2%
if 3.20000000000000013e193 < x.re Initial program 0.0%
Taylor expanded in x.re around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
Applied rewrites78.1%
Taylor expanded in y.im around 0
Applied rewrites68.8%
Taylor expanded in y.im around inf
Applied rewrites68.8%
Final simplification52.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re)))
(t_1 (fma x.im x.im (* x.re x.re)))
(t_2 (* t_1 t_1)))
(if (<= y.im -30500000000.0)
(* (pow (* t_2 t_2) (* 0.25 (* 0.5 y.re))) t_0)
(* (pow (sqrt (fma x.re x.re (* x.im x.im))) y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double t_2 = t_1 * t_1;
double tmp;
if (y_46_im <= -30500000000.0) {
tmp = pow((t_2 * t_2), (0.25 * (0.5 * y_46_re))) * t_0;
} else {
tmp = pow(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im))), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) t_2 = Float64(t_1 * t_1) tmp = 0.0 if (y_46_im <= -30500000000.0) tmp = Float64((Float64(t_2 * t_2) ^ Float64(0.25 * Float64(0.5 * y_46_re))) * t_0); else tmp = Float64((sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))) ^ y_46_re) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$im, -30500000000.0], N[(N[Power[N[(t$95$2 * t$95$2), $MachinePrecision], N[(0.25 * N[(0.5 * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
t_2 := t\_1 \cdot t\_1\\
\mathbf{if}\;y.im \leq -30500000000:\\
\;\;\;\;{\left(t\_2 \cdot t\_2\right)}^{\left(0.25 \cdot \left(0.5 \cdot y.re\right)\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.im < -3.05e10Initial program 36.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.1
Applied rewrites48.1%
Applied rewrites54.2%
Applied rewrites57.1%
if -3.05e10 < y.im Initial program 41.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Final simplification52.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (fma x.im x.im (* x.re x.re))))
(if (<= y.im -4.6e-160)
(* (pow (* t_1 t_1) (* (* 0.5 y.re) 0.5)) (sin t_0))
(* t_0 (pow t_1 (* 0.5 y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double tmp;
if (y_46_im <= -4.6e-160) {
tmp = pow((t_1 * t_1), ((0.5 * y_46_re) * 0.5)) * sin(t_0);
} else {
tmp = t_0 * pow(t_1, (0.5 * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) tmp = 0.0 if (y_46_im <= -4.6e-160) tmp = Float64((Float64(t_1 * t_1) ^ Float64(Float64(0.5 * y_46_re) * 0.5)) * sin(t_0)); else tmp = Float64(t_0 * (t_1 ^ Float64(0.5 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4.6e-160], N[(N[Power[N[(t$95$1 * t$95$1), $MachinePrecision], N[(N[(0.5 * y$46$re), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[t$95$1, N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{-160}:\\
\;\;\;\;{\left(t\_1 \cdot t\_1\right)}^{\left(\left(0.5 \cdot y.re\right) \cdot 0.5\right)} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {t\_1}^{\left(0.5 \cdot y.re\right)}\\
\end{array}
\end{array}
if y.im < -4.5999999999999997e-160Initial program 40.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6452.0
Applied rewrites52.0%
Applied rewrites55.8%
if -4.5999999999999997e-160 < y.im Initial program 40.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.5
Applied rewrites48.5%
Taylor expanded in y.re around 0
Applied rewrites49.1%
Applied rewrites49.1%
Final simplification51.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma x.im x.im (* x.re x.re)))
(t_1 (* t_0 t_0))
(t_2 (* (atan2 x.im x.re) y.re))
(t_3 (sin t_2)))
(if (<= x.im -2.75e-133)
(* (pow (- x.im) y.re) t_3)
(if (<= x.im 1.6e-246)
(* t_2 (pow (* t_1 t_1) (* 0.25 (* 0.5 y.re))))
(* (pow (sqrt (fma x.re x.re (* x.im x.im))) y.re) t_3)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double t_1 = t_0 * t_0;
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double t_3 = sin(t_2);
double tmp;
if (x_46_im <= -2.75e-133) {
tmp = pow(-x_46_im, y_46_re) * t_3;
} else if (x_46_im <= 1.6e-246) {
tmp = t_2 * pow((t_1 * t_1), (0.25 * (0.5 * y_46_re)));
} else {
tmp = pow(sqrt(fma(x_46_re, x_46_re, (x_46_im * x_46_im))), y_46_re) * t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) t_1 = Float64(t_0 * t_0) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_3 = sin(t_2) tmp = 0.0 if (x_46_im <= -2.75e-133) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_3); elseif (x_46_im <= 1.6e-246) tmp = Float64(t_2 * (Float64(t_1 * t_1) ^ Float64(0.25 * Float64(0.5 * y_46_re)))); else tmp = Float64((sqrt(fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im))) ^ y_46_re) * t_3); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, If[LessEqual[x$46$im, -2.75e-133], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[x$46$im, 1.6e-246], N[(t$95$2 * N[Power[N[(t$95$1 * t$95$1), $MachinePrecision], N[(0.25 * N[(0.5 * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
t_1 := t\_0 \cdot t\_0\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_3 := \sin t\_2\\
\mathbf{if}\;x.im \leq -2.75 \cdot 10^{-133}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_3\\
\mathbf{elif}\;x.im \leq 1.6 \cdot 10^{-246}:\\
\;\;\;\;t\_2 \cdot {\left(t\_1 \cdot t\_1\right)}^{\left(0.25 \cdot \left(0.5 \cdot y.re\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)}\right)}^{y.re} \cdot t\_3\\
\end{array}
\end{array}
if x.im < -2.74999999999999988e-133Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.2
Applied rewrites49.2%
Taylor expanded in x.im around -inf
Applied rewrites53.1%
if -2.74999999999999988e-133 < x.im < 1.6e-246Initial program 45.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.5
Applied rewrites48.5%
Taylor expanded in y.re around 0
Applied rewrites54.0%
Applied rewrites57.3%
if 1.6e-246 < x.im Initial program 41.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.9
Applied rewrites50.9%
Final simplification53.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.im -8.5e-141)
(* (pow (- x.im) y.re) (sin t_0))
(* t_0 (pow (fma x.im x.im (* x.re x.re)) (* 0.5 y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_im <= -8.5e-141) {
tmp = pow(-x_46_im, y_46_re) * sin(t_0);
} else {
tmp = t_0 * pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), (0.5 * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_im <= -8.5e-141) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * sin(t_0)); else tmp = Float64(t_0 * (fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ Float64(0.5 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$im, -8.5e-141], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.im \leq -8.5 \cdot 10^{-141}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
\end{array}
\end{array}
if x.im < -8.50000000000000021e-141Initial program 36.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.8
Applied rewrites48.8%
Taylor expanded in x.im around -inf
Applied rewrites52.6%
if -8.50000000000000021e-141 < x.im Initial program 42.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites49.2%
Applied rewrites49.2%
Final simplification50.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma x.im x.im (* x.re x.re)))
(t_1 (* t_0 t_0))
(t_2 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -9e-5)
(* t_2 (pow (* t_1 t_1) (* 0.25 (* 0.5 y.re))))
(* t_2 (pow t_0 (* 0.5 y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double t_1 = t_0 * t_0;
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= -9e-5) {
tmp = t_2 * pow((t_1 * t_1), (0.25 * (0.5 * y_46_re)));
} else {
tmp = t_2 * pow(t_0, (0.5 * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) t_1 = Float64(t_0 * t_0) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= -9e-5) tmp = Float64(t_2 * (Float64(t_1 * t_1) ^ Float64(0.25 * Float64(0.5 * y_46_re)))); else tmp = Float64(t_2 * (t_0 ^ Float64(0.5 * 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[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -9e-5], N[(t$95$2 * N[Power[N[(t$95$1 * t$95$1), $MachinePrecision], N[(0.25 * N[(0.5 * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Power[t$95$0, N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
t_1 := t\_0 \cdot t\_0\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{-5}:\\
\;\;\;\;t\_2 \cdot {\left(t\_1 \cdot t\_1\right)}^{\left(0.25 \cdot \left(0.5 \cdot y.re\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot {t\_0}^{\left(0.5 \cdot y.re\right)}\\
\end{array}
\end{array}
if y.im < -9.00000000000000057e-5Initial program 35.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.8
Applied rewrites49.8%
Taylor expanded in y.re around 0
Applied rewrites46.7%
Applied rewrites55.2%
if -9.00000000000000057e-5 < y.im Initial program 42.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.8
Applied rewrites49.8%
Taylor expanded in y.re around 0
Applied rewrites48.2%
Applied rewrites48.2%
Final simplification50.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.im -5.5e-133)
(* t_0 (pow (- x.im) y.re))
(* t_0 (pow (fma x.im x.im (* x.re x.re)) (* 0.5 y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_im <= -5.5e-133) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else {
tmp = t_0 * pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), (0.5 * y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_im <= -5.5e-133) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); else tmp = Float64(t_0 * (fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ Float64(0.5 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$im, -5.5e-133], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], N[(0.5 * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.im \leq -5.5 \cdot 10^{-133}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{\left(0.5 \cdot y.re\right)}\\
\end{array}
\end{array}
if x.im < -5.49999999999999977e-133Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.2
Applied rewrites49.2%
Taylor expanded in y.re around 0
Applied rewrites46.0%
Taylor expanded in x.im around -inf
Applied rewrites51.0%
if -5.49999999999999977e-133 < x.im Initial program 42.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.1
Applied rewrites50.1%
Taylor expanded in y.re around 0
Applied rewrites48.9%
Applied rewrites48.9%
Final simplification49.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (* (pow x.re y.re) t_0)))
(if (<= y.re -44.0)
t_1
(if (<= y.re 240000000000.0)
(* 1.0 (sin t_0))
(if (<= y.re 2e+138) t_1 (* (pow x.im y.re) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -44.0) {
tmp = t_1;
} else if (y_46_re <= 240000000000.0) {
tmp = 1.0 * sin(t_0);
} else if (y_46_re <= 2e+138) {
tmp = t_1;
} else {
tmp = pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46re
t_1 = (x_46re ** y_46re) * t_0
if (y_46re <= (-44.0d0)) then
tmp = t_1
else if (y_46re <= 240000000000.0d0) then
tmp = 1.0d0 * sin(t_0)
else if (y_46re <= 2d+138) then
tmp = t_1
else
tmp = (x_46im ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.pow(x_46_re, y_46_re) * t_0;
double tmp;
if (y_46_re <= -44.0) {
tmp = t_1;
} else if (y_46_re <= 240000000000.0) {
tmp = 1.0 * Math.sin(t_0);
} else if (y_46_re <= 2e+138) {
tmp = t_1;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.pow(x_46_re, y_46_re) * t_0 tmp = 0 if y_46_re <= -44.0: tmp = t_1 elif y_46_re <= 240000000000.0: tmp = 1.0 * math.sin(t_0) elif y_46_re <= 2e+138: tmp = t_1 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((x_46_re ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -44.0) tmp = t_1; elseif (y_46_re <= 240000000000.0) tmp = Float64(1.0 * sin(t_0)); elseif (y_46_re <= 2e+138) tmp = t_1; else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = (x_46_re ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -44.0) tmp = t_1; elseif (y_46_re <= 240000000000.0) tmp = 1.0 * sin(t_0); elseif (y_46_re <= 2e+138) tmp = t_1; else tmp = (x_46_im ^ y_46_re) * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -44.0], t$95$1, If[LessEqual[y$46$re, 240000000000.0], N[(1.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+138], t$95$1, N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {x.re}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -44:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 240000000000:\\
\;\;\;\;1 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -44 or 2.4e11 < y.re < 2.0000000000000001e138Initial program 34.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6471.4
Applied rewrites71.4%
Taylor expanded in y.re around 0
Applied rewrites69.2%
Taylor expanded in x.im around 0
Applied rewrites56.7%
if -44 < y.re < 2.4e11Initial program 48.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6428.8
Applied rewrites28.8%
Taylor expanded in y.re around 0
Applied rewrites28.5%
if 2.0000000000000001e138 < y.re Initial program 30.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.2
Applied rewrites64.2%
Taylor expanded in y.re around 0
Applied rewrites59.1%
Taylor expanded in x.re around 0
Applied rewrites56.7%
Final simplification43.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.im -8.5e-141)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im 1.7e-13)
(* (pow (- x.re) y.re) t_0)
(* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_im <= -8.5e-141) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.7e-13) {
tmp = pow(-x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46re
if (x_46im <= (-8.5d-141)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= 1.7d-13) then
tmp = (-x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_im <= -8.5e-141) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.7e-13) {
tmp = Math.pow(-x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if x_46_im <= -8.5e-141: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 1.7e-13: tmp = math.pow(-x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_im <= -8.5e-141) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 1.7e-13) tmp = Float64((Float64(-x_46_re) ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (x_46_im <= -8.5e-141) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 1.7e-13) tmp = (-x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$im, -8.5e-141], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.7e-13], N[(N[Power[(-x$46$re), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.im \leq -8.5 \cdot 10^{-141}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -8.50000000000000021e-141Initial program 36.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6448.8
Applied rewrites48.8%
Taylor expanded in y.re around 0
Applied rewrites45.5%
Taylor expanded in x.im around -inf
Applied rewrites50.4%
if -8.50000000000000021e-141 < x.im < 1.70000000000000008e-13Initial program 48.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites50.4%
Taylor expanded in x.re around -inf
Applied rewrites45.6%
if 1.70000000000000008e-13 < x.im Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites47.2%
Taylor expanded in x.re around 0
Applied rewrites45.0%
Final simplification47.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (<= x.im -1.4e-134)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im 1.5e-13) (* (pow x.re y.re) t_0) (* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_im <= -1.4e-134) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.5e-13) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46re
if (x_46im <= (-1.4d-134)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= 1.5d-13) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_46re) * t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (x_46_im <= -1.4e-134) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 1.5e-13) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re tmp = 0 if x_46_im <= -1.4e-134: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 1.5e-13: tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (x_46_im <= -1.4e-134) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 1.5e-13) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; tmp = 0.0; if (x_46_im <= -1.4e-134) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 1.5e-13) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[x$46$im, -1.4e-134], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.5e-13], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;x.im \leq -1.4 \cdot 10^{-134}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 1.5 \cdot 10^{-13}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -1.3999999999999999e-134Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.2
Applied rewrites49.2%
Taylor expanded in y.re around 0
Applied rewrites46.0%
Taylor expanded in x.im around -inf
Applied rewrites51.0%
if -1.3999999999999999e-134 < x.im < 1.49999999999999992e-13Initial program 48.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.9
Applied rewrites49.9%
Taylor expanded in y.re around 0
Applied rewrites49.9%
Taylor expanded in x.im around 0
Applied rewrites41.6%
if 1.49999999999999992e-13 < x.im Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites47.2%
Taylor expanded in x.re around 0
Applied rewrites45.0%
Final simplification45.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (atan2 x.im x.re) y.re)) (t_1 (* (pow x.im y.re) t_0))) (if (<= y.re -2.25e+29) t_1 (if (<= y.re 240000000000.0) t_0 t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -2.25e+29) {
tmp = t_1;
} else if (y_46_re <= 240000000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46re
t_1 = (x_46im ** y_46re) * t_0
if (y_46re <= (-2.25d+29)) then
tmp = t_1
else if (y_46re <= 240000000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = Math.pow(x_46_im, y_46_re) * t_0;
double tmp;
if (y_46_re <= -2.25e+29) {
tmp = t_1;
} else if (y_46_re <= 240000000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_re t_1 = math.pow(x_46_im, y_46_re) * t_0 tmp = 0 if y_46_re <= -2.25e+29: tmp = t_1 elif y_46_re <= 240000000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64((x_46_im ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -2.25e+29) tmp = t_1; elseif (y_46_re <= 240000000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_re; t_1 = (x_46_im ^ y_46_re) * t_0; tmp = 0.0; if (y_46_re <= -2.25e+29) tmp = t_1; elseif (y_46_re <= 240000000000.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -2.25e+29], t$95$1, If[LessEqual[y$46$re, 240000000000.0], t$95$0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := {x.im}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -2.25 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 240000000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.2500000000000001e29 or 2.4e11 < y.re Initial program 33.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.9
Applied rewrites69.9%
Taylor expanded in y.re around 0
Applied rewrites67.5%
Taylor expanded in x.re around 0
Applied rewrites49.7%
if -2.2500000000000001e29 < y.re < 2.4e11Initial program 47.1%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6430.3
Applied rewrites30.3%
Taylor expanded in y.re around 0
Applied rewrites27.9%
Final simplification38.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (sin (* (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) {
return 1.0 * sin((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
code = 1.0d0 * sin((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) {
return 1.0 * Math.sin((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): return 1.0 * math.sin((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) return Float64(1.0 * sin(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) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 40.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.8
Applied rewrites49.8%
Taylor expanded in y.re around 0
Applied rewrites16.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (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) {
return 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
code = 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) {
return 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): return 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) return 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) tmp = atan2(x_46_im, x_46_re) * y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re
\end{array}
Initial program 40.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6449.8
Applied rewrites49.8%
Taylor expanded in y.re around 0
Applied rewrites16.5%
Final simplification16.5%
herbie shell --seed 2024235
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))