
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
(FPCore (x y) :precision binary64 (/ (/ (* y (/ x (+ y x))) (- (+ y x) -1.0)) (+ y x)))
double code(double x, double y) {
return ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x);
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y * (x / (y + x))) / ((y + x) - (-1.0d0))) / (y + x)
end function
public static double code(double x, double y) {
return ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x);
}
def code(x, y): return ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x)
function code(x, y) return Float64(Float64(Float64(y * Float64(x / Float64(y + x))) / Float64(Float64(y + x) - -1.0)) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x); end
code[x_, y_] := N[(N[(N[(y * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{y + x}
Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
(FPCore (x y) :precision binary64 (/ (* (/ y (- (+ y x) -1.0)) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x);
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / ((y + x) - (-1.0d0))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x);
}
def code(x, y): return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(Float64(y + x) - -1.0)) * Float64(x / Float64(y + x))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\frac{\frac{y}{\left(y + x\right) - -1} \cdot \frac{x}{y + x}}{y + x}
Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))))
(if (<= (fmax x y) 1.25e+166)
(* (/ (fmax x y) (* (- t_0 -1.0) t_0)) (/ (fmin x y) t_0))
(*
(/
(/ (fmin x y) (+ (fmin x y) (fmax x y)))
(- (- -1.0 (fmin x y)) (fmax x y)))
(- (/ (fmin x y) (fmax x y)) 1.0)))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 1.25e+166) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0);
} else {
tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / ((-1.0 - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
if (fmax(x, y) <= 1.25d+166) then
tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * (fmin(x, y) / t_0)
else
tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / (((-1.0d0) - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 1.25e+166) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0);
} else {
tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / ((-1.0 - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.0);
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) tmp = 0 if fmax(x, y) <= 1.25e+166: tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0) else: tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / ((-1.0 - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.0) return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) tmp = 0.0 if (fmax(x, y) <= 1.25e+166) tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * Float64(fmin(x, y) / t_0)); else tmp = Float64(Float64(Float64(fmin(x, y) / Float64(fmin(x, y) + fmax(x, y))) / Float64(Float64(-1.0 - fmin(x, y)) - fmax(x, y))) * Float64(Float64(fmin(x, y) / fmax(x, y)) - 1.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); tmp = 0.0; if (max(x, y) <= 1.25e+166) tmp = (max(x, y) / ((t_0 - -1.0) * t_0)) * (min(x, y) / t_0); else tmp = ((min(x, y) / (min(x, y) + max(x, y))) / ((-1.0 - min(x, y)) - max(x, y))) * ((min(x, y) / max(x, y)) - 1.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.25e+166], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 - N[Min[x, y], $MachinePrecision]), $MachinePrecision] - N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.25 \cdot 10^{+166}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)}}{\left(-1 - \mathsf{min}\left(x, y\right)\right) - \mathsf{max}\left(x, y\right)} \cdot \left(\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)} - 1\right)\\
\end{array}
if y < 1.25e166Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.9%
if 1.25e166 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
lower-unsound-+.f64N/A
lower-unsound-/.f64N/A
lower--.f6499.8%
Applied rewrites99.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f6450.7%
Applied rewrites50.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmin x y) (fmax x y)))
(t_1 (+ (fmax x y) (fmin x y)))
(t_2 (- (fmax x y) -1.0)))
(if (<= (fmin x y) -1.4e+159)
(* (/ 1.0 (+ t_2 (fmin x y))) (/ (fmax x y) t_0))
(if (<= (fmin x y) -9.8e-11)
(* (/ (fmax x y) (* (- t_1 -1.0) t_1)) 1.0)
(if (<= (fmin x y) 4.7e+52)
(/ (* (/ (fmin x y) t_0) (fmax x y)) (* t_2 t_0))
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_1))))))double code(double x, double y) {
double t_0 = fmin(x, y) + fmax(x, y);
double t_1 = fmax(x, y) + fmin(x, y);
double t_2 = fmax(x, y) - -1.0;
double tmp;
if (fmin(x, y) <= -1.4e+159) {
tmp = (1.0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0);
} else if (fmin(x, y) <= -9.8e-11) {
tmp = (fmax(x, y) / ((t_1 - -1.0) * t_1)) * 1.0;
} else if (fmin(x, y) <= 4.7e+52) {
tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * t_0);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = fmin(x, y) + fmax(x, y)
t_1 = fmax(x, y) + fmin(x, y)
t_2 = fmax(x, y) - (-1.0d0)
if (fmin(x, y) <= (-1.4d+159)) then
tmp = (1.0d0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0)
else if (fmin(x, y) <= (-9.8d-11)) then
tmp = (fmax(x, y) / ((t_1 - (-1.0d0)) * t_1)) * 1.0d0
else if (fmin(x, y) <= 4.7d+52) then
tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * t_0)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmin(x, y) + fmax(x, y);
double t_1 = fmax(x, y) + fmin(x, y);
double t_2 = fmax(x, y) - -1.0;
double tmp;
if (fmin(x, y) <= -1.4e+159) {
tmp = (1.0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0);
} else if (fmin(x, y) <= -9.8e-11) {
tmp = (fmax(x, y) / ((t_1 - -1.0) * t_1)) * 1.0;
} else if (fmin(x, y) <= 4.7e+52) {
tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * t_0);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1;
}
return tmp;
}
def code(x, y): t_0 = fmin(x, y) + fmax(x, y) t_1 = fmax(x, y) + fmin(x, y) t_2 = fmax(x, y) - -1.0 tmp = 0 if fmin(x, y) <= -1.4e+159: tmp = (1.0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0) elif fmin(x, y) <= -9.8e-11: tmp = (fmax(x, y) / ((t_1 - -1.0) * t_1)) * 1.0 elif fmin(x, y) <= 4.7e+52: tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * t_0) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1 return tmp
function code(x, y) t_0 = Float64(fmin(x, y) + fmax(x, y)) t_1 = Float64(fmax(x, y) + fmin(x, y)) t_2 = Float64(fmax(x, y) - -1.0) tmp = 0.0 if (fmin(x, y) <= -1.4e+159) tmp = Float64(Float64(1.0 / Float64(t_2 + fmin(x, y))) * Float64(fmax(x, y) / t_0)); elseif (fmin(x, y) <= -9.8e-11) tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_1 - -1.0) * t_1)) * 1.0); elseif (fmin(x, y) <= 4.7e+52) tmp = Float64(Float64(Float64(fmin(x, y) / t_0) * fmax(x, y)) / Float64(t_2 * t_0)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = min(x, y) + max(x, y); t_1 = max(x, y) + min(x, y); t_2 = max(x, y) - -1.0; tmp = 0.0; if (min(x, y) <= -1.4e+159) tmp = (1.0 / (t_2 + min(x, y))) * (max(x, y) / t_0); elseif (min(x, y) <= -9.8e-11) tmp = (max(x, y) / ((t_1 - -1.0) * t_1)) * 1.0; elseif (min(x, y) <= 4.7e+52) tmp = ((min(x, y) / t_0) * max(x, y)) / (t_2 * t_0); else tmp = (min(x, y) / (1.0 + max(x, y))) / t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -1.4e+159], N[(N[(1.0 / N[(t$95$2 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], -9.8e-11], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$1 - -1.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], 4.7e+52], N[(N[(N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
t_1 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
t_2 := \mathsf{max}\left(x, y\right) - -1\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.4 \cdot 10^{+159}:\\
\;\;\;\;\frac{1}{t\_2 + \mathsf{min}\left(x, y\right)} \cdot \frac{\mathsf{max}\left(x, y\right)}{t\_0}\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -9.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_1 - -1\right) \cdot t\_1} \cdot 1\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq 4.7 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{t\_0} \cdot \mathsf{max}\left(x, y\right)}{t\_2 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_1}\\
\end{array}
if x < -1.4000000000000001e159Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites51.5%
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites51.5%
if -1.4000000000000001e159 < x < -9.7999999999999998e-11Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.9%
Taylor expanded in x around inf
Applied rewrites66.4%
if -9.7999999999999998e-11 < x < 4.7e52Initial program 69.3%
Taylor expanded in x around 0
lower-+.f6459.4%
Applied rewrites59.4%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
associate-*l*N/A
+-commutativeN/A
lift-+.f64N/A
associate-/r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites76.8%
if 4.7e52 < x Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))) (t_1 (- t_0 -1.0)))
(if (<= (fmax x y) 1.25e+166)
(* (/ (fmax x y) (* t_1 t_0)) (/ (fmin x y) t_0))
(/ (* (/ (fmax x y) t_1) (/ (fmin x y) (fmax x y))) t_0))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = t_0 - -1.0;
double tmp;
if (fmax(x, y) <= 1.25e+166) {
tmp = (fmax(x, y) / (t_1 * t_0)) * (fmin(x, y) / t_0);
} else {
tmp = ((fmax(x, y) / t_1) * (fmin(x, y) / fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
t_1 = t_0 - (-1.0d0)
if (fmax(x, y) <= 1.25d+166) then
tmp = (fmax(x, y) / (t_1 * t_0)) * (fmin(x, y) / t_0)
else
tmp = ((fmax(x, y) / t_1) * (fmin(x, y) / fmax(x, y))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = t_0 - -1.0;
double tmp;
if (fmax(x, y) <= 1.25e+166) {
tmp = (fmax(x, y) / (t_1 * t_0)) * (fmin(x, y) / t_0);
} else {
tmp = ((fmax(x, y) / t_1) * (fmin(x, y) / fmax(x, y))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) t_1 = t_0 - -1.0 tmp = 0 if fmax(x, y) <= 1.25e+166: tmp = (fmax(x, y) / (t_1 * t_0)) * (fmin(x, y) / t_0) else: tmp = ((fmax(x, y) / t_1) * (fmin(x, y) / fmax(x, y))) / t_0 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) t_1 = Float64(t_0 - -1.0) tmp = 0.0 if (fmax(x, y) <= 1.25e+166) tmp = Float64(Float64(fmax(x, y) / Float64(t_1 * t_0)) * Float64(fmin(x, y) / t_0)); else tmp = Float64(Float64(Float64(fmax(x, y) / t_1) * Float64(fmin(x, y) / fmax(x, y))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); t_1 = t_0 - -1.0; tmp = 0.0; if (max(x, y) <= 1.25e+166) tmp = (max(x, y) / (t_1 * t_0)) * (min(x, y) / t_0); else tmp = ((max(x, y) / t_1) * (min(x, y) / max(x, y))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - -1.0), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.25e+166], N[(N[(N[Max[x, y], $MachinePrecision] / N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Max[x, y], $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
t_1 := t\_0 - -1\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.25 \cdot 10^{+166}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_1 \cdot t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{t\_1} \cdot \frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{t\_0}\\
\end{array}
if y < 1.25e166Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.9%
if 1.25e166 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))))
(if (<= (fmax x y) 1.25e+166)
(* (/ (fmax x y) (* (- t_0 -1.0) t_0)) (/ (fmin x y) t_0))
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 1.25e+166) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
if (fmax(x, y) <= 1.25d+166) then
tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * (fmin(x, y) / t_0)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 1.25e+166) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) tmp = 0 if fmax(x, y) <= 1.25e+166: tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) tmp = 0.0 if (fmax(x, y) <= 1.25e+166) tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * Float64(fmin(x, y) / t_0)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); tmp = 0.0; if (max(x, y) <= 1.25e+166) tmp = (max(x, y) / ((t_0 - -1.0) * t_0)) * (min(x, y) / t_0); else tmp = (min(x, y) / (1.0 + max(x, y))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.25e+166], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.25 \cdot 10^{+166}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
\end{array}
if y < 1.25e166Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.9%
if 1.25e166 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))))
(if (<= (fmax x y) 2e-20)
(/ (* (/ (fmin x y) t_0) (fmax x y)) (* (- (fmin x y) -1.0) t_0))
(if (<= (fmax x y) 4.2e+107)
(* (/ (fmax x y) (* (- t_0 -1.0) (* t_0 t_0))) (fmin x y))
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0)))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 2e-20) {
tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - -1.0) * t_0);
} else if (fmax(x, y) <= 4.2e+107) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmin(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
if (fmax(x, y) <= 2d-20) then
tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - (-1.0d0)) * t_0)
else if (fmax(x, y) <= 4.2d+107) then
tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * (t_0 * t_0))) * fmin(x, y)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 2e-20) {
tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - -1.0) * t_0);
} else if (fmax(x, y) <= 4.2e+107) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmin(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) tmp = 0 if fmax(x, y) <= 2e-20: tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - -1.0) * t_0) elif fmax(x, y) <= 4.2e+107: tmp = (fmax(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmin(x, y) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) tmp = 0.0 if (fmax(x, y) <= 2e-20) tmp = Float64(Float64(Float64(fmin(x, y) / t_0) * fmax(x, y)) / Float64(Float64(fmin(x, y) - -1.0) * t_0)); elseif (fmax(x, y) <= 4.2e+107) tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * Float64(t_0 * t_0))) * fmin(x, y)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); tmp = 0.0; if (max(x, y) <= 2e-20) tmp = ((min(x, y) / t_0) * max(x, y)) / ((min(x, y) - -1.0) * t_0); elseif (max(x, y) <= 4.2e+107) tmp = (max(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * min(x, y); else tmp = (min(x, y) / (1.0 + max(x, y))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 2e-20], N[(N[(N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Min[x, y], $MachinePrecision] - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4.2e+107], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 2 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{t\_0} \cdot \mathsf{max}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot t\_0}\\
\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.2 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{min}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
\end{array}
if y < 1.9999999999999999e-20Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-+.f6475.5%
Applied rewrites75.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6476.4%
Applied rewrites76.4%
if 1.9999999999999999e-20 < y < 4.1999999999999999e107Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.6%
if 4.1999999999999999e107 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmin x y) (fmax x y))))
(if (<= (fmax x y) 1.18e+86)
(* (fmax x y) (/ (/ (fmin x y) (* (- t_0 -1.0) t_0)) t_0))
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) (+ (fmax x y) (fmin x y))))))double code(double x, double y) {
double t_0 = fmin(x, y) + fmax(x, y);
double tmp;
if (fmax(x, y) <= 1.18e+86) {
tmp = fmax(x, y) * ((fmin(x, y) / ((t_0 - -1.0) * t_0)) / t_0);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = fmin(x, y) + fmax(x, y)
if (fmax(x, y) <= 1.18d+86) then
tmp = fmax(x, y) * ((fmin(x, y) / ((t_0 - (-1.0d0)) * t_0)) / t_0)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmin(x, y) + fmax(x, y);
double tmp;
if (fmax(x, y) <= 1.18e+86) {
tmp = fmax(x, y) * ((fmin(x, y) / ((t_0 - -1.0) * t_0)) / t_0);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y));
}
return tmp;
}
def code(x, y): t_0 = fmin(x, y) + fmax(x, y) tmp = 0 if fmax(x, y) <= 1.18e+86: tmp = fmax(x, y) * ((fmin(x, y) / ((t_0 - -1.0) * t_0)) / t_0) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y)) return tmp
function code(x, y) t_0 = Float64(fmin(x, y) + fmax(x, y)) tmp = 0.0 if (fmax(x, y) <= 1.18e+86) tmp = Float64(fmax(x, y) * Float64(Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) / t_0)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / Float64(fmax(x, y) + fmin(x, y))); end return tmp end
function tmp_2 = code(x, y) t_0 = min(x, y) + max(x, y); tmp = 0.0; if (max(x, y) <= 1.18e+86) tmp = max(x, y) * ((min(x, y) / ((t_0 - -1.0) * t_0)) / t_0); else tmp = (min(x, y) / (1.0 + max(x, y))) / (max(x, y) + min(x, y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.18e+86], N[(N[Max[x, y], $MachinePrecision] * N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.18 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)}\\
\end{array}
if y < 1.1799999999999999e86Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6491.0%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6491.0%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6491.0%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites91.0%
if 1.1799999999999999e86 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))) (t_1 (- t_0 -1.0)))
(if (<= (fmax x y) 5.2e-179)
(/ (/ (* (fmax x y) 1.0) t_1) t_0)
(if (<= (fmax x y) 4.2e+107)
(* (/ (fmax x y) (* t_1 (* t_0 t_0))) (fmin x y))
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0)))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = t_0 - -1.0;
double tmp;
if (fmax(x, y) <= 5.2e-179) {
tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
} else if (fmax(x, y) <= 4.2e+107) {
tmp = (fmax(x, y) / (t_1 * (t_0 * t_0))) * fmin(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
t_1 = t_0 - (-1.0d0)
if (fmax(x, y) <= 5.2d-179) then
tmp = ((fmax(x, y) * 1.0d0) / t_1) / t_0
else if (fmax(x, y) <= 4.2d+107) then
tmp = (fmax(x, y) / (t_1 * (t_0 * t_0))) * fmin(x, y)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = t_0 - -1.0;
double tmp;
if (fmax(x, y) <= 5.2e-179) {
tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
} else if (fmax(x, y) <= 4.2e+107) {
tmp = (fmax(x, y) / (t_1 * (t_0 * t_0))) * fmin(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) t_1 = t_0 - -1.0 tmp = 0 if fmax(x, y) <= 5.2e-179: tmp = ((fmax(x, y) * 1.0) / t_1) / t_0 elif fmax(x, y) <= 4.2e+107: tmp = (fmax(x, y) / (t_1 * (t_0 * t_0))) * fmin(x, y) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) t_1 = Float64(t_0 - -1.0) tmp = 0.0 if (fmax(x, y) <= 5.2e-179) tmp = Float64(Float64(Float64(fmax(x, y) * 1.0) / t_1) / t_0); elseif (fmax(x, y) <= 4.2e+107) tmp = Float64(Float64(fmax(x, y) / Float64(t_1 * Float64(t_0 * t_0))) * fmin(x, y)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); t_1 = t_0 - -1.0; tmp = 0.0; if (max(x, y) <= 5.2e-179) tmp = ((max(x, y) * 1.0) / t_1) / t_0; elseif (max(x, y) <= 4.2e+107) tmp = (max(x, y) / (t_1 * (t_0 * t_0))) * min(x, y); else tmp = (min(x, y) / (1.0 + max(x, y))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - -1.0), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 5.2e-179], N[(N[(N[(N[Max[x, y], $MachinePrecision] * 1.0), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4.2e+107], N[(N[(N[Max[x, y], $MachinePrecision] / N[(t$95$1 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
t_1 := t\_0 - -1\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 5.2 \cdot 10^{-179}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right) \cdot 1}{t\_1}}{t\_0}\\
\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.2 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_1 \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{min}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
\end{array}
if y < 5.2000000000000001e-179Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites51.5%
if 5.2000000000000001e-179 < y < 4.1999999999999999e107Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.6%
if 4.1999999999999999e107 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))) (t_1 (- t_0 -1.0)))
(if (<= (fmax x y) 1.4e-178)
(/ (/ (* (fmax x y) 1.0) t_1) t_0)
(if (<= (fmax x y) 1.18e+86)
(* (/ (fmin x y) (* t_1 (* t_0 t_0))) (fmax x y))
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0)))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = t_0 - -1.0;
double tmp;
if (fmax(x, y) <= 1.4e-178) {
tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
} else if (fmax(x, y) <= 1.18e+86) {
tmp = (fmin(x, y) / (t_1 * (t_0 * t_0))) * fmax(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
t_1 = t_0 - (-1.0d0)
if (fmax(x, y) <= 1.4d-178) then
tmp = ((fmax(x, y) * 1.0d0) / t_1) / t_0
else if (fmax(x, y) <= 1.18d+86) then
tmp = (fmin(x, y) / (t_1 * (t_0 * t_0))) * fmax(x, y)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = t_0 - -1.0;
double tmp;
if (fmax(x, y) <= 1.4e-178) {
tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
} else if (fmax(x, y) <= 1.18e+86) {
tmp = (fmin(x, y) / (t_1 * (t_0 * t_0))) * fmax(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) t_1 = t_0 - -1.0 tmp = 0 if fmax(x, y) <= 1.4e-178: tmp = ((fmax(x, y) * 1.0) / t_1) / t_0 elif fmax(x, y) <= 1.18e+86: tmp = (fmin(x, y) / (t_1 * (t_0 * t_0))) * fmax(x, y) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) t_1 = Float64(t_0 - -1.0) tmp = 0.0 if (fmax(x, y) <= 1.4e-178) tmp = Float64(Float64(Float64(fmax(x, y) * 1.0) / t_1) / t_0); elseif (fmax(x, y) <= 1.18e+86) tmp = Float64(Float64(fmin(x, y) / Float64(t_1 * Float64(t_0 * t_0))) * fmax(x, y)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); t_1 = t_0 - -1.0; tmp = 0.0; if (max(x, y) <= 1.4e-178) tmp = ((max(x, y) * 1.0) / t_1) / t_0; elseif (max(x, y) <= 1.18e+86) tmp = (min(x, y) / (t_1 * (t_0 * t_0))) * max(x, y); else tmp = (min(x, y) / (1.0 + max(x, y))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - -1.0), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.4e-178], N[(N[(N[(N[Max[x, y], $MachinePrecision] * 1.0), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 1.18e+86], N[(N[(N[Min[x, y], $MachinePrecision] / N[(t$95$1 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
t_1 := t\_0 - -1\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right) \cdot 1}{t\_1}}{t\_0}\\
\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 1.18 \cdot 10^{+86}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{t\_1 \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
\end{array}
if y < 1.4000000000000001e-178Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites51.5%
if 1.4000000000000001e-178 < y < 1.1799999999999999e86Initial program 69.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.5%
if 1.1799999999999999e86 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))) (t_1 (- (fmax x y) -1.0)))
(if (<= (fmin x y) -1.4e+159)
(*
(/ 1.0 (+ t_1 (fmin x y)))
(/ (fmax x y) (+ (fmin x y) (fmax x y))))
(if (<= (fmin x y) -1.85e-215)
(* (/ (fmax x y) (* (- t_0 -1.0) t_0)) 1.0)
(/ (/ (fmin x y) (fmax x y)) t_1)))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = fmax(x, y) - -1.0;
double tmp;
if (fmin(x, y) <= -1.4e+159) {
tmp = (1.0 / (t_1 + fmin(x, y))) * (fmax(x, y) / (fmin(x, y) + fmax(x, y)));
} else if (fmin(x, y) <= -1.85e-215) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
} else {
tmp = (fmin(x, y) / fmax(x, y)) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
t_1 = fmax(x, y) - (-1.0d0)
if (fmin(x, y) <= (-1.4d+159)) then
tmp = (1.0d0 / (t_1 + fmin(x, y))) * (fmax(x, y) / (fmin(x, y) + fmax(x, y)))
else if (fmin(x, y) <= (-1.85d-215)) then
tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * 1.0d0
else
tmp = (fmin(x, y) / fmax(x, y)) / t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double t_1 = fmax(x, y) - -1.0;
double tmp;
if (fmin(x, y) <= -1.4e+159) {
tmp = (1.0 / (t_1 + fmin(x, y))) * (fmax(x, y) / (fmin(x, y) + fmax(x, y)));
} else if (fmin(x, y) <= -1.85e-215) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
} else {
tmp = (fmin(x, y) / fmax(x, y)) / t_1;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) t_1 = fmax(x, y) - -1.0 tmp = 0 if fmin(x, y) <= -1.4e+159: tmp = (1.0 / (t_1 + fmin(x, y))) * (fmax(x, y) / (fmin(x, y) + fmax(x, y))) elif fmin(x, y) <= -1.85e-215: tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0 else: tmp = (fmin(x, y) / fmax(x, y)) / t_1 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) t_1 = Float64(fmax(x, y) - -1.0) tmp = 0.0 if (fmin(x, y) <= -1.4e+159) tmp = Float64(Float64(1.0 / Float64(t_1 + fmin(x, y))) * Float64(fmax(x, y) / Float64(fmin(x, y) + fmax(x, y)))); elseif (fmin(x, y) <= -1.85e-215) tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * 1.0); else tmp = Float64(Float64(fmin(x, y) / fmax(x, y)) / t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); t_1 = max(x, y) - -1.0; tmp = 0.0; if (min(x, y) <= -1.4e+159) tmp = (1.0 / (t_1 + min(x, y))) * (max(x, y) / (min(x, y) + max(x, y))); elseif (min(x, y) <= -1.85e-215) tmp = (max(x, y) / ((t_0 - -1.0) * t_0)) * 1.0; else tmp = (min(x, y) / max(x, y)) / t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -1.4e+159], N[(N[(1.0 / N[(t$95$1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], -1.85e-215], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
t_1 := \mathsf{max}\left(x, y\right) - -1\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.4 \cdot 10^{+159}:\\
\;\;\;\;\frac{1}{t\_1 + \mathsf{min}\left(x, y\right)} \cdot \frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)}\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -1.85 \cdot 10^{-215}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{t\_1}\\
\end{array}
if x < -1.4000000000000001e159Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites51.5%
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites51.5%
if -1.4000000000000001e159 < x < -1.85e-215Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.9%
Taylor expanded in x around inf
Applied rewrites66.4%
if -1.85e-215 < x Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))))
(if (<= (fmin x y) -1.9e+157)
(/ (/ (fmax x y) (fmin x y)) t_0)
(if (<= (fmin x y) -1.85e-215)
(* (/ (fmax x y) (* (- t_0 -1.0) t_0)) 1.0)
(/ (/ (fmin x y) (fmax x y)) (- (fmax x y) -1.0))))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmin(x, y) <= -1.9e+157) {
tmp = (fmax(x, y) / fmin(x, y)) / t_0;
} else if (fmin(x, y) <= -1.85e-215) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
} else {
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
if (fmin(x, y) <= (-1.9d+157)) then
tmp = (fmax(x, y) / fmin(x, y)) / t_0
else if (fmin(x, y) <= (-1.85d-215)) then
tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * 1.0d0
else
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmin(x, y) <= -1.9e+157) {
tmp = (fmax(x, y) / fmin(x, y)) / t_0;
} else if (fmin(x, y) <= -1.85e-215) {
tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
} else {
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0);
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) tmp = 0 if fmin(x, y) <= -1.9e+157: tmp = (fmax(x, y) / fmin(x, y)) / t_0 elif fmin(x, y) <= -1.85e-215: tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0 else: tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0) return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) tmp = 0.0 if (fmin(x, y) <= -1.9e+157) tmp = Float64(Float64(fmax(x, y) / fmin(x, y)) / t_0); elseif (fmin(x, y) <= -1.85e-215) tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * 1.0); else tmp = Float64(Float64(fmin(x, y) / fmax(x, y)) / Float64(fmax(x, y) - -1.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); tmp = 0.0; if (min(x, y) <= -1.9e+157) tmp = (max(x, y) / min(x, y)) / t_0; elseif (min(x, y) <= -1.85e-215) tmp = (max(x, y) / ((t_0 - -1.0) * t_0)) * 1.0; else tmp = (min(x, y) / max(x, y)) / (max(x, y) - -1.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -1.9e+157], N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], -1.85e-215], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.9 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\
\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -1.85 \cdot 10^{-215}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) - -1}\\
\end{array}
if x < -1.9e157Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.3%
Applied rewrites38.3%
if -1.9e157 < x < -1.85e-215Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.9%
Taylor expanded in x around inf
Applied rewrites66.4%
if -1.85e-215 < x Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (fmax x y) (fmin x y))))
(if (<= (fmax x y) 1.7e-49)
(/ (/ (fmax x y) (+ 1.0 (fmin x y))) t_0)
(/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0))))double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / 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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = fmax(x, y) + fmin(x, y)
if (fmax(x, y) <= 1.7d-49) then
tmp = (fmax(x, y) / (1.0d0 + fmin(x, y))) / t_0
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = fmax(x, y) + fmin(x, y);
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = fmax(x, y) + fmin(x, y) tmp = 0 if fmax(x, y) <= 1.7e-49: tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0 else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0 return tmp
function code(x, y) t_0 = Float64(fmax(x, y) + fmin(x, y)) tmp = 0.0 if (fmax(x, y) <= 1.7e-49) tmp = Float64(Float64(fmax(x, y) / Float64(1.0 + fmin(x, y))) / t_0); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = max(x, y) + min(x, y); tmp = 0.0; if (max(x, y) <= 1.7e-49) tmp = (max(x, y) / (1.0 + min(x, y))) / t_0; else tmp = (min(x, y) / (1.0 + max(x, y))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.7e-49], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1.0 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
\end{array}
if y < 1.7e-49Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6450.7%
Applied rewrites50.7%
if 1.7e-49 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y) :precision binary64 (if (<= (fmax x y) 1.7e-49) (/ (/ (fmax x y) (- (fmin x y) -1.0)) (fmin x y)) (/ (/ (fmin x y) (+ 1.0 (fmax x y))) (+ (fmax x y) (fmin x y)))))
double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = (fmax(x, y) / (fmin(x, y) - -1.0)) / fmin(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (fmax(x, y) <= 1.7d-49) then
tmp = (fmax(x, y) / (fmin(x, y) - (-1.0d0))) / fmin(x, y)
else
tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = (fmax(x, y) / (fmin(x, y) - -1.0)) / fmin(x, y);
} else {
tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y));
}
return tmp;
}
def code(x, y): tmp = 0 if fmax(x, y) <= 1.7e-49: tmp = (fmax(x, y) / (fmin(x, y) - -1.0)) / fmin(x, y) else: tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / (fmax(x, y) + fmin(x, y)) return tmp
function code(x, y) tmp = 0.0 if (fmax(x, y) <= 1.7e-49) tmp = Float64(Float64(fmax(x, y) / Float64(fmin(x, y) - -1.0)) / fmin(x, y)); else tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / Float64(fmax(x, y) + fmin(x, y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (max(x, y) <= 1.7e-49) tmp = (max(x, y) / (min(x, y) - -1.0)) / min(x, y); else tmp = (min(x, y) / (1.0 + max(x, y))) / (max(x, y) + min(x, y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 1.7e-49], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) - -1}}{\mathsf{min}\left(x, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)}\\
\end{array}
if y < 1.7e-49Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
metadata-evalN/A
associate-/l/N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
if 1.7e-49 < y Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6451.0%
Applied rewrites51.0%
(FPCore (x y) :precision binary64 (if (<= (fmax x y) 1.7e-49) (/ (/ (fmax x y) (- (fmin x y) -1.0)) (fmin x y)) (/ (/ (fmin x y) (fmax x y)) (- (fmax x y) -1.0))))
double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = (fmax(x, y) / (fmin(x, y) - -1.0)) / fmin(x, y);
} else {
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (fmax(x, y) <= 1.7d-49) then
tmp = (fmax(x, y) / (fmin(x, y) - (-1.0d0))) / fmin(x, y)
else
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = (fmax(x, y) / (fmin(x, y) - -1.0)) / fmin(x, y);
} else {
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if fmax(x, y) <= 1.7e-49: tmp = (fmax(x, y) / (fmin(x, y) - -1.0)) / fmin(x, y) else: tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0) return tmp
function code(x, y) tmp = 0.0 if (fmax(x, y) <= 1.7e-49) tmp = Float64(Float64(fmax(x, y) / Float64(fmin(x, y) - -1.0)) / fmin(x, y)); else tmp = Float64(Float64(fmin(x, y) / fmax(x, y)) / Float64(fmax(x, y) - -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (max(x, y) <= 1.7e-49) tmp = (max(x, y) / (min(x, y) - -1.0)) / min(x, y); else tmp = (min(x, y) / max(x, y)) / (max(x, y) - -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 1.7e-49], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) - -1}}{\mathsf{min}\left(x, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) - -1}\\
\end{array}
if y < 1.7e-49Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
metadata-evalN/A
associate-/l/N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
if 1.7e-49 < y Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y) :precision binary64 (if (<= (fmax x y) 1.7e-49) (/ (fmax x y) (* (fmin x y) (+ 1.0 (fmin x y)))) (/ (/ (fmin x y) (fmax x y)) (- (fmax x y) -1.0))))
double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
} else {
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (fmax(x, y) <= 1.7d-49) then
tmp = fmax(x, y) / (fmin(x, y) * (1.0d0 + fmin(x, y)))
else
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
} else {
tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if fmax(x, y) <= 1.7e-49: tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y))) else: tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0) return tmp
function code(x, y) tmp = 0.0 if (fmax(x, y) <= 1.7e-49) tmp = Float64(fmax(x, y) / Float64(fmin(x, y) * Float64(1.0 + fmin(x, y)))); else tmp = Float64(Float64(fmin(x, y) / fmax(x, y)) / Float64(fmax(x, y) - -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (max(x, y) <= 1.7e-49) tmp = max(x, y) / (min(x, y) * (1.0 + min(x, y))); else tmp = (min(x, y) / max(x, y)) / (max(x, y) - -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 1.7e-49], N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] * N[(1.0 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) - -1}\\
\end{array}
if y < 1.7e-49Initial program 69.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
if 1.7e-49 < y Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y) :precision binary64 (if (<= (fmax x y) 1.7e-49) (/ (fmax x y) (* (fmin x y) (+ 1.0 (fmin x y)))) (/ (fmin x y) (+ (* (fmax x y) (fmax x y)) (fmax x y)))))
double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
} else {
tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (fmax(x, y) <= 1.7d-49) then
tmp = fmax(x, y) / (fmin(x, y) * (1.0d0 + fmin(x, y)))
else
tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 1.7e-49) {
tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
} else {
tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y));
}
return tmp;
}
def code(x, y): tmp = 0 if fmax(x, y) <= 1.7e-49: tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y))) else: tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y)) return tmp
function code(x, y) tmp = 0.0 if (fmax(x, y) <= 1.7e-49) tmp = Float64(fmax(x, y) / Float64(fmin(x, y) * Float64(1.0 + fmin(x, y)))); else tmp = Float64(fmin(x, y) / Float64(Float64(fmax(x, y) * fmax(x, y)) + fmax(x, y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (max(x, y) <= 1.7e-49) tmp = max(x, y) / (min(x, y) * (1.0 + min(x, y))); else tmp = min(x, y) / ((max(x, y) * max(x, y)) + max(x, y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 1.7e-49], N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] * N[(1.0 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] / N[(N[(N[Max[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.7 \cdot 10^{-49}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) + \mathsf{max}\left(x, y\right)}\\
\end{array}
if y < 1.7e-49Initial program 69.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
if 1.7e-49 < y Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-*.f32N/A
lower-unsound-*.f32N/A
lower-+.f64N/A
lower-unsound-*.f6449.1%
Applied rewrites49.1%
(FPCore (x y) :precision binary64 (if (<= (fmax x y) 7.5e-115) (/ (fmax x y) (fmin x y)) (/ (fmin x y) (+ (* (fmax x y) (fmax x y)) (fmax x y)))))
double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 7.5e-115) {
tmp = fmax(x, y) / fmin(x, y);
} else {
tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (fmax(x, y) <= 7.5d-115) then
tmp = fmax(x, y) / fmin(x, y)
else
tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 7.5e-115) {
tmp = fmax(x, y) / fmin(x, y);
} else {
tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y));
}
return tmp;
}
def code(x, y): tmp = 0 if fmax(x, y) <= 7.5e-115: tmp = fmax(x, y) / fmin(x, y) else: tmp = fmin(x, y) / ((fmax(x, y) * fmax(x, y)) + fmax(x, y)) return tmp
function code(x, y) tmp = 0.0 if (fmax(x, y) <= 7.5e-115) tmp = Float64(fmax(x, y) / fmin(x, y)); else tmp = Float64(fmin(x, y) / Float64(Float64(fmax(x, y) * fmax(x, y)) + fmax(x, y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (max(x, y) <= 7.5e-115) tmp = max(x, y) / min(x, y); else tmp = min(x, y) / ((max(x, y) * max(x, y)) + max(x, y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 7.5e-115], N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] / N[(N[(N[Max[x, y], $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 7.5 \cdot 10^{-115}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \mathsf{max}\left(x, y\right) + \mathsf{max}\left(x, y\right)}\\
\end{array}
if y < 7.5000000000000004e-115Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
Taylor expanded in x around 0
lower-/.f6426.6%
Applied rewrites26.6%
if 7.5000000000000004e-115 < y Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-*.f32N/A
lower-unsound-*.f32N/A
lower-+.f64N/A
lower-unsound-*.f6449.1%
Applied rewrites49.1%
(FPCore (x y) :precision binary64 (if (<= (fmax x y) 7.5e-115) (/ (fmax x y) (fmin x y)) (/ (fmin x y) (* (fmax x y) (+ 1.0 (fmax x y))))))
double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 7.5e-115) {
tmp = fmax(x, y) / fmin(x, y);
} else {
tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)));
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (fmax(x, y) <= 7.5d-115) then
tmp = fmax(x, y) / fmin(x, y)
else
tmp = fmin(x, y) / (fmax(x, y) * (1.0d0 + fmax(x, y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (fmax(x, y) <= 7.5e-115) {
tmp = fmax(x, y) / fmin(x, y);
} else {
tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)));
}
return tmp;
}
def code(x, y): tmp = 0 if fmax(x, y) <= 7.5e-115: tmp = fmax(x, y) / fmin(x, y) else: tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y))) return tmp
function code(x, y) tmp = 0.0 if (fmax(x, y) <= 7.5e-115) tmp = Float64(fmax(x, y) / fmin(x, y)); else tmp = Float64(fmin(x, y) / Float64(fmax(x, y) * Float64(1.0 + fmax(x, y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (max(x, y) <= 7.5e-115) tmp = max(x, y) / min(x, y); else tmp = min(x, y) / (max(x, y) * (1.0 + max(x, y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 7.5e-115], N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] * N[(1.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 7.5 \cdot 10^{-115}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \left(1 + \mathsf{max}\left(x, y\right)\right)}\\
\end{array}
if y < 7.5000000000000004e-115Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
Taylor expanded in x around 0
lower-/.f6426.6%
Applied rewrites26.6%
if 7.5000000000000004e-115 < y Initial program 69.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.1%
Applied rewrites49.1%
(FPCore (x y) :precision binary64 (/ (fmax x y) (fmin x y)))
double code(double x, double y) {
return fmax(x, y) / fmin(x, y);
}
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, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = fmax(x, y) / fmin(x, y)
end function
public static double code(double x, double y) {
return fmax(x, y) / fmin(x, y);
}
def code(x, y): return fmax(x, y) / fmin(x, y)
function code(x, y) return Float64(fmax(x, y) / fmin(x, y)) end
function tmp = code(x, y) tmp = max(x, y) / min(x, y); end
code[x_, y_] := N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision]
\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}
Initial program 69.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6449.0%
Applied rewrites49.0%
Taylor expanded in x around 0
lower-/.f6426.6%
Applied rewrites26.6%
herbie shell --seed 2025258
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))