
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
(FPCore (x y z t) :precision binary64 (/ (/ x (- z (fmin y t))) (- z (fmax y t))))
double code(double x, double y, double z, double t) {
return (x / (z - fmin(y, t))) / (z - fmax(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 = (x / (z - fmin(y, t))) / (z - fmax(y, t))
end function
public static double code(double x, double y, double z, double t) {
return (x / (z - fmin(y, t))) / (z - fmax(y, t));
}
def code(x, y, z, t): return (x / (z - fmin(y, t))) / (z - fmax(y, t))
function code(x, y, z, t) return Float64(Float64(x / Float64(z - fmin(y, t))) / Float64(z - fmax(y, t))) end
function tmp = code(x, y, z, t) tmp = (x / (z - min(y, t))) / (z - max(y, t)); end
code[x_, y_, z_, t_] := N[(N[(x / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\frac{x}{z - \mathsf{min}\left(y, t\right)}}{z - \mathsf{max}\left(y, t\right)}
Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
(FPCore (x y z t) :precision binary64 (/ (/ x (- z t)) (- z y)))
double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - 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, 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 = (x / (z - t)) / (z - y)
end function
public static double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
def code(x, y, z, t): return (x / (z - t)) / (z - y)
function code(x, y, z, t) return Float64(Float64(x / Float64(z - t)) / Float64(z - y)) end
function tmp = code(x, y, z, t) tmp = (x / (z - t)) / (z - y); end
code[x_, y_, z_, t_] := N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\frac{\frac{x}{z - t}}{z - y}
Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-neg2N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6496.6%
Applied rewrites96.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) (- z (fmax y t)))))
(if (<= z -7.4e+112)
t_1
(if (<= z 3.9e+99) (/ x (* (- (fmin y t) z) (- (fmax y t) z))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / (z - fmax(y, t));
double tmp;
if (z <= -7.4e+112) {
tmp = t_1;
} else if (z <= 3.9e+99) {
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z));
} 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) :: tmp
t_1 = (x / z) / (z - fmax(y, t))
if (z <= (-7.4d+112)) then
tmp = t_1
else if (z <= 3.9d+99) then
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z))
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 = (x / z) / (z - fmax(y, t));
double tmp;
if (z <= -7.4e+112) {
tmp = t_1;
} else if (z <= 3.9e+99) {
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / (z - fmax(y, t)) tmp = 0 if z <= -7.4e+112: tmp = t_1 elif z <= 3.9e+99: tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / Float64(z - fmax(y, t))) tmp = 0.0 if (z <= -7.4e+112) tmp = t_1; elseif (z <= 3.9e+99) tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * Float64(fmax(y, t) - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / (z - max(y, t)); tmp = 0.0; if (z <= -7.4e+112) tmp = t_1; elseif (z <= 3.9e+99) tmp = x / ((min(y, t) - z) * (max(y, t) - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+112], t$95$1, If[LessEqual[z, 3.9e+99], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z - \mathsf{max}\left(y, t\right)}\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+99}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -7.40000000000000008e112 or 3.89999999999999995e99 < z Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
Applied rewrites57.7%
if -7.40000000000000008e112 < z < 3.89999999999999995e99Initial program 89.2%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -6.2e+52)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) -3.7e-14)
(/ (/ x (- z (fmin y t))) z)
(if (<= (fmin y t) 9e-118)
(/ (/ x z) (- z (fmax y t)))
(/ (/ x (- (fmin y t) z)) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -6.2e+52) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= -3.7e-14) {
tmp = (x / (z - fmin(y, t))) / z;
} else if (fmin(y, t) <= 9e-118) {
tmp = (x / z) / (z - fmax(y, t));
} else {
tmp = (x / (fmin(y, t) - z)) / fmax(y, t);
}
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 (fmin(y, t) <= (-6.2d+52)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= (-3.7d-14)) then
tmp = (x / (z - fmin(y, t))) / z
else if (fmin(y, t) <= 9d-118) then
tmp = (x / z) / (z - fmax(y, t))
else
tmp = (x / (fmin(y, t) - z)) / fmax(y, t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -6.2e+52) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= -3.7e-14) {
tmp = (x / (z - fmin(y, t))) / z;
} else if (fmin(y, t) <= 9e-118) {
tmp = (x / z) / (z - fmax(y, t));
} else {
tmp = (x / (fmin(y, t) - z)) / fmax(y, t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -6.2e+52: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= -3.7e-14: tmp = (x / (z - fmin(y, t))) / z elif fmin(y, t) <= 9e-118: tmp = (x / z) / (z - fmax(y, t)) else: tmp = (x / (fmin(y, t) - z)) / fmax(y, t) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmin(y, t) <= -6.2e+52) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= -3.7e-14) tmp = Float64(Float64(x / Float64(z - fmin(y, t))) / z); elseif (fmin(y, t) <= 9e-118) tmp = Float64(Float64(x / z) / Float64(z - fmax(y, t))); else tmp = Float64(Float64(x / Float64(fmin(y, t) - z)) / fmax(y, t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (min(y, t) <= -6.2e+52) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= -3.7e-14) tmp = (x / (z - min(y, t))) / z; elseif (min(y, t) <= 9e-118) tmp = (x / z) / (z - max(y, t)); else tmp = (x / (min(y, t) - z)) / max(y, t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Min[y, t], $MachinePrecision], -6.2e+52], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], -3.7e-14], N[(N[(x / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], 9e-118], N[(N[(x / z), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -6.2 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq -3.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{min}\left(y, t\right)}}{z}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 9 \cdot 10^{-118}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - \mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right) - z}}{\mathsf{max}\left(y, t\right)}\\
\end{array}
if y < -6.2e52Initial program 89.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6456.7%
Applied rewrites56.7%
if -6.2e52 < y < -3.70000000000000001e-14Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f6460.2%
Applied rewrites60.2%
if -3.70000000000000001e-14 < y < 9.0000000000000001e-118Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
Applied rewrites57.7%
if 9.0000000000000001e-118 < y Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6463.0%
Applied rewrites63.0%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -6.2e+52)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) -3.7e-14)
(/ (/ x (- z (fmin y t))) z)
(if (<= (fmin y t) 9e-118)
(/ (/ x z) (- z (fmax y t)))
(/ (/ x (fmax y t)) (- (fmin y t) z))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -6.2e+52) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= -3.7e-14) {
tmp = (x / (z - fmin(y, t))) / z;
} else if (fmin(y, t) <= 9e-118) {
tmp = (x / z) / (z - fmax(y, t));
} else {
tmp = (x / fmax(y, t)) / (fmin(y, 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 (fmin(y, t) <= (-6.2d+52)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= (-3.7d-14)) then
tmp = (x / (z - fmin(y, t))) / z
else if (fmin(y, t) <= 9d-118) then
tmp = (x / z) / (z - fmax(y, t))
else
tmp = (x / fmax(y, t)) / (fmin(y, t) - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -6.2e+52) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= -3.7e-14) {
tmp = (x / (z - fmin(y, t))) / z;
} else if (fmin(y, t) <= 9e-118) {
tmp = (x / z) / (z - fmax(y, t));
} else {
tmp = (x / fmax(y, t)) / (fmin(y, t) - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -6.2e+52: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= -3.7e-14: tmp = (x / (z - fmin(y, t))) / z elif fmin(y, t) <= 9e-118: tmp = (x / z) / (z - fmax(y, t)) else: tmp = (x / fmax(y, t)) / (fmin(y, t) - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmin(y, t) <= -6.2e+52) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= -3.7e-14) tmp = Float64(Float64(x / Float64(z - fmin(y, t))) / z); elseif (fmin(y, t) <= 9e-118) tmp = Float64(Float64(x / z) / Float64(z - fmax(y, t))); else tmp = Float64(Float64(x / fmax(y, t)) / Float64(fmin(y, t) - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (min(y, t) <= -6.2e+52) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= -3.7e-14) tmp = (x / (z - min(y, t))) / z; elseif (min(y, t) <= 9e-118) tmp = (x / z) / (z - max(y, t)); else tmp = (x / max(y, t)) / (min(y, t) - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Min[y, t], $MachinePrecision], -6.2e+52], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], -3.7e-14], N[(N[(x / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], 9e-118], N[(N[(x / z), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[Max[y, t], $MachinePrecision]), $MachinePrecision] / N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -6.2 \cdot 10^{+52}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq -3.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{min}\left(y, t\right)}}{z}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 9 \cdot 10^{-118}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - \mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{max}\left(y, t\right)}}{\mathsf{min}\left(y, t\right) - z}\\
\end{array}
if y < -6.2e52Initial program 89.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6456.7%
Applied rewrites56.7%
if -6.2e52 < y < -3.70000000000000001e-14Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f6460.2%
Applied rewrites60.2%
if -3.70000000000000001e-14 < y < 9.0000000000000001e-118Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
Applied rewrites57.7%
if 9.0000000000000001e-118 < y Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6458.2%
Applied rewrites58.2%
(FPCore (x y z t)
:precision binary64
(if (<= (fmax y t) -2.5e-16)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmax y t) 5.2e-61)
(/ (/ x (- z (fmin y t))) z)
(/ (/ x (fmax y t)) (- (fmin y t) z)))))double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmax(y, t) <= 5.2e-61) {
tmp = (x / (z - fmin(y, t))) / z;
} else {
tmp = (x / fmax(y, t)) / (fmin(y, 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 (fmax(y, t) <= (-2.5d-16)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmax(y, t) <= 5.2d-61) then
tmp = (x / (z - fmin(y, t))) / z
else
tmp = (x / fmax(y, t)) / (fmin(y, t) - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmax(y, t) <= 5.2e-61) {
tmp = (x / (z - fmin(y, t))) / z;
} else {
tmp = (x / fmax(y, t)) / (fmin(y, t) - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmax(y, t) <= -2.5e-16: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmax(y, t) <= 5.2e-61: tmp = (x / (z - fmin(y, t))) / z else: tmp = (x / fmax(y, t)) / (fmin(y, t) - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmax(y, t) <= -2.5e-16) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmax(y, t) <= 5.2e-61) tmp = Float64(Float64(x / Float64(z - fmin(y, t))) / z); else tmp = Float64(Float64(x / fmax(y, t)) / Float64(fmin(y, t) - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (max(y, t) <= -2.5e-16) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (max(y, t) <= 5.2e-61) tmp = (x / (z - min(y, t))) / z; else tmp = (x / max(y, t)) / (min(y, t) - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Max[y, t], $MachinePrecision], -2.5e-16], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[y, t], $MachinePrecision], 5.2e-61], N[(N[(x / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x / N[Max[y, t], $MachinePrecision]), $MachinePrecision] / N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(y, t\right) \leq -2.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{max}\left(y, t\right) \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{min}\left(y, t\right)}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{max}\left(y, t\right)}}{\mathsf{min}\left(y, t\right) - z}\\
\end{array}
if t < -2.5000000000000002e-16Initial program 89.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6456.7%
Applied rewrites56.7%
if -2.5000000000000002e-16 < t < 5.20000000000000021e-61Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f6460.2%
Applied rewrites60.2%
if 5.20000000000000021e-61 < t Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift--.f6458.2%
Applied rewrites58.2%
(FPCore (x y z t)
:precision binary64
(if (<= (fmax y t) -2.5e-16)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmax y t) 5.2e-61)
(/ (/ x (- z (fmin y t))) z)
(/ x (* (- (fmin y t) z) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmax(y, t) <= 5.2e-61) {
tmp = (x / (z - fmin(y, t))) / z;
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
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 (fmax(y, t) <= (-2.5d-16)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmax(y, t) <= 5.2d-61) then
tmp = (x / (z - fmin(y, t))) / z
else
tmp = x / ((fmin(y, t) - z) * fmax(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmax(y, t) <= 5.2e-61) {
tmp = (x / (z - fmin(y, t))) / z;
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmax(y, t) <= -2.5e-16: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmax(y, t) <= 5.2e-61: tmp = (x / (z - fmin(y, t))) / z else: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmax(y, t) <= -2.5e-16) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmax(y, t) <= 5.2e-61) tmp = Float64(Float64(x / Float64(z - fmin(y, t))) / z); else tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (max(y, t) <= -2.5e-16) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (max(y, t) <= 5.2e-61) tmp = (x / (z - min(y, t))) / z; else tmp = x / ((min(y, t) - z) * max(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Max[y, t], $MachinePrecision], -2.5e-16], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[y, t], $MachinePrecision], 5.2e-61], N[(N[(x / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(y, t\right) \leq -2.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{max}\left(y, t\right) \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{min}\left(y, t\right)}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\end{array}
if t < -2.5000000000000002e-16Initial program 89.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6456.7%
Applied rewrites56.7%
if -2.5000000000000002e-16 < t < 5.20000000000000021e-61Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-/.f6460.2%
Applied rewrites60.2%
if 5.20000000000000021e-61 < t Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -3.6e+51)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) -3.7e-14)
(/ x (* z (- z (fmin y t))))
(if (<= (fmin y t) 1.5e-106)
(/ x (* z (- z (fmax y t))))
(/ (/ x (fmin y t)) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -3.6e+51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= -3.7e-14) {
tmp = x / (z * (z - fmin(y, t)));
} else if (fmin(y, t) <= 1.5e-106) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = (x / fmin(y, t)) / fmax(y, t);
}
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 (fmin(y, t) <= (-3.6d+51)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= (-3.7d-14)) then
tmp = x / (z * (z - fmin(y, t)))
else if (fmin(y, t) <= 1.5d-106) then
tmp = x / (z * (z - fmax(y, t)))
else
tmp = (x / fmin(y, t)) / fmax(y, t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -3.6e+51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= -3.7e-14) {
tmp = x / (z * (z - fmin(y, t)));
} else if (fmin(y, t) <= 1.5e-106) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = (x / fmin(y, t)) / fmax(y, t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -3.6e+51: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= -3.7e-14: tmp = x / (z * (z - fmin(y, t))) elif fmin(y, t) <= 1.5e-106: tmp = x / (z * (z - fmax(y, t))) else: tmp = (x / fmin(y, t)) / fmax(y, t) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmin(y, t) <= -3.6e+51) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= -3.7e-14) tmp = Float64(x / Float64(z * Float64(z - fmin(y, t)))); elseif (fmin(y, t) <= 1.5e-106) tmp = Float64(x / Float64(z * Float64(z - fmax(y, t)))); else tmp = Float64(Float64(x / fmin(y, t)) / fmax(y, t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (min(y, t) <= -3.6e+51) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= -3.7e-14) tmp = x / (z * (z - min(y, t))); elseif (min(y, t) <= 1.5e-106) tmp = x / (z * (z - max(y, t))); else tmp = (x / min(y, t)) / max(y, t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Min[y, t], $MachinePrecision], -3.6e+51], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], -3.7e-14], N[(x / N[(z * N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], 1.5e-106], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -3.6 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq -3.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{min}\left(y, t\right)\right)}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 1.5 \cdot 10^{-106}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\end{array}
if y < -3.60000000000000011e51Initial program 89.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6456.7%
Applied rewrites56.7%
if -3.60000000000000011e51 < y < -3.70000000000000001e-14Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
if -3.70000000000000001e-14 < y < 1.50000000000000009e-106Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.2%
Applied rewrites53.2%
if 1.50000000000000009e-106 < y Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6463.0%
Applied rewrites63.0%
Taylor expanded in y around inf
lower-/.f6442.7%
Applied rewrites42.7%
(FPCore (x y z t)
:precision binary64
(if (<= (fmax y t) -2.5e-16)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmax y t) 5.2e-61)
(/ x (* z (- z (fmin y t))))
(/ x (* (- (fmin y t) z) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmax(y, t) <= 5.2e-61) {
tmp = x / (z * (z - fmin(y, t)));
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
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 (fmax(y, t) <= (-2.5d-16)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmax(y, t) <= 5.2d-61) then
tmp = x / (z * (z - fmin(y, t)))
else
tmp = x / ((fmin(y, t) - z) * fmax(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmax(y, t) <= 5.2e-61) {
tmp = x / (z * (z - fmin(y, t)));
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmax(y, t) <= -2.5e-16: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmax(y, t) <= 5.2e-61: tmp = x / (z * (z - fmin(y, t))) else: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmax(y, t) <= -2.5e-16) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmax(y, t) <= 5.2e-61) tmp = Float64(x / Float64(z * Float64(z - fmin(y, t)))); else tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (max(y, t) <= -2.5e-16) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (max(y, t) <= 5.2e-61) tmp = x / (z * (z - min(y, t))); else tmp = x / ((min(y, t) - z) * max(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Max[y, t], $MachinePrecision], -2.5e-16], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[y, t], $MachinePrecision], 5.2e-61], N[(x / N[(z * N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(y, t\right) \leq -2.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{max}\left(y, t\right) \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{min}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\end{array}
if t < -2.5000000000000002e-16Initial program 89.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6456.7%
Applied rewrites56.7%
if -2.5000000000000002e-16 < t < 5.20000000000000021e-61Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
if 5.20000000000000021e-61 < t Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
(FPCore (x y z t)
:precision binary64
(if (<= (fmax y t) -2.5e-16)
(/ (/ x (fmin y t)) (fmax y t))
(if (<= (fmax y t) 8.5e-49)
(/ x (* z (- z (fmin y t))))
(/ x (* z (- z (fmax y t)))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else if (fmax(y, t) <= 8.5e-49) {
tmp = x / (z * (z - fmin(y, t)));
} else {
tmp = x / (z * (z - fmax(y, t)));
}
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 (fmax(y, t) <= (-2.5d-16)) then
tmp = (x / fmin(y, t)) / fmax(y, t)
else if (fmax(y, t) <= 8.5d-49) then
tmp = x / (z * (z - fmin(y, t)))
else
tmp = x / (z * (z - fmax(y, t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmax(y, t) <= -2.5e-16) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else if (fmax(y, t) <= 8.5e-49) {
tmp = x / (z * (z - fmin(y, t)));
} else {
tmp = x / (z * (z - fmax(y, t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmax(y, t) <= -2.5e-16: tmp = (x / fmin(y, t)) / fmax(y, t) elif fmax(y, t) <= 8.5e-49: tmp = x / (z * (z - fmin(y, t))) else: tmp = x / (z * (z - fmax(y, t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmax(y, t) <= -2.5e-16) tmp = Float64(Float64(x / fmin(y, t)) / fmax(y, t)); elseif (fmax(y, t) <= 8.5e-49) tmp = Float64(x / Float64(z * Float64(z - fmin(y, t)))); else tmp = Float64(x / Float64(z * Float64(z - fmax(y, t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (max(y, t) <= -2.5e-16) tmp = (x / min(y, t)) / max(y, t); elseif (max(y, t) <= 8.5e-49) tmp = x / (z * (z - min(y, t))); else tmp = x / (z * (z - max(y, t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Max[y, t], $MachinePrecision], -2.5e-16], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[y, t], $MachinePrecision], 8.5e-49], N[(x / N[(z * N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(y, t\right) \leq -2.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{elif}\;\mathsf{max}\left(y, t\right) \leq 8.5 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{min}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\end{array}
if t < -2.5000000000000002e-16Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6463.0%
Applied rewrites63.0%
Taylor expanded in y around inf
lower-/.f6442.7%
Applied rewrites42.7%
if -2.5000000000000002e-16 < t < 8.50000000000000069e-49Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.5%
Applied rewrites53.5%
if 8.50000000000000069e-49 < t Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.2%
Applied rewrites53.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z (fmax y t))))))
(if (<= z -3.2e-92)
t_1
(if (<= z 1.02e-91) (/ (/ x (fmin y t)) (fmax y t)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - fmax(y, t)));
double tmp;
if (z <= -3.2e-92) {
tmp = t_1;
} else if (z <= 1.02e-91) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} 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) :: tmp
t_1 = x / (z * (z - fmax(y, t)))
if (z <= (-3.2d-92)) then
tmp = t_1
else if (z <= 1.02d-91) then
tmp = (x / fmin(y, t)) / fmax(y, t)
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 = x / (z * (z - fmax(y, t)));
double tmp;
if (z <= -3.2e-92) {
tmp = t_1;
} else if (z <= 1.02e-91) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - fmax(y, t))) tmp = 0 if z <= -3.2e-92: tmp = t_1 elif z <= 1.02e-91: tmp = (x / fmin(y, t)) / fmax(y, t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - fmax(y, t)))) tmp = 0.0 if (z <= -3.2e-92) tmp = t_1; elseif (z <= 1.02e-91) tmp = Float64(Float64(x / fmin(y, t)) / fmax(y, t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - max(y, t))); tmp = 0.0; if (z <= -3.2e-92) tmp = t_1; elseif (z <= 1.02e-91) tmp = (x / min(y, t)) / max(y, t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-92], t$95$1, If[LessEqual[z, 1.02e-91], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.1999999999999997e-92 or 1.01999999999999994e-91 < z Initial program 89.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.2%
Applied rewrites53.2%
if -3.1999999999999997e-92 < z < 1.01999999999999994e-91Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6463.0%
Applied rewrites63.0%
Taylor expanded in y around inf
lower-/.f6442.7%
Applied rewrites42.7%
(FPCore (x y z t) :precision binary64 (/ (/ x (fmin y t)) (fmax y t)))
double code(double x, double y, double z, double t) {
return (x / fmin(y, t)) / fmax(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 = (x / fmin(y, t)) / fmax(y, t)
end function
public static double code(double x, double y, double z, double t) {
return (x / fmin(y, t)) / fmax(y, t);
}
def code(x, y, z, t): return (x / fmin(y, t)) / fmax(y, t)
function code(x, y, z, t) return Float64(Float64(x / fmin(y, t)) / fmax(y, t)) end
function tmp = code(x, y, z, t) tmp = (x / min(y, t)) / max(y, t); end
code[x_, y_, z_, t_] := N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision]
\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}
Initial program 89.2%
Taylor expanded in z around 0
Applied rewrites57.0%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/r*N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lift--.f6463.0%
Applied rewrites63.0%
Taylor expanded in y around inf
lower-/.f6442.7%
Applied rewrites42.7%
(FPCore (x y z t) :precision binary64 (/ x (* t y)))
double code(double x, double y, double z, double t) {
return x / (t * 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, 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 = x / (t * y)
end function
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
def code(x, y, z, t): return x / (t * y)
function code(x, y, z, t) return Float64(x / Float64(t * y)) end
function tmp = code(x, y, z, t) tmp = x / (t * y); end
code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\frac{x}{t \cdot y}
Initial program 89.2%
Taylor expanded in z around 0
lower-*.f6439.0%
Applied rewrites39.0%
herbie shell --seed 2025183
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
(/ x (* (- y z) (- t z))))