
(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}
Sampling outcomes in binary64 precision:
Herbie found 12 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 (fma y.im y.im (* y.re y.re)))
(t_1
(* (- x.re) (fma (/ -1.0 x.re) (* x.im (/ y.re t_0)) (/ y.im t_0)))))
(if (<= y.im -1.55e+126)
(/ (fma x.im (/ y.re y.im) (- x.re)) y.im)
(if (<= y.im -4.6e-41)
t_1
(if (<= y.im 6.7e-59)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1e+132)
t_1
(fma (/ x.im y.im) (/ y.re y.im) (/ (- x.re) y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = -x_46_re * fma((-1.0 / x_46_re), (x_46_im * (y_46_re / t_0)), (y_46_im / t_0));
double tmp;
if (y_46_im <= -1.55e+126) {
tmp = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
} else if (y_46_im <= -4.6e-41) {
tmp = t_1;
} else if (y_46_im <= 6.7e-59) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1e+132) {
tmp = t_1;
} else {
tmp = fma((x_46_im / y_46_im), (y_46_re / y_46_im), (-x_46_re / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_1 = Float64(Float64(-x_46_re) * fma(Float64(-1.0 / x_46_re), Float64(x_46_im * Float64(y_46_re / t_0)), Float64(y_46_im / t_0))) tmp = 0.0 if (y_46_im <= -1.55e+126) tmp = Float64(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im); elseif (y_46_im <= -4.6e-41) tmp = t_1; elseif (y_46_im <= 6.7e-59) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1e+132) tmp = t_1; else tmp = fma(Float64(x_46_im / y_46_im), Float64(y_46_re / y_46_im), Float64(Float64(-x_46_re) / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x$46$re) * N[(N[(-1.0 / x$46$re), $MachinePrecision] * N[(x$46$im * N[(y$46$re / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(y$46$im / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.55e+126], 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$im, -4.6e-41], t$95$1, If[LessEqual[y$46$im, 6.7e-59], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1e+132], t$95$1, N[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision] + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \left(-x.re\right) \cdot \mathsf{fma}\left(\frac{-1}{x.re}, x.im \cdot \frac{y.re}{t\_0}, \frac{y.im}{t\_0}\right)\\
\mathbf{if}\;y.im \leq -1.55 \cdot 10^{+126}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{elif}\;y.im \leq -4.6 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 6.7 \cdot 10^{-59}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x.im}{y.im}, \frac{y.re}{y.im}, \frac{-x.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -1.55e126Initial program 29.6%
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.f6494.7
Applied rewrites94.7%
if -1.55e126 < y.im < -4.6000000000000002e-41 or 6.7e-59 < y.im < 9.99999999999999991e131Initial program 74.5%
Taylor expanded in x.re around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r/N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites82.2%
if -4.6000000000000002e-41 < y.im < 6.7e-59Initial program 74.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-*.f6490.2
Applied rewrites90.2%
if 9.99999999999999991e131 < y.im Initial program 42.9%
Taylor expanded in y.re around 0
+-commutativeN/A
pow2N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6493.4
Applied rewrites93.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.6e+35)
(/ (fma x.im (/ y.re y.im) (- x.re)) y.im)
(if (<= y.im 2e-88)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.6e+86)
(/ (fma (- x.re) y.im (* y.re x.im)) (fma y.im y.im (* y.re y.re)))
(fma (/ x.im y.im) (/ y.re y.im) (/ (- x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.6e+35) {
tmp = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
} else if (y_46_im <= 2e-88) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.6e+86) {
tmp = fma(-x_46_re, y_46_im, (y_46_re * x_46_im)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else {
tmp = fma((x_46_im / y_46_im), (y_46_re / y_46_im), (-x_46_re / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -4.6e+35) tmp = Float64(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im); elseif (y_46_im <= 2e-88) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.6e+86) tmp = Float64(fma(Float64(-x_46_re), y_46_im, Float64(y_46_re * x_46_im)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); else tmp = fma(Float64(x_46_im / y_46_im), Float64(y_46_re / y_46_im), Float64(Float64(-x_46_re) / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.6e+35], 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$im, 2e-88], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.6e+86], N[(N[((-x$46$re) * y$46$im + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision] + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{-88}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+86}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x.re, y.im, y.re \cdot x.im\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x.im}{y.im}, \frac{y.re}{y.im}, \frac{-x.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -4.5999999999999996e35Initial program 44.0%
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.9
Applied rewrites83.9%
if -4.5999999999999996e35 < y.im < 1.99999999999999987e-88Initial program 74.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-*.f6486.7
Applied rewrites86.7%
if 1.99999999999999987e-88 < y.im < 1.6e86Initial program 87.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6487.9
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6487.9
Applied rewrites87.9%
if 1.6e86 < y.im Initial program 44.2%
Taylor expanded in y.re around 0
+-commutativeN/A
pow2N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6485.8
Applied rewrites85.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<= y.im -8.8e+77)
t_0
(if (<= y.im -1.9e+34)
(/ (- (* x.im y.re) (* x.re y.im)) (* y.im y.im))
(if (<= y.im -1.2e-185)
(/ x.im y.re)
(if (<= y.im 122000000000.0)
(/ (fma (- x.re) y.im (* y.re x.im)) (* y.re y.re))
(if (<= y.im 7e+110)
(* 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_re / y_46_im;
double tmp;
if (y_46_im <= -8.8e+77) {
tmp = t_0;
} else if (y_46_im <= -1.9e+34) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else if (y_46_im <= -1.2e-185) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 122000000000.0) {
tmp = fma(-x_46_re, y_46_im, (y_46_re * x_46_im)) / (y_46_re * y_46_re);
} else if (y_46_im <= 7e+110) {
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_re) / y_46_im) tmp = 0.0 if (y_46_im <= -8.8e+77) tmp = t_0; elseif (y_46_im <= -1.9e+34) 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_im <= -1.2e-185) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 122000000000.0) tmp = Float64(fma(Float64(-x_46_re), y_46_im, Float64(y_46_re * x_46_im)) / Float64(y_46_re * y_46_re)); elseif (y_46_im <= 7e+110) 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[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -8.8e+77], t$95$0, If[LessEqual[y$46$im, -1.9e+34], 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$im, -1.2e-185], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 122000000000.0], N[(N[((-x$46$re) * y$46$im + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7e+110], 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.re}{y.im}\\
\mathbf{if}\;y.im \leq -8.8 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-185}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 122000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x.re, y.im, y.re \cdot x.im\right)}{y.re \cdot y.re}\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{+110}:\\
\;\;\;\;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.im < -8.8000000000000002e77 or 6.9999999999999998e110 < y.im Initial program 38.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -8.8000000000000002e77 < y.im < -1.9000000000000001e34Initial program 99.6%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6478.7
Applied rewrites78.7%
if -1.9000000000000001e34 < y.im < -1.2000000000000001e-185Initial program 71.4%
Taylor expanded in y.re around inf
lower-/.f6472.2
Applied rewrites72.2%
if -1.2000000000000001e-185 < y.im < 1.22e11Initial program 79.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6479.8
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6479.8
Applied rewrites79.8%
Taylor expanded in y.re around inf
pow2N/A
lift-*.f6469.3
Applied rewrites69.3%
if 1.22e11 < y.im < 6.9999999999999998e110Initial program 65.7%
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-*.f6457.6
Applied rewrites57.6%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)) (t_1 (- (* x.im y.re) (* x.re y.im))))
(if (<= y.im -8.8e+77)
t_0
(if (<= y.im -1.9e+34)
(/ t_1 (* y.im y.im))
(if (<= y.im -1.2e-185)
(/ x.im y.re)
(if (<= y.im 122000000000.0)
(/ t_1 (* y.re y.re))
(if (<= y.im 7e+110)
(* 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_re / y_46_im;
double t_1 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
double tmp;
if (y_46_im <= -8.8e+77) {
tmp = t_0;
} else if (y_46_im <= -1.9e+34) {
tmp = t_1 / (y_46_im * y_46_im);
} else if (y_46_im <= -1.2e-185) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 122000000000.0) {
tmp = t_1 / (y_46_re * y_46_re);
} else if (y_46_im <= 7e+110) {
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_re) / y_46_im) t_1 = Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) tmp = 0.0 if (y_46_im <= -8.8e+77) tmp = t_0; elseif (y_46_im <= -1.9e+34) tmp = Float64(t_1 / Float64(y_46_im * y_46_im)); elseif (y_46_im <= -1.2e-185) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 122000000000.0) tmp = Float64(t_1 / Float64(y_46_re * y_46_re)); elseif (y_46_im <= 7e+110) 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[((-x$46$re) / y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.8e+77], t$95$0, If[LessEqual[y$46$im, -1.9e+34], N[(t$95$1 / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.2e-185], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 122000000000.0], N[(t$95$1 / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7e+110], 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.re}{y.im}\\
t_1 := x.im \cdot y.re - x.re \cdot y.im\\
\mathbf{if}\;y.im \leq -8.8 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{t\_1}{y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-185}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 122000000000:\\
\;\;\;\;\frac{t\_1}{y.re \cdot y.re}\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{+110}:\\
\;\;\;\;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.im < -8.8000000000000002e77 or 6.9999999999999998e110 < y.im Initial program 38.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -8.8000000000000002e77 < y.im < -1.9000000000000001e34Initial program 99.6%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6478.7
Applied rewrites78.7%
if -1.9000000000000001e34 < y.im < -1.2000000000000001e-185Initial program 71.4%
Taylor expanded in y.re around inf
lower-/.f6472.2
Applied rewrites72.2%
if -1.2000000000000001e-185 < y.im < 1.22e11Initial program 79.8%
Taylor expanded in y.re around inf
pow2N/A
lift-*.f6469.3
Applied rewrites69.3%
if 1.22e11 < y.im < 6.9999999999999998e110Initial program 65.7%
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-*.f6457.6
Applied rewrites57.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im))
(t_1 (/ (- (* x.im y.re) (* x.re y.im)) (* y.im y.im))))
(if (<= y.im -8.8e+77)
t_0
(if (<= y.im -1.9e+34)
t_1
(if (<= y.im 5.8e-77)
(/ x.im y.re)
(if (<= y.im 9.2e-24)
t_1
(if (<= y.im 7e+110)
(* 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_re / y_46_im;
double t_1 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -8.8e+77) {
tmp = t_0;
} else if (y_46_im <= -1.9e+34) {
tmp = t_1;
} else if (y_46_im <= 5.8e-77) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 9.2e-24) {
tmp = t_1;
} else if (y_46_im <= 7e+110) {
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_re) / y_46_im) t_1 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -8.8e+77) tmp = t_0; elseif (y_46_im <= -1.9e+34) tmp = t_1; elseif (y_46_im <= 5.8e-77) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 9.2e-24) tmp = t_1; elseif (y_46_im <= 7e+110) 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[((-x$46$re) / y$46$im), $MachinePrecision]}, Block[{t$95$1 = 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$im, -8.8e+77], t$95$0, If[LessEqual[y$46$im, -1.9e+34], t$95$1, If[LessEqual[y$46$im, 5.8e-77], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 9.2e-24], t$95$1, If[LessEqual[y$46$im, 7e+110], 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.re}{y.im}\\
t_1 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -8.8 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{+110}:\\
\;\;\;\;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.im < -8.8000000000000002e77 or 6.9999999999999998e110 < y.im Initial program 38.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -8.8000000000000002e77 < y.im < -1.9000000000000001e34 or 5.7999999999999997e-77 < y.im < 9.2000000000000004e-24Initial program 99.3%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6473.6
Applied rewrites73.6%
if -1.9000000000000001e34 < y.im < 5.7999999999999997e-77Initial program 74.4%
Taylor expanded in y.re around inf
lower-/.f6470.0
Applied rewrites70.0%
if 9.2000000000000004e-24 < y.im < 6.9999999999999998e110Initial program 71.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-*.f6458.1
Applied rewrites58.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma x.im (/ y.re y.im) (- x.re)) y.im)))
(if (<= y.im -4.6e+35)
t_0
(if (<= y.im 2e-88)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.6e+86)
(/ (fma (- x.re) y.im (* y.re x.im)) (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 = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -4.6e+35) {
tmp = t_0;
} else if (y_46_im <= 2e-88) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.6e+86) {
tmp = fma(-x_46_re, y_46_im, (y_46_re * x_46_im)) / 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(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im) tmp = 0.0 if (y_46_im <= -4.6e+35) tmp = t_0; elseif (y_46_im <= 2e-88) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.6e+86) tmp = Float64(fma(Float64(-x_46_re), y_46_im, Float64(y_46_re * x_46_im)) / 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[(y$46$re / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -4.6e+35], t$95$0, If[LessEqual[y$46$im, 2e-88], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.6e+86], N[(N[((-x$46$re) * y$46$im + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{-88}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+86}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x.re, y.im, y.re \cdot x.im\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -4.5999999999999996e35 or 1.6e86 < y.im Initial program 44.1%
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.f6484.8
Applied rewrites84.8%
if -4.5999999999999996e35 < y.im < 1.99999999999999987e-88Initial program 74.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-*.f6486.7
Applied rewrites86.7%
if 1.99999999999999987e-88 < y.im < 1.6e86Initial program 87.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6487.9
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6487.9
Applied rewrites87.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma y.im y.im (* y.re y.re))) (t_1 (/ (- x.re) y.im)))
(if (<= y.im -1.4e+35)
t_1
(if (<= y.im 5.2e-86)
(/ x.im y.re)
(if (<= y.im 1.3e-16)
(* (- x.re) (/ y.im t_0))
(if (<= y.im 7e+110) (* x.im (/ y.re 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 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = -x_46_re / y_46_im;
double tmp;
if (y_46_im <= -1.4e+35) {
tmp = t_1;
} else if (y_46_im <= 5.2e-86) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1.3e-16) {
tmp = -x_46_re * (y_46_im / t_0);
} else if (y_46_im <= 7e+110) {
tmp = x_46_im * (y_46_re / t_0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_1 = Float64(Float64(-x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -1.4e+35) tmp = t_1; elseif (y_46_im <= 5.2e-86) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 1.3e-16) tmp = Float64(Float64(-x_46_re) * Float64(y_46_im / t_0)); elseif (y_46_im <= 7e+110) tmp = Float64(x_46_im * Float64(y_46_re / t_0)); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.4e+35], t$95$1, If[LessEqual[y$46$im, 5.2e-86], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.3e-16], N[((-x$46$re) * N[(y$46$im / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7e+110], N[(x$46$im * N[(y$46$re / t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{-86}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{-16}:\\
\;\;\;\;\left(-x.re\right) \cdot \frac{y.im}{t\_0}\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{+110}:\\
\;\;\;\;x.im \cdot \frac{y.re}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.39999999999999999e35 or 6.9999999999999998e110 < y.im Initial program 44.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6476.3
Applied rewrites76.3%
if -1.39999999999999999e35 < y.im < 5.2000000000000002e-86Initial program 74.2%
Taylor expanded in y.re around inf
lower-/.f6469.7
Applied rewrites69.7%
if 5.2000000000000002e-86 < y.im < 1.2999999999999999e-16Initial program 99.2%
Taylor expanded in x.re around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r/N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites92.4%
Taylor expanded in x.re around inf
lower-/.f64N/A
pow2N/A
pow2N/A
lift-*.f64N/A
lift-fma.f6471.9
Applied rewrites71.9%
if 1.2999999999999999e-16 < y.im < 6.9999999999999998e110Initial program 71.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-*.f6458.1
Applied rewrites58.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<= y.im -8.8e+77)
t_0
(if (<= y.im -4.6e+35)
(/ (- (* x.im y.re) (* x.re y.im)) (* y.im y.im))
(if (<= y.im 8.2e+110) (/ (- x.im (/ (* y.im x.re) 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_re / y_46_im;
double tmp;
if (y_46_im <= -8.8e+77) {
tmp = t_0;
} else if (y_46_im <= -4.6e+35) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else if (y_46_im <= 8.2e+110) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / 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 <= (-8.8d+77)) then
tmp = t_0
else if (y_46im <= (-4.6d+35)) then
tmp = ((x_46im * y_46re) - (x_46re * y_46im)) / (y_46im * y_46im)
else if (y_46im <= 8.2d+110) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / 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 <= -8.8e+77) {
tmp = t_0;
} else if (y_46_im <= -4.6e+35) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else if (y_46_im <= 8.2e+110) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / 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 <= -8.8e+77: tmp = t_0 elif y_46_im <= -4.6e+35: tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im) elif y_46_im <= 8.2e+110: tmp = (x_46_im - ((y_46_im * x_46_re) / 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_re) / y_46_im) tmp = 0.0 if (y_46_im <= -8.8e+77) tmp = t_0; elseif (y_46_im <= -4.6e+35) 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_im <= 8.2e+110) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / 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 <= -8.8e+77) tmp = t_0; elseif (y_46_im <= -4.6e+35) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / (y_46_im * y_46_im); elseif (y_46_im <= 8.2e+110) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / 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, -8.8e+77], t$95$0, If[LessEqual[y$46$im, -4.6e+35], 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$im, 8.2e+110], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / 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 -8.8 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -4.6 \cdot 10^{+35}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 8.2 \cdot 10^{+110}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -8.8000000000000002e77 or 8.1999999999999997e110 < y.im Initial program 38.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6481.7
Applied rewrites81.7%
if -8.8000000000000002e77 < y.im < -4.5999999999999996e35Initial program 99.5%
Taylor expanded in y.re around 0
pow2N/A
lift-*.f6487.6
Applied rewrites87.6%
if -4.5999999999999996e35 < y.im < 8.1999999999999997e110Initial program 76.0%
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-*.f6480.5
Applied rewrites80.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.6e+35) (not (<= y.im 1.16e+69))) (/ (fma x.im (/ y.re y.im) (- x.re)) y.im) (/ (- x.im (/ (* y.im x.re) y.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_im <= -4.6e+35) || !(y_46_im <= 1.16e+69)) {
tmp = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
} else {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_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_im <= -4.6e+35) || !(y_46_im <= 1.16e+69)) tmp = Float64(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -4.6e+35], N[Not[LessEqual[y$46$im, 1.16e+69]], $MachinePrecision]], N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+35} \lor \neg \left(y.im \leq 1.16 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -4.5999999999999996e35 or 1.16000000000000005e69 < y.im Initial program 44.8%
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.f6484.3
Applied rewrites84.3%
if -4.5999999999999996e35 < y.im < 1.16000000000000005e69Initial program 77.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-*.f6483.1
Applied rewrites83.1%
Final simplification83.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.25e+126) (not (<= y.im 1.2e+111))) (/ (- x.re) y.im) (/ (- x.im (* x.re (/ y.im y.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_im <= -2.25e+126) || !(y_46_im <= 1.2e+111)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
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) :: tmp
if ((y_46im <= (-2.25d+126)) .or. (.not. (y_46im <= 1.2d+111))) then
tmp = -x_46re / y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_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_im <= -2.25e+126) || !(y_46_im <= 1.2e+111)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_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_im <= -2.25e+126) or not (y_46_im <= 1.2e+111): tmp = -x_46_re / y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_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_im <= -2.25e+126) || !(y_46_im <= 1.2e+111)) tmp = Float64(Float64(-x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_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_im <= -2.25e+126) || ~((y_46_im <= 1.2e+111))) tmp = -x_46_re / y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.25e+126], N[Not[LessEqual[y$46$im, 1.2e+111]], $MachinePrecision]], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.25 \cdot 10^{+126} \lor \neg \left(y.im \leq 1.2 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.24999999999999987e126 or 1.20000000000000003e111 < y.im Initial program 37.2%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6489.2
Applied rewrites89.2%
if -2.24999999999999987e126 < y.im < 1.20000000000000003e111Initial program 74.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-*.f6474.6
Applied rewrites74.6%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6475.4
Applied rewrites75.4%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.4e+35) (not (<= y.im 7e+110))) (/ (- x.re) y.im) (/ x.im 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_im <= -1.4e+35) || !(y_46_im <= 7e+110)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
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) :: tmp
if ((y_46im <= (-1.4d+35)) .or. (.not. (y_46im <= 7d+110))) then
tmp = -x_46re / y_46im
else
tmp = x_46im / 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_im <= -1.4e+35) || !(y_46_im <= 7e+110)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.4e+35) or not (y_46_im <= 7e+110): tmp = -x_46_re / y_46_im else: tmp = x_46_im / 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_im <= -1.4e+35) || !(y_46_im <= 7e+110)) tmp = Float64(Float64(-x_46_re) / y_46_im); else tmp = Float64(x_46_im / 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_im <= -1.4e+35) || ~((y_46_im <= 7e+110))) tmp = -x_46_re / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.4e+35], N[Not[LessEqual[y$46$im, 7e+110]], $MachinePrecision]], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{+35} \lor \neg \left(y.im \leq 7 \cdot 10^{+110}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.39999999999999999e35 or 6.9999999999999998e110 < y.im Initial program 44.1%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6476.3
Applied rewrites76.3%
if -1.39999999999999999e35 < y.im < 6.9999999999999998e110Initial program 75.8%
Taylor expanded in y.re around inf
lower-/.f6462.2
Applied rewrites62.2%
Final simplification67.3%
(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 64.3%
Taylor expanded in y.re around inf
lower-/.f6443.7
Applied rewrites43.7%
herbie shell --seed 2025040
(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))))