
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
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
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
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
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (- x.im (* (/ y.im y.re) x.re)) y.re)))
(if (<= y.re -2.6e+129)
t_1
(if (<= y.re -6.2e-119)
t_0
(if (<= y.re 1.55e-164)
(- (/ (- x.re (/ (* y.re x.im) y.im)) y.im))
(if (<= y.re 1.25e+89) 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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -2.6e+129) {
tmp = t_1;
} else if (y_46_re <= -6.2e-119) {
tmp = t_0;
} else if (y_46_re <= 1.55e-164) {
tmp = -((x_46_re - ((y_46_re * x_46_im) / y_46_im)) / y_46_im);
} else if (y_46_re <= 1.25e+89) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im - ((y_46im / y_46re) * x_46re)) / y_46re
if (y_46re <= (-2.6d+129)) then
tmp = t_1
else if (y_46re <= (-6.2d-119)) then
tmp = t_0
else if (y_46re <= 1.55d-164) then
tmp = -((x_46re - ((y_46re * x_46im) / y_46im)) / y_46im)
else if (y_46re <= 1.25d+89) 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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -2.6e+129) {
tmp = t_1;
} else if (y_46_re <= -6.2e-119) {
tmp = t_0;
} else if (y_46_re <= 1.55e-164) {
tmp = -((x_46_re - ((y_46_re * x_46_im) / y_46_im)) / y_46_im);
} else if (y_46_re <= 1.25e+89) {
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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re tmp = 0 if y_46_re <= -2.6e+129: tmp = t_1 elif y_46_re <= -6.2e-119: tmp = t_0 elif y_46_re <= 1.55e-164: tmp = -((x_46_re - ((y_46_re * x_46_im) / y_46_im)) / y_46_im) elif y_46_re <= 1.25e+89: 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(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_46_re)) / y_46_re) tmp = 0.0 if (y_46_re <= -2.6e+129) tmp = t_1; elseif (y_46_re <= -6.2e-119) tmp = t_0; elseif (y_46_re <= 1.55e-164) tmp = Float64(-Float64(Float64(x_46_re - Float64(Float64(y_46_re * x_46_im) / y_46_im)) / y_46_im)); elseif (y_46_re <= 1.25e+89) 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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re; tmp = 0.0; if (y_46_re <= -2.6e+129) tmp = t_1; elseif (y_46_re <= -6.2e-119) tmp = t_0; elseif (y_46_re <= 1.55e-164) tmp = -((x_46_re - ((y_46_re * x_46_im) / y_46_im)) / y_46_im); elseif (y_46_re <= 1.25e+89) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e+129], t$95$1, If[LessEqual[y$46$re, -6.2e-119], t$95$0, If[LessEqual[y$46$re, 1.55e-164], (-N[(N[(x$46$re - N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), If[LessEqual[y$46$re, 1.25e+89], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -6.2 \cdot 10^{-119}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.55 \cdot 10^{-164}:\\
\;\;\;\;-\frac{x.re - \frac{y.re \cdot x.im}{y.im}}{y.im}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.60000000000000012e129 or 1.24999999999999996e89 < y.re Initial program 38.7%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6478.5
Applied rewrites78.5%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6483.3
Applied rewrites83.3%
if -2.60000000000000012e129 < y.re < -6.19999999999999956e-119 or 1.55e-164 < y.re < 1.24999999999999996e89Initial program 74.5%
if -6.19999999999999956e-119 < y.re < 1.55e-164Initial program 69.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6424.5
Applied rewrites24.5%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6425.0
Applied rewrites25.0%
Taylor expanded in y.im around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f6491.7
Applied rewrites91.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* x.im y.re) (* x.re y.im))))
(if (<= y.re -2.6e+129)
(/ x.im y.re)
(if (<= y.re -1.28e-107)
(/ t_0 (* y.re y.re))
(if (<= y.re 3e-105)
(/ t_0 (* y.im y.im))
(if (<= y.re 1.25e+166)
(* x.im (/ y.re (fma y.im y.im (* y.re y.re))))
(/ x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
double tmp;
if (y_46_re <= -2.6e+129) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -1.28e-107) {
tmp = t_0 / (y_46_re * y_46_re);
} else if (y_46_re <= 3e-105) {
tmp = t_0 / (y_46_im * y_46_im);
} else if (y_46_re <= 1.25e+166) {
tmp = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) tmp = 0.0 if (y_46_re <= -2.6e+129) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -1.28e-107) tmp = Float64(t_0 / Float64(y_46_re * y_46_re)); elseif (y_46_re <= 3e-105) tmp = Float64(t_0 / Float64(y_46_im * y_46_im)); elseif (y_46_re <= 1.25e+166) tmp = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); else tmp = Float64(x_46_im / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e+129], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.28e-107], N[(t$95$0 / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3e-105], N[(t$95$0 / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+166], N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot y.re - x.re \cdot y.im\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+129}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -1.28 \cdot 10^{-107}:\\
\;\;\;\;\frac{t\_0}{y.re \cdot y.re}\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{-105}:\\
\;\;\;\;\frac{t\_0}{y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+166}:\\
\;\;\;\;x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -2.60000000000000012e129 or 1.25e166 < y.re Initial program 33.1%
Taylor expanded in y.re around inf
lower-/.f6476.7
Applied rewrites76.7%
if -2.60000000000000012e129 < y.re < -1.28e-107Initial program 74.0%
Taylor expanded in y.re around inf
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
if -1.28e-107 < y.re < 3.0000000000000001e-105Initial program 71.1%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6466.3
Applied rewrites66.3%
if 3.0000000000000001e-105 < y.re < 1.25e166Initial program 69.5%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6454.3
Applied rewrites54.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* x.im (/ y.re (fma y.im y.im (* y.re y.re))))))
(if (<= y.re -9e+130)
(/ x.im y.re)
(if (<= y.re -4.8e-139)
t_0
(if (<= y.re 3e-105)
(/ (- (* x.im y.re) (* x.re y.im)) (* y.im y.im))
(if (<= y.re 1.25e+166) t_0 (/ x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
double tmp;
if (y_46_re <= -9e+130) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -4.8e-139) {
tmp = t_0;
} else if (y_46_re <= 3e-105) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else if (y_46_re <= 1.25e+166) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))) tmp = 0.0 if (y_46_re <= -9e+130) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -4.8e-139) tmp = t_0; elseif (y_46_re <= 3e-105) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(y_46_im * y_46_im)); elseif (y_46_re <= 1.25e+166) tmp = t_0; else tmp = Float64(x_46_im / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+130], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -4.8e-139], t$95$0, If[LessEqual[y$46$re, 3e-105], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+166], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+130}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -4.8 \cdot 10^{-139}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{-105}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+166}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -9.00000000000000078e130 or 1.25e166 < y.re Initial program 32.6%
Taylor expanded in y.re around inf
lower-/.f6476.7
Applied rewrites76.7%
if -9.00000000000000078e130 < y.re < -4.80000000000000029e-139 or 3.0000000000000001e-105 < y.re < 1.25e166Initial program 72.3%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6454.1
Applied rewrites54.1%
if -4.80000000000000029e-139 < y.re < 3.0000000000000001e-105Initial program 70.2%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6466.8
Applied rewrites66.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* x.im (/ y.re (fma y.im y.im (* y.re y.re))))))
(if (<= y.re -9e+130)
(/ x.im y.re)
(if (<= y.re -1.56e-220)
t_0
(if (<= y.re 1.45e-86)
(/ (- x.re) y.im)
(if (<= y.re 1.25e+166) t_0 (/ x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
double tmp;
if (y_46_re <= -9e+130) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -1.56e-220) {
tmp = t_0;
} else if (y_46_re <= 1.45e-86) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 1.25e+166) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))) tmp = 0.0 if (y_46_re <= -9e+130) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -1.56e-220) tmp = t_0; elseif (y_46_re <= 1.45e-86) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 1.25e+166) tmp = t_0; else tmp = Float64(x_46_im / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9e+130], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.56e-220], t$95$0, If[LessEqual[y$46$re, 1.45e-86], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+166], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{+130}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -1.56 \cdot 10^{-220}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-86}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+166}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -9.00000000000000078e130 or 1.25e166 < y.re Initial program 32.6%
Taylor expanded in y.re around inf
lower-/.f6476.7
Applied rewrites76.7%
if -9.00000000000000078e130 < y.re < -1.5599999999999999e-220 or 1.45e-86 < y.re < 1.25e166Initial program 71.6%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6451.8
Applied rewrites51.8%
if -1.5599999999999999e-220 < y.re < 1.45e-86Initial program 71.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6476.2
Applied rewrites76.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* (/ y.im y.re) x.re)) y.re)))
(if (<= y.re -70000000000.0)
t_0
(if (<= y.re 1.3e-84)
(- (/ (- x.re (/ (* y.re x.im) y.im)) y.im))
(if (<= y.re 2.5e+89)
(* x.im (/ y.re (fma y.im y.im (* y.re y.re))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -70000000000.0) {
tmp = t_0;
} else if (y_46_re <= 1.3e-84) {
tmp = -((x_46_re - ((y_46_re * x_46_im) / y_46_im)) / y_46_im);
} else if (y_46_re <= 2.5e+89) {
tmp = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_46_re)) / y_46_re) tmp = 0.0 if (y_46_re <= -70000000000.0) tmp = t_0; elseif (y_46_re <= 1.3e-84) tmp = Float64(-Float64(Float64(x_46_re - Float64(Float64(y_46_re * x_46_im) / y_46_im)) / y_46_im)); elseif (y_46_re <= 2.5e+89) tmp = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -70000000000.0], t$95$0, If[LessEqual[y$46$re, 1.3e-84], (-N[(N[(x$46$re - N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), If[LessEqual[y$46$re, 2.5e+89], N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{if}\;y.re \leq -70000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-84}:\\
\;\;\;\;-\frac{x.re - \frac{y.re \cdot x.im}{y.im}}{y.im}\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+89}:\\
\;\;\;\;x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7e10 or 2.49999999999999992e89 < y.re Initial program 45.2%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6478.3
Applied rewrites78.3%
if -7e10 < y.re < 1.3e-84Initial program 72.9%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6430.3
Applied rewrites30.3%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6430.7
Applied rewrites30.7%
Taylor expanded in y.im around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f6483.2
Applied rewrites83.2%
if 1.3e-84 < y.re < 2.49999999999999992e89Initial program 74.0%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.6
Applied rewrites52.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* (/ y.im y.re) x.re)) y.re)))
(if (<= y.re -70000000000.0)
t_0
(if (<= y.re 1.3e-84)
(/ (fma y.re (/ x.im y.im) (- x.re)) y.im)
(if (<= y.re 2.5e+89)
(* x.im (/ y.re (fma y.im y.im (* y.re y.re))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -70000000000.0) {
tmp = t_0;
} else if (y_46_re <= 1.3e-84) {
tmp = fma(y_46_re, (x_46_im / y_46_im), -x_46_re) / y_46_im;
} else if (y_46_re <= 2.5e+89) {
tmp = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_46_re)) / y_46_re) tmp = 0.0 if (y_46_re <= -70000000000.0) tmp = t_0; elseif (y_46_re <= 1.3e-84) tmp = Float64(fma(y_46_re, Float64(x_46_im / y_46_im), Float64(-x_46_re)) / y_46_im); elseif (y_46_re <= 2.5e+89) tmp = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -70000000000.0], t$95$0, If[LessEqual[y$46$re, 1.3e-84], N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.5e+89], N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{if}\;y.re \leq -70000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-84}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.re, \frac{x.im}{y.im}, -x.re\right)}{y.im}\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+89}:\\
\;\;\;\;x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7e10 or 2.49999999999999992e89 < y.re Initial program 45.2%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6478.3
Applied rewrites78.3%
if -7e10 < y.re < 1.3e-84Initial program 72.9%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6483.3
Applied rewrites83.3%
lift-/.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-neg.f6481.2
Applied rewrites81.2%
if 1.3e-84 < y.re < 2.49999999999999992e89Initial program 74.0%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.6
Applied rewrites52.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* (/ y.im y.re) x.re)) y.re)))
(if (<= y.re -70000000000.0)
t_0
(if (<= y.re 1.3e-84)
(/ (fma x.im (/ y.re y.im) (- x.re)) y.im)
(if (<= y.re 2.5e+89)
(* x.im (/ y.re (fma y.im y.im (* y.re y.re))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -70000000000.0) {
tmp = t_0;
} else if (y_46_re <= 1.3e-84) {
tmp = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
} else if (y_46_re <= 2.5e+89) {
tmp = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_46_re)) / y_46_re) tmp = 0.0 if (y_46_re <= -70000000000.0) tmp = t_0; elseif (y_46_re <= 1.3e-84) tmp = Float64(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im); elseif (y_46_re <= 2.5e+89) tmp = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -70000000000.0], t$95$0, If[LessEqual[y$46$re, 1.3e-84], N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.5e+89], N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{if}\;y.re \leq -70000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-84}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+89}:\\
\;\;\;\;x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7e10 or 2.49999999999999992e89 < y.re Initial program 45.2%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6478.3
Applied rewrites78.3%
if -7e10 < y.re < 1.3e-84Initial program 72.9%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6483.3
Applied rewrites83.3%
if 1.3e-84 < y.re < 2.49999999999999992e89Initial program 74.0%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.6
Applied rewrites52.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* (/ y.im y.re) x.re)) y.re)))
(if (<= y.re -1.28e-107)
t_0
(if (<= y.re 3e-105)
(/ (- (* x.im y.re) (* x.re y.im)) (* y.im y.im))
(if (<= y.re 2.5e+89)
(* x.im (/ y.re (fma y.im y.im (* y.re y.re))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((y_46_im / y_46_re) * x_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -1.28e-107) {
tmp = t_0;
} else if (y_46_re <= 3e-105) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else if (y_46_re <= 2.5e+89) {
tmp = x_46_im * (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(Float64(y_46_im / y_46_re) * x_46_re)) / y_46_re) tmp = 0.0 if (y_46_re <= -1.28e-107) tmp = t_0; elseif (y_46_re <= 3e-105) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(y_46_im * y_46_im)); elseif (y_46_re <= 2.5e+89) tmp = Float64(x_46_im * Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.28e-107], t$95$0, If[LessEqual[y$46$re, 3e-105], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.5e+89], N[(x$46$im * N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - \frac{y.im}{y.re} \cdot x.re}{y.re}\\
\mathbf{if}\;y.re \leq -1.28 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{-105}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+89}:\\
\;\;\;\;x.im \cdot \frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.28e-107 or 2.49999999999999992e89 < y.re Initial program 51.4%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.2
Applied rewrites69.2%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6472.4
Applied rewrites72.4%
if -1.28e-107 < y.re < 3.0000000000000001e-105Initial program 71.1%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6466.3
Applied rewrites66.3%
if 3.0000000000000001e-105 < y.re < 2.49999999999999992e89Initial program 73.8%
Taylor expanded in x.re around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6452.1
Applied rewrites52.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (/ (- x.re) y.im))) (if (<= y.im -31500000000.0) t_0 (if (<= y.im 4.2e-36) (/ x.im y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -x_46_re / y_46_im;
double tmp;
if (y_46_im <= -31500000000.0) {
tmp = t_0;
} else if (y_46_im <= 4.2e-36) {
tmp = x_46_im / y_46_re;
} else {
tmp = t_0;
}
return tmp;
}
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
real(8) :: tmp
t_0 = -x_46re / y_46im
if (y_46im <= (-31500000000.0d0)) then
tmp = t_0
else if (y_46im <= 4.2d-36) then
tmp = x_46im / y_46re
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 = -x_46_re / y_46_im;
double tmp;
if (y_46_im <= -31500000000.0) {
tmp = t_0;
} else if (y_46_im <= 4.2e-36) {
tmp = x_46_im / y_46_re;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = -x_46_re / y_46_im tmp = 0 if y_46_im <= -31500000000.0: tmp = t_0 elif y_46_im <= 4.2e-36: tmp = x_46_im / y_46_re else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(-x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -31500000000.0) tmp = t_0; elseif (y_46_im <= 4.2e-36) tmp = Float64(x_46_im / y_46_re); 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 / y_46_im; tmp = 0.0; if (y_46_im <= -31500000000.0) tmp = t_0; elseif (y_46_im <= 4.2e-36) tmp = x_46_im / y_46_re; 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[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -31500000000.0], t$95$0, If[LessEqual[y$46$im, 4.2e-36], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -31500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -3.15e10 or 4.19999999999999982e-36 < y.im Initial program 49.9%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6464.9
Applied rewrites64.9%
if -3.15e10 < y.im < 4.19999999999999982e-36Initial program 74.0%
Taylor expanded in y.re around inf
lower-/.f6464.8
Applied rewrites64.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / 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
code = x_46im / y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 61.3%
Taylor expanded in y.re around inf
lower-/.f6442.2
Applied rewrites42.2%
herbie shell --seed 2025095
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))