
(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 16 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
(let* ((t_1 (/ (fabs x) (* (- y z) (- t z)))))
(*
(copysign 1.0 x)
(if (<= t_1 1e-275) (/ (/ (fabs x) (- z t)) (- z y)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = fabs(x) / ((y - z) * (t - z));
double tmp;
if (t_1 <= 1e-275) {
tmp = (fabs(x) / (z - t)) / (z - y);
} else {
tmp = t_1;
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = Math.abs(x) / ((y - z) * (t - z));
double tmp;
if (t_1 <= 1e-275) {
tmp = (Math.abs(x) / (z - t)) / (z - y);
} else {
tmp = t_1;
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t): t_1 = math.fabs(x) / ((y - z) * (t - z)) tmp = 0 if t_1 <= 1e-275: tmp = (math.fabs(x) / (z - t)) / (z - y) else: tmp = t_1 return math.copysign(1.0, x) * tmp
function code(x, y, z, t) t_1 = Float64(abs(x) / Float64(Float64(y - z) * Float64(t - z))) tmp = 0.0 if (t_1 <= 1e-275) tmp = Float64(Float64(abs(x) / Float64(z - t)) / Float64(z - y)); else tmp = t_1; end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t) t_1 = abs(x) / ((y - z) * (t - z)); tmp = 0.0; if (t_1 <= 1e-275) tmp = (abs(x) / (z - t)) / (z - y); else tmp = t_1; end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Abs[x], $MachinePrecision] / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, 1e-275], N[(N[(N[Abs[x], $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]), $MachinePrecision]]
\begin{array}{l}
t_1 := \frac{\left|x\right|}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 10^{-275}:\\
\;\;\;\;\frac{\frac{\left|x\right|}{z - t}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < 9.99999999999999934e-276Initial program 89.3%
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.8%
Applied rewrites96.8%
if 9.99999999999999934e-276 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 89.3%
(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.3%
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--.f6496.8%
Applied rewrites96.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3.3e+164) (/ (/ x z) (- z y)) (if (<= z 1.3e+81) (/ x (* (- y z) (- t z))) (/ (/ x z) (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e+164) {
tmp = (x / z) / (z - y);
} else if (z <= 1.3e+81) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - 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 (z <= (-3.3d+164)) then
tmp = (x / z) / (z - y)
else if (z <= 1.3d+81) then
tmp = x / ((y - z) * (t - z))
else
tmp = (x / z) / (z - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e+164) {
tmp = (x / z) / (z - y);
} else if (z <= 1.3e+81) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = (x / z) / (z - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.3e+164: tmp = (x / z) / (z - y) elif z <= 1.3e+81: tmp = x / ((y - z) * (t - z)) else: tmp = (x / z) / (z - t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.3e+164) tmp = Float64(Float64(x / z) / Float64(z - y)); elseif (z <= 1.3e+81) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); else tmp = Float64(Float64(x / z) / Float64(z - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.3e+164) tmp = (x / z) / (z - y); elseif (z <= 1.3e+81) tmp = x / ((y - z) * (t - z)); else tmp = (x / z) / (z - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.3e+164], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+81], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+81}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\
\end{array}
if z < -3.29999999999999995e164Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
if -3.29999999999999995e164 < z < 1.29999999999999996e81Initial program 89.3%
if 1.29999999999999996e81 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.2e-17)
(/ (/ x z) (- z (fmax y t)))
(if (<= z 7.6e-185)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= z 8e-38)
(/ (/ x (- (fmin y t) z)) (fmax y t))
(/ (/ x z) (- z (fmin y t)))))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e-17) {
tmp = (x / z) / (z - fmax(y, t));
} else if (z <= 7.6e-185) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (z <= 8e-38) {
tmp = (x / (fmin(y, t) - z)) / fmax(y, t);
} else {
tmp = (x / z) / (z - fmin(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 (z <= (-8.2d-17)) then
tmp = (x / z) / (z - fmax(y, t))
else if (z <= 7.6d-185) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (z <= 8d-38) then
tmp = (x / (fmin(y, t) - z)) / fmax(y, t)
else
tmp = (x / z) / (z - fmin(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e-17) {
tmp = (x / z) / (z - fmax(y, t));
} else if (z <= 7.6e-185) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (z <= 8e-38) {
tmp = (x / (fmin(y, t) - z)) / fmax(y, t);
} else {
tmp = (x / z) / (z - fmin(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.2e-17: tmp = (x / z) / (z - fmax(y, t)) elif z <= 7.6e-185: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif z <= 8e-38: tmp = (x / (fmin(y, t) - z)) / fmax(y, t) else: tmp = (x / z) / (z - fmin(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.2e-17) tmp = Float64(Float64(x / z) / Float64(z - fmax(y, t))); elseif (z <= 7.6e-185) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (z <= 8e-38) tmp = Float64(Float64(x / Float64(fmin(y, t) - z)) / fmax(y, t)); else tmp = Float64(Float64(x / z) / Float64(z - fmin(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.2e-17) tmp = (x / z) / (z - max(y, t)); elseif (z <= 7.6e-185) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (z <= 8e-38) tmp = (x / (min(y, t) - z)) / max(y, t); else tmp = (x / z) / (z - min(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.2e-17], N[(N[(x / z), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e-185], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-38], N[(N[(x / N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - \mathsf{max}\left(y, t\right)}\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-185}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right) - z}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - \mathsf{min}\left(y, t\right)}\\
\end{array}
if z < -8.2000000000000001e-17Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
if -8.2000000000000001e-17 < z < 7.5999999999999998e-185Initial program 89.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
if 7.5999999999999998e-185 < z < 7.9999999999999997e-38Initial program 89.3%
Taylor expanded in z around 0
Applied rewrites57.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
*-rgt-identityN/A
metadata-evalN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
metadata-evalN/A
*-rgt-identity63.1%
Applied rewrites63.1%
if 7.9999999999999997e-38 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.2e-17)
(/ (/ x z) (- z (fmax y t)))
(if (<= z 1.35e-172)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= z 8e-38)
(/ (/ x (fmax y t)) (- (fmin y t) z))
(/ (/ x z) (- z (fmin y t)))))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e-17) {
tmp = (x / z) / (z - fmax(y, t));
} else if (z <= 1.35e-172) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (z <= 8e-38) {
tmp = (x / fmax(y, t)) / (fmin(y, t) - z);
} else {
tmp = (x / z) / (z - fmin(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 (z <= (-8.2d-17)) then
tmp = (x / z) / (z - fmax(y, t))
else if (z <= 1.35d-172) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (z <= 8d-38) then
tmp = (x / fmax(y, t)) / (fmin(y, t) - z)
else
tmp = (x / z) / (z - fmin(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e-17) {
tmp = (x / z) / (z - fmax(y, t));
} else if (z <= 1.35e-172) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (z <= 8e-38) {
tmp = (x / fmax(y, t)) / (fmin(y, t) - z);
} else {
tmp = (x / z) / (z - fmin(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.2e-17: tmp = (x / z) / (z - fmax(y, t)) elif z <= 1.35e-172: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif z <= 8e-38: tmp = (x / fmax(y, t)) / (fmin(y, t) - z) else: tmp = (x / z) / (z - fmin(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.2e-17) tmp = Float64(Float64(x / z) / Float64(z - fmax(y, t))); elseif (z <= 1.35e-172) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (z <= 8e-38) tmp = Float64(Float64(x / fmax(y, t)) / Float64(fmin(y, t) - z)); else tmp = Float64(Float64(x / z) / Float64(z - fmin(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.2e-17) tmp = (x / z) / (z - max(y, t)); elseif (z <= 1.35e-172) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (z <= 8e-38) tmp = (x / max(y, t)) / (min(y, t) - z); else tmp = (x / z) / (z - min(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.2e-17], N[(N[(x / z), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-172], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-38], N[(N[(x / N[Max[y, t], $MachinePrecision]), $MachinePrecision] / N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - \mathsf{max}\left(y, t\right)}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-172}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{max}\left(y, t\right)}}{\mathsf{min}\left(y, t\right) - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - \mathsf{min}\left(y, t\right)}\\
\end{array}
if z < -8.2000000000000001e-17Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
if -8.2000000000000001e-17 < z < 1.35000000000000013e-172Initial program 89.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
if 1.35000000000000013e-172 < z < 7.9999999999999997e-38Initial program 89.3%
Taylor expanded in z around 0
Applied rewrites57.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
*-rgt-identityN/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
*-rgt-identity59.0%
Applied rewrites59.0%
if 7.9999999999999997e-38 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x (fmax y t)) (- (fmin y t) z))) (t_2 (- z (fmin y t))))
(if (<= z -1.06e+30)
(/ (/ x t_2) z)
(if (<= z -1.4e-31)
t_1
(if (<= z 1.35e-172)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= z 8e-38) t_1 (/ (/ x z) t_2)))))))double code(double x, double y, double z, double t) {
double t_1 = (x / fmax(y, t)) / (fmin(y, t) - z);
double t_2 = z - fmin(y, t);
double tmp;
if (z <= -1.06e+30) {
tmp = (x / t_2) / z;
} else if (z <= -1.4e-31) {
tmp = t_1;
} else if (z <= 1.35e-172) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (z <= 8e-38) {
tmp = t_1;
} else {
tmp = (x / z) / 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 / fmax(y, t)) / (fmin(y, t) - z)
t_2 = z - fmin(y, t)
if (z <= (-1.06d+30)) then
tmp = (x / t_2) / z
else if (z <= (-1.4d-31)) then
tmp = t_1
else if (z <= 1.35d-172) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (z <= 8d-38) then
tmp = t_1
else
tmp = (x / z) / t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / fmax(y, t)) / (fmin(y, t) - z);
double t_2 = z - fmin(y, t);
double tmp;
if (z <= -1.06e+30) {
tmp = (x / t_2) / z;
} else if (z <= -1.4e-31) {
tmp = t_1;
} else if (z <= 1.35e-172) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (z <= 8e-38) {
tmp = t_1;
} else {
tmp = (x / z) / t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / fmax(y, t)) / (fmin(y, t) - z) t_2 = z - fmin(y, t) tmp = 0 if z <= -1.06e+30: tmp = (x / t_2) / z elif z <= -1.4e-31: tmp = t_1 elif z <= 1.35e-172: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif z <= 8e-38: tmp = t_1 else: tmp = (x / z) / t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / fmax(y, t)) / Float64(fmin(y, t) - z)) t_2 = Float64(z - fmin(y, t)) tmp = 0.0 if (z <= -1.06e+30) tmp = Float64(Float64(x / t_2) / z); elseif (z <= -1.4e-31) tmp = t_1; elseif (z <= 1.35e-172) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (z <= 8e-38) tmp = t_1; else tmp = Float64(Float64(x / z) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / max(y, t)) / (min(y, t) - z); t_2 = z - min(y, t); tmp = 0.0; if (z <= -1.06e+30) tmp = (x / t_2) / z; elseif (z <= -1.4e-31) tmp = t_1; elseif (z <= 1.35e-172) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (z <= 8e-38) tmp = t_1; else tmp = (x / z) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[Max[y, t], $MachinePrecision]), $MachinePrecision] / N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.06e+30], N[(N[(x / t$95$2), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -1.4e-31], t$95$1, If[LessEqual[z, 1.35e-172], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-38], t$95$1, N[(N[(x / z), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{\mathsf{max}\left(y, t\right)}}{\mathsf{min}\left(y, t\right) - z}\\
t_2 := z - \mathsf{min}\left(y, t\right)\\
\mathbf{if}\;z \leq -1.06 \cdot 10^{+30}:\\
\;\;\;\;\frac{\frac{x}{t\_2}}{z}\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-172}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{t\_2}\\
\end{array}
if z < -1.06e30Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
if -1.06e30 < z < -1.3999999999999999e-31 or 1.35000000000000013e-172 < z < 7.9999999999999997e-38Initial program 89.3%
Taylor expanded in z around 0
Applied rewrites57.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
*-rgt-identityN/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
*-rgt-identity59.0%
Applied rewrites59.0%
if -1.3999999999999999e-31 < z < 1.35000000000000013e-172Initial program 89.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
if 7.9999999999999997e-38 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- z (fmin y t))))
(if (<= z -3.7e-66)
(/ (/ x t_1) z)
(if (<= z 3.4e-55)
(/ x (* (- (fmin y t) z) (fmax y t)))
(/ (/ x z) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = z - fmin(y, t);
double tmp;
if (z <= -3.7e-66) {
tmp = (x / t_1) / z;
} else if (z <= 3.4e-55) {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
} else {
tmp = (x / z) / 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 = z - fmin(y, t)
if (z <= (-3.7d-66)) then
tmp = (x / t_1) / z
else if (z <= 3.4d-55) then
tmp = x / ((fmin(y, t) - z) * fmax(y, t))
else
tmp = (x / z) / t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z - fmin(y, t);
double tmp;
if (z <= -3.7e-66) {
tmp = (x / t_1) / z;
} else if (z <= 3.4e-55) {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
} else {
tmp = (x / z) / t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z - fmin(y, t) tmp = 0 if z <= -3.7e-66: tmp = (x / t_1) / z elif z <= 3.4e-55: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) else: tmp = (x / z) / t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z - fmin(y, t)) tmp = 0.0 if (z <= -3.7e-66) tmp = Float64(Float64(x / t_1) / z); elseif (z <= 3.4e-55) tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); else tmp = Float64(Float64(x / z) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z - min(y, t); tmp = 0.0; if (z <= -3.7e-66) tmp = (x / t_1) / z; elseif (z <= 3.4e-55) tmp = x / ((min(y, t) - z) * max(y, t)); else tmp = (x / z) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e-66], N[(N[(x / t$95$1), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.4e-55], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
t_1 := z - \mathsf{min}\left(y, t\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-66}:\\
\;\;\;\;\frac{\frac{x}{t\_1}}{z}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{t\_1}\\
\end{array}
if z < -3.7000000000000002e-66Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
if -3.7000000000000002e-66 < z < 3.39999999999999973e-55Initial program 89.3%
Taylor expanded in z around 0
Applied rewrites57.9%
if 3.39999999999999973e-55 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) (- z (fmin y t)))))
(if (<= z -3.7e-66)
t_1
(if (<= z 3.4e-55) (/ x (* (- (fmin y t) z) (fmax y t))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / (z - fmin(y, t));
double tmp;
if (z <= -3.7e-66) {
tmp = t_1;
} else if (z <= 3.4e-55) {
tmp = x / ((fmin(y, t) - z) * 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 - fmin(y, t))
if (z <= (-3.7d-66)) then
tmp = t_1
else if (z <= 3.4d-55) then
tmp = x / ((fmin(y, t) - z) * 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 - fmin(y, t));
double tmp;
if (z <= -3.7e-66) {
tmp = t_1;
} else if (z <= 3.4e-55) {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / (z - fmin(y, t)) tmp = 0 if z <= -3.7e-66: tmp = t_1 elif z <= 3.4e-55: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / Float64(z - fmin(y, t))) tmp = 0.0 if (z <= -3.7e-66) tmp = t_1; elseif (z <= 3.4e-55) tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / (z - min(y, t)); tmp = 0.0; if (z <= -3.7e-66) tmp = t_1; elseif (z <= 3.4e-55) tmp = x / ((min(y, t) - z) * max(y, t)); 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[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e-66], t$95$1, If[LessEqual[z, 3.4e-55], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z - \mathsf{min}\left(y, t\right)}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.7000000000000002e-66 or 3.39999999999999973e-55 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.5%
Applied rewrites57.5%
if -3.7000000000000002e-66 < z < 3.39999999999999973e-55Initial program 89.3%
Taylor expanded in z around 0
Applied rewrites57.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z y)))))
(if (<= z -4.1e+164)
(/ (/ x z) z)
(if (<= z -3.7e-66) t_1 (if (<= z 3.4e-55) (/ x (* (- y z) t)) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -4.1e+164) {
tmp = (x / z) / z;
} else if (z <= -3.7e-66) {
tmp = t_1;
} else if (z <= 3.4e-55) {
tmp = x / ((y - z) * 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 - y))
if (z <= (-4.1d+164)) then
tmp = (x / z) / z
else if (z <= (-3.7d-66)) then
tmp = t_1
else if (z <= 3.4d-55) then
tmp = x / ((y - z) * 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 - y));
double tmp;
if (z <= -4.1e+164) {
tmp = (x / z) / z;
} else if (z <= -3.7e-66) {
tmp = t_1;
} else if (z <= 3.4e-55) {
tmp = x / ((y - z) * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - y)) tmp = 0 if z <= -4.1e+164: tmp = (x / z) / z elif z <= -3.7e-66: tmp = t_1 elif z <= 3.4e-55: tmp = x / ((y - z) * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -4.1e+164) tmp = Float64(Float64(x / z) / z); elseif (z <= -3.7e-66) tmp = t_1; elseif (z <= 3.4e-55) tmp = Float64(x / Float64(Float64(y - z) * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - y)); tmp = 0.0; if (z <= -4.1e+164) tmp = (x / z) / z; elseif (z <= -3.7e-66) tmp = t_1; elseif (z <= 3.4e-55) tmp = x / ((y - z) * 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 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+164], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -3.7e-66], t$95$1, If[LessEqual[z, 3.4e-55], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -4.10000000000000016e164Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -4.10000000000000016e164 < z < -3.7000000000000002e-66 or 3.39999999999999973e-55 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
if -3.7000000000000002e-66 < z < 3.39999999999999973e-55Initial program 89.3%
Taylor expanded in z around 0
Applied rewrites57.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.6e+80)
(/ (/ x z) z)
(if (<= z -8.2e-17)
(/ (/ (- x) z) (fmax y t))
(if (<= z 8e-38)
(/ x (* (fmin y t) (- (fmax y t) z)))
(/ x (* z (- z (fmin y t))))))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+80) {
tmp = (x / z) / z;
} else if (z <= -8.2e-17) {
tmp = (-x / z) / fmax(y, t);
} else if (z <= 8e-38) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else {
tmp = x / (z * (z - fmin(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 (z <= (-3.6d+80)) then
tmp = (x / z) / z
else if (z <= (-8.2d-17)) then
tmp = (-x / z) / fmax(y, t)
else if (z <= 8d-38) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else
tmp = x / (z * (z - fmin(y, t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+80) {
tmp = (x / z) / z;
} else if (z <= -8.2e-17) {
tmp = (-x / z) / fmax(y, t);
} else if (z <= 8e-38) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else {
tmp = x / (z * (z - fmin(y, t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+80: tmp = (x / z) / z elif z <= -8.2e-17: tmp = (-x / z) / fmax(y, t) elif z <= 8e-38: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) else: tmp = x / (z * (z - fmin(y, t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+80) tmp = Float64(Float64(x / z) / z); elseif (z <= -8.2e-17) tmp = Float64(Float64(Float64(-x) / z) / fmax(y, t)); elseif (z <= 8e-38) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); else tmp = Float64(x / Float64(z * Float64(z - fmin(y, t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+80) tmp = (x / z) / z; elseif (z <= -8.2e-17) tmp = (-x / z) / max(y, t); elseif (z <= 8e-38) tmp = x / (min(y, t) * (max(y, t) - z)); else tmp = x / (z * (z - min(y, t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+80], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -8.2e-17], N[(N[((-x) / z), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-38], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+80}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{-x}{z}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{min}\left(y, t\right)\right)}\\
\end{array}
if z < -3.59999999999999995e80Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -3.59999999999999995e80 < z < -8.2000000000000001e-17Initial program 89.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
mult-flipN/A
lower-*.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
Taylor expanded in z around 0
Applied rewrites34.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
*-rgt-identityN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-rgt-identity34.4%
Applied rewrites34.4%
if -8.2000000000000001e-17 < z < 7.9999999999999997e-38Initial program 89.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.9%
Applied rewrites57.9%
if 7.9999999999999997e-38 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* z (- z y)))))
(if (<= z -4.1e+164)
(/ (/ x z) z)
(if (<= z -4.8e-66) t_1 (if (<= z 3.4e-55) (/ x (* t y)) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - y));
double tmp;
if (z <= -4.1e+164) {
tmp = (x / z) / z;
} else if (z <= -4.8e-66) {
tmp = t_1;
} else if (z <= 3.4e-55) {
tmp = x / (t * y);
} 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 - y))
if (z <= (-4.1d+164)) then
tmp = (x / z) / z
else if (z <= (-4.8d-66)) then
tmp = t_1
else if (z <= 3.4d-55) then
tmp = x / (t * y)
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 - y));
double tmp;
if (z <= -4.1e+164) {
tmp = (x / z) / z;
} else if (z <= -4.8e-66) {
tmp = t_1;
} else if (z <= 3.4e-55) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - y)) tmp = 0 if z <= -4.1e+164: tmp = (x / z) / z elif z <= -4.8e-66: tmp = t_1 elif z <= 3.4e-55: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - y))) tmp = 0.0 if (z <= -4.1e+164) tmp = Float64(Float64(x / z) / z); elseif (z <= -4.8e-66) tmp = t_1; elseif (z <= 3.4e-55) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - y)); tmp = 0.0; if (z <= -4.1e+164) tmp = (x / z) / z; elseif (z <= -4.8e-66) tmp = t_1; elseif (z <= 3.4e-55) tmp = x / (t * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+164], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -4.8e-66], t$95$1, If[LessEqual[z, 3.4e-55], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - y\right)}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -4.10000000000000016e164Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -4.10000000000000016e164 < z < -4.80000000000000052e-66 or 3.39999999999999973e-55 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
if -4.80000000000000052e-66 < z < 3.39999999999999973e-55Initial program 89.3%
Taylor expanded in z around 0
lower-*.f6439.8%
Applied rewrites39.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -3.6e+80)
t_1
(if (<= z -8e-17)
(/ (/ (- x) z) (fmax y t))
(if (<= z 5e-22) (/ x (* (fmax y t) (fmin y t))) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -3.6e+80) {
tmp = t_1;
} else if (z <= -8e-17) {
tmp = (-x / z) / fmax(y, t);
} else if (z <= 5e-22) {
tmp = x / (fmax(y, t) * fmin(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
if (z <= (-3.6d+80)) then
tmp = t_1
else if (z <= (-8d-17)) then
tmp = (-x / z) / fmax(y, t)
else if (z <= 5d-22) then
tmp = x / (fmax(y, t) * fmin(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;
double tmp;
if (z <= -3.6e+80) {
tmp = t_1;
} else if (z <= -8e-17) {
tmp = (-x / z) / fmax(y, t);
} else if (z <= 5e-22) {
tmp = x / (fmax(y, t) * fmin(y, t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -3.6e+80: tmp = t_1 elif z <= -8e-17: tmp = (-x / z) / fmax(y, t) elif z <= 5e-22: tmp = x / (fmax(y, t) * fmin(y, t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -3.6e+80) tmp = t_1; elseif (z <= -8e-17) tmp = Float64(Float64(Float64(-x) / z) / fmax(y, t)); elseif (z <= 5e-22) tmp = Float64(x / Float64(fmax(y, t) * fmin(y, t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / z; tmp = 0.0; if (z <= -3.6e+80) tmp = t_1; elseif (z <= -8e-17) tmp = (-x / z) / max(y, t); elseif (z <= 5e-22) tmp = x / (max(y, t) * min(y, t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -3.6e+80], t$95$1, If[LessEqual[z, -8e-17], N[(N[((-x) / z), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-22], N[(x / N[(N[Max[y, t], $MachinePrecision] * N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{-x}{z}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{\mathsf{max}\left(y, t\right) \cdot \mathsf{min}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.59999999999999995e80 or 4.99999999999999954e-22 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -3.59999999999999995e80 < z < -8.00000000000000057e-17Initial program 89.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
mult-flipN/A
lower-*.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
Taylor expanded in z around 0
Applied rewrites34.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
mul-1-negN/A
lower-/.f64N/A
*-rgt-identityN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-rgt-identity34.4%
Applied rewrites34.4%
if -8.00000000000000057e-17 < z < 4.99999999999999954e-22Initial program 89.3%
Taylor expanded in z around 0
lower-*.f6439.8%
Applied rewrites39.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -5.3e+54)
t_1
(if (<= z -8e-17)
(/ (/ (- x) (fmax y t)) z)
(if (<= z 5e-22) (/ x (* (fmax y t) (fmin y t))) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.3e+54) {
tmp = t_1;
} else if (z <= -8e-17) {
tmp = (-x / fmax(y, t)) / z;
} else if (z <= 5e-22) {
tmp = x / (fmax(y, t) * fmin(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
if (z <= (-5.3d+54)) then
tmp = t_1
else if (z <= (-8d-17)) then
tmp = (-x / fmax(y, t)) / z
else if (z <= 5d-22) then
tmp = x / (fmax(y, t) * fmin(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;
double tmp;
if (z <= -5.3e+54) {
tmp = t_1;
} else if (z <= -8e-17) {
tmp = (-x / fmax(y, t)) / z;
} else if (z <= 5e-22) {
tmp = x / (fmax(y, t) * fmin(y, t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -5.3e+54: tmp = t_1 elif z <= -8e-17: tmp = (-x / fmax(y, t)) / z elif z <= 5e-22: tmp = x / (fmax(y, t) * fmin(y, t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -5.3e+54) tmp = t_1; elseif (z <= -8e-17) tmp = Float64(Float64(Float64(-x) / fmax(y, t)) / z); elseif (z <= 5e-22) tmp = Float64(x / Float64(fmax(y, t) * fmin(y, t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / z; tmp = 0.0; if (z <= -5.3e+54) tmp = t_1; elseif (z <= -8e-17) tmp = (-x / max(y, t)) / z; elseif (z <= 5e-22) tmp = x / (max(y, t) * min(y, t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -5.3e+54], t$95$1, If[LessEqual[z, -8e-17], N[(N[((-x) / N[Max[y, t], $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5e-22], N[(x / N[(N[Max[y, t], $MachinePrecision] * N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -5.3 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{-x}{\mathsf{max}\left(y, t\right)}}{z}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{\mathsf{max}\left(y, t\right) \cdot \mathsf{min}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.30000000000000018e54 or 4.99999999999999954e-22 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -5.30000000000000018e54 < z < -8.00000000000000057e-17Initial program 89.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
mult-flipN/A
lower-*.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
Taylor expanded in z around 0
Applied rewrites34.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
mult-flip-revN/A
distribute-neg-frac2N/A
lift-/.f64N/A
lower-/.f64N/A
Applied rewrites33.1%
if -8.00000000000000057e-17 < z < 4.99999999999999954e-22Initial program 89.3%
Taylor expanded in z around 0
lower-*.f6439.8%
Applied rewrites39.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -5.3e+54)
t_1
(if (<= z -8e-17)
(/ (- x) (* z (fmax y t)))
(if (<= z 5e-22) (/ x (* (fmax y t) (fmin y t))) t_1)))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -5.3e+54) {
tmp = t_1;
} else if (z <= -8e-17) {
tmp = -x / (z * fmax(y, t));
} else if (z <= 5e-22) {
tmp = x / (fmax(y, t) * fmin(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
if (z <= (-5.3d+54)) then
tmp = t_1
else if (z <= (-8d-17)) then
tmp = -x / (z * fmax(y, t))
else if (z <= 5d-22) then
tmp = x / (fmax(y, t) * fmin(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;
double tmp;
if (z <= -5.3e+54) {
tmp = t_1;
} else if (z <= -8e-17) {
tmp = -x / (z * fmax(y, t));
} else if (z <= 5e-22) {
tmp = x / (fmax(y, t) * fmin(y, t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -5.3e+54: tmp = t_1 elif z <= -8e-17: tmp = -x / (z * fmax(y, t)) elif z <= 5e-22: tmp = x / (fmax(y, t) * fmin(y, t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -5.3e+54) tmp = t_1; elseif (z <= -8e-17) tmp = Float64(Float64(-x) / Float64(z * fmax(y, t))); elseif (z <= 5e-22) tmp = Float64(x / Float64(fmax(y, t) * fmin(y, t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / z; tmp = 0.0; if (z <= -5.3e+54) tmp = t_1; elseif (z <= -8e-17) tmp = -x / (z * max(y, t)); elseif (z <= 5e-22) tmp = x / (max(y, t) * min(y, t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -5.3e+54], t$95$1, If[LessEqual[z, -8e-17], N[((-x) / N[(z * N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-22], N[(x / N[(N[Max[y, t], $MachinePrecision] * N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -5.3 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-17}:\\
\;\;\;\;\frac{-x}{z \cdot \mathsf{max}\left(y, t\right)}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{\mathsf{max}\left(y, t\right) \cdot \mathsf{min}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.30000000000000018e54 or 4.99999999999999954e-22 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -5.30000000000000018e54 < z < -8.00000000000000057e-17Initial program 89.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
mult-flipN/A
lower-*.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f6496.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites57.4%
Taylor expanded in z around 0
Applied rewrites34.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
mul-1-negN/A
*-commutativeN/A
lower-/.f64N/A
*-rgt-identityN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
*-commutativeN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-rgt-identityN/A
lower-*.f6431.9%
Applied rewrites31.9%
if -8.00000000000000057e-17 < z < 4.99999999999999954e-22Initial program 89.3%
Taylor expanded in z around 0
lower-*.f6439.8%
Applied rewrites39.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (/ x z) z))) (if (<= z -1.1e-17) t_1 (if (<= z 5e-22) (/ x (* t y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -1.1e-17) {
tmp = t_1;
} else if (z <= 5e-22) {
tmp = x / (t * y);
} 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
if (z <= (-1.1d-17)) then
tmp = t_1
else if (z <= 5d-22) then
tmp = x / (t * y)
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;
double tmp;
if (z <= -1.1e-17) {
tmp = t_1;
} else if (z <= 5e-22) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -1.1e-17: tmp = t_1 elif z <= 5e-22: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / z) tmp = 0.0 if (z <= -1.1e-17) tmp = t_1; elseif (z <= 5e-22) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / z; tmp = 0.0; if (z <= -1.1e-17) tmp = t_1; elseif (z <= 5e-22) tmp = x / (t * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.1e-17], t$95$1, If[LessEqual[z, 5e-22], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.1e-17 or 4.99999999999999954e-22 < z Initial program 89.3%
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--.f6496.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6459.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lower-/.f6459.6%
Applied rewrites59.6%
Taylor expanded in y around 0
lower-/.f6443.4%
Applied rewrites43.4%
if -1.1e-17 < z < 4.99999999999999954e-22Initial program 89.3%
Taylor expanded in z around 0
lower-*.f6439.8%
Applied rewrites39.8%
(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.3%
Taylor expanded in z around 0
lower-*.f6439.8%
Applied rewrites39.8%
herbie shell --seed 2025179
(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))))