
(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 24 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 (/ (* (/ x (+ y x)) (/ y (- (+ y x) -1.0))) (+ y x)))
double code(double x, double y) {
return ((x / (y + x)) * (y / ((y + x) - -1.0))) / (y + x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / (y + x)) * (y / ((y + x) - (-1.0d0)))) / (y + x)
end function
public static double code(double x, double y) {
return ((x / (y + x)) * (y / ((y + x) - -1.0))) / (y + x);
}
def code(x, y): return ((x / (y + x)) * (y / ((y + x) - -1.0))) / (y + x)
function code(x, y) return Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) - -1.0))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((x / (y + x)) * (y / ((y + x) - -1.0))) / (y + x); end
code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) - -1}}{y + x}
\end{array}
Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
(FPCore (x y) :precision binary64 (* (/ (/ x (+ y x)) (+ y x)) (/ y (- (+ y x) -1.0))))
double code(double x, double y) {
return ((x / (y + x)) / (y + x)) * (y / ((y + x) - -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 / ((y + x) - (-1.0d0)))
end function
public static double code(double x, double y) {
return ((x / (y + x)) / (y + x)) * (y / ((y + x) - -1.0));
}
def code(x, y): return ((x / (y + x)) / (y + x)) * (y / ((y + x) - -1.0))
function code(x, y) return Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / Float64(Float64(y + x) - -1.0))) end
function tmp = code(x, y) tmp = ((x / (y + x)) / (y + x)) * (y / ((y + x) - -1.0)); end
code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) - -1}
\end{array}
Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (+ y x) -1.0)) (t_1 (/ y t_0)))
(if (<= x -4.8e+153)
(* (/ (fma (/ y x) -2.0 1.0) x) t_1)
(if (<= x 1.48e+50)
(/ (* (/ x (+ y x)) y) (* (+ y x) t_0))
(* (/ (/ x y) (+ y x)) t_1)))))
double code(double x, double y) {
double t_0 = (y + x) - -1.0;
double t_1 = y / t_0;
double tmp;
if (x <= -4.8e+153) {
tmp = (fma((y / x), -2.0, 1.0) / x) * t_1;
} else if (x <= 1.48e+50) {
tmp = ((x / (y + x)) * y) / ((y + x) * t_0);
} else {
tmp = ((x / y) / (y + x)) * t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(y + x) - -1.0) t_1 = Float64(y / t_0) tmp = 0.0 if (x <= -4.8e+153) tmp = Float64(Float64(fma(Float64(y / x), -2.0, 1.0) / x) * t_1); elseif (x <= 1.48e+50) tmp = Float64(Float64(Float64(x / Float64(y + x)) * y) / Float64(Float64(y + x) * t_0)); else tmp = Float64(Float64(Float64(x / y) / Float64(y + x)) * t_1); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(y / t$95$0), $MachinePrecision]}, If[LessEqual[x, -4.8e+153], N[(N[(N[(N[(y / x), $MachinePrecision] * -2.0 + 1.0), $MachinePrecision] / x), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, 1.48e+50], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + x\right) - -1\\
t_1 := \frac{y}{t\_0}\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+153}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{x}, -2, 1\right)}{x} \cdot t\_1\\
\mathbf{elif}\;x \leq 1.48 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot y}{\left(y + x\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x} \cdot t\_1\\
\end{array}
\end{array}
if x < -4.79999999999999985e153Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6450.5
Applied rewrites50.5%
if -4.79999999999999985e153 < x < 1.48000000000000007e50Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f6493.4
Applied rewrites93.4%
if 1.48000000000000007e50 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f6450.8
Applied rewrites50.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (- (+ y x) -1.0))))
(if (<= x -8.5e+145)
(* (/ (fma (/ y x) -2.0 1.0) x) t_0)
(if (<= x -8e-16)
(* (/ x (* (+ y x) (+ y x))) t_0)
(/ (* (/ x (+ y x)) (/ y (+ 1.0 y))) (+ y x))))))
double code(double x, double y) {
double t_0 = y / ((y + x) - -1.0);
double tmp;
if (x <= -8.5e+145) {
tmp = (fma((y / x), -2.0, 1.0) / x) * t_0;
} else if (x <= -8e-16) {
tmp = (x / ((y + x) * (y + x))) * t_0;
} else {
tmp = ((x / (y + x)) * (y / (1.0 + y))) / (y + x);
}
return tmp;
}
function code(x, y) t_0 = Float64(y / Float64(Float64(y + x) - -1.0)) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(fma(Float64(y / x), -2.0, 1.0) / x) * t_0); elseif (x <= -8e-16) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * t_0); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(1.0 + y))) / Float64(y + x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+145], N[(N[(N[(N[(y / x), $MachinePrecision] * -2.0 + 1.0), $MachinePrecision] / x), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x, -8e-16], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{\left(y + x\right) - -1}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{x}, -2, 1\right)}{x} \cdot t\_0\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6450.5
Applied rewrites50.5%
if -8.49999999999999977e145 < x < -7.9999999999999998e-16Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
if -7.9999999999999998e-16 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6475.3
Applied rewrites75.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (+ y x) (+ y x))) (t_1 (- (+ y x) -1.0)))
(if (<= x -8.5e+145)
(* (/ (fma (/ y x) -2.0 1.0) x) (/ y t_1))
(if (<= x -1.25e+50)
(* (/ x t_0) (/ y x))
(if (<= x -1.45e-15)
(/ (* y x) (* t_1 t_0))
(/ (* (/ x (+ y x)) (/ y (+ 1.0 y))) (+ y x)))))))
double code(double x, double y) {
double t_0 = (y + x) * (y + x);
double t_1 = (y + x) - -1.0;
double tmp;
if (x <= -8.5e+145) {
tmp = (fma((y / x), -2.0, 1.0) / x) * (y / t_1);
} else if (x <= -1.25e+50) {
tmp = (x / t_0) * (y / x);
} else if (x <= -1.45e-15) {
tmp = (y * x) / (t_1 * t_0);
} else {
tmp = ((x / (y + x)) * (y / (1.0 + y))) / (y + x);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(y + x) * Float64(y + x)) t_1 = Float64(Float64(y + x) - -1.0) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(fma(Float64(y / x), -2.0, 1.0) / x) * Float64(y / t_1)); elseif (x <= -1.25e+50) tmp = Float64(Float64(x / t_0) * Float64(y / x)); elseif (x <= -1.45e-15) tmp = Float64(Float64(y * x) / Float64(t_1 * t_0)); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(1.0 + y))) / Float64(y + x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]}, If[LessEqual[x, -8.5e+145], N[(N[(N[(N[(y / x), $MachinePrecision] * -2.0 + 1.0), $MachinePrecision] / x), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.25e+50], N[(N[(x / t$95$0), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-15], N[(N[(y * x), $MachinePrecision] / N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + x\right) \cdot \left(y + x\right)\\
t_1 := \left(y + x\right) - -1\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{x}, -2, 1\right)}{x} \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{+50}:\\
\;\;\;\;\frac{x}{t\_0} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-15}:\\
\;\;\;\;\frac{y \cdot x}{t\_1 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6450.5
Applied rewrites50.5%
if -8.49999999999999977e145 < x < -1.25e50Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -1.25e50 < x < -1.45000000000000009e-15Initial program 69.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.0
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6469.0
Applied rewrites69.0%
if -1.45000000000000009e-15 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6475.3
Applied rewrites75.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (+ y x) (+ y x))))
(if (<= x -8.5e+145)
(/ (/ (fma (fma 3.0 y 1.0) (/ y (- x)) y) x) x)
(if (<= x -1.25e+50)
(* (/ x t_0) (/ y x))
(if (<= x -1.45e-15)
(/ (* y x) (* (- (+ y x) -1.0) t_0))
(/ (* (/ x (+ y x)) (/ y (+ 1.0 y))) (+ y x)))))))
double code(double x, double y) {
double t_0 = (y + x) * (y + x);
double tmp;
if (x <= -8.5e+145) {
tmp = (fma(fma(3.0, y, 1.0), (y / -x), y) / x) / x;
} else if (x <= -1.25e+50) {
tmp = (x / t_0) * (y / x);
} else if (x <= -1.45e-15) {
tmp = (y * x) / (((y + x) - -1.0) * t_0);
} else {
tmp = ((x / (y + x)) * (y / (1.0 + y))) / (y + x);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(y + x) * Float64(y + x)) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(y / Float64(-x)), y) / x) / x); elseif (x <= -1.25e+50) tmp = Float64(Float64(x / t_0) * Float64(y / x)); elseif (x <= -1.45e-15) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(y + x) - -1.0) * t_0)); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(1.0 + y))) / Float64(y + x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+145], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[(y / (-x)), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.25e+50], N[(N[(x / t$95$0), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-15], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y + x\right) \cdot \left(y + x\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{y}{-x}, y\right)}{x}}{x}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{+50}:\\
\;\;\;\;\frac{x}{t\_0} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-15}:\\
\;\;\;\;\frac{y \cdot x}{\left(\left(y + x\right) - -1\right) \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.5
Applied rewrites33.5%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites35.2%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/l*N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lift-fma.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
if -8.49999999999999977e145 < x < -1.25e50Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -1.25e50 < x < -1.45000000000000009e-15Initial program 69.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.0
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6469.0
Applied rewrites69.0%
if -1.45000000000000009e-15 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6475.3
Applied rewrites75.3%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e+145)
(/ (/ (fma (fma 3.0 y 1.0) (/ y (- x)) y) x) x)
(if (<= x -6.5)
(* (/ x (* (+ y x) (+ y x))) (/ y x))
(/ (* (/ x (+ y x)) (/ y (+ 1.0 y))) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (fma(fma(3.0, y, 1.0), (y / -x), y) / x) / x;
} else if (x <= -6.5) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else {
tmp = ((x / (y + x)) * (y / (1.0 + y))) / (y + x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(y / Float64(-x)), y) / x) / x); elseif (x <= -6.5) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / x)); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(1.0 + y))) / Float64(y + x)); end return tmp end
code[x_, y_] := If[LessEqual[x, -8.5e+145], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[(y / (-x)), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -6.5], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{y}{-x}, y\right)}{x}}{x}\\
\mathbf{elif}\;x \leq -6.5:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot \frac{y}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.5
Applied rewrites33.5%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites35.2%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/l*N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lift-fma.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
if -8.49999999999999977e145 < x < -6.5Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -6.5 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6475.3
Applied rewrites75.3%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e+145)
(/ (/ (fma (fma 3.0 y 1.0) (/ y (- x)) y) x) x)
(if (<= x -6.5)
(* (/ x (* (+ y x) (+ y x))) (/ y x))
(* (/ (/ x (+ y x)) (+ y x)) (/ y (+ 1.0 y))))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (fma(fma(3.0, y, 1.0), (y / -x), y) / x) / x;
} else if (x <= -6.5) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else {
tmp = ((x / (y + x)) / (y + x)) * (y / (1.0 + y));
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(y / Float64(-x)), y) / x) / x); elseif (x <= -6.5) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / x)); else tmp = Float64(Float64(Float64(x / Float64(y + x)) / Float64(y + x)) * Float64(y / Float64(1.0 + y))); end return tmp end
code[x_, y_] := If[LessEqual[x, -8.5e+145], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[(y / (-x)), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -6.5], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{y}{-x}, y\right)}{x}}{x}\\
\mathbf{elif}\;x \leq -6.5:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{1 + y}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.5
Applied rewrites33.5%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites35.2%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/l*N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lift-fma.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
if -8.49999999999999977e145 < x < -6.5Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -6.5 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6475.2
Applied rewrites75.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* (+ y x) (+ y x)))))
(if (<= x -8.5e+145)
(/ (/ (fma (fma 3.0 y 1.0) (/ y (- x)) y) x) x)
(if (<= x -6.5)
(* t_0 (/ y x))
(if (<= x -1.9e-191)
(* t_0 (/ y (+ 1.0 y)))
(/ (/ x (+ 1.0 y)) (+ y x)))))))
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double tmp;
if (x <= -8.5e+145) {
tmp = (fma(fma(3.0, y, 1.0), (y / -x), y) / x) / x;
} else if (x <= -6.5) {
tmp = t_0 * (y / x);
} else if (x <= -1.9e-191) {
tmp = t_0 * (y / (1.0 + y));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(fma(fma(3.0, y, 1.0), Float64(y / Float64(-x)), y) / x) / x); elseif (x <= -6.5) tmp = Float64(t_0 * Float64(y / x)); elseif (x <= -1.9e-191) tmp = Float64(t_0 * Float64(y / Float64(1.0 + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+145], N[(N[(N[(N[(3.0 * y + 1.0), $MachinePrecision] * N[(y / (-x)), $MachinePrecision] + y), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -6.5], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-191], N[(t$95$0 * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(3, y, 1\right), \frac{y}{-x}, y\right)}{x}}{x}\\
\mathbf{elif}\;x \leq -6.5:\\
\;\;\;\;t\_0 \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-191}:\\
\;\;\;\;t\_0 \cdot \frac{y}{1 + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6433.5
Applied rewrites33.5%
lift-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites35.2%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-/l*N/A
metadata-evalN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
distribute-rgt1-inN/A
metadata-evalN/A
lift-fma.f64N/A
lower-/.f6438.3
Applied rewrites38.3%
if -8.49999999999999977e145 < x < -6.5Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -6.5 < x < -1.8999999999999999e-191Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around 0
lower-+.f6475.0
Applied rewrites75.0%
if -1.8999999999999999e-191 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* (+ y x) (+ y x)))))
(if (<= x -8.5e+145)
(/ (/ y x) (+ y x))
(if (<= x -6.5)
(* t_0 (/ y x))
(if (<= x -1.9e-191)
(* t_0 (/ y (+ 1.0 y)))
(/ (/ x (+ 1.0 y)) (+ y x)))))))
double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -6.5) {
tmp = t_0 * (y / x);
} else if (x <= -1.9e-191) {
tmp = t_0 * (y / (1.0 + y));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 / ((y + x) * (y + x))
if (x <= (-8.5d+145)) then
tmp = (y / x) / (y + x)
else if (x <= (-6.5d0)) then
tmp = t_0 * (y / x)
else if (x <= (-1.9d-191)) then
tmp = t_0 * (y / (1.0d0 + y))
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / ((y + x) * (y + x));
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -6.5) {
tmp = t_0 * (y / x);
} else if (x <= -1.9e-191) {
tmp = t_0 * (y / (1.0 + y));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = x / ((y + x) * (y + x)) tmp = 0 if x <= -8.5e+145: tmp = (y / x) / (y + x) elif x <= -6.5: tmp = t_0 * (y / x) elif x <= -1.9e-191: tmp = t_0 * (y / (1.0 + y)) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) t_0 = Float64(x / Float64(Float64(y + x) * Float64(y + x))) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -6.5) tmp = Float64(t_0 * Float64(y / x)); elseif (x <= -1.9e-191) tmp = Float64(t_0 * Float64(y / Float64(1.0 + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = x / ((y + x) * (y + x)); tmp = 0.0; if (x <= -8.5e+145) tmp = (y / x) / (y + x); elseif (x <= -6.5) tmp = t_0 * (y / x); elseif (x <= -1.9e-191) tmp = t_0 * (y / (1.0 + y)); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+145], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e-191], N[(t$95$0 * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -6.5:\\
\;\;\;\;t\_0 \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-191}:\\
\;\;\;\;t\_0 \cdot \frac{y}{1 + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.9
Applied rewrites38.9%
if -8.49999999999999977e145 < x < -6.5Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -6.5 < x < -1.8999999999999999e-191Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around 0
lower-+.f6475.0
Applied rewrites75.0%
if -1.8999999999999999e-191 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e+145)
(/ (/ y x) (+ y x))
(if (<= x -1.1)
(* (/ x (* (+ y x) (+ y x))) (/ y x))
(if (<= x -1.05e-150)
(/ (* x y) (* (* (+ x y) (+ x y)) (+ 1.0 y)))
(/ (/ x (+ 1.0 y)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -1.1) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else if (x <= -1.05e-150) {
tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-8.5d+145)) then
tmp = (y / x) / (y + x)
else if (x <= (-1.1d0)) then
tmp = (x / ((y + x) * (y + x))) * (y / x)
else if (x <= (-1.05d-150)) then
tmp = (x * y) / (((x + y) * (x + y)) * (1.0d0 + y))
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -1.1) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else if (x <= -1.05e-150) {
tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8.5e+145: tmp = (y / x) / (y + x) elif x <= -1.1: tmp = (x / ((y + x) * (y + x))) * (y / x) elif x <= -1.05e-150: tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y)) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -1.1) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / x)); elseif (x <= -1.05e-150) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(1.0 + y))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8.5e+145) tmp = (y / x) / (y + x); elseif (x <= -1.1) tmp = (x / ((y + x) * (y + x))) * (y / x); elseif (x <= -1.05e-150) tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y)); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8.5e+145], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.1], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e-150], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -1.1:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-150}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.9
Applied rewrites38.9%
if -8.49999999999999977e145 < x < -1.1000000000000001Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -1.1000000000000001 < x < -1.0500000000000001e-150Initial program 69.0%
Taylor expanded in x around 0
lower-+.f6458.7
Applied rewrites58.7%
if -1.0500000000000001e-150 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e+145)
(/ (/ y x) (+ y x))
(if (<= x -1e+32)
(* (/ x (* (+ y x) (+ y x))) (/ y x))
(if (<= x -5.6e-100)
(/ (* x y) (* (* (+ x y) (+ x y)) (+ 1.0 x)))
(/ (/ x (+ 1.0 y)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -1e+32) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else if (x <= -5.6e-100) {
tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + x));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-8.5d+145)) then
tmp = (y / x) / (y + x)
else if (x <= (-1d+32)) then
tmp = (x / ((y + x) * (y + x))) * (y / x)
else if (x <= (-5.6d-100)) then
tmp = (x * y) / (((x + y) * (x + y)) * (1.0d0 + x))
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -1e+32) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else if (x <= -5.6e-100) {
tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + x));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8.5e+145: tmp = (y / x) / (y + x) elif x <= -1e+32: tmp = (x / ((y + x) * (y + x))) * (y / x) elif x <= -5.6e-100: tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + x)) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -1e+32) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / x)); elseif (x <= -5.6e-100) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(1.0 + x))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8.5e+145) tmp = (y / x) / (y + x); elseif (x <= -1e+32) tmp = (x / ((y + x) * (y + x))) * (y / x); elseif (x <= -5.6e-100) tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + x)); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8.5e+145], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e+32], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.6e-100], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -1 \cdot 10^{+32}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-100}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.9
Applied rewrites38.9%
if -8.49999999999999977e145 < x < -1.00000000000000005e32Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -1.00000000000000005e32 < x < -5.59999999999999991e-100Initial program 69.0%
Taylor expanded in y around 0
lower-+.f6459.2
Applied rewrites59.2%
if -5.59999999999999991e-100 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y)
:precision binary64
(if (<= x -8.5e+145)
(/ (/ y x) (+ y x))
(if (<= x -3.6e+31)
(* (/ x (* (+ y x) (+ y x))) (/ y x))
(if (<= x -2.2e-50)
(/ (* x y) (* (* x x) (+ (+ x y) 1.0)))
(/ (/ x (+ 1.0 y)) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -3.6e+31) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else if (x <= -2.2e-50) {
tmp = (x * y) / ((x * x) * ((x + y) + 1.0));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-8.5d+145)) then
tmp = (y / x) / (y + x)
else if (x <= (-3.6d+31)) then
tmp = (x / ((y + x) * (y + x))) * (y / x)
else if (x <= (-2.2d-50)) then
tmp = (x * y) / ((x * x) * ((x + y) + 1.0d0))
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -8.5e+145) {
tmp = (y / x) / (y + x);
} else if (x <= -3.6e+31) {
tmp = (x / ((y + x) * (y + x))) * (y / x);
} else if (x <= -2.2e-50) {
tmp = (x * y) / ((x * x) * ((x + y) + 1.0));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8.5e+145: tmp = (y / x) / (y + x) elif x <= -3.6e+31: tmp = (x / ((y + x) * (y + x))) * (y / x) elif x <= -2.2e-50: tmp = (x * y) / ((x * x) * ((x + y) + 1.0)) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -8.5e+145) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -3.6e+31) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / x)); elseif (x <= -2.2e-50) tmp = Float64(Float64(x * y) / Float64(Float64(x * x) * Float64(Float64(x + y) + 1.0))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8.5e+145) tmp = (y / x) / (y + x); elseif (x <= -3.6e+31) tmp = (x / ((y + x) * (y + x))) * (y / x); elseif (x <= -2.2e-50) tmp = (x * y) / ((x * x) * ((x + y) + 1.0)); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8.5e+145], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.6e+31], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-50], N[(N[(x * y), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{x \cdot y}{\left(x \cdot x\right) \cdot \left(\left(x + y\right) + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -8.49999999999999977e145Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.9
Applied rewrites38.9%
if -8.49999999999999977e145 < x < -3.59999999999999996e31Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around inf
lower-/.f6446.9
Applied rewrites46.9%
if -3.59999999999999996e31 < x < -2.1999999999999999e-50Initial program 69.0%
Taylor expanded in x around inf
unpow2N/A
lower-*.f6436.1
Applied rewrites36.1%
if -2.1999999999999999e-50 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y) :precision binary64 (if (<= x -1.56e-55) (/ (* 1.0 (/ y (- (+ y x) -1.0))) (+ y x)) (/ (/ x (+ 1.0 y)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -1.56e-55) {
tmp = (1.0 * (y / ((y + x) - -1.0))) / (y + x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-1.56d-55)) then
tmp = (1.0d0 * (y / ((y + x) - (-1.0d0)))) / (y + x)
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.56e-55) {
tmp = (1.0 * (y / ((y + x) - -1.0))) / (y + x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.56e-55: tmp = (1.0 * (y / ((y + x) - -1.0))) / (y + x) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.56e-55) tmp = Float64(Float64(1.0 * Float64(y / Float64(Float64(y + x) - -1.0))) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.56e-55) tmp = (1.0 * (y / ((y + x) - -1.0))) / (y + x); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.56e-55], N[(N[(1.0 * N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{\left(y + x\right) - -1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -1.56e-55Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites51.7%
if -1.56e-55 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y)
:precision binary64
(if (<= x -3.35e+15)
(/ (/ y x) (+ y x))
(if (<= x -2.2e-50)
(/ y (* (+ 1.0 x) x))
(if (<= x 1e-35) (/ x (* (+ 1.0 y) y)) (/ (/ x y) y)))))
double code(double x, double y) {
double tmp;
if (x <= -3.35e+15) {
tmp = (y / x) / (y + x);
} else if (x <= -2.2e-50) {
tmp = y / ((1.0 + x) * x);
} else if (x <= 1e-35) {
tmp = x / ((1.0 + y) * y);
} else {
tmp = (x / y) / 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 (x <= (-3.35d+15)) then
tmp = (y / x) / (y + x)
else if (x <= (-2.2d-50)) then
tmp = y / ((1.0d0 + x) * x)
else if (x <= 1d-35) then
tmp = x / ((1.0d0 + y) * y)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.35e+15) {
tmp = (y / x) / (y + x);
} else if (x <= -2.2e-50) {
tmp = y / ((1.0 + x) * x);
} else if (x <= 1e-35) {
tmp = x / ((1.0 + y) * y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.35e+15: tmp = (y / x) / (y + x) elif x <= -2.2e-50: tmp = y / ((1.0 + x) * x) elif x <= 1e-35: tmp = x / ((1.0 + y) * y) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -3.35e+15) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.2e-50) tmp = Float64(y / Float64(Float64(1.0 + x) * x)); elseif (x <= 1e-35) tmp = Float64(x / Float64(Float64(1.0 + y) * y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.35e+15) tmp = (y / x) / (y + x); elseif (x <= -2.2e-50) tmp = y / ((1.0 + x) * x); elseif (x <= 1e-35) tmp = x / ((1.0 + y) * y); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.35e+15], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e-50], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-35], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.35 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
\mathbf{elif}\;x \leq 10^{-35}:\\
\;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -3.35e15Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.9
Applied rewrites38.9%
if -3.35e15 < x < -2.1999999999999999e-50Initial program 69.0%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6448.8
Applied rewrites48.8%
if -2.1999999999999999e-50 < x < 1.00000000000000001e-35Initial program 69.0%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6448.9
Applied rewrites48.9%
if 1.00000000000000001e-35 < x Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.7
Applied rewrites37.7%
(FPCore (x y) :precision binary64 (if (<= x -1.56e-55) (* (/ 1.0 (+ y x)) (/ y (- (+ y x) -1.0))) (/ (/ x (+ 1.0 y)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -1.56e-55) {
tmp = (1.0 / (y + x)) * (y / ((y + x) - -1.0));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-1.56d-55)) then
tmp = (1.0d0 / (y + x)) * (y / ((y + x) - (-1.0d0)))
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.56e-55) {
tmp = (1.0 / (y + x)) * (y / ((y + x) - -1.0));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.56e-55: tmp = (1.0 / (y + x)) * (y / ((y + x) - -1.0)) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.56e-55) tmp = Float64(Float64(1.0 / Float64(y + x)) * Float64(y / Float64(Float64(y + x) - -1.0))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.56e-55) tmp = (1.0 / (y + x)) * (y / ((y + x) - -1.0)); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.56e-55], N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{1}{y + x} \cdot \frac{y}{\left(y + x\right) - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -1.56e-55Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites51.6%
if -1.56e-55 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y) :precision binary64 (if (<= x -3.35e+15) (/ (/ y x) (+ y x)) (if (<= x -1.56e-55) (/ y (* (+ 1.0 x) x)) (/ (/ x (+ 1.0 y)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -3.35e+15) {
tmp = (y / x) / (y + x);
} else if (x <= -1.56e-55) {
tmp = y / ((1.0 + x) * x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-3.35d+15)) then
tmp = (y / x) / (y + x)
else if (x <= (-1.56d-55)) then
tmp = y / ((1.0d0 + x) * x)
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.35e+15) {
tmp = (y / x) / (y + x);
} else if (x <= -1.56e-55) {
tmp = y / ((1.0 + x) * x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.35e+15: tmp = (y / x) / (y + x) elif x <= -1.56e-55: tmp = y / ((1.0 + x) * x) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.35e+15) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -1.56e-55) tmp = Float64(y / Float64(Float64(1.0 + x) * x)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.35e+15) tmp = (y / x) / (y + x); elseif (x <= -1.56e-55) tmp = y / ((1.0 + x) * x); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.35e+15], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.56e-55], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.35 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -3.35e15Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6438.9
Applied rewrites38.9%
if -3.35e15 < x < -1.56e-55Initial program 69.0%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6448.8
Applied rewrites48.8%
if -1.56e-55 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y) :precision binary64 (if (<= x -1.56e-55) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ 1.0 y)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -1.56e-55) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
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 (x <= (-1.56d-55)) then
tmp = (y / (1.0d0 + x)) / (y + x)
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.56e-55) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.56e-55: tmp = (y / (1.0 + x)) / (y + x) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.56e-55) tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.56e-55) tmp = (y / (1.0 + x)) / (y + x); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.56e-55], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.56 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -1.56e-55Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
if -1.56e-55 < x Initial program 69.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6487.6
Applied rewrites87.6%
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6450.9
Applied rewrites50.9%
(FPCore (x y)
:precision binary64
(if (<= x -4e+153)
(/ (/ y x) x)
(if (<= x -2.2e-50)
(/ y (* (+ 1.0 x) x))
(if (<= x 1e-35) (/ x (* (+ 1.0 y) y)) (/ (/ x y) y)))))
double code(double x, double y) {
double tmp;
if (x <= -4e+153) {
tmp = (y / x) / x;
} else if (x <= -2.2e-50) {
tmp = y / ((1.0 + x) * x);
} else if (x <= 1e-35) {
tmp = x / ((1.0 + y) * y);
} else {
tmp = (x / y) / 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 (x <= (-4d+153)) then
tmp = (y / x) / x
else if (x <= (-2.2d-50)) then
tmp = y / ((1.0d0 + x) * x)
else if (x <= 1d-35) then
tmp = x / ((1.0d0 + y) * y)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4e+153) {
tmp = (y / x) / x;
} else if (x <= -2.2e-50) {
tmp = y / ((1.0 + x) * x);
} else if (x <= 1e-35) {
tmp = x / ((1.0 + y) * y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4e+153: tmp = (y / x) / x elif x <= -2.2e-50: tmp = y / ((1.0 + x) * x) elif x <= 1e-35: tmp = x / ((1.0 + y) * y) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -4e+153) tmp = Float64(Float64(y / x) / x); elseif (x <= -2.2e-50) tmp = Float64(y / Float64(Float64(1.0 + x) * x)); elseif (x <= 1e-35) tmp = Float64(x / Float64(Float64(1.0 + y) * y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4e+153) tmp = (y / x) / x; elseif (x <= -2.2e-50) tmp = y / ((1.0 + x) * x); elseif (x <= 1e-35) tmp = x / ((1.0 + y) * y); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4e+153], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.2e-50], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-35], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
\mathbf{elif}\;x \leq 10^{-35}:\\
\;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -4e153Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-/.f6438.5
Applied rewrites38.5%
if -4e153 < x < -2.1999999999999999e-50Initial program 69.0%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6448.8
Applied rewrites48.8%
if -2.1999999999999999e-50 < x < 1.00000000000000001e-35Initial program 69.0%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6448.9
Applied rewrites48.9%
if 1.00000000000000001e-35 < x Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.7
Applied rewrites37.7%
(FPCore (x y) :precision binary64 (if (<= x -38.0) (/ (/ y x) x) (if (<= x 1e-35) (/ x (* (+ 1.0 y) y)) (/ (/ x y) y))))
double code(double x, double y) {
double tmp;
if (x <= -38.0) {
tmp = (y / x) / x;
} else if (x <= 1e-35) {
tmp = x / ((1.0 + y) * y);
} else {
tmp = (x / y) / 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 (x <= (-38.0d0)) then
tmp = (y / x) / x
else if (x <= 1d-35) then
tmp = x / ((1.0d0 + y) * y)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -38.0) {
tmp = (y / x) / x;
} else if (x <= 1e-35) {
tmp = x / ((1.0 + y) * y);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -38.0: tmp = (y / x) / x elif x <= 1e-35: tmp = x / ((1.0 + y) * y) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -38.0) tmp = Float64(Float64(y / x) / x); elseif (x <= 1e-35) tmp = Float64(x / Float64(Float64(1.0 + y) * y)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -38.0) tmp = (y / x) / x; elseif (x <= 1e-35) tmp = x / ((1.0 + y) * y); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -38.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1e-35], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -38:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq 10^{-35}:\\
\;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if x < -38Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-/.f6438.5
Applied rewrites38.5%
if -38 < x < 1.00000000000000001e-35Initial program 69.0%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6448.9
Applied rewrites48.9%
if 1.00000000000000001e-35 < x Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.7
Applied rewrites37.7%
(FPCore (x y) :precision binary64 (if (<= y 27000000000000.0) (/ (/ y x) x) (/ (/ x y) y)))
double code(double x, double y) {
double tmp;
if (y <= 27000000000000.0) {
tmp = (y / x) / x;
} else {
tmp = (x / y) / 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 <= 27000000000000.0d0) then
tmp = (y / x) / x
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 27000000000000.0) {
tmp = (y / x) / x;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 27000000000000.0: tmp = (y / x) / x else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 27000000000000.0) tmp = Float64(Float64(y / x) / x); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 27000000000000.0) tmp = (y / x) / x; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 27000000000000.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 27000000000000:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 2.7e13Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-/.f6438.5
Applied rewrites38.5%
if 2.7e13 < y Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.7
Applied rewrites37.7%
(FPCore (x y) :precision binary64 (if (<= y 27000000000000.0) (/ y (* x x)) (/ (/ x y) y)))
double code(double x, double y) {
double tmp;
if (y <= 27000000000000.0) {
tmp = y / (x * x);
} else {
tmp = (x / y) / 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 <= 27000000000000.0d0) then
tmp = y / (x * x)
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 27000000000000.0) {
tmp = y / (x * x);
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 27000000000000.0: tmp = y / (x * x) else: tmp = (x / y) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 27000000000000.0) tmp = Float64(y / Float64(x * x)); else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 27000000000000.0) tmp = y / (x * x); else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 27000000000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 27000000000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 2.7e13Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
if 2.7e13 < y Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.7
Applied rewrites37.7%
(FPCore (x y) :precision binary64 (if (<= y 27000000000000.0) (/ y (* x x)) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 27000000000000.0) {
tmp = y / (x * x);
} else {
tmp = x / (y * 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 <= 27000000000000.0d0) then
tmp = y / (x * x)
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 27000000000000.0) {
tmp = y / (x * x);
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 27000000000000.0: tmp = y / (x * x) else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 27000000000000.0) tmp = Float64(y / Float64(x * x)); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 27000000000000.0) tmp = y / (x * x); else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 27000000000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 27000000000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 2.7e13Initial program 69.0%
Taylor expanded in x around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.9
Applied rewrites36.9%
if 2.7e13 < y Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
(FPCore (x y) :precision binary64 (/ x (* y y)))
double code(double x, double y) {
return x / (y * 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 * y)
end function
public static double code(double x, double y) {
return x / (y * y);
}
def code(x, y): return x / (y * y)
function code(x, y) return Float64(x / Float64(y * y)) end
function tmp = code(x, y) tmp = x / (y * y); end
code[x_, y_] := N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot y}
\end{array}
Initial program 69.0%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6436.2
Applied rewrites36.2%
herbie shell --seed 2025134
(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))))