
(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 11 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 (sin t_1))
(t_3 (* y.im (cos t_1)))
(t_4 (log (/ -1.0 x.im))))
(if (<= x.im -2.2e-246)
(* (exp (- (fma y.re t_4 t_0))) (- t_2 (* t_4 t_3)))
(if (<= x.im 5e+19)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(+ t_2 (* 0.5 (* t_3 (log (fma x.im x.im (* x.re x.re)))))))
(*
(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 = sin(t_1);
double t_3 = y_46_im * cos(t_1);
double t_4 = log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -2.2e-246) {
tmp = exp(-fma(y_46_re, t_4, t_0)) * (t_2 - (t_4 * t_3));
} else if (x_46_im <= 5e+19) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * (t_2 + (0.5 * (t_3 * log(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))));
} 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 = sin(t_1) t_3 = Float64(y_46_im * cos(t_1)) t_4 = log(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -2.2e-246) tmp = Float64(exp(Float64(-fma(y_46_re, t_4, t_0))) * Float64(t_2 - Float64(t_4 * t_3))); elseif (x_46_im <= 5e+19) 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)) * Float64(t_2 + Float64(0.5 * Float64(t_3 * log(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))))); 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[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -2.2e-246], N[(N[Exp[(-N[(y$46$re * t$95$4 + t$95$0), $MachinePrecision])], $MachinePrecision] * N[(t$95$2 - N[(t$95$4 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5e+19], 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[(t$95$2 + N[(0.5 * N[(t$95$3 * N[Log[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := \sin t\_1\\
t_3 := y.im \cdot \cos t\_1\\
t_4 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{-246}:\\
\;\;\;\;e^{-\mathsf{fma}\left(y.re, t\_4, t\_0\right)} \cdot \left(t\_2 - t\_4 \cdot t\_3\right)\\
\mathbf{elif}\;x.im \leq 5 \cdot 10^{+19}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \left(t\_2 + 0.5 \cdot \left(t\_3 \cdot \log \left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)\right)\right)\\
\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 < -2.19999999999999998e-246Initial program 40.7%
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 rewrites65.6%
Taylor expanded in y.im around 0
Applied rewrites68.1%
if -2.19999999999999998e-246 < x.im < 5e19Initial program 51.7%
lift-+.f64N/A
flip-+N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites26.9%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6466.5
Applied rewrites66.5%
if 5e19 < x.im Initial program 30.1%
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.f6481.2
Applied rewrites81.2%
Final simplification70.8%
(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 -5.4e-25)
(*
(exp (- (fma y.re t_2 t_0)))
(sin (fma y.re (atan2 x.im x.re) (* t_2 (- y.im)))))
(if (<= x.re 2.9e-19)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin 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 <= -5.4e-25) {
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 <= 2.9e-19) {
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_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 <= -5.4e-25) 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 <= 2.9e-19) 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_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, -5.4e-25], 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, 2.9e-19], 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$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 -5.4 \cdot 10^{-25}:\\
\;\;\;\;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 2.9 \cdot 10^{-19}:\\
\;\;\;\;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.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 < -5.40000000000000032e-25Initial program 33.3%
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 rewrites70.7%
if -5.40000000000000032e-25 < x.re < 2.9e-19Initial program 48.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6464.5
Applied rewrites64.5%
if 2.9e-19 < x.re Initial program 35.8%
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.f6480.0
Applied rewrites80.0%
Final simplification69.8%
(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 (log t_0))
(t_2 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1.8e-15)
(/ t_2 (exp (* t_1 (* y.re -0.5))))
(if (<= y.re 0.72)
(* t_2 (exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 1.75e+213)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(* t_1 (* y.im 0.5)))
(* (sin (* (atan2 x.im x.re) (- y.re))) (pow (sqrt t_0) 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 = log(t_0);
double t_2 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.8e-15) {
tmp = t_2 / exp((t_1 * (y_46_re * -0.5)));
} else if (y_46_re <= 0.72) {
tmp = t_2 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 1.75e+213) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * (t_1 * (y_46_im * 0.5));
} else {
tmp = sin((atan2(x_46_im, x_46_re) * -y_46_re)) * pow(sqrt(t_0), 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 = log(t_0) t_2 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.8e-15) tmp = Float64(t_2 / exp(Float64(t_1 * Float64(y_46_re * -0.5)))); elseif (y_46_re <= 0.72) tmp = Float64(t_2 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 1.75e+213) 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))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * Float64(t_1 * Float64(y_46_im * 0.5))); else tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_re))) * (sqrt(t_0) ^ 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[Log[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-15], N[(t$95$2 / N[Exp[N[(t$95$1 * N[(y$46$re * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.72], N[(t$95$2 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.75e+213], 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(y$46$im * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[t$95$0], $MachinePrecision], y$46$re], $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 := \log t\_0\\
t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_2}{e^{t\_1 \cdot \left(y.re \cdot -0.5\right)}}\\
\mathbf{elif}\;y.re \leq 0.72:\\
\;\;\;\;t\_2 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+213}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(t\_1 \cdot \left(y.im \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.re\right)\right) \cdot {\left(\sqrt{t\_0}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.8000000000000001e-15Initial program 46.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6486.0
Applied rewrites86.0%
Applied rewrites86.0%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.0
Applied rewrites86.0%
if -1.8000000000000001e-15 < y.re < 0.71999999999999997Initial program 40.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6441.2
Applied rewrites41.2%
Taylor expanded in y.re around 0
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6457.7
Applied rewrites57.7%
if 0.71999999999999997 < y.re < 1.7499999999999999e213Initial program 40.4%
lift-+.f64N/A
flip-+N/A
clear-numN/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites21.2%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6467.4
Applied rewrites67.4%
Taylor expanded in y.re around 0
Applied rewrites75.1%
if 1.7499999999999999e213 < y.re Initial program 31.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-*.f6450.0
Applied rewrites50.0%
Applied rewrites0.0%
Taylor expanded in y.re around -inf
Applied rewrites77.3%
Final simplification70.0%
(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 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1.8e-15)
(/ t_1 (exp (* (log t_0) (* y.re -0.5))))
(if (<= y.re 1.9e+69)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(* (sin (* (atan2 x.im x.re) (- y.re))) (pow (sqrt t_0) 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.8e-15) {
tmp = t_1 / exp((log(t_0) * (y_46_re * -0.5)));
} else if (y_46_re <= 1.9e+69) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = sin((atan2(x_46_im, x_46_re) * -y_46_re)) * pow(sqrt(t_0), 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 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.8e-15) tmp = Float64(t_1 / exp(Float64(log(t_0) * Float64(y_46_re * -0.5)))); elseif (y_46_re <= 1.9e+69) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_re))) * (sqrt(t_0) ^ 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-15], N[(t$95$1 / N[Exp[N[(N[Log[t$95$0], $MachinePrecision] * N[(y$46$re * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.9e+69], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[t$95$0], $MachinePrecision], y$46$re], $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 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{t\_1}{e^{\log t\_0 \cdot \left(y.re \cdot -0.5\right)}}\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+69}:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.re\right)\right) \cdot {\left(\sqrt{t\_0}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.8000000000000001e-15Initial program 46.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6486.0
Applied rewrites86.0%
Applied rewrites86.0%
Taylor expanded in y.im around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.0
Applied rewrites86.0%
if -1.8000000000000001e-15 < y.re < 1.90000000000000014e69Initial program 43.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6445.6
Applied rewrites45.6%
Taylor expanded in y.re around 0
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6455.1
Applied rewrites55.1%
if 1.90000000000000014e69 < y.re Initial program 32.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-*.f6444.2
Applied rewrites44.2%
Applied rewrites17.1%
Taylor expanded in y.re around -inf
Applied rewrites64.5%
Final simplification65.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
(if (<= y.re -1.8e-15)
(* t_0 t_1)
(if (<= y.re 1.9e+69)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(* (sin (* (atan2 x.im x.re) (- 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((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -1.8e-15) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.9e+69) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = sin((atan2(x_46_im, x_46_re) * -y_46_re)) * t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(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))) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.8e-15) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 1.9e+69) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * Float64(-y_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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{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]}, If[LessEqual[y$46$re, -1.8e-15], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.9e+69], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-15}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+69}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.re\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.8000000000000001e-15Initial program 46.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-*.f6486.0
Applied rewrites86.0%
if -1.8000000000000001e-15 < y.re < 1.90000000000000014e69Initial program 43.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-atan2.f6445.6
Applied rewrites45.6%
Taylor expanded in y.re around 0
neg-mul-1N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6455.1
Applied rewrites55.1%
if 1.90000000000000014e69 < y.re Initial program 32.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-*.f6444.2
Applied rewrites44.2%
Applied rewrites17.1%
Taylor expanded in y.re around -inf
Applied rewrites64.5%
Final simplification65.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))
(t_2 (* (sin t_0) t_1)))
(if (<= y.re -2.8e-39)
t_2
(if (<= y.re 1e-96)
(pow (pow t_0 4.0) 0.25)
(if (<= y.re 1.38e+57)
t_2
(* (sin (* (atan2 x.im x.re) (- 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 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double t_2 = sin(t_0) * t_1;
double tmp;
if (y_46_re <= -2.8e-39) {
tmp = t_2;
} else if (y_46_re <= 1e-96) {
tmp = pow(pow(t_0, 4.0), 0.25);
} else if (y_46_re <= 1.38e+57) {
tmp = t_2;
} else {
tmp = sin((atan2(x_46_im, x_46_re) * -y_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_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))) ^ y_46_re t_2 = Float64(sin(t_0) * t_1) tmp = 0.0 if (y_46_re <= -2.8e-39) tmp = t_2; elseif (y_46_re <= 1e-96) tmp = (t_0 ^ 4.0) ^ 0.25; elseif (y_46_re <= 1.38e+57) tmp = t_2; else tmp = Float64(sin(Float64(atan(x_46_im, x_46_re) * Float64(-y_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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{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]}, Block[{t$95$2 = N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[y$46$re, -2.8e-39], t$95$2, If[LessEqual[y$46$re, 1e-96], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], If[LessEqual[y$46$re, 1.38e+57], t$95$2, N[(N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
t_2 := \sin t\_0 \cdot t\_1\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 10^{-96}:\\
\;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
\mathbf{elif}\;y.re \leq 1.38 \cdot 10^{+57}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.re\right)\right) \cdot t\_1\\
\end{array}
\end{array}
if y.re < -2.8000000000000001e-39 or 9.9999999999999991e-97 < y.re < 1.38e57Initial program 45.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-*.f6466.8
Applied rewrites66.8%
if -2.8000000000000001e-39 < y.re < 9.9999999999999991e-97Initial program 43.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-*.f6420.5
Applied rewrites20.5%
Taylor expanded in y.re around 0
Applied rewrites20.2%
Applied rewrites33.7%
if 1.38e57 < y.re Initial program 31.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-*.f6443.5
Applied rewrites43.5%
Applied rewrites16.8%
Taylor expanded in y.re around -inf
Applied rewrites63.5%
Final simplification54.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
(if (<= y.re -2.8e-39)
(* (sin t_0) t_1)
(if (<= y.re 1e-96) (pow (pow t_0 4.0) 0.25) (* t_1 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 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -2.8e-39) {
tmp = sin(t_0) * t_1;
} else if (y_46_re <= 1e-96) {
tmp = pow(pow(t_0, 4.0), 0.25);
} else {
tmp = t_1 * 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))) ^ y_46_re tmp = 0.0 if (y_46_re <= -2.8e-39) tmp = Float64(sin(t_0) * t_1); elseif (y_46_re <= 1e-96) tmp = (t_0 ^ 4.0) ^ 0.25; else tmp = Float64(t_1 * 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[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -2.8e-39], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1e-96], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-39}:\\
\;\;\;\;\sin t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 10^{-96}:\\
\;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -2.8000000000000001e-39Initial program 46.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-*.f6486.4
Applied rewrites86.4%
if -2.8000000000000001e-39 < y.re < 9.9999999999999991e-97Initial program 43.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-*.f6420.5
Applied rewrites20.5%
Taylor expanded in y.re around 0
Applied rewrites20.2%
Applied rewrites33.7%
if 9.9999999999999991e-97 < y.re Initial program 36.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-*.f6440.2
Applied rewrites40.2%
Taylor expanded in y.re around 0
Applied rewrites47.1%
Final simplification52.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_0)))
(if (<= y.re -2.8e-39)
t_1
(if (<= y.re 1e-96) (pow (pow t_0 4.0) 0.25) 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(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_0;
double tmp;
if (y_46_re <= -2.8e-39) {
tmp = t_1;
} else if (y_46_re <= 1e-96) {
tmp = pow(pow(t_0, 4.0), 0.25);
} 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((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -2.8e-39) tmp = t_1; elseif (y_46_re <= 1e-96) tmp = (t_0 ^ 4.0) ^ 0.25; 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[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -2.8e-39], t$95$1, If[LessEqual[y$46$re, 1e-96], N[Power[N[Power[t$95$0, 4.0], $MachinePrecision], 0.25], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 10^{-96}:\\
\;\;\;\;{\left({t\_0}^{4}\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.8000000000000001e-39 or 9.9999999999999991e-97 < y.re Initial program 40.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-*.f6458.5
Applied rewrites58.5%
Taylor expanded in y.re around 0
Applied rewrites59.7%
if -2.8000000000000001e-39 < y.re < 9.9999999999999991e-97Initial program 43.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-*.f6420.5
Applied rewrites20.5%
Taylor expanded in y.re around 0
Applied rewrites20.2%
Applied rewrites33.7%
Final simplification50.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) t_0)))
(if (<= y.re -2.5e-169)
t_1
(if (<= y.re 1.7e-106) (sqrt (pow t_0 2.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(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * t_0;
double tmp;
if (y_46_re <= -2.5e-169) {
tmp = t_1;
} else if (y_46_re <= 1.7e-106) {
tmp = sqrt(pow(t_0, 2.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((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * t_0) tmp = 0.0 if (y_46_re <= -2.5e-169) tmp = t_1; elseif (y_46_re <= 1.7e-106) tmp = sqrt((t_0 ^ 2.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[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -2.5e-169], t$95$1, If[LessEqual[y$46$re, 1.7e-106], N[Sqrt[N[Power[t$95$0, 2.0], $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 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot t\_0\\
\mathbf{if}\;y.re \leq -2.5 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-106}:\\
\;\;\;\;\sqrt{{t\_0}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.5000000000000001e-169 or 1.69999999999999991e-106 < y.re Initial program 40.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-*.f6456.0
Applied rewrites56.0%
Taylor expanded in y.re around 0
Applied rewrites57.0%
if -2.5000000000000001e-169 < y.re < 1.69999999999999991e-106Initial program 43.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-*.f6415.1
Applied rewrites15.1%
Taylor expanded in y.re around 0
Applied rewrites13.2%
Applied rewrites28.4%
Final simplification49.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sqrt (pow t_0 2.0)))) (if (<= y.im -1.75e-168) t_1 (if (<= y.im 2.2e-130) 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 = sqrt(pow(t_0, 2.0));
double tmp;
if (y_46_im <= -1.75e-168) {
tmp = t_1;
} else if (y_46_im <= 2.2e-130) {
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 = sqrt((t_0 ** 2.0d0))
if (y_46im <= (-1.75d-168)) then
tmp = t_1
else if (y_46im <= 2.2d-130) 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 = Math.sqrt(Math.pow(t_0, 2.0));
double tmp;
if (y_46_im <= -1.75e-168) {
tmp = t_1;
} else if (y_46_im <= 2.2e-130) {
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 = math.sqrt(math.pow(t_0, 2.0)) tmp = 0 if y_46_im <= -1.75e-168: tmp = t_1 elif y_46_im <= 2.2e-130: 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 = sqrt((t_0 ^ 2.0)) tmp = 0.0 if (y_46_im <= -1.75e-168) tmp = t_1; elseif (y_46_im <= 2.2e-130) 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 = sqrt((t_0 ^ 2.0)); tmp = 0.0; if (y_46_im <= -1.75e-168) tmp = t_1; elseif (y_46_im <= 2.2e-130) 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[Sqrt[N[Power[t$95$0, 2.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.75e-168], t$95$1, If[LessEqual[y$46$im, 2.2e-130], 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 := \sqrt{{t\_0}^{2}}\\
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.74999999999999991e-168 or 2.1999999999999999e-130 < y.im Initial program 37.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.6
Applied rewrites43.6%
Taylor expanded in y.re around 0
Applied rewrites6.9%
Applied rewrites20.1%
if -1.74999999999999991e-168 < y.im < 2.1999999999999999e-130Initial program 51.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-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y.re around 0
Applied rewrites31.9%
Final simplification23.2%
(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.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.3
Applied rewrites45.3%
Taylor expanded in y.re around 0
Applied rewrites13.5%
herbie shell --seed 2024234
(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)))))