
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Initial program 99.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.8e-43)
(- 1.0 (/ (/ x (- z)) (- y t)))
(if (<= z 1.16e-208)
(- 1.0 (/ x (* (- y t) y)))
(+ (/ (/ x t) (- y z)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = 1.0 - ((x / -z) / (y - t));
} else if (z <= 1.16e-208) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = ((x / t) / (y - z)) + 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.8d-43)) then
tmp = 1.0d0 - ((x / -z) / (y - t))
else if (z <= 1.16d-208) then
tmp = 1.0d0 - (x / ((y - t) * y))
else
tmp = ((x / t) / (y - z)) + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = 1.0 - ((x / -z) / (y - t));
} else if (z <= 1.16e-208) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = ((x / t) / (y - z)) + 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-43: tmp = 1.0 - ((x / -z) / (y - t)) elif z <= 1.16e-208: tmp = 1.0 - (x / ((y - t) * y)) else: tmp = ((x / t) / (y - z)) + 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-43) tmp = Float64(1.0 - Float64(Float64(x / Float64(-z)) / Float64(y - t))); elseif (z <= 1.16e-208) tmp = Float64(1.0 - Float64(x / Float64(Float64(y - t) * y))); else tmp = Float64(Float64(Float64(x / t) / Float64(y - z)) + 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e-43) tmp = 1.0 - ((x / -z) / (y - t)); elseif (z <= 1.16e-208) tmp = 1.0 - (x / ((y - t) * y)); else tmp = ((x / t) / (y - z)) + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-43], N[(1.0 - N[(N[(x / (-z)), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e-208], N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;1 - \frac{\frac{x}{-z}}{y - t}\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{x}{\left(y - t\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z} + 1\\
\end{array}
\end{array}
if z < -1.7999999999999999e-43Initial program 99.1%
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--.f6498.4
Applied rewrites98.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6478.2
Applied rewrites78.2%
if -1.7999999999999999e-43 < z < 1.1600000000000001e-208Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if 1.1600000000000001e-208 < z Initial program 99.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.5
Applied rewrites78.5%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6478.3
Applied rewrites78.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.8e-43)
(+ (/ x (* (- y t) z)) 1.0)
(if (<= z 1.16e-208)
(- 1.0 (/ x (* (- y t) y)))
(+ (/ (/ x t) (- y z)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = (x / ((y - t) * z)) + 1.0;
} else if (z <= 1.16e-208) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = ((x / t) / (y - z)) + 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.8d-43)) then
tmp = (x / ((y - t) * z)) + 1.0d0
else if (z <= 1.16d-208) then
tmp = 1.0d0 - (x / ((y - t) * y))
else
tmp = ((x / t) / (y - z)) + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = (x / ((y - t) * z)) + 1.0;
} else if (z <= 1.16e-208) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = ((x / t) / (y - z)) + 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-43: tmp = (x / ((y - t) * z)) + 1.0 elif z <= 1.16e-208: tmp = 1.0 - (x / ((y - t) * y)) else: tmp = ((x / t) / (y - z)) + 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-43) tmp = Float64(Float64(x / Float64(Float64(y - t) * z)) + 1.0); elseif (z <= 1.16e-208) tmp = Float64(1.0 - Float64(x / Float64(Float64(y - t) * y))); else tmp = Float64(Float64(Float64(x / t) / Float64(y - z)) + 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e-43) tmp = (x / ((y - t) * z)) + 1.0; elseif (z <= 1.16e-208) tmp = 1.0 - (x / ((y - t) * y)); else tmp = ((x / t) / (y - z)) + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-43], N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 1.16e-208], N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(y - t\right) \cdot z} + 1\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{x}{\left(y - t\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z} + 1\\
\end{array}
\end{array}
if z < -1.7999999999999999e-43Initial program 99.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.4
Applied rewrites78.4%
if -1.7999999999999999e-43 < z < 1.1600000000000001e-208Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if 1.1600000000000001e-208 < z Initial program 99.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.5
Applied rewrites78.5%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6478.3
Applied rewrites78.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.8e-43)
(+ (/ x (* (- y t) z)) 1.0)
(if (<= z 1.16e-208)
(- 1.0 (/ x (* (- y t) y)))
(+ (/ x (* (- y z) t)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = (x / ((y - t) * z)) + 1.0;
} else if (z <= 1.16e-208) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = (x / ((y - z) * t)) + 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.8d-43)) then
tmp = (x / ((y - t) * z)) + 1.0d0
else if (z <= 1.16d-208) then
tmp = 1.0d0 - (x / ((y - t) * y))
else
tmp = (x / ((y - z) * t)) + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = (x / ((y - t) * z)) + 1.0;
} else if (z <= 1.16e-208) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = (x / ((y - z) * t)) + 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-43: tmp = (x / ((y - t) * z)) + 1.0 elif z <= 1.16e-208: tmp = 1.0 - (x / ((y - t) * y)) else: tmp = (x / ((y - z) * t)) + 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-43) tmp = Float64(Float64(x / Float64(Float64(y - t) * z)) + 1.0); elseif (z <= 1.16e-208) tmp = Float64(1.0 - Float64(x / Float64(Float64(y - t) * y))); else tmp = Float64(Float64(x / Float64(Float64(y - z) * t)) + 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e-43) tmp = (x / ((y - t) * z)) + 1.0; elseif (z <= 1.16e-208) tmp = 1.0 - (x / ((y - t) * y)); else tmp = (x / ((y - z) * t)) + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-43], N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 1.16e-208], N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(y - t\right) \cdot z} + 1\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-208}:\\
\;\;\;\;1 - \frac{x}{\left(y - t\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t} + 1\\
\end{array}
\end{array}
if z < -1.7999999999999999e-43Initial program 99.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.4
Applied rewrites78.4%
if -1.7999999999999999e-43 < z < 1.1600000000000001e-208Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if 1.1600000000000001e-208 < z Initial program 99.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.5
Applied rewrites78.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e-43) (+ (/ x (* (- y t) z)) 1.0) (if (<= z 1.32e-105) (- 1.0 (/ x (* (- y t) y))) (- 1.0 (/ x (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = (x / ((y - t) * z)) + 1.0;
} else if (z <= 1.32e-105) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = 1.0 - (x / (t * z));
}
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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.8d-43)) then
tmp = (x / ((y - t) * z)) + 1.0d0
else if (z <= 1.32d-105) then
tmp = 1.0d0 - (x / ((y - t) * y))
else
tmp = 1.0d0 - (x / (t * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e-43) {
tmp = (x / ((y - t) * z)) + 1.0;
} else if (z <= 1.32e-105) {
tmp = 1.0 - (x / ((y - t) * y));
} else {
tmp = 1.0 - (x / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e-43: tmp = (x / ((y - t) * z)) + 1.0 elif z <= 1.32e-105: tmp = 1.0 - (x / ((y - t) * y)) else: tmp = 1.0 - (x / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e-43) tmp = Float64(Float64(x / Float64(Float64(y - t) * z)) + 1.0); elseif (z <= 1.32e-105) tmp = Float64(1.0 - Float64(x / Float64(Float64(y - t) * y))); else tmp = Float64(1.0 - Float64(x / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e-43) tmp = (x / ((y - t) * z)) + 1.0; elseif (z <= 1.32e-105) tmp = 1.0 - (x / ((y - t) * y)); else tmp = 1.0 - (x / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e-43], N[(N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 1.32e-105], N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(y - t\right) \cdot z} + 1\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-105}:\\
\;\;\;\;1 - \frac{x}{\left(y - t\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-43Initial program 99.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.4
Applied rewrites78.4%
if -1.7999999999999999e-43 < z < 1.32000000000000006e-105Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if 1.32000000000000006e-105 < z Initial program 99.1%
Taylor expanded in y around 0
lower-*.f6461.2
Applied rewrites61.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* (- y z) (- y t))))))
(if (<= t_1 -2e+130)
(- 1.0 (/ x (* y y)))
(if (<= t_1 -1e+17)
(- 1.0 (/ x (* t z)))
(if (<= t_1 10.0)
1.0
(if (<= t_1 2e+55)
(+ (/ (/ x t) (- z)) 1.0)
(+ (/ x (* y z)) 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if (t_1 <= -2e+130) {
tmp = 1.0 - (x / (y * y));
} else if (t_1 <= -1e+17) {
tmp = 1.0 - (x / (t * z));
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else if (t_1 <= 2e+55) {
tmp = ((x / t) / -z) + 1.0;
} else {
tmp = (x / (y * z)) + 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - z) * (y - t)))
if (t_1 <= (-2d+130)) then
tmp = 1.0d0 - (x / (y * y))
else if (t_1 <= (-1d+17)) then
tmp = 1.0d0 - (x / (t * z))
else if (t_1 <= 10.0d0) then
tmp = 1.0d0
else if (t_1 <= 2d+55) then
tmp = ((x / t) / -z) + 1.0d0
else
tmp = (x / (y * z)) + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if (t_1 <= -2e+130) {
tmp = 1.0 - (x / (y * y));
} else if (t_1 <= -1e+17) {
tmp = 1.0 - (x / (t * z));
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else if (t_1 <= 2e+55) {
tmp = ((x / t) / -z) + 1.0;
} else {
tmp = (x / (y * z)) + 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - z) * (y - t))) tmp = 0 if t_1 <= -2e+130: tmp = 1.0 - (x / (y * y)) elif t_1 <= -1e+17: tmp = 1.0 - (x / (t * z)) elif t_1 <= 10.0: tmp = 1.0 elif t_1 <= 2e+55: tmp = ((x / t) / -z) + 1.0 else: tmp = (x / (y * z)) + 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) tmp = 0.0 if (t_1 <= -2e+130) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (t_1 <= -1e+17) tmp = Float64(1.0 - Float64(x / Float64(t * z))); elseif (t_1 <= 10.0) tmp = 1.0; elseif (t_1 <= 2e+55) tmp = Float64(Float64(Float64(x / t) / Float64(-z)) + 1.0); else tmp = Float64(Float64(x / Float64(y * z)) + 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - z) * (y - t))); tmp = 0.0; if (t_1 <= -2e+130) tmp = 1.0 - (x / (y * y)); elseif (t_1 <= -1e+17) tmp = 1.0 - (x / (t * z)); elseif (t_1 <= 10.0) tmp = 1.0; elseif (t_1 <= 2e+55) tmp = ((x / t) / -z) + 1.0; else tmp = (x / (y * z)) + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+130], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+17], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10.0], 1.0, If[LessEqual[t$95$1, 2e+55], N[(N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+130}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+17}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+55}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z} + 1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot z} + 1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2.0000000000000001e130Initial program 99.1%
Taylor expanded in y around inf
unpow2N/A
lower-*.f6458.1
Applied rewrites58.1%
if -2.0000000000000001e130 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -1e17Initial program 99.1%
Taylor expanded in y around 0
lower-*.f6461.2
Applied rewrites61.2%
if -1e17 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 10Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
if 10 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 2.00000000000000002e55Initial program 99.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.5
Applied rewrites78.5%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6478.3
Applied rewrites78.3%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6460.8
Applied rewrites60.8%
if 2.00000000000000002e55 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 99.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.4
Applied rewrites78.4%
Taylor expanded in y around inf
lower-*.f6456.6
Applied rewrites56.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* (- y z) (- y t))))) (t_2 (- 1.0 (/ x (* t z)))))
(if (<= t_1 -2e+130)
(- 1.0 (/ x (* y y)))
(if (<= t_1 -1e+17)
t_2
(if (<= t_1 10.0) 1.0 (if (<= t_1 2e+55) t_2 (+ (/ x (* y z)) 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double t_2 = 1.0 - (x / (t * z));
double tmp;
if (t_1 <= -2e+130) {
tmp = 1.0 - (x / (y * y));
} else if (t_1 <= -1e+17) {
tmp = t_2;
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else if (t_1 <= 2e+55) {
tmp = t_2;
} else {
tmp = (x / (y * z)) + 1.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - z) * (y - t)))
t_2 = 1.0d0 - (x / (t * z))
if (t_1 <= (-2d+130)) then
tmp = 1.0d0 - (x / (y * y))
else if (t_1 <= (-1d+17)) then
tmp = t_2
else if (t_1 <= 10.0d0) then
tmp = 1.0d0
else if (t_1 <= 2d+55) then
tmp = t_2
else
tmp = (x / (y * z)) + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double t_2 = 1.0 - (x / (t * z));
double tmp;
if (t_1 <= -2e+130) {
tmp = 1.0 - (x / (y * y));
} else if (t_1 <= -1e+17) {
tmp = t_2;
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else if (t_1 <= 2e+55) {
tmp = t_2;
} else {
tmp = (x / (y * z)) + 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - z) * (y - t))) t_2 = 1.0 - (x / (t * z)) tmp = 0 if t_1 <= -2e+130: tmp = 1.0 - (x / (y * y)) elif t_1 <= -1e+17: tmp = t_2 elif t_1 <= 10.0: tmp = 1.0 elif t_1 <= 2e+55: tmp = t_2 else: tmp = (x / (y * z)) + 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) t_2 = Float64(1.0 - Float64(x / Float64(t * z))) tmp = 0.0 if (t_1 <= -2e+130) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (t_1 <= -1e+17) tmp = t_2; elseif (t_1 <= 10.0) tmp = 1.0; elseif (t_1 <= 2e+55) tmp = t_2; else tmp = Float64(Float64(x / Float64(y * z)) + 1.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - z) * (y - t))); t_2 = 1.0 - (x / (t * z)); tmp = 0.0; if (t_1 <= -2e+130) tmp = 1.0 - (x / (y * y)); elseif (t_1 <= -1e+17) tmp = t_2; elseif (t_1 <= 10.0) tmp = 1.0; elseif (t_1 <= 2e+55) tmp = t_2; else tmp = (x / (y * z)) + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+130], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+17], t$95$2, If[LessEqual[t$95$1, 10.0], 1.0, If[LessEqual[t$95$1, 2e+55], t$95$2, N[(N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
t_2 := 1 - \frac{x}{t \cdot z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+130}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+55}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot z} + 1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2.0000000000000001e130Initial program 99.1%
Taylor expanded in y around inf
unpow2N/A
lower-*.f6458.1
Applied rewrites58.1%
if -2.0000000000000001e130 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -1e17 or 10 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 2.00000000000000002e55Initial program 99.1%
Taylor expanded in y around 0
lower-*.f6461.2
Applied rewrites61.2%
if -1e17 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 10Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
if 2.00000000000000002e55 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 99.1%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6478.4
Applied rewrites78.4%
Taylor expanded in y around inf
lower-*.f6456.6
Applied rewrites56.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* (- y t) y))))
(t_2 (- 1.0 (/ x (* (- y z) (- y t))))))
(if (<= t_2 -2e+130)
t_1
(if (<= t_2 -1e+17) (- 1.0 (/ x (* t z))) (if (<= t_2 1.0) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - t) * y));
double t_2 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if (t_2 <= -2e+130) {
tmp = t_1;
} else if (t_2 <= -1e+17) {
tmp = 1.0 - (x / (t * z));
} else if (t_2 <= 1.0) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - t) * y))
t_2 = 1.0d0 - (x / ((y - z) * (y - t)))
if (t_2 <= (-2d+130)) then
tmp = t_1
else if (t_2 <= (-1d+17)) then
tmp = 1.0d0 - (x / (t * z))
else if (t_2 <= 1.0d0) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - t) * y));
double t_2 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if (t_2 <= -2e+130) {
tmp = t_1;
} else if (t_2 <= -1e+17) {
tmp = 1.0 - (x / (t * z));
} else if (t_2 <= 1.0) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - t) * y)) t_2 = 1.0 - (x / ((y - z) * (y - t))) tmp = 0 if t_2 <= -2e+130: tmp = t_1 elif t_2 <= -1e+17: tmp = 1.0 - (x / (t * z)) elif t_2 <= 1.0: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - t) * y))) t_2 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) tmp = 0.0 if (t_2 <= -2e+130) tmp = t_1; elseif (t_2 <= -1e+17) tmp = Float64(1.0 - Float64(x / Float64(t * z))); elseif (t_2 <= 1.0) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - t) * y)); t_2 = 1.0 - (x / ((y - z) * (y - t))); tmp = 0.0; if (t_2 <= -2e+130) tmp = t_1; elseif (t_2 <= -1e+17) tmp = 1.0 - (x / (t * z)); elseif (t_2 <= 1.0) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+130], t$95$1, If[LessEqual[t$95$2, -1e+17], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.0], 1.0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - t\right) \cdot y}\\
t_2 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+17}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{elif}\;t\_2 \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2.0000000000000001e130 or 1 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if -2.0000000000000001e130 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -1e17Initial program 99.1%
Taylor expanded in y around 0
lower-*.f6461.2
Applied rewrites61.2%
if -1e17 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 1Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* (- y z) (- y t))))))
(if (<= t_1 0.9999999999999999)
(- 1.0 (/ x (* (- y z) y)))
(if (<= t_1 1.0) 1.0 (- 1.0 (/ x (* (- y t) y)))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if (t_1 <= 0.9999999999999999) {
tmp = 1.0 - (x / ((y - z) * y));
} else if (t_1 <= 1.0) {
tmp = 1.0;
} else {
tmp = 1.0 - (x / ((y - t) * 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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - z) * (y - t)))
if (t_1 <= 0.9999999999999999d0) then
tmp = 1.0d0 - (x / ((y - z) * y))
else if (t_1 <= 1.0d0) then
tmp = 1.0d0
else
tmp = 1.0d0 - (x / ((y - t) * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double tmp;
if (t_1 <= 0.9999999999999999) {
tmp = 1.0 - (x / ((y - z) * y));
} else if (t_1 <= 1.0) {
tmp = 1.0;
} else {
tmp = 1.0 - (x / ((y - t) * y));
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - z) * (y - t))) tmp = 0 if t_1 <= 0.9999999999999999: tmp = 1.0 - (x / ((y - z) * y)) elif t_1 <= 1.0: tmp = 1.0 else: tmp = 1.0 - (x / ((y - t) * y)) return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) tmp = 0.0 if (t_1 <= 0.9999999999999999) tmp = Float64(1.0 - Float64(x / Float64(Float64(y - z) * y))); elseif (t_1 <= 1.0) tmp = 1.0; else tmp = Float64(1.0 - Float64(x / Float64(Float64(y - t) * y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - z) * (y - t))); tmp = 0.0; if (t_1 <= 0.9999999999999999) tmp = 1.0 - (x / ((y - z) * y)); elseif (t_1 <= 1.0) tmp = 1.0; else tmp = 1.0 - (x / ((y - t) * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.9999999999999999], N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], 1.0, N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
\mathbf{if}\;t\_1 \leq 0.9999999999999999:\\
\;\;\;\;1 - \frac{x}{\left(y - z\right) \cdot y}\\
\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{\left(y - t\right) \cdot y}\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 0.999999999999999889Initial program 99.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
if 0.999999999999999889 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 1Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
if 1 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6472.9
Applied rewrites72.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* (- y z) (- y t))))) (t_2 (- 1.0 (/ x (* t z)))))
(if (<= t_1 -2e+130)
(- 1.0 (/ x (* y y)))
(if (<= t_1 -1e+17) t_2 (if (<= t_1 10.0) 1.0 t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double t_2 = 1.0 - (x / (t * z));
double tmp;
if (t_1 <= -2e+130) {
tmp = 1.0 - (x / (y * y));
} else if (t_1 <= -1e+17) {
tmp = t_2;
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else {
tmp = t_2;
}
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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - (x / ((y - z) * (y - t)))
t_2 = 1.0d0 - (x / (t * z))
if (t_1 <= (-2d+130)) then
tmp = 1.0d0 - (x / (y * y))
else if (t_1 <= (-1d+17)) then
tmp = t_2
else if (t_1 <= 10.0d0) then
tmp = 1.0d0
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / ((y - z) * (y - t)));
double t_2 = 1.0 - (x / (t * z));
double tmp;
if (t_1 <= -2e+130) {
tmp = 1.0 - (x / (y * y));
} else if (t_1 <= -1e+17) {
tmp = t_2;
} else if (t_1 <= 10.0) {
tmp = 1.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / ((y - z) * (y - t))) t_2 = 1.0 - (x / (t * z)) tmp = 0 if t_1 <= -2e+130: tmp = 1.0 - (x / (y * y)) elif t_1 <= -1e+17: tmp = t_2 elif t_1 <= 10.0: tmp = 1.0 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) t_2 = Float64(1.0 - Float64(x / Float64(t * z))) tmp = 0.0 if (t_1 <= -2e+130) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (t_1 <= -1e+17) tmp = t_2; elseif (t_1 <= 10.0) tmp = 1.0; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / ((y - z) * (y - t))); t_2 = 1.0 - (x / (t * z)); tmp = 0.0; if (t_1 <= -2e+130) tmp = 1.0 - (x / (y * y)); elseif (t_1 <= -1e+17) tmp = t_2; elseif (t_1 <= 10.0) tmp = 1.0; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+130], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e+17], t$95$2, If[LessEqual[t$95$1, 10.0], 1.0, t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
t_2 := 1 - \frac{x}{t \cdot z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+130}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -2.0000000000000001e130Initial program 99.1%
Taylor expanded in y around inf
unpow2N/A
lower-*.f6458.1
Applied rewrites58.1%
if -2.0000000000000001e130 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < -1e17 or 10 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) Initial program 99.1%
Taylor expanded in y around 0
lower-*.f6461.2
Applied rewrites61.2%
if -1e17 < (-.f64 #s(literal 1 binary64) (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t)))) < 10Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* (- y z) (- y t)))) (t_2 (- 1.0 (/ x (* t z))))) (if (<= t_1 -2000000.0) t_2 (if (<= t_1 2e+16) 1.0 t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double t_2 = 1.0 - (x / (t * z));
double tmp;
if (t_1 <= -2000000.0) {
tmp = t_2;
} else if (t_1 <= 2e+16) {
tmp = 1.0;
} else {
tmp = t_2;
}
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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x / ((y - z) * (y - t))
t_2 = 1.0d0 - (x / (t * z))
if (t_1 <= (-2000000.0d0)) then
tmp = t_2
else if (t_1 <= 2d+16) then
tmp = 1.0d0
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / ((y - z) * (y - t));
double t_2 = 1.0 - (x / (t * z));
double tmp;
if (t_1 <= -2000000.0) {
tmp = t_2;
} else if (t_1 <= 2e+16) {
tmp = 1.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((y - z) * (y - t)) t_2 = 1.0 - (x / (t * z)) tmp = 0 if t_1 <= -2000000.0: tmp = t_2 elif t_1 <= 2e+16: tmp = 1.0 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(y - z) * Float64(y - t))) t_2 = Float64(1.0 - Float64(x / Float64(t * z))) tmp = 0.0 if (t_1 <= -2000000.0) tmp = t_2; elseif (t_1 <= 2e+16) tmp = 1.0; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((y - z) * (y - t)); t_2 = 1.0 - (x / (t * z)); tmp = 0.0; if (t_1 <= -2000000.0) tmp = t_2; elseif (t_1 <= 2e+16) tmp = 1.0; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000.0], t$95$2, If[LessEqual[t$95$1, 2e+16], 1.0, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}\\
t_2 := 1 - \frac{x}{t \cdot z}\\
\mathbf{if}\;t\_1 \leq -2000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+16}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < -2e6 or 2e16 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) Initial program 99.1%
Taylor expanded in y around 0
lower-*.f6461.2
Applied rewrites61.2%
if -2e6 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 y t))) < 2e16Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites74.8%
herbie shell --seed 2025131
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))