
(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 14 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 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.re))))
(if (<= x.re -2.8e-216)
(*
(exp (- (fma y.re t_2 t_0)))
(sin (fma y.re (atan2 x.im x.re) (* t_2 (- y.im)))))
(if (<= x.re 1e-308)
(* (exp (- (* y.re (log x.im)) t_0)) (sin (fma y.im (log x.im) t_1)))
(*
(exp (- (* y.re (log x.re)) t_0))
(sin (fma y.im (log x.re) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -2.8e-216) {
tmp = exp(-fma(y_46_re, t_2, t_0)) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (t_2 * -y_46_im)));
} else if (x_46_re <= 1e-308) {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -2.8e-216) tmp = Float64(exp(Float64(-fma(y_46_re, t_2, t_0))) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_2 * Float64(-y_46_im))))); elseif (x_46_re <= 1e-308) tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)) * sin(fma(y_46_im, log(x_46_re), t_1))); 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[ArcTan[x$46$im / x$46$re], $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[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2.8e-216], N[(N[Exp[(-N[(y$46$re * t$95$2 + t$95$0), $MachinePrecision])], $MachinePrecision] * 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]), $MachinePrecision], If[LessEqual[x$46$re, 1e-308], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -2.8 \cdot 10^{-216}:\\
\;\;\;\;e^{-\mathsf{fma}\left(y.re, t\_2, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_2 \cdot \left(-y.im\right)\right)\right)\\
\mathbf{elif}\;x.re \leq 10^{-308}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_1\right)\right)\\
\end{array}
\end{array}
if x.re < -2.8e-216Initial program 41.1%
Taylor expanded in x.re around -inf
lower-*.f64N/A
lower-exp.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
lower-neg.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites72.0%
if -2.8e-216 < x.re < 9.9999999999999991e-309Initial program 39.8%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6470.9
Applied rewrites70.9%
if 9.9999999999999991e-309 < x.re Initial program 42.7%
Taylor expanded in x.im around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6470.0
Applied rewrites70.0%
Final simplification71.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (/ -1.0 x.im))))
(if (<= x.im -1.05e-5)
(* (exp (- (fma y.re t_2 t_0))) (sin (fma t_2 (- y.im) t_1)))
(if (<= x.im 3e-114)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin t_1))
(*
(exp (- (* y.re (log x.im)) t_0))
(sin (fma y.im (log x.im) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -1.05e-5) {
tmp = exp(-fma(y_46_re, t_2, t_0)) * sin(fma(t_2, -y_46_im, t_1));
} else if (x_46_im <= 3e-114) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_46_im), t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -1.05e-5) tmp = Float64(exp(Float64(-fma(y_46_re, t_2, t_0))) * sin(fma(t_2, Float64(-y_46_im), t_1))); elseif (x_46_im <= 3e-114) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * sin(fma(y_46_im, log(x_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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $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[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.05e-5], N[(N[Exp[(-N[(y$46$re * t$95$2 + t$95$0), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(t$95$2 * (-y$46$im) + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3e-114], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -1.05 \cdot 10^{-5}:\\
\;\;\;\;e^{-\mathsf{fma}\left(y.re, t\_2, t\_0\right)} \cdot \sin \left(\mathsf{fma}\left(t\_2, -y.im, t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 3 \cdot 10^{-114}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \sin t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -1.04999999999999994e-5Initial program 30.1%
Taylor expanded in x.im around -inf
lower-*.f64N/A
lower-exp.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
lower-neg.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
Applied rewrites81.1%
if -1.04999999999999994e-5 < x.im < 3.00000000000000015e-114Initial program 49.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6459.0
Applied rewrites59.0%
if 3.00000000000000015e-114 < x.im Initial program 39.5%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6473.9
Applied rewrites73.9%
Final simplification69.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* y.im (atan2 x.im x.re))))
(if (<= x.im -1.85e+140)
(* (exp (- t_1)) (sin (+ t_0 (* y.im (log (- x.im))))))
(if (<= x.im 3e-114)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(sin t_0))
(*
(exp (- (* y.re (log x.im)) t_1))
(sin (fma y.im (log x.im) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -1.85e+140) {
tmp = exp(-t_1) * sin((t_0 + (y_46_im * log(-x_46_im))));
} else if (x_46_im <= 3e-114) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * sin(t_0);
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_1)) * sin(fma(y_46_im, log(x_46_im), t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -1.85e+140) tmp = Float64(exp(Float64(-t_1)) * sin(Float64(t_0 + Float64(y_46_im * log(Float64(-x_46_im)))))); elseif (x_46_im <= 3e-114) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * sin(t_0)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_1)) * sin(fma(y_46_im, log(x_46_im), t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.85e+140], N[(N[Exp[(-t$95$1)], $MachinePrecision] * N[Sin[N[(t$95$0 + N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 3e-114], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -1.85 \cdot 10^{+140}:\\
\;\;\;\;e^{-t\_1} \cdot \sin \left(t\_0 + y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{elif}\;x.im \leq 3 \cdot 10^{-114}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_1} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_0\right)\right)\\
\end{array}
\end{array}
if x.im < -1.85000000000000001e140Initial program 3.2%
Taylor expanded in x.im around -inf
mul-1-negN/A
lower-neg.f6439.9
Applied rewrites39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6465.9
Applied rewrites65.9%
if -1.85000000000000001e140 < x.im < 3.00000000000000015e-114Initial program 52.8%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6459.6
Applied rewrites59.6%
if 3.00000000000000015e-114 < x.im Initial program 39.5%
Taylor expanded in x.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-atan2.f6473.9
Applied rewrites73.9%
Final simplification65.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.re (atan2 x.im x.re))))
(t_2
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_1))
(t_3 (exp (- t_0)))
(t_4 (* t_1 t_3)))
(if (<= y.re -1.1)
t_2
(if (<= y.re -1.5e-280)
t_4
(if (<= y.re 6.5e-185)
(* t_3 (sin (* y.im (log (sqrt (fma x.im x.im (* x.re x.re)))))))
(if (<= y.re 0.96) t_4 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_1;
double t_3 = exp(-t_0);
double t_4 = t_1 * t_3;
double tmp;
if (y_46_re <= -1.1) {
tmp = t_2;
} else if (y_46_re <= -1.5e-280) {
tmp = t_4;
} else if (y_46_re <= 6.5e-185) {
tmp = t_3 * sin((y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))));
} else if (y_46_re <= 0.96) {
tmp = t_4;
} else {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_1) t_3 = exp(Float64(-t_0)) t_4 = Float64(t_1 * t_3) tmp = 0.0 if (y_46_re <= -1.1) tmp = t_2; elseif (y_46_re <= -1.5e-280) tmp = t_4; elseif (y_46_re <= 6.5e-185) tmp = Float64(t_3 * sin(Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))))); elseif (y_46_re <= 0.96) tmp = t_4; else tmp = t_2; 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[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Exp[(-t$95$0)], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$3), $MachinePrecision]}, If[LessEqual[y$46$re, -1.1], t$95$2, If[LessEqual[y$46$re, -1.5e-280], t$95$4, If[LessEqual[y$46$re, 6.5e-185], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.96], t$95$4, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_1\\
t_3 := e^{-t\_0}\\
t_4 := t\_1 \cdot t\_3\\
\mathbf{if}\;y.re \leq -1.1:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -1.5 \cdot 10^{-280}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-185}:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\\
\mathbf{elif}\;y.re \leq 0.96:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.1000000000000001 or 0.95999999999999996 < y.re Initial program 42.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6476.5
Applied rewrites76.5%
if -1.1000000000000001 < y.re < -1.49999999999999994e-280 or 6.49999999999999946e-185 < y.re < 0.95999999999999996Initial program 34.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6434.8
Applied rewrites34.8%
Taylor expanded in y.re around 0
neg-mul-1N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6455.9
Applied rewrites55.9%
if -1.49999999999999994e-280 < y.re < 6.49999999999999946e-185Initial program 60.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6460.4
Applied rewrites60.4%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (- (* y.im (atan2 x.im x.re)))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (* t_2 t_0))
(t_4 (sqrt (fma x.im x.im (* x.re x.re)))))
(if (<= y.re -1.1)
(* t_2 (pow t_4 y.re))
(if (<= y.re -1.5e-280)
t_3
(if (<= y.re 6.5e-185)
(* t_0 (sin (* y.im (log t_4))))
(if (<= y.re 2.35)
t_3
(* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(-(y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = t_2 * t_0;
double t_4 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double tmp;
if (y_46_re <= -1.1) {
tmp = t_2 * pow(t_4, y_46_re);
} else if (y_46_re <= -1.5e-280) {
tmp = t_3;
} else if (y_46_re <= 6.5e-185) {
tmp = t_0 * sin((y_46_im * log(t_4)));
} else if (y_46_re <= 2.35) {
tmp = t_3;
} else {
tmp = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(t_2 * t_0) t_4 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) tmp = 0.0 if (y_46_re <= -1.1) tmp = Float64(t_2 * (t_4 ^ y_46_re)); elseif (y_46_re <= -1.5e-280) tmp = t_3; elseif (y_46_re <= 6.5e-185) tmp = Float64(t_0 * sin(Float64(y_46_im * log(t_4)))); elseif (y_46_re <= 2.35) tmp = t_3; else tmp = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1], N[(t$95$2 * N[Power[t$95$4, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.5e-280], t$95$3, If[LessEqual[y$46$re, 6.5e-185], N[(t$95$0 * N[Sin[N[(y$46$im * N[Log[t$95$4], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.35], t$95$3, N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := t\_2 \cdot t\_0\\
t_4 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
\mathbf{if}\;y.re \leq -1.1:\\
\;\;\;\;t\_2 \cdot {t\_4}^{y.re}\\
\mathbf{elif}\;y.re \leq -1.5 \cdot 10^{-280}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-185}:\\
\;\;\;\;t\_0 \cdot \sin \left(y.im \cdot \log t\_4\right)\\
\mathbf{elif}\;y.re \leq 2.35:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.1000000000000001Initial program 44.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.7
Applied rewrites84.7%
if -1.1000000000000001 < y.re < -1.49999999999999994e-280 or 6.49999999999999946e-185 < y.re < 2.35000000000000009Initial program 34.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6434.8
Applied rewrites34.8%
Taylor expanded in y.re around 0
neg-mul-1N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6455.9
Applied rewrites55.9%
if -1.49999999999999994e-280 < y.re < 6.49999999999999946e-185Initial program 60.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6460.4
Applied rewrites60.4%
if 2.35000000000000009 < y.re Initial program 40.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around 0
Applied rewrites63.1%
Applied rewrites63.1%
Final simplification65.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (* t_1 (exp (- (* y.im (atan2 x.im x.re))))))
(t_3 (sqrt (fma x.im x.im (* x.re x.re))))
(t_4 (pow t_3 y.re)))
(if (<= y.re -1.1)
(* t_1 t_4)
(if (<= y.re -5.8e-297)
t_2
(if (<= y.re 5e-222)
(* t_4 (sin (* y.im (log t_3))))
(if (<= y.re 2.35)
t_2
(* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = t_1 * exp(-(y_46_im * atan2(x_46_im, x_46_re)));
double t_3 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_4 = pow(t_3, y_46_re);
double tmp;
if (y_46_re <= -1.1) {
tmp = t_1 * t_4;
} else if (y_46_re <= -5.8e-297) {
tmp = t_2;
} else if (y_46_re <= 5e-222) {
tmp = t_4 * sin((y_46_im * log(t_3)));
} else if (y_46_re <= 2.35) {
tmp = t_2;
} else {
tmp = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = Float64(t_1 * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))) t_3 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_4 = t_3 ^ y_46_re tmp = 0.0 if (y_46_re <= -1.1) tmp = Float64(t_1 * t_4); elseif (y_46_re <= -5.8e-297) tmp = t_2; elseif (y_46_re <= 5e-222) tmp = Float64(t_4 * sin(Float64(y_46_im * log(t_3)))); elseif (y_46_re <= 2.35) tmp = t_2; else tmp = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[t$95$3, y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1], N[(t$95$1 * t$95$4), $MachinePrecision], If[LessEqual[y$46$re, -5.8e-297], t$95$2, If[LessEqual[y$46$re, 5e-222], N[(t$95$4 * N[Sin[N[(y$46$im * N[Log[t$95$3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.35], t$95$2, N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
t_2 := t\_1 \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_3 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_4 := {t\_3}^{y.re}\\
\mathbf{if}\;y.re \leq -1.1:\\
\;\;\;\;t\_1 \cdot t\_4\\
\mathbf{elif}\;y.re \leq -5.8 \cdot 10^{-297}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-222}:\\
\;\;\;\;t\_4 \cdot \sin \left(y.im \cdot \log t\_3\right)\\
\mathbf{elif}\;y.re \leq 2.35:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.1000000000000001Initial program 44.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.7
Applied rewrites84.7%
if -1.1000000000000001 < y.re < -5.79999999999999979e-297 or 5.00000000000000008e-222 < y.re < 2.35000000000000009Initial program 36.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6433.9
Applied rewrites33.9%
Taylor expanded in y.re around 0
neg-mul-1N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
neg-mul-1N/A
lower-*.f64N/A
lower-atan2.f64N/A
neg-mul-1N/A
lower-neg.f6454.4
Applied rewrites54.4%
if -5.79999999999999979e-297 < y.re < 5.00000000000000008e-222Initial program 62.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.2
Applied rewrites53.2%
Taylor expanded in y.im around inf
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.2
Applied rewrites53.2%
if 2.35000000000000009 < y.re Initial program 40.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6458.3
Applied rewrites58.3%
Taylor expanded in y.re around 0
Applied rewrites63.1%
Applied rewrites63.1%
Final simplification64.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sqrt (fma x.im x.im (* x.re x.re))))
(t_2 (pow t_1 y.re)))
(if (<= y.re -1.45e-16)
(* (sin t_0) t_2)
(if (<= y.re -2.45e-250)
t_0
(if (<= y.re 7e-168)
(* t_2 (sin (* y.im (log t_1))))
(* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_2 = pow(t_1, y_46_re);
double tmp;
if (y_46_re <= -1.45e-16) {
tmp = sin(t_0) * t_2;
} else if (y_46_re <= -2.45e-250) {
tmp = t_0;
} else if (y_46_re <= 7e-168) {
tmp = t_2 * sin((y_46_im * log(t_1)));
} else {
tmp = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) t_2 = t_1 ^ y_46_re tmp = 0.0 if (y_46_re <= -1.45e-16) tmp = Float64(sin(t_0) * t_2); elseif (y_46_re <= -2.45e-250) tmp = t_0; elseif (y_46_re <= 7e-168) tmp = Float64(t_2 * sin(Float64(y_46_im * log(t_1)))); else tmp = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$1, y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.45e-16], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, -2.45e-250], t$95$0, If[LessEqual[y$46$re, 7e-168], N[(t$95$2 * N[Sin[N[(y$46$im * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_2 := {t\_1}^{y.re}\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-16}:\\
\;\;\;\;\sin t\_0 \cdot t\_2\\
\mathbf{elif}\;y.re \leq -2.45 \cdot 10^{-250}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{-168}:\\
\;\;\;\;t\_2 \cdot \sin \left(y.im \cdot \log t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.4499999999999999e-16Initial program 44.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6482.5
Applied rewrites82.5%
if -1.4499999999999999e-16 < y.re < -2.44999999999999985e-250Initial program 33.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6417.0
Applied rewrites17.0%
Taylor expanded in y.re around 0
Applied rewrites33.2%
if -2.44999999999999985e-250 < y.re < 6.99999999999999964e-168Initial program 52.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.4
Applied rewrites42.4%
Taylor expanded in y.im around inf
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.4
Applied rewrites42.4%
if 6.99999999999999964e-168 < y.re Initial program 40.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6450.5
Applied rewrites50.5%
Taylor expanded in y.re around 0
Applied rewrites53.8%
Applied rewrites53.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= x.im 1.35)
(* t_1 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(if (<= x.im 7e+181)
(*
t_0
(pow
(fma
(* x.im x.im)
(fma -0.125 (/ (* x.im x.im) (* x.re (* x.re x.re))) (/ 0.5 x.re))
x.re)
y.re))
(* t_1 (pow x.im 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_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (x_46_im <= 1.35) {
tmp = t_1 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
} else if (x_46_im <= 7e+181) {
tmp = t_0 * pow(fma((x_46_im * x_46_im), fma(-0.125, ((x_46_im * x_46_im) / (x_46_re * (x_46_re * x_46_re))), (0.5 / x_46_re)), x_46_re), y_46_re);
} else {
tmp = t_1 * pow(x_46_im, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) tmp = 0.0 if (x_46_im <= 1.35) tmp = Float64(t_1 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); elseif (x_46_im <= 7e+181) tmp = Float64(t_0 * (fma(Float64(x_46_im * x_46_im), fma(-0.125, Float64(Float64(x_46_im * x_46_im) / Float64(x_46_re * Float64(x_46_re * x_46_re))), Float64(0.5 / x_46_re)), x_46_re) ^ y_46_re)); else tmp = Float64(t_1 * (x_46_im ^ 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[x$46$im, 1.35], N[(t$95$1 * N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7e+181], N[(t$95$0 * N[Power[N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[(-0.125 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / N[(x$46$re * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
\mathbf{if}\;x.im \leq 1.35:\\
\;\;\;\;t\_1 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 7 \cdot 10^{+181}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(x.im \cdot x.im, \mathsf{fma}\left(-0.125, \frac{x.im \cdot x.im}{x.re \cdot \left(x.re \cdot x.re\right)}, \frac{0.5}{x.re}\right), x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < 1.3500000000000001Initial program 45.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6446.2
Applied rewrites46.2%
if 1.3500000000000001 < x.im < 7.00000000000000016e181Initial program 55.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6439.6
Applied rewrites39.6%
Taylor expanded in y.re around 0
Applied rewrites52.9%
Taylor expanded in x.im around 0
Applied rewrites60.7%
if 7.00000000000000016e181 < x.im Initial program 0.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6440.5
Applied rewrites40.5%
Taylor expanded in x.im around inf
Applied rewrites62.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (pow (fma x.re x.re (* x.im x.im)) (* y.re 0.5)) t_0)))
(if (<= y.re -1.45e-16) t_1 (if (<= y.re 8.2e-122) 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(fma(x_46_re, x_46_re, (x_46_im * x_46_im)), (y_46_re * 0.5)) * t_0;
double tmp;
if (y_46_re <= -1.45e-16) {
tmp = t_1;
} else if (y_46_re <= 8.2e-122) {
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(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64((fma(x_46_re, x_46_re, Float64(x_46_im * x_46_im)) ^ Float64(y_46_re * 0.5)) * t_0) tmp = 0.0 if (y_46_re <= -1.45e-16) tmp = t_1; elseif (y_46_re <= 8.2e-122) tmp = t_0; 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x$46$re * x$46$re + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -1.45e-16], t$95$1, If[LessEqual[y$46$re, 8.2e-122], t$95$0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{fma}\left(x.re, x.re, x.im \cdot x.im\right)\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{-122}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.4499999999999999e-16 or 8.2000000000000001e-122 < y.re Initial program 42.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6467.4
Applied rewrites67.4%
Taylor expanded in y.re around 0
Applied rewrites68.8%
Applied rewrites68.8%
if -1.4499999999999999e-16 < y.re < 8.2000000000000001e-122Initial program 41.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6412.2
Applied rewrites12.2%
Taylor expanded in y.re around 0
Applied rewrites24.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.re -1.55e+124)
(* t_0 (pow (- x.re) y.re))
(if (<= x.re 1.1e-38)
(* t_0 (pow (* x.im x.im) (* y.re 0.5)))
(* t_0 (pow (* x.re x.re) (* y.re 0.5)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1.55e+124) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else if (x_46_re <= 1.1e-38) {
tmp = t_0 * pow((x_46_im * x_46_im), (y_46_re * 0.5));
} else {
tmp = t_0 * pow((x_46_re * x_46_re), (y_46_re * 0.5));
}
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 = y_46re * atan2(x_46im, x_46re)
if (x_46re <= (-1.55d+124)) then
tmp = t_0 * (-x_46re ** y_46re)
else if (x_46re <= 1.1d-38) then
tmp = t_0 * ((x_46im * x_46im) ** (y_46re * 0.5d0))
else
tmp = t_0 * ((x_46re * x_46re) ** (y_46re * 0.5d0))
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -1.55e+124) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 1.1e-38) {
tmp = t_0 * Math.pow((x_46_im * x_46_im), (y_46_re * 0.5));
} else {
tmp = t_0 * Math.pow((x_46_re * x_46_re), (y_46_re * 0.5));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -1.55e+124: tmp = t_0 * math.pow(-x_46_re, y_46_re) elif x_46_re <= 1.1e-38: tmp = t_0 * math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) else: tmp = t_0 * math.pow((x_46_re * x_46_re), (y_46_re * 0.5)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -1.55e+124) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); elseif (x_46_re <= 1.1e-38) tmp = Float64(t_0 * (Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5))); else tmp = Float64(t_0 * (Float64(x_46_re * x_46_re) ^ Float64(y_46_re * 0.5))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -1.55e+124) tmp = t_0 * (-x_46_re ^ y_46_re); elseif (x_46_re <= 1.1e-38) tmp = t_0 * ((x_46_im * x_46_im) ^ (y_46_re * 0.5)); else tmp = t_0 * ((x_46_re * x_46_re) ^ (y_46_re * 0.5)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -1.55e+124], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.1e-38], N[(t$95$0 * N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -1.55 \cdot 10^{+124}:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.1 \cdot 10^{-38}:\\
\;\;\;\;t\_0 \cdot {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(x.re \cdot x.re\right)}^{\left(y.re \cdot 0.5\right)}\\
\end{array}
\end{array}
if x.re < -1.5500000000000001e124Initial program 10.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in y.re around 0
Applied rewrites34.0%
Taylor expanded in x.re around -inf
Applied rewrites41.9%
if -1.5500000000000001e124 < x.re < 1.10000000000000004e-38Initial program 52.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.2
Applied rewrites42.2%
Taylor expanded in y.re around 0
Applied rewrites42.9%
Applied rewrites42.9%
Taylor expanded in x.re around 0
Applied rewrites44.1%
if 1.10000000000000004e-38 < x.re Initial program 35.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6453.0
Applied rewrites53.0%
Taylor expanded in y.re around 0
Applied rewrites57.8%
Applied rewrites57.8%
Taylor expanded in x.re around inf
Applied rewrites56.3%
Final simplification46.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im -8e-66)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im 0.00062)
(* t_0 (pow (- x.re) y.re))
(* t_0 (pow (* x.im x.im) (* y.re 0.5)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -8e-66) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.00062) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * pow((x_46_im * x_46_im), (y_46_re * 0.5));
}
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 = y_46re * atan2(x_46im, x_46re)
if (x_46im <= (-8d-66)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= 0.00062d0) then
tmp = t_0 * (-x_46re ** y_46re)
else
tmp = t_0 * ((x_46im * x_46im) ** (y_46re * 0.5d0))
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -8e-66) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 0.00062) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow((x_46_im * x_46_im), (y_46_re * 0.5));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -8e-66: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 0.00062: tmp = t_0 * math.pow(-x_46_re, y_46_re) else: tmp = t_0 * math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -8e-66) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 0.00062) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -8e-66) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 0.00062) tmp = t_0 * (-x_46_re ^ y_46_re); else tmp = t_0 * ((x_46_im * x_46_im) ^ (y_46_re * 0.5)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -8e-66], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 0.00062], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -8 \cdot 10^{-66}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 0.00062:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)}\\
\end{array}
\end{array}
if x.im < -7.9999999999999998e-66Initial program 37.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6444.5
Applied rewrites44.5%
Taylor expanded in y.re around 0
Applied rewrites44.5%
Taylor expanded in x.im around -inf
Applied rewrites44.9%
if -7.9999999999999998e-66 < x.im < 6.2e-4Initial program 49.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6446.6
Applied rewrites46.6%
Taylor expanded in y.re around 0
Applied rewrites44.9%
Taylor expanded in x.re around -inf
Applied rewrites45.1%
if 6.2e-4 < x.im Initial program 33.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6440.7
Applied rewrites40.7%
Taylor expanded in y.re around 0
Applied rewrites45.9%
Applied rewrites45.9%
Taylor expanded in x.re around 0
Applied rewrites47.3%
Final simplification45.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* t_0 (pow (- x.re) y.re))))
(if (<= x.re -2.8e-71)
t_1
(if (<= x.re 6.1e+19) (* t_0 (pow (- 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = t_0 * pow(-x_46_re, y_46_re);
double tmp;
if (x_46_re <= -2.8e-71) {
tmp = t_1;
} else if (x_46_re <= 6.1e+19) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} 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 = y_46re * atan2(x_46im, x_46re)
t_1 = t_0 * (-x_46re ** y_46re)
if (x_46re <= (-2.8d-71)) then
tmp = t_1
else if (x_46re <= 6.1d+19) then
tmp = t_0 * (-x_46im ** y_46re)
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = t_0 * Math.pow(-x_46_re, y_46_re);
double tmp;
if (x_46_re <= -2.8e-71) {
tmp = t_1;
} else if (x_46_re <= 6.1e+19) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = t_0 * math.pow(-x_46_re, y_46_re) tmp = 0 if x_46_re <= -2.8e-71: tmp = t_1 elif x_46_re <= 6.1e+19: tmp = t_0 * math.pow(-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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)) tmp = 0.0 if (x_46_re <= -2.8e-71) tmp = t_1; elseif (x_46_re <= 6.1e+19) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); 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 = y_46_re * atan2(x_46_im, x_46_re); t_1 = t_0 * (-x_46_re ^ y_46_re); tmp = 0.0; if (x_46_re <= -2.8e-71) tmp = t_1; elseif (x_46_re <= 6.1e+19) tmp = t_0 * (-x_46_im ^ y_46_re); 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2.8e-71], t$95$1, If[LessEqual[x$46$re, 6.1e+19], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{if}\;x.re \leq -2.8 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.re \leq 6.1 \cdot 10^{+19}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.re < -2.8e-71 or 6.1e19 < x.re Initial program 34.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6445.6
Applied rewrites45.6%
Taylor expanded in y.re around 0
Applied rewrites44.8%
Taylor expanded in x.re around -inf
Applied rewrites43.8%
if -2.8e-71 < x.re < 6.1e19Initial program 49.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6443.0
Applied rewrites43.0%
Taylor expanded in y.re around 0
Applied rewrites45.4%
Taylor expanded in x.im around -inf
Applied rewrites44.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (* t_0 (pow (- x.im) y.re)))) (if (<= y.re -1.36e-15) t_1 (if (<= y.re 0.95) 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = t_0 * pow(-x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.36e-15) {
tmp = t_1;
} else if (y_46_re <= 0.95) {
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 = y_46re * atan2(x_46im, x_46re)
t_1 = t_0 * (-x_46im ** y_46re)
if (y_46re <= (-1.36d-15)) then
tmp = t_1
else if (y_46re <= 0.95d0) 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = t_0 * Math.pow(-x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.36e-15) {
tmp = t_1;
} else if (y_46_re <= 0.95) {
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 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = t_0 * math.pow(-x_46_im, y_46_re) tmp = 0 if y_46_re <= -1.36e-15: tmp = t_1 elif y_46_re <= 0.95: 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(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.36e-15) tmp = t_1; elseif (y_46_re <= 0.95) 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 = y_46_re * atan2(x_46_im, x_46_re); t_1 = t_0 * (-x_46_im ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.36e-15) tmp = t_1; elseif (y_46_re <= 0.95) 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.36e-15], t$95$1, If[LessEqual[y$46$re, 0.95], t$95$0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.36 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 0.95:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.36e-15 or 0.94999999999999996 < y.re Initial program 42.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.0
Applied rewrites71.0%
Taylor expanded in y.re around 0
Applied rewrites72.5%
Taylor expanded in x.im around -inf
Applied rewrites52.8%
if -1.36e-15 < y.re < 0.94999999999999996Initial program 41.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6416.8
Applied rewrites16.8%
Taylor expanded in y.re around 0
Applied rewrites25.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (atan2 x.im x.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * atan2(x_46_im, x_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 41.8%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6444.3
Applied rewrites44.3%
Taylor expanded in y.re around 0
Applied rewrites16.3%
herbie shell --seed 2024221
(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)))))