
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (* y.im (atan2 x.im x.re)))
(t_2 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -52000.0)
t_2
(if (<= y.re 8.2e+48) (/ t_0 (exp t_1)) (/ t_0 (/ (+ t_1 1.0) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double t_2 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -52000.0) {
tmp = t_2;
} else if (y_46_re <= 8.2e+48) {
tmp = t_0 / exp(t_1);
} else {
tmp = t_0 / ((t_1 + 1.0) / t_2);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -52000.0) {
tmp = t_2;
} else if (y_46_re <= 8.2e+48) {
tmp = t_0 / Math.exp(t_1);
} else {
tmp = t_0 / ((t_1 + 1.0) / t_2);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) t_2 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -52000.0: tmp = t_2 elif y_46_re <= 8.2e+48: tmp = t_0 / math.exp(t_1) else: tmp = t_0 / ((t_1 + 1.0) / t_2) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_2 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -52000.0) tmp = t_2; elseif (y_46_re <= 8.2e+48) tmp = Float64(t_0 / exp(t_1)); else tmp = Float64(t_0 / Float64(Float64(t_1 + 1.0) / t_2)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = y_46_im * atan2(x_46_im, x_46_re); t_2 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -52000.0) tmp = t_2; elseif (y_46_re <= 8.2e+48) tmp = t_0 / exp(t_1); else tmp = t_0 / ((t_1 + 1.0) / t_2); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -52000.0], t$95$2, If[LessEqual[y$46$re, 8.2e+48], N[(t$95$0 / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(t$95$1 + 1.0), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -52000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+48}:\\
\;\;\;\;\frac{t\_0}{e^{t\_1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\frac{t\_1 + 1}{t\_2}}\\
\end{array}
\end{array}
if y.re < -52000Initial program 37.7%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified68.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6468.9%
Simplified68.9%
Taylor expanded in y.im around 0
Simplified70.5%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6478.9%
Simplified78.9%
if -52000 < y.re < 8.2000000000000005e48Initial program 33.6%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified81.0%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6484.1%
Simplified84.1%
if 8.2000000000000005e48 < y.re Initial program 36.8%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified43.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6457.9%
Simplified57.9%
Taylor expanded in y.im around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6470.3%
Simplified70.3%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))) (t_1 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -52000.0)
t_1
(if (<= y.re 8.2e+48)
(/ (cos (* y.im (log (hypot x.im x.re)))) (exp t_0))
(/ 1.0 (/ (+ t_0 1.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_im * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -52000.0) {
tmp = t_1;
} else if (y_46_re <= 8.2e+48) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(t_0);
} else {
tmp = 1.0 / ((t_0 + 1.0) / t_1);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -52000.0) {
tmp = t_1;
} else if (y_46_re <= 8.2e+48) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) / Math.exp(t_0);
} else {
tmp = 1.0 / ((t_0 + 1.0) / t_1);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -52000.0: tmp = t_1 elif y_46_re <= 8.2e+48: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) / math.exp(t_0) else: tmp = 1.0 / ((t_0 + 1.0) / 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 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -52000.0) tmp = t_1; elseif (y_46_re <= 8.2e+48) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(t_0)); else tmp = Float64(1.0 / Float64(Float64(t_0 + 1.0) / 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_im * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -52000.0) tmp = t_1; elseif (y_46_re <= 8.2e+48) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) / exp(t_0); else tmp = 1.0 / ((t_0 + 1.0) / 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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -52000.0], t$95$1, If[LessEqual[y$46$re, 8.2e+48], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(t$95$0 + 1.0), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -52000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+48}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{e^{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t\_0 + 1}{t\_1}}\\
\end{array}
\end{array}
if y.re < -52000Initial program 37.7%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified68.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6468.9%
Simplified68.9%
Taylor expanded in y.im around 0
Simplified70.5%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6478.9%
Simplified78.9%
if -52000 < y.re < 8.2000000000000005e48Initial program 33.6%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified81.0%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6484.1%
Simplified84.1%
if 8.2000000000000005e48 < y.re Initial program 36.8%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified43.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6457.9%
Simplified57.9%
Taylor expanded in y.im around 0
Simplified59.6%
Taylor expanded in y.im around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6466.8%
Simplified66.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1.22)
t_0
(if (<= y.re 8.2e+48)
(exp (* (atan2 x.im x.re) (- 0.0 y.im)))
(/ 1.0 (/ (+ (* y.im (atan2 x.im x.re)) 1.0) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.22) {
tmp = t_0;
} else if (y_46_re <= 8.2e+48) {
tmp = exp((atan2(x_46_im, x_46_re) * (0.0 - y_46_im)));
} else {
tmp = 1.0 / (((y_46_im * atan2(x_46_im, x_46_re)) + 1.0) / t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.22) {
tmp = t_0;
} else if (y_46_re <= 8.2e+48) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * (0.0 - y_46_im)));
} else {
tmp = 1.0 / (((y_46_im * Math.atan2(x_46_im, x_46_re)) + 1.0) / t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.22: tmp = t_0 elif y_46_re <= 8.2e+48: tmp = math.exp((math.atan2(x_46_im, x_46_re) * (0.0 - y_46_im))) else: tmp = 1.0 / (((y_46_im * math.atan2(x_46_im, x_46_re)) + 1.0) / t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.22) tmp = t_0; elseif (y_46_re <= 8.2e+48) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(0.0 - y_46_im))); else tmp = Float64(1.0 / Float64(Float64(Float64(y_46_im * atan(x_46_im, x_46_re)) + 1.0) / t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.22) tmp = t_0; elseif (y_46_re <= 8.2e+48) tmp = exp((atan2(x_46_im, x_46_re) * (0.0 - y_46_im))); else tmp = 1.0 / (((y_46_im * atan2(x_46_im, x_46_re)) + 1.0) / t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.22], t$95$0, If[LessEqual[y$46$re, 8.2e+48], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(0.0 - y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[(N[(N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.22:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+48}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(0 - y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} + 1}{t\_0}}\\
\end{array}
\end{array}
if y.re < -1.21999999999999997Initial program 36.5%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified66.7%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6466.7%
Simplified66.7%
Taylor expanded in y.im around 0
Simplified68.3%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6476.4%
Simplified76.4%
if -1.21999999999999997 < y.re < 8.2000000000000005e48Initial program 34.1%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified82.2%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6481.7%
Simplified81.7%
Taylor expanded in y.im around 0
Simplified75.5%
Taylor expanded in y.re around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6477.7%
Simplified77.7%
if 8.2000000000000005e48 < y.re Initial program 36.8%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified43.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6457.9%
Simplified57.9%
Taylor expanded in y.im around 0
Simplified59.6%
Taylor expanded in y.im around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6466.8%
Simplified66.8%
Final simplification74.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.45)
(pow (hypot x.re x.im) y.re)
(if (<= y.re 8.2e+48)
(exp (* (atan2 x.im x.re) (- 0.0 y.im)))
(/
(pow (+ (* x.re x.re) (* x.im x.im)) (/ y.re 2.0))
(+ (* y.im (atan2 x.im x.re)) 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.45) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_re <= 8.2e+48) {
tmp = exp((atan2(x_46_im, x_46_re) * (0.0 - y_46_im)));
} else {
tmp = pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) / ((y_46_im * atan2(x_46_im, x_46_re)) + 1.0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.45) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_re <= 8.2e+48) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * (0.0 - y_46_im)));
} else {
tmp = Math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) / ((y_46_im * Math.atan2(x_46_im, x_46_re)) + 1.0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.45: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) elif y_46_re <= 8.2e+48: tmp = math.exp((math.atan2(x_46_im, x_46_re) * (0.0 - y_46_im))) else: tmp = math.pow(((x_46_re * x_46_re) + (x_46_im * x_46_im)), (y_46_re / 2.0)) / ((y_46_im * math.atan2(x_46_im, x_46_re)) + 1.0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.45) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; elseif (y_46_re <= 8.2e+48) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(0.0 - y_46_im))); else tmp = Float64((Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)) ^ Float64(y_46_re / 2.0)) / Float64(Float64(y_46_im * atan(x_46_im, x_46_re)) + 1.0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.45) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; elseif (y_46_re <= 8.2e+48) tmp = exp((atan2(x_46_im, x_46_re) * (0.0 - y_46_im))); else tmp = (((x_46_re * x_46_re) + (x_46_im * x_46_im)) ^ (y_46_re / 2.0)) / ((y_46_im * atan2(x_46_im, x_46_re)) + 1.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.45], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 8.2e+48], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(0.0 - y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Power[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.45:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+48}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(0 - y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(x.re \cdot x.re + x.im \cdot x.im\right)}^{\left(\frac{y.re}{2}\right)}}{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} + 1}\\
\end{array}
\end{array}
if y.re < -1.44999999999999996Initial program 36.5%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified66.7%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6466.7%
Simplified66.7%
Taylor expanded in y.im around 0
Simplified68.3%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6476.4%
Simplified76.4%
if -1.44999999999999996 < y.re < 8.2000000000000005e48Initial program 34.1%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified82.2%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6481.7%
Simplified81.7%
Taylor expanded in y.im around 0
Simplified75.5%
Taylor expanded in y.re around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6477.7%
Simplified77.7%
if 8.2000000000000005e48 < y.re Initial program 36.8%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified43.9%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6457.9%
Simplified57.9%
Taylor expanded in y.im around 0
Simplified59.6%
Taylor expanded in y.im around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6466.8%
Simplified66.8%
+-commutativeN/A
*-commutativeN/A
clear-numN/A
/-lowering-/.f64N/A
sqrt-pow2N/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6466.8%
Applied egg-rr66.8%
Final simplification74.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -0.7)
t_0
(if (<= y.re 2.05e+49) (exp (* (atan2 x.im x.re) (- 0.0 y.im))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -0.7) {
tmp = t_0;
} else if (y_46_re <= 2.05e+49) {
tmp = exp((atan2(x_46_im, x_46_re) * (0.0 - y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -0.7) {
tmp = t_0;
} else if (y_46_re <= 2.05e+49) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * (0.0 - y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -0.7: tmp = t_0 elif y_46_re <= 2.05e+49: tmp = math.exp((math.atan2(x_46_im, x_46_re) * (0.0 - y_46_im))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -0.7) tmp = t_0; elseif (y_46_re <= 2.05e+49) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(0.0 - y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -0.7) tmp = t_0; elseif (y_46_re <= 2.05e+49) tmp = exp((atan2(x_46_im, x_46_re) * (0.0 - y_46_im))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -0.7], t$95$0, If[LessEqual[y$46$re, 2.05e+49], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(0.0 - y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.05 \cdot 10^{+49}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(0 - y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.69999999999999996 or 2.05e49 < y.re Initial program 36.7%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified55.8%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6462.5%
Simplified62.5%
Taylor expanded in y.im around 0
Simplified64.2%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6471.0%
Simplified71.0%
if -0.69999999999999996 < y.re < 2.05e49Initial program 34.1%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified82.2%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6481.7%
Simplified81.7%
Taylor expanded in y.im around 0
Simplified75.5%
Taylor expanded in y.re around 0
rec-expN/A
exp-lowering-exp.f64N/A
neg-lowering-neg.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6477.7%
Simplified77.7%
Final simplification74.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.re x.im) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_re, x_46_im), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_re, x_46_im), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_re, x_46_im) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_re, x_46_im) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}
\end{array}
Initial program 35.3%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified69.8%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6472.7%
Simplified72.7%
Taylor expanded in y.im around 0
Simplified70.2%
Taylor expanded in y.im around 0
pow-lowering-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6458.3%
Simplified58.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (* x.re x.re) (/ y.re 2.0))))
(if (<= y.re -0.0003)
t_0
(if (<= y.re 4.4e-13) (/ 1.0 (+ (* y.im (atan2 x.im x.re)) 1.0)) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow((x_46_re * x_46_re), (y_46_re / 2.0));
double tmp;
if (y_46_re <= -0.0003) {
tmp = t_0;
} else if (y_46_re <= 4.4e-13) {
tmp = 1.0 / ((y_46_im * atan2(x_46_im, x_46_re)) + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46re * x_46re) ** (y_46re / 2.0d0)
if (y_46re <= (-0.0003d0)) then
tmp = t_0
else if (y_46re <= 4.4d-13) then
tmp = 1.0d0 / ((y_46im * atan2(x_46im, x_46re)) + 1.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow((x_46_re * x_46_re), (y_46_re / 2.0));
double tmp;
if (y_46_re <= -0.0003) {
tmp = t_0;
} else if (y_46_re <= 4.4e-13) {
tmp = 1.0 / ((y_46_im * Math.atan2(x_46_im, x_46_re)) + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow((x_46_re * x_46_re), (y_46_re / 2.0)) tmp = 0 if y_46_re <= -0.0003: tmp = t_0 elif y_46_re <= 4.4e-13: tmp = 1.0 / ((y_46_im * math.atan2(x_46_im, x_46_re)) + 1.0) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re * x_46_re) ^ Float64(y_46_re / 2.0) tmp = 0.0 if (y_46_re <= -0.0003) tmp = t_0; elseif (y_46_re <= 4.4e-13) tmp = Float64(1.0 / Float64(Float64(y_46_im * atan(x_46_im, x_46_re)) + 1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * x_46_re) ^ (y_46_re / 2.0); tmp = 0.0; if (y_46_re <= -0.0003) tmp = t_0; elseif (y_46_re <= 4.4e-13) tmp = 1.0 / ((y_46_im * atan2(x_46_im, x_46_re)) + 1.0); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.0003], t$95$0, If[LessEqual[y$46$re, 4.4e-13], N[(1.0 / N[(N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x.re \cdot x.re\right)}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{if}\;y.re \leq -0.0003:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{1}{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.99999999999999974e-4 or 4.39999999999999993e-13 < y.re Initial program 38.5%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified55.4%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6461.4%
Simplified61.4%
Taylor expanded in x.im around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6420.9%
Simplified20.9%
Taylor expanded in y.im around 0
pow-lowering-pow.f6450.5%
Simplified50.5%
sqr-powN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6453.4%
Applied egg-rr53.4%
if -2.99999999999999974e-4 < y.re < 4.39999999999999993e-13Initial program 32.0%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified84.7%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6484.4%
Simplified84.4%
Taylor expanded in y.im around 0
Simplified78.5%
Taylor expanded in y.im around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6449.7%
Simplified49.7%
Taylor expanded in y.re around 0
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6449.2%
Simplified49.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (pow (* x.re x.re) (/ y.re 2.0)))) (if (<= y.re -0.000305) t_0 (if (<= y.re 2.2e-15) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow((x_46_re * x_46_re), (y_46_re / 2.0));
double tmp;
if (y_46_re <= -0.000305) {
tmp = t_0;
} else if (y_46_re <= 2.2e-15) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46re * x_46re) ** (y_46re / 2.0d0)
if (y_46re <= (-0.000305d0)) then
tmp = t_0
else if (y_46re <= 2.2d-15) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow((x_46_re * x_46_re), (y_46_re / 2.0));
double tmp;
if (y_46_re <= -0.000305) {
tmp = t_0;
} else if (y_46_re <= 2.2e-15) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow((x_46_re * x_46_re), (y_46_re / 2.0)) tmp = 0 if y_46_re <= -0.000305: tmp = t_0 elif y_46_re <= 2.2e-15: tmp = 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re * x_46_re) ^ Float64(y_46_re / 2.0) tmp = 0.0 if (y_46_re <= -0.000305) tmp = t_0; elseif (y_46_re <= 2.2e-15) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * x_46_re) ^ (y_46_re / 2.0); tmp = 0.0; if (y_46_re <= -0.000305) tmp = t_0; elseif (y_46_re <= 2.2e-15) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(x$46$re * x$46$re), $MachinePrecision], N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.000305], t$95$0, If[LessEqual[y$46$re, 2.2e-15], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(x.re \cdot x.re\right)}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{if}\;y.re \leq -0.000305:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.2 \cdot 10^{-15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.04999999999999987e-4 or 2.19999999999999986e-15 < y.re Initial program 38.9%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified55.7%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6461.7%
Simplified61.7%
Taylor expanded in x.im around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6420.7%
Simplified20.7%
Taylor expanded in y.im around 0
pow-lowering-pow.f6450.1%
Simplified50.1%
sqr-powN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6453.1%
Applied egg-rr53.1%
if -3.04999999999999987e-4 < y.re < 2.19999999999999986e-15Initial program 31.5%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6450.1%
Simplified50.1%
Taylor expanded in y.re around 0
Simplified49.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.65e-12) (pow x.re y.re) (if (<= y.re 3.7e+33) 1.0 (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.65e-12) {
tmp = pow(x_46_re, y_46_re);
} else if (y_46_re <= 3.7e+33) {
tmp = 1.0;
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-1.65d-12)) then
tmp = x_46re ** y_46re
else if (y_46re <= 3.7d+33) then
tmp = 1.0d0
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.65e-12) {
tmp = Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 3.7e+33) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.65e-12: tmp = math.pow(x_46_re, y_46_re) elif y_46_re <= 3.7e+33: tmp = 1.0 else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.65e-12) tmp = x_46_re ^ y_46_re; elseif (y_46_re <= 3.7e+33) tmp = 1.0; else tmp = x_46_re ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.65e-12) tmp = x_46_re ^ y_46_re; elseif (y_46_re <= 3.7e+33) tmp = 1.0; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.65e-12], N[Power[x$46$re, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 3.7e+33], 1.0, N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{-12}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+33}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.65e-12 or 3.6999999999999999e33 < y.re Initial program 36.0%
exp-diffN/A
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
exp-diffN/A
Simplified56.8%
Taylor expanded in y.re around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6462.8%
Simplified62.8%
Taylor expanded in x.im around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f6422.5%
Simplified22.5%
Taylor expanded in y.im around 0
pow-lowering-pow.f6453.3%
Simplified53.3%
if -1.65e-12 < y.re < 3.6999999999999999e33Initial program 34.6%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6447.9%
Simplified47.9%
Taylor expanded in y.re around 0
Simplified46.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 35.3%
Taylor expanded in y.im around 0
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
atan2-lowering-atan2.f64N/A
pow-lowering-pow.f64N/A
unpow2N/A
unpow2N/A
hypot-defineN/A
hypot-lowering-hypot.f6456.3%
Simplified56.3%
Taylor expanded in y.re around 0
Simplified25.5%
herbie shell --seed 2024158
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))