
(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)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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}
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}
Herbie found 9 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)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
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}
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}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<=
y.im
409999999999999990472932154957878370114535304606251784249590698051943254078174365087551489442461857594998784)
(/
(sin
(+
(* (atan2 x.im x.re) y.re)
(184-logsqrtz0z0z1z1z2 x.im x.re y.im)))
(exp (- t_0 (184-logsqrtz0z0z1z1z2 x.im x.re y.re))))
(*
(sin (- PI (* y.re (atan2 x.im x.re))))
(exp (- (184-logsqrtz0z0z1z1z2 x.im x.re y.re) t_0))))))\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq 409999999999999990472932154957878370114535304606251784249590698051943254078174365087551489442461857594998784:\\
\;\;\;\;\frac{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.im\right)\right)}{e^{t\_0 - \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\pi - y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - t\_0}\\
\end{array}
if y.im < 4.0999999999999999e107Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites80.8%
if 4.0999999999999999e107 < y.im Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6464.4%
Applied rewrites64.4%
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-lft-identityN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-atan2.f64N/A
lift-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
Applied rewrites56.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(184-logsqrtz0z0z1z1z2 x.im x.re y.re)
(* y.im (atan2 x.im x.re))))))
(if (<=
y.im
409999999999999990472932154957878370114535304606251784249590698051943254078174365087551489442461857594998784)
(*
(sin
(+
(* (atan2 x.im x.re) y.re)
(184-logsqrtz0z0z1z1z2 x.im x.re y.im)))
t_0)
(* (sin (- PI (* y.re (atan2 x.im x.re)))) t_0))))\begin{array}{l}
t_0 := e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq 409999999999999990472932154957878370114535304606251784249590698051943254078174365087551489442461857594998784:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.im\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\pi - y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\end{array}
if y.im < 4.0999999999999999e107Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
if 4.0999999999999999e107 < y.im Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6464.4%
Applied rewrites64.4%
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-lft-identityN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift-atan2.f64N/A
lift-neg.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
Applied rewrites56.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<=
y.re
-1684996666696915/3369993333393829974333376885877453834204643052817571560137951281152)
(/
(sin (* y.re (atan2 x.im x.re)))
(exp (- t_0 (184-logsqrtz0z0z1z1z2 x.im x.re y.re))))
(if (<= y.re 1224979098644775/36028797018963968)
(/
(sin
(+
(* (atan2 x.im x.re) y.re)
(184-logsqrtz0z0z1z1z2 x.im x.re y.im)))
(/ 1 (exp (- t_0))))
(*
(sin (* 1 (184-logsqrtz0z0z1z1z2 x.re x.im y.im)))
(exp (- (184-logsqrtz0z0z1z1z2 x.im x.re y.re) t_0)))))))\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq \frac{-1684996666696915}{3369993333393829974333376885877453834204643052817571560137951281152}:\\
\;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{e^{t\_0 - \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right)}}\\
\mathbf{elif}\;y.re \leq \frac{1224979098644775}{36028797018963968}:\\
\;\;\;\;\frac{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.im\right)\right)}{\frac{1}{e^{-t\_0}}}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(1 \cdot \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.im\right)\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - t\_0}\\
\end{array}
if y.re < -5e-52Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites80.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6464.4%
Applied rewrites64.4%
if -5e-52 < y.re < 0.034000000000000002Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites80.8%
Applied rewrites80.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6453.2%
Applied rewrites53.2%
if 0.034000000000000002 < y.re Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<=
y.re
-1684996666696915/3369993333393829974333376885877453834204643052817571560137951281152)
(/
(sin (* y.re (atan2 x.im x.re)))
(exp (- t_0 (184-logsqrtz0z0z1z1z2 x.im x.re y.re))))
(if (<= y.re 1224979098644775/36028797018963968)
(*
(sin
(+
(* (atan2 x.im x.re) y.re)
(184-logsqrtz0z0z1z1z2 x.im x.re y.im)))
(exp (- t_0)))
(*
(sin (* 1 (184-logsqrtz0z0z1z1z2 x.re x.im y.im)))
(exp (- (184-logsqrtz0z0z1z1z2 x.im x.re y.re) t_0)))))))\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq \frac{-1684996666696915}{3369993333393829974333376885877453834204643052817571560137951281152}:\\
\;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{e^{t\_0 - \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right)}}\\
\mathbf{elif}\;y.re \leq \frac{1224979098644775}{36028797018963968}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.im\right)\right) \cdot e^{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(1 \cdot \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.im\right)\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - t\_0}\\
\end{array}
if y.re < -5e-52Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites80.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6464.4%
Applied rewrites64.4%
if -5e-52 < y.re < 0.034000000000000002Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6453.2%
Applied rewrites53.2%
if 0.034000000000000002 < y.re Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (exp (- (184-logsqrtz0z0z1z1z2 x.im x.re y.re) t_0))))
(if (<=
y.re
-1684996666696915/3369993333393829974333376885877453834204643052817571560137951281152)
(* (sin (* y.re (atan2 x.im x.re))) t_1)
(if (<= y.re 1224979098644775/36028797018963968)
(*
(sin
(+
(* (atan2 x.im x.re) y.re)
(184-logsqrtz0z0z1z1z2 x.im x.re y.im)))
(exp (- t_0)))
(* (sin (* 1 (184-logsqrtz0z0z1z1z2 x.re x.im y.im))) t_1)))))\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - t\_0}\\
\mathbf{if}\;y.re \leq \frac{-1684996666696915}{3369993333393829974333376885877453834204643052817571560137951281152}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq \frac{1224979098644775}{36028797018963968}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.im\right)\right) \cdot e^{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(1 \cdot \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.im\right)\right) \cdot t\_1\\
\end{array}
if y.re < -5e-52Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6464.4%
Applied rewrites64.4%
if -5e-52 < y.re < 0.034000000000000002Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6453.2%
Applied rewrites53.2%
if 0.034000000000000002 < y.re Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<=
x.re
-8036314553897005/10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376)
(*
(sin (* y.re (atan2 x.im x.re)))
(exp (- (184-logsqrtz0z0z1z1z2 x.im x.re y.re) t_0)))
(*
(sin (* (184-logsqrtz0z0z1z1z2 x.re x.im 1) y.im))
(exp (- (184-logsqrtz0z0z1z1z2 x.re x.im y.re) t_0))))))\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq \frac{-8036314553897005}{10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, 1\right) \cdot y.im\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.re\right) - t\_0}\\
\end{array}
if x.re < -7.5000000000000001e-286Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
Taylor expanded in y.im around 0
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6464.4%
Applied rewrites64.4%
if -7.5000000000000001e-286 < x.re Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
lift-*.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-184-logsqrtz0z0z1z1z270.7%
lift-exp.f64N/A
Applied rewrites70.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* (184-logsqrtz0z0z1z1z2 x.re x.im 1) y.im)) (exp (- (184-logsqrtz0z0z1z1z2 x.re x.im y.re) (* y.im (atan2 x.im x.re))))))
\sin \left(\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, 1\right) \cdot y.im\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
lift-*.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-184-logsqrtz0z0z1z1z270.7%
lift-exp.f64N/A
Applied rewrites70.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* 1 (184-logsqrtz0z0z1z1z2 x.re x.im y.im))) (exp (- (184-logsqrtz0z0z1z1z2 x.im x.re y.re) (* y.im (atan2 x.im x.re))))))
\sin \left(1 \cdot \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.im\right)\right) \cdot e^{\mathsf{184\_logsqrtz0z0z1z1z2}\left(x.im, x.re, y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* 1 (184-logsqrtz0z0z1z1z2 x.re x.im y.im))) (exp (- (* y.im (atan2 x.im x.re))))))
\sin \left(1 \cdot \mathsf{184\_logsqrtz0z0z1z1z2}\left(x.re, x.im, y.im\right)\right) \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
Initial program 40.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8%
Applied rewrites80.8%
lift-+.f64N/A
lift-184-logsqrtz0z0z1z1z2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-sqrt.f64N/A
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
sum-to-multN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
Applied rewrites72.9%
Taylor expanded in y.re around 0
Applied rewrites70.8%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f6443.6%
Applied rewrites43.6%
herbie shell --seed 2025271 -o generate:evaluate
(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)))))