
(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]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Herbie found 18 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]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ (/ y (+ x y)) (- (+ x y) -1.0)) (/ x (+ x y))))
double code(double x, double y) {
return ((y / (x + y)) / ((x + y) - -1.0)) * (x / (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 = ((y / (x + y)) / ((x + y) - (-1.0d0))) * (x / (x + y))
end function
public static double code(double x, double y) {
return ((y / (x + y)) / ((x + y) - -1.0)) * (x / (x + y));
}
def code(x, y): return ((y / (x + y)) / ((x + y) - -1.0)) * (x / (x + y))
function code(x, y) return Float64(Float64(Float64(y / Float64(x + y)) / Float64(Float64(x + y) - -1.0)) * Float64(x / Float64(x + y))) end
function tmp = code(x, y) tmp = ((y / (x + y)) / ((x + y) - -1.0)) * (x / (x + y)); end
code[x_, y_] := N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x + y}}{\left(x + y\right) - -1} \cdot \frac{x}{x + y}
\end{array}
Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
(FPCore (x y) :precision binary64 (* (/ (/ y (- x (- -1.0 y))) (+ x y)) (/ x (+ x y))))
double code(double x, double y) {
return ((y / (x - (-1.0 - y))) / (x + y)) * (x / (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 = ((y / (x - ((-1.0d0) - y))) / (x + y)) * (x / (x + y))
end function
public static double code(double x, double y) {
return ((y / (x - (-1.0 - y))) / (x + y)) * (x / (x + y));
}
def code(x, y): return ((y / (x - (-1.0 - y))) / (x + y)) * (x / (x + y))
function code(x, y) return Float64(Float64(Float64(y / Float64(x - Float64(-1.0 - y))) / Float64(x + y)) * Float64(x / Float64(x + y))) end
function tmp = code(x, y) tmp = ((y / (x - (-1.0 - y))) / (x + y)) * (x / (x + y)); end
code[x_, y_] := N[(N[(N[(y / N[(x - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{x - \left(-1 - y\right)}}{x + y} \cdot \frac{x}{x + y}
\end{array}
Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
lift-+.f64N/A
lower-/.f64N/A
Applied rewrites99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= x -4.6e+172)
(* (/ (/ y x) (+ x y)) t_0)
(if (<= x 1.7e+25)
(/ (* (/ y (+ x y)) x) (* (- x (- -1.0 y)) (+ x y)))
(* (/ 1.0 (- (+ x y) -1.0)) t_0)))))
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -4.6e+172) {
tmp = ((y / x) / (x + y)) * t_0;
} else if (x <= 1.7e+25) {
tmp = ((y / (x + y)) * x) / ((x - (-1.0 - y)) * (x + y));
} else {
tmp = (1.0 / ((x + y) - -1.0)) * 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 = x / (x + y)
if (x <= (-4.6d+172)) then
tmp = ((y / x) / (x + y)) * t_0
else if (x <= 1.7d+25) then
tmp = ((y / (x + y)) * x) / ((x - ((-1.0d0) - y)) * (x + y))
else
tmp = (1.0d0 / ((x + y) - (-1.0d0))) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (x <= -4.6e+172) {
tmp = ((y / x) / (x + y)) * t_0;
} else if (x <= 1.7e+25) {
tmp = ((y / (x + y)) * x) / ((x - (-1.0 - y)) * (x + y));
} else {
tmp = (1.0 / ((x + y) - -1.0)) * t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (x + y) tmp = 0 if x <= -4.6e+172: tmp = ((y / x) / (x + y)) * t_0 elif x <= 1.7e+25: tmp = ((y / (x + y)) * x) / ((x - (-1.0 - y)) * (x + y)) else: tmp = (1.0 / ((x + y) - -1.0)) * t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (x <= -4.6e+172) tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * t_0); elseif (x <= 1.7e+25) tmp = Float64(Float64(Float64(y / Float64(x + y)) * x) / Float64(Float64(x - Float64(-1.0 - y)) * Float64(x + y))); else tmp = Float64(Float64(1.0 / Float64(Float64(x + y) - -1.0)) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (x + y); tmp = 0.0; if (x <= -4.6e+172) tmp = ((y / x) / (x + y)) * t_0; elseif (x <= 1.7e+25) tmp = ((y / (x + y)) * x) / ((x - (-1.0 - y)) * (x + y)); else tmp = (1.0 / ((x + y) - -1.0)) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.6e+172], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, 1.7e+25], N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(N[(x - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(x + y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -4.6 \cdot 10^{+172}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+25}:\\
\;\;\;\;\frac{\frac{y}{x + y} \cdot x}{\left(x - \left(-1 - y\right)\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(x + y\right) - -1} \cdot t\_0\\
\end{array}
\end{array}
if x < -4.6000000000000002e172Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
lift-+.f64N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6437.9
Applied rewrites37.9%
if -4.6000000000000002e172 < x < 1.69999999999999992e25Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lift--.f64N/A
add-flipN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6493.8
Applied rewrites93.8%
if 1.69999999999999992e25 < x Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites52.9%
(FPCore (x y)
:precision binary64
(if (<= y -3.65e-57)
(* (/ (/ y x) (- (+ x y) -1.0)) (/ x (+ x y)))
(if (<= y 3e-24)
(* (/ y (+ x y)) (/ x (* (- x -1.0) (+ x y))))
(if (<= y 1.35e+127)
(/ (* (/ x (- x (- -1.0 y))) y) (* (+ x y) (+ x y)))
(/ (* (/ 1.0 y) x) (+ x y))))))
double code(double x, double y) {
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y));
} else if (y <= 3e-24) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else if (y <= 1.35e+127) {
tmp = ((x / (x - (-1.0 - y))) * y) / ((x + y) * (x + y));
} else {
tmp = ((1.0 / y) * x) / (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 (y <= (-3.65d-57)) then
tmp = ((y / x) / ((x + y) - (-1.0d0))) * (x / (x + y))
else if (y <= 3d-24) then
tmp = (y / (x + y)) * (x / ((x - (-1.0d0)) * (x + y)))
else if (y <= 1.35d+127) then
tmp = ((x / (x - ((-1.0d0) - y))) * y) / ((x + y) * (x + y))
else
tmp = ((1.0d0 / y) * x) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y));
} else if (y <= 3e-24) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else if (y <= 1.35e+127) {
tmp = ((x / (x - (-1.0 - y))) * y) / ((x + y) * (x + y));
} else {
tmp = ((1.0 / y) * x) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.65e-57: tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y)) elif y <= 3e-24: tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))) elif y <= 1.35e+127: tmp = ((x / (x - (-1.0 - y))) * y) / ((x + y) * (x + y)) else: tmp = ((1.0 / y) * x) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.65e-57) tmp = Float64(Float64(Float64(y / x) / Float64(Float64(x + y) - -1.0)) * Float64(x / Float64(x + y))); elseif (y <= 3e-24) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x - -1.0) * Float64(x + y)))); elseif (y <= 1.35e+127) tmp = Float64(Float64(Float64(x / Float64(x - Float64(-1.0 - y))) * y) / Float64(Float64(x + y) * Float64(x + y))); else tmp = Float64(Float64(Float64(1.0 / y) * x) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.65e-57) tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y)); elseif (y <= 3e-24) tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))); elseif (y <= 1.35e+127) tmp = ((x / (x - (-1.0 - y))) * y) / ((x + y) * (x + y)); else tmp = ((1.0 / y) * x) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.65e-57], N[(N[(N[(y / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-24], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+127], N[(N[(N[(x / N[(x - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] * x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.65 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{y}{x}}{\left(x + y\right) - -1} \cdot \frac{x}{x + y}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+127}:\\
\;\;\;\;\frac{\frac{x}{x - \left(-1 - y\right)} \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y} \cdot x}{x + y}\\
\end{array}
\end{array}
if y < -3.65000000000000011e-57Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6449.6
Applied rewrites49.6%
if -3.65000000000000011e-57 < y < 2.99999999999999995e-24Initial program 69.5%
Taylor expanded in y around 0
lower-+.f6459.1
Applied rewrites59.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites75.5%
if 2.99999999999999995e-24 < y < 1.3500000000000001e127Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lift-/.f64N/A
associate-/l/N/A
lift-/.f64N/A
times-fracN/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites82.8%
if 1.3500000000000001e127 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6439.7
Applied rewrites39.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y)
:precision binary64
(if (<= y -3.65e-57)
(* (/ (/ y x) (- (+ x y) -1.0)) (/ x (+ x y)))
(if (<= y 3400.0)
(* (/ y (+ x y)) (/ x (* (- x -1.0) (+ x y))))
(if (<= y 8.2e+82)
(* (/ y (* (- (+ y x) -1.0) (* (+ y x) (+ y x)))) x)
(/ (* (/ 1.0 y) x) (+ x y))))))
double code(double x, double y) {
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y));
} else if (y <= 3400.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else if (y <= 8.2e+82) {
tmp = (y / (((y + x) - -1.0) * ((y + x) * (y + x)))) * x;
} else {
tmp = ((1.0 / y) * x) / (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 (y <= (-3.65d-57)) then
tmp = ((y / x) / ((x + y) - (-1.0d0))) * (x / (x + y))
else if (y <= 3400.0d0) then
tmp = (y / (x + y)) * (x / ((x - (-1.0d0)) * (x + y)))
else if (y <= 8.2d+82) then
tmp = (y / (((y + x) - (-1.0d0)) * ((y + x) * (y + x)))) * x
else
tmp = ((1.0d0 / y) * x) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y));
} else if (y <= 3400.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else if (y <= 8.2e+82) {
tmp = (y / (((y + x) - -1.0) * ((y + x) * (y + x)))) * x;
} else {
tmp = ((1.0 / y) * x) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.65e-57: tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y)) elif y <= 3400.0: tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))) elif y <= 8.2e+82: tmp = (y / (((y + x) - -1.0) * ((y + x) * (y + x)))) * x else: tmp = ((1.0 / y) * x) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.65e-57) tmp = Float64(Float64(Float64(y / x) / Float64(Float64(x + y) - -1.0)) * Float64(x / Float64(x + y))); elseif (y <= 3400.0) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x - -1.0) * Float64(x + y)))); elseif (y <= 8.2e+82) tmp = Float64(Float64(y / Float64(Float64(Float64(y + x) - -1.0) * Float64(Float64(y + x) * Float64(y + x)))) * x); else tmp = Float64(Float64(Float64(1.0 / y) * x) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.65e-57) tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y)); elseif (y <= 3400.0) tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))); elseif (y <= 8.2e+82) tmp = (y / (((y + x) - -1.0) * ((y + x) * (y + x)))) * x; else tmp = ((1.0 / y) * x) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.65e-57], N[(N[(N[(y / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3400.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+82], N[(N[(y / N[(N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] * x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.65 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{y}{x}}{\left(x + y\right) - -1} \cdot \frac{x}{x + y}\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{\left(\left(y + x\right) - -1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y} \cdot x}{x + y}\\
\end{array}
\end{array}
if y < -3.65000000000000011e-57Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6449.6
Applied rewrites49.6%
if -3.65000000000000011e-57 < y < 3400Initial program 69.5%
Taylor expanded in y around 0
lower-+.f6459.1
Applied rewrites59.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites75.5%
if 3400 < y < 8.1999999999999999e82Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.0%
if 8.1999999999999999e82 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6439.7
Applied rewrites39.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y)
:precision binary64
(if (<= y -3.65e-57)
(* (/ (/ y x) (- (+ x y) -1.0)) (/ x (+ x y)))
(if (<= y 3400.0)
(* (/ y (+ x y)) (/ x (* (- x -1.0) (+ x y))))
(if (<= y 8.2e+82)
(* (/ y (* (* (- x (- -1.0 y)) (+ x y)) (+ x y))) x)
(/ (* (/ 1.0 y) x) (+ x y))))))
double code(double x, double y) {
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y));
} else if (y <= 3400.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else if (y <= 8.2e+82) {
tmp = (y / (((x - (-1.0 - y)) * (x + y)) * (x + y))) * x;
} else {
tmp = ((1.0 / y) * x) / (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 (y <= (-3.65d-57)) then
tmp = ((y / x) / ((x + y) - (-1.0d0))) * (x / (x + y))
else if (y <= 3400.0d0) then
tmp = (y / (x + y)) * (x / ((x - (-1.0d0)) * (x + y)))
else if (y <= 8.2d+82) then
tmp = (y / (((x - ((-1.0d0) - y)) * (x + y)) * (x + y))) * x
else
tmp = ((1.0d0 / y) * x) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y));
} else if (y <= 3400.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else if (y <= 8.2e+82) {
tmp = (y / (((x - (-1.0 - y)) * (x + y)) * (x + y))) * x;
} else {
tmp = ((1.0 / y) * x) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.65e-57: tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y)) elif y <= 3400.0: tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))) elif y <= 8.2e+82: tmp = (y / (((x - (-1.0 - y)) * (x + y)) * (x + y))) * x else: tmp = ((1.0 / y) * x) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.65e-57) tmp = Float64(Float64(Float64(y / x) / Float64(Float64(x + y) - -1.0)) * Float64(x / Float64(x + y))); elseif (y <= 3400.0) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x - -1.0) * Float64(x + y)))); elseif (y <= 8.2e+82) tmp = Float64(Float64(y / Float64(Float64(Float64(x - Float64(-1.0 - y)) * Float64(x + y)) * Float64(x + y))) * x); else tmp = Float64(Float64(Float64(1.0 / y) * x) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.65e-57) tmp = ((y / x) / ((x + y) - -1.0)) * (x / (x + y)); elseif (y <= 3400.0) tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))); elseif (y <= 8.2e+82) tmp = (y / (((x - (-1.0 - y)) * (x + y)) * (x + y))) * x; else tmp = ((1.0 / y) * x) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.65e-57], N[(N[(N[(y / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3400.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+82], N[(N[(y / N[(N[(N[(x - N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] * x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.65 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{y}{x}}{\left(x + y\right) - -1} \cdot \frac{x}{x + y}\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{\left(\left(x - \left(-1 - y\right)\right) \cdot \left(x + y\right)\right) \cdot \left(x + y\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y} \cdot x}{x + y}\\
\end{array}
\end{array}
if y < -3.65000000000000011e-57Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6449.6
Applied rewrites49.6%
if -3.65000000000000011e-57 < y < 3400Initial program 69.5%
Taylor expanded in y around 0
lower-+.f6459.1
Applied rewrites59.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites75.5%
if 3400 < y < 8.1999999999999999e82Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-/.f64N/A
times-fracN/A
lift-*.f64N/A
associate-/r*N/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/l*N/A
Applied rewrites82.0%
if 8.1999999999999999e82 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6439.7
Applied rewrites39.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y -3.65e-57)
(* (/ (/ y x) (- (+ x y) -1.0)) t_0)
(if (<= y 5200.0)
(* (/ y (+ x y)) (/ x (* (- x -1.0) (+ x y))))
(* (/ 1.0 (+ 1.0 y)) t_0)))))
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * t_0;
} else if (y <= 5200.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else {
tmp = (1.0 / (1.0 + 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 = x / (x + y)
if (y <= (-3.65d-57)) then
tmp = ((y / x) / ((x + y) - (-1.0d0))) * t_0
else if (y <= 5200.0d0) then
tmp = (y / (x + y)) * (x / ((x - (-1.0d0)) * (x + y)))
else
tmp = (1.0d0 / (1.0d0 + y)) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -3.65e-57) {
tmp = ((y / x) / ((x + y) - -1.0)) * t_0;
} else if (y <= 5200.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else {
tmp = (1.0 / (1.0 + y)) * t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= -3.65e-57: tmp = ((y / x) / ((x + y) - -1.0)) * t_0 elif y <= 5200.0: tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))) else: tmp = (1.0 / (1.0 + y)) * t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= -3.65e-57) tmp = Float64(Float64(Float64(y / x) / Float64(Float64(x + y) - -1.0)) * t_0); elseif (y <= 5200.0) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x - -1.0) * Float64(x + y)))); else tmp = Float64(Float64(1.0 / Float64(1.0 + y)) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (x + y); tmp = 0.0; if (y <= -3.65e-57) tmp = ((y / x) / ((x + y) - -1.0)) * t_0; elseif (y <= 5200.0) tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))); else tmp = (1.0 / (1.0 + y)) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.65e-57], N[(N[(N[(y / x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 5200.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq -3.65 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{y}{x}}{\left(x + y\right) - -1} \cdot t\_0\\
\mathbf{elif}\;y \leq 5200:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + y} \cdot t\_0\\
\end{array}
\end{array}
if y < -3.65000000000000011e-57Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6449.6
Applied rewrites49.6%
if -3.65000000000000011e-57 < y < 5200Initial program 69.5%
Taylor expanded in y around 0
lower-+.f6459.1
Applied rewrites59.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites75.5%
if 5200 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6452.2
Applied rewrites52.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ x y))))
(if (<= y -2100000000.0)
(* (/ (/ y x) (+ x y)) t_0)
(if (<= y 5200.0)
(* (/ y (+ x y)) (/ x (* (- x -1.0) (+ x y))))
(* (/ 1.0 (+ 1.0 y)) t_0)))))
double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -2100000000.0) {
tmp = ((y / x) / (x + y)) * t_0;
} else if (y <= 5200.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else {
tmp = (1.0 / (1.0 + 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 = x / (x + y)
if (y <= (-2100000000.0d0)) then
tmp = ((y / x) / (x + y)) * t_0
else if (y <= 5200.0d0) then
tmp = (y / (x + y)) * (x / ((x - (-1.0d0)) * (x + y)))
else
tmp = (1.0d0 / (1.0d0 + y)) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (x + y);
double tmp;
if (y <= -2100000000.0) {
tmp = ((y / x) / (x + y)) * t_0;
} else if (y <= 5200.0) {
tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
} else {
tmp = (1.0 / (1.0 + y)) * t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (x + y) tmp = 0 if y <= -2100000000.0: tmp = ((y / x) / (x + y)) * t_0 elif y <= 5200.0: tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))) else: tmp = (1.0 / (1.0 + y)) * t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(x + y)) tmp = 0.0 if (y <= -2100000000.0) tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * t_0); elseif (y <= 5200.0) tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x - -1.0) * Float64(x + y)))); else tmp = Float64(Float64(1.0 / Float64(1.0 + y)) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (x + y); tmp = 0.0; if (y <= -2100000000.0) tmp = ((y / x) / (x + y)) * t_0; elseif (y <= 5200.0) tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y))); else tmp = (1.0 / (1.0 + y)) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2100000000.0], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 5200.0], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;y \leq -2100000000:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\
\mathbf{elif}\;y \leq 5200:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + y} \cdot t\_0\\
\end{array}
\end{array}
if y < -2.1e9Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
lift-+.f64N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6437.9
Applied rewrites37.9%
if -2.1e9 < y < 5200Initial program 69.5%
Taylor expanded in y around 0
lower-+.f6459.1
Applied rewrites59.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
times-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
Applied rewrites75.5%
if 5200 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6452.2
Applied rewrites52.2%
(FPCore (x y)
:precision binary64
(if (<= y 8.5e-217)
(* (/ y (+ y x)) (/ 1.0 (+ 1.0 x)))
(if (<= y 2.1e-19)
(* (/ x (* (* (+ x y) (+ x y)) (- x -1.0))) y)
(* (/ 1.0 (+ 1.0 y)) (/ x (+ x y))))))
double code(double x, double y) {
double tmp;
if (y <= 8.5e-217) {
tmp = (y / (y + x)) * (1.0 / (1.0 + x));
} else if (y <= 2.1e-19) {
tmp = (x / (((x + y) * (x + y)) * (x - -1.0))) * y;
} else {
tmp = (1.0 / (1.0 + y)) * (x / (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 (y <= 8.5d-217) then
tmp = (y / (y + x)) * (1.0d0 / (1.0d0 + x))
else if (y <= 2.1d-19) then
tmp = (x / (((x + y) * (x + y)) * (x - (-1.0d0)))) * y
else
tmp = (1.0d0 / (1.0d0 + y)) * (x / (x + y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8.5e-217) {
tmp = (y / (y + x)) * (1.0 / (1.0 + x));
} else if (y <= 2.1e-19) {
tmp = (x / (((x + y) * (x + y)) * (x - -1.0))) * y;
} else {
tmp = (1.0 / (1.0 + y)) * (x / (x + y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8.5e-217: tmp = (y / (y + x)) * (1.0 / (1.0 + x)) elif y <= 2.1e-19: tmp = (x / (((x + y) * (x + y)) * (x - -1.0))) * y else: tmp = (1.0 / (1.0 + y)) * (x / (x + y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 8.5e-217) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(1.0 + x))); elseif (y <= 2.1e-19) tmp = Float64(Float64(x / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(x - -1.0))) * y); else tmp = Float64(Float64(1.0 / Float64(1.0 + y)) * Float64(x / Float64(x + y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8.5e-217) tmp = (y / (y + x)) * (1.0 / (1.0 + x)); elseif (y <= 2.1e-19) tmp = (x / (((x + y) * (x + y)) * (x - -1.0))) * y; else tmp = (1.0 / (1.0 + y)) * (x / (x + y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8.5e-217], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-19], N[(N[(x / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(1.0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{-217}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{1 + x}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x - -1\right)} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + y} \cdot \frac{x}{x + y}\\
\end{array}
\end{array}
if y < 8.4999999999999994e-217Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6449.6
Applied rewrites49.6%
if 8.4999999999999994e-217 < y < 2.0999999999999999e-19Initial program 69.5%
Taylor expanded in y around 0
lower-+.f6459.1
Applied rewrites59.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6475.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.9
lift-+.f64N/A
+-commutativeN/A
add-flip-revN/A
metadata-evalN/A
lower--.f6475.9
Applied rewrites75.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.9
Applied rewrites75.9%
if 2.0999999999999999e-19 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6452.2
Applied rewrites52.2%
(FPCore (x y)
:precision binary64
(if (<= y 2.3e-128)
(* (/ y (+ y x)) (/ 1.0 (+ 1.0 x)))
(if (<= y 4.9e+81)
(* 1.0 (/ x (* (- (+ y x) -1.0) (+ y x))))
(/ (* (/ 1.0 y) x) (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= 2.3e-128) {
tmp = (y / (y + x)) * (1.0 / (1.0 + x));
} else if (y <= 4.9e+81) {
tmp = 1.0 * (x / (((y + x) - -1.0) * (y + x)));
} else {
tmp = ((1.0 / y) * x) / (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 (y <= 2.3d-128) then
tmp = (y / (y + x)) * (1.0d0 / (1.0d0 + x))
else if (y <= 4.9d+81) then
tmp = 1.0d0 * (x / (((y + x) - (-1.0d0)) * (y + x)))
else
tmp = ((1.0d0 / y) * x) / (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.3e-128) {
tmp = (y / (y + x)) * (1.0 / (1.0 + x));
} else if (y <= 4.9e+81) {
tmp = 1.0 * (x / (((y + x) - -1.0) * (y + x)));
} else {
tmp = ((1.0 / y) * x) / (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.3e-128: tmp = (y / (y + x)) * (1.0 / (1.0 + x)) elif y <= 4.9e+81: tmp = 1.0 * (x / (((y + x) - -1.0) * (y + x))) else: tmp = ((1.0 / y) * x) / (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.3e-128) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(1.0 + x))); elseif (y <= 4.9e+81) tmp = Float64(1.0 * Float64(x / Float64(Float64(Float64(y + x) - -1.0) * Float64(y + x)))); else tmp = Float64(Float64(Float64(1.0 / y) * x) / Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.3e-128) tmp = (y / (y + x)) * (1.0 / (1.0 + x)); elseif (y <= 4.9e+81) tmp = 1.0 * (x / (((y + x) - -1.0) * (y + x))); else tmp = ((1.0 / y) * x) / (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.3e-128], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e+81], N[(1.0 * N[(x / N[(N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] * x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-128}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{1 + x}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+81}:\\
\;\;\;\;1 \cdot \frac{x}{\left(\left(y + x\right) - -1\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y} \cdot x}{x + y}\\
\end{array}
\end{array}
if y < 2.3000000000000001e-128Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6449.6
Applied rewrites49.6%
if 2.3000000000000001e-128 < y < 4.90000000000000023e81Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
Taylor expanded in x around 0
Applied rewrites66.8%
if 4.90000000000000023e81 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-/.f6439.7
Applied rewrites39.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y)
:precision binary64
(if (<= y -1850000000.0)
(* (/ y (+ y x)) (/ 1.0 x))
(if (<= y 1.08e-94)
(/ y (* x (+ 1.0 x)))
(* (/ 1.0 (+ 1.0 y)) (/ x (+ x y))))))
double code(double x, double y) {
double tmp;
if (y <= -1850000000.0) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (y <= 1.08e-94) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (1.0 / (1.0 + y)) * (x / (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 (y <= (-1850000000.0d0)) then
tmp = (y / (y + x)) * (1.0d0 / x)
else if (y <= 1.08d-94) then
tmp = y / (x * (1.0d0 + x))
else
tmp = (1.0d0 / (1.0d0 + y)) * (x / (x + y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1850000000.0) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (y <= 1.08e-94) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (1.0 / (1.0 + y)) * (x / (x + y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1850000000.0: tmp = (y / (y + x)) * (1.0 / x) elif y <= 1.08e-94: tmp = y / (x * (1.0 + x)) else: tmp = (1.0 / (1.0 + y)) * (x / (x + y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1850000000.0) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / x)); elseif (y <= 1.08e-94) tmp = Float64(y / Float64(x * Float64(1.0 + x))); else tmp = Float64(Float64(1.0 / Float64(1.0 + y)) * Float64(x / Float64(x + y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1850000000.0) tmp = (y / (y + x)) * (1.0 / x); elseif (y <= 1.08e-94) tmp = y / (x * (1.0 + x)); else tmp = (1.0 / (1.0 + y)) * (x / (x + y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1850000000.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.08e-94], N[(y / N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1850000000:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 1.08 \cdot 10^{-94}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + y} \cdot \frac{x}{x + y}\\
\end{array}
\end{array}
if y < -1.85e9Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
Taylor expanded in x around inf
lower-/.f6437.6
Applied rewrites37.6%
if -1.85e9 < y < 1.08e-94Initial program 69.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6447.9
Applied rewrites47.9%
if 1.08e-94 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6452.2
Applied rewrites52.2%
(FPCore (x y) :precision binary64 (if (<= y 1.08e-94) (* (/ y (+ y x)) (/ 1.0 (+ 1.0 x))) (* (/ 1.0 (+ 1.0 y)) (/ x (+ x y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.08e-94) {
tmp = (y / (y + x)) * (1.0 / (1.0 + x));
} else {
tmp = (1.0 / (1.0 + y)) * (x / (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 (y <= 1.08d-94) then
tmp = (y / (y + x)) * (1.0d0 / (1.0d0 + x))
else
tmp = (1.0d0 / (1.0d0 + y)) * (x / (x + y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.08e-94) {
tmp = (y / (y + x)) * (1.0 / (1.0 + x));
} else {
tmp = (1.0 / (1.0 + y)) * (x / (x + y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.08e-94: tmp = (y / (y + x)) * (1.0 / (1.0 + x)) else: tmp = (1.0 / (1.0 + y)) * (x / (x + y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.08e-94) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / Float64(1.0 + x))); else tmp = Float64(Float64(1.0 / Float64(1.0 + y)) * Float64(x / Float64(x + y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.08e-94) tmp = (y / (y + x)) * (1.0 / (1.0 + x)); else tmp = (1.0 / (1.0 + y)) * (x / (x + y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.08e-94], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.08 \cdot 10^{-94}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{1 + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + y} \cdot \frac{x}{x + y}\\
\end{array}
\end{array}
if y < 1.08e-94Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6449.6
Applied rewrites49.6%
if 1.08e-94 < y Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6452.2
Applied rewrites52.2%
(FPCore (x y) :precision binary64 (if (<= y -1850000000.0) (* (/ y (+ y x)) (/ 1.0 x)) (if (<= y 1.2e-99) (/ y (* x (+ 1.0 x))) (/ (/ x (- y -1.0)) y))))
double code(double x, double y) {
double tmp;
if (y <= -1850000000.0) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (y <= 1.2e-99) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / (y - -1.0)) / 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 (y <= (-1850000000.0d0)) then
tmp = (y / (y + x)) * (1.0d0 / x)
else if (y <= 1.2d-99) then
tmp = y / (x * (1.0d0 + x))
else
tmp = (x / (y - (-1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1850000000.0) {
tmp = (y / (y + x)) * (1.0 / x);
} else if (y <= 1.2e-99) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / (y - -1.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1850000000.0: tmp = (y / (y + x)) * (1.0 / x) elif y <= 1.2e-99: tmp = y / (x * (1.0 + x)) else: tmp = (x / (y - -1.0)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= -1850000000.0) tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / x)); elseif (y <= 1.2e-99) tmp = Float64(y / Float64(x * Float64(1.0 + x))); else tmp = Float64(Float64(x / Float64(y - -1.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1850000000.0) tmp = (y / (y + x)) * (1.0 / x); elseif (y <= 1.2e-99) tmp = y / (x * (1.0 + x)); else tmp = (x / (y - -1.0)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1850000000.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-99], N[(y / N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1850000000:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - -1}}{y}\\
\end{array}
\end{array}
if y < -1.85e9Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.8
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-eval93.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.8
Applied rewrites93.8%
Taylor expanded in x around inf
lower-/.f6437.6
Applied rewrites37.6%
if -1.85e9 < y < 1.2e-99Initial program 69.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6447.9
Applied rewrites47.9%
if 1.2e-99 < y Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.0
Applied rewrites50.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6451.7
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6451.7
Applied rewrites51.7%
(FPCore (x y) :precision binary64 (if (<= y 1.2e-99) (/ y (* x (+ 1.0 x))) (/ (/ x (- y -1.0)) y)))
double code(double x, double y) {
double tmp;
if (y <= 1.2e-99) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / (y - -1.0)) / 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 (y <= 1.2d-99) then
tmp = y / (x * (1.0d0 + x))
else
tmp = (x / (y - (-1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.2e-99) {
tmp = y / (x * (1.0 + x));
} else {
tmp = (x / (y - -1.0)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.2e-99: tmp = y / (x * (1.0 + x)) else: tmp = (x / (y - -1.0)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 1.2e-99) tmp = Float64(y / Float64(x * Float64(1.0 + x))); else tmp = Float64(Float64(x / Float64(y - -1.0)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.2e-99) tmp = y / (x * (1.0 + x)); else tmp = (x / (y - -1.0)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.2e-99], N[(y / N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - -1}}{y}\\
\end{array}
\end{array}
if y < 1.2e-99Initial program 69.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6447.9
Applied rewrites47.9%
if 1.2e-99 < y Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.0
Applied rewrites50.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6451.7
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6451.7
Applied rewrites51.7%
(FPCore (x y) :precision binary64 (if (<= y 1.2e-99) (/ y (* x (+ 1.0 x))) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (y <= 1.2e-99) {
tmp = y / (x * (1.0 + x));
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= 1.2e-99) tmp = Float64(y / Float64(x * Float64(1.0 + x))); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[y, 1.2e-99], N[(y / N[(x * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-99}:\\
\;\;\;\;\frac{y}{x \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if y < 1.2e-99Initial program 69.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6447.9
Applied rewrites47.9%
if 1.2e-99 < y Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.0
Applied rewrites50.0%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f6450.0
Applied rewrites50.0%
(FPCore (x y) :precision binary64 (/ x (fma y y y)))
double code(double x, double y) {
return x / fma(y, y, y);
}
function code(x, y) return Float64(x / fma(y, y, y)) end
code[x_, y_] := N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\mathsf{fma}\left(y, y, y\right)}
\end{array}
Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.0
Applied rewrites50.0%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f6450.0
Applied rewrites50.0%
(FPCore (x y) :precision binary64 (/ 1.0 (/ y x)))
double code(double x, double y) {
return 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 = 1.0d0 / (y / x)
end function
public static double code(double x, double y) {
return 1.0 / (y / x);
}
def code(x, y): return 1.0 / (y / x)
function code(x, y) return Float64(1.0 / Float64(y / x)) end
function tmp = code(x, y) tmp = 1.0 / (y / x); end
code[x_, y_] := N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{y}{x}}
\end{array}
Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.0
Applied rewrites50.0%
Taylor expanded in y around 0
lower-/.f6426.9
Applied rewrites26.9%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6427.4
Applied rewrites27.4%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return 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 = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 69.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.0
Applied rewrites50.0%
Taylor expanded in y around 0
lower-/.f6426.9
Applied rewrites26.9%
herbie shell --seed 2025142
(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))))