
(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 12 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) (* (- (fmin y t) z) (- (fmax y t) z)))))
(*
(copysign 1.0 x)
(if (<= t_1 -4e-322)
t_1
(/ (/ (fabs x) (- z (fmin y t))) (- z (fmax y t)))))))double code(double x, double y, double z, double t) {
double t_1 = fabs(x) / ((fmin(y, t) - z) * (fmax(y, t) - z));
double tmp;
if (t_1 <= -4e-322) {
tmp = t_1;
} else {
tmp = (fabs(x) / (z - fmin(y, t))) / (z - fmax(y, t));
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = Math.abs(x) / ((fmin(y, t) - z) * (fmax(y, t) - z));
double tmp;
if (t_1 <= -4e-322) {
tmp = t_1;
} else {
tmp = (Math.abs(x) / (z - fmin(y, t))) / (z - fmax(y, t));
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t): t_1 = math.fabs(x) / ((fmin(y, t) - z) * (fmax(y, t) - z)) tmp = 0 if t_1 <= -4e-322: tmp = t_1 else: tmp = (math.fabs(x) / (z - fmin(y, t))) / (z - fmax(y, t)) return math.copysign(1.0, x) * tmp
function code(x, y, z, t) t_1 = Float64(abs(x) / Float64(Float64(fmin(y, t) - z) * Float64(fmax(y, t) - z))) tmp = 0.0 if (t_1 <= -4e-322) tmp = t_1; else tmp = Float64(Float64(abs(x) / Float64(z - fmin(y, t))) / Float64(z - fmax(y, t))); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t) t_1 = abs(x) / ((min(y, t) - z) * (max(y, t) - z)); tmp = 0.0; if (t_1 <= -4e-322) tmp = t_1; else tmp = (abs(x) / (z - min(y, t))) / (z - max(y, t)); 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[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - 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, -4e-322], t$95$1, N[(N[(N[Abs[x], $MachinePrecision] / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \frac{\left|x\right|}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-322}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|x\right|}{z - \mathsf{min}\left(y, t\right)}}{z - \mathsf{max}\left(y, t\right)}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -4.00193e-322Initial program 89.0%
if -4.00193e-322 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 89.0%
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.9
Applied rewrites96.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (fabs x) (* (- y z) (- t z)))))
(*
(copysign 1.0 x)
(if (<= t_1 -2e-262) t_1 (/ (/ (fabs x) (- z t)) (- z y))))))double code(double x, double y, double z, double t) {
double t_1 = fabs(x) / ((y - z) * (t - z));
double tmp;
if (t_1 <= -2e-262) {
tmp = t_1;
} else {
tmp = (fabs(x) / (z - t)) / (z - y);
}
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 <= -2e-262) {
tmp = t_1;
} else {
tmp = (Math.abs(x) / (z - t)) / (z - y);
}
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 <= -2e-262: tmp = t_1 else: tmp = (math.fabs(x) / (z - t)) / (z - y) 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 <= -2e-262) tmp = t_1; else tmp = Float64(Float64(abs(x) / Float64(z - t)) / Float64(z - y)); 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 <= -2e-262) tmp = t_1; else tmp = (abs(x) / (z - t)) / (z - y); 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, -2e-262], t$95$1, N[(N[(N[Abs[x], $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]), $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 -2 \cdot 10^{-262}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left|x\right|}{z - t}}{z - y}\\
\end{array}
\end{array}
if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -2.00000000000000002e-262Initial program 89.0%
if -2.00000000000000002e-262 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 89.0%
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%
(FPCore (x y z t) :precision binary64 (/ 1.0 (* (/ (- (fmin y t) z) x) (- (fmax y t) z))))
double code(double x, double y, double z, double t) {
return 1.0 / (((fmin(y, t) - z) / x) * (fmax(y, 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 = 1.0d0 / (((fmin(y, t) - z) / x) * (fmax(y, t) - z))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 / (((fmin(y, t) - z) / x) * (fmax(y, t) - z));
}
def code(x, y, z, t): return 1.0 / (((fmin(y, t) - z) / x) * (fmax(y, t) - z))
function code(x, y, z, t) return Float64(1.0 / Float64(Float64(Float64(fmin(y, t) - z) / x) * Float64(fmax(y, t) - z))) end
function tmp = code(x, y, z, t) tmp = 1.0 / (((min(y, t) - z) / x) * (max(y, t) - z)); end
code[x_, y_, z_, t_] := N[(1.0 / N[(N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{1}{\frac{\mathsf{min}\left(y, t\right) - z}{x} \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}
Initial program 89.0%
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.9
Applied rewrites96.9%
lift-/.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6496.6
Applied rewrites96.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lower--.f6496.1
Applied rewrites96.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (fmin y t) z)) (t_2 (* t_1 (- (fmax y t) z))))
(if (<= t_2 (- INFINITY))
(/ (/ x (fmax y t)) t_1)
(if (<= t_2 1e+305) (/ x t_2) (/ (/ x (- z (fmax y t))) z)))))double code(double x, double y, double z, double t) {
double t_1 = fmin(y, t) - z;
double t_2 = t_1 * (fmax(y, t) - z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (x / fmax(y, t)) / t_1;
} else if (t_2 <= 1e+305) {
tmp = x / t_2;
} else {
tmp = (x / (z - fmax(y, t))) / z;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = fmin(y, t) - z;
double t_2 = t_1 * (fmax(y, t) - z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (x / fmax(y, t)) / t_1;
} else if (t_2 <= 1e+305) {
tmp = x / t_2;
} else {
tmp = (x / (z - fmax(y, t))) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = fmin(y, t) - z t_2 = t_1 * (fmax(y, t) - z) tmp = 0 if t_2 <= -math.inf: tmp = (x / fmax(y, t)) / t_1 elif t_2 <= 1e+305: tmp = x / t_2 else: tmp = (x / (z - fmax(y, t))) / z return tmp
function code(x, y, z, t) t_1 = Float64(fmin(y, t) - z) t_2 = Float64(t_1 * Float64(fmax(y, t) - z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(x / fmax(y, t)) / t_1); elseif (t_2 <= 1e+305) tmp = Float64(x / t_2); else tmp = Float64(Float64(x / Float64(z - fmax(y, t))) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = min(y, t) - z; t_2 = t_1 * (max(y, t) - z); tmp = 0.0; if (t_2 <= -Inf) tmp = (x / max(y, t)) / t_1; elseif (t_2 <= 1e+305) tmp = x / t_2; else tmp = (x / (z - max(y, t))) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x / N[Max[y, t], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], N[(x / t$95$2), $MachinePrecision], N[(N[(x / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(y, t\right) - z\\
t_2 := t\_1 \cdot \left(\mathsf{max}\left(y, t\right) - z\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{\mathsf{max}\left(y, t\right)}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;\frac{x}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{max}\left(y, t\right)}}{z}\\
\end{array}
if (*.f64 (-.f64 y z) (-.f64 t z)) < -inf.0Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.1
Applied rewrites59.1%
if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 9.9999999999999994e304Initial program 89.0%
if 9.9999999999999994e304 < (*.f64 (-.f64 y z) (-.f64 t z)) Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y 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
lower-/.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -8.6e-51)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) 1.55e-111)
(/ (/ x (- z (fmax y t))) z)
(/ (/ x (- (fmin y t) z)) (fmax y t)))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
tmp = (x / (z - fmax(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 (fmin(y, t) <= (-8.6d-51)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= 1.55d-111) then
tmp = (x / (z - fmax(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 (fmin(y, t) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
tmp = (x / (z - fmax(y, t))) / z;
} else {
tmp = (x / (fmin(y, t) - z)) / fmax(y, t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -8.6e-51: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= 1.55e-111: tmp = (x / (z - fmax(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 (fmin(y, t) <= -8.6e-51) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= 1.55e-111) tmp = Float64(Float64(x / Float64(z - fmax(y, t))) / z); 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) <= -8.6e-51) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= 1.55e-111) tmp = (x / (z - max(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[Min[y, t], $MachinePrecision], -8.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], 1.55e-111], N[(N[(x / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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 -8.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 1.55 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{max}\left(y, t\right)}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right) - z}}{\mathsf{max}\left(y, t\right)}\\
\end{array}
if y < -8.5999999999999995e-51Initial program 89.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.5
Applied rewrites57.5%
if -8.5999999999999995e-51 < y < 1.55000000000000007e-111Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y 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
lower-/.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
if 1.55000000000000007e-111 < y Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
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
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -8.6e-51)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) 1.55e-111)
(/ (/ x (- z (fmax y t))) z)
(/ x (* (- (fmin y t) z) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
tmp = (x / (z - fmax(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 (fmin(y, t) <= (-8.6d-51)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= 1.55d-111) then
tmp = (x / (z - fmax(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 (fmin(y, t) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
tmp = (x / (z - fmax(y, t))) / z;
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -8.6e-51: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= 1.55e-111: tmp = (x / (z - fmax(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 (fmin(y, t) <= -8.6e-51) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= 1.55e-111) tmp = Float64(Float64(x / Float64(z - fmax(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 (min(y, t) <= -8.6e-51) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= 1.55e-111) tmp = (x / (z - max(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[Min[y, t], $MachinePrecision], -8.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], 1.55e-111], N[(N[(x / N[(z - N[Max[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{min}\left(y, t\right) \leq -8.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 1.55 \cdot 10^{-111}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{max}\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 y < -8.5999999999999995e-51Initial program 89.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.5
Applied rewrites57.5%
if -8.5999999999999995e-51 < y < 1.55000000000000007e-111Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y 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
lower-/.f64N/A
lower-/.f6459.9
Applied rewrites59.9%
if 1.55000000000000007e-111 < y Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -8.6e-51)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) 1.55e-111)
(/ 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) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
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) <= (-8.6d-51)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= 1.55d-111) 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) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
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) <= -8.6e-51: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= 1.55e-111: 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) <= -8.6e-51) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= 1.55e-111) tmp = Float64(x / Float64(z * Float64(z - fmax(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 (min(y, t) <= -8.6e-51) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= 1.55e-111) 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], -8.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], 1.55e-111], N[(x / N[(z * N[(z - N[Max[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{min}\left(y, t\right) \leq -8.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 1.55 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\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 y < -8.5999999999999995e-51Initial program 89.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.5
Applied rewrites57.5%
if -8.5999999999999995e-51 < y < 1.55000000000000007e-111Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8
Applied rewrites52.8%
if 1.55000000000000007e-111 < y Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -8.6e-51)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) 1.55e-111)
(/ 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) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
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) <= (-8.6d-51)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= 1.55d-111) 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) <= -8.6e-51) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 1.55e-111) {
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) <= -8.6e-51: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= 1.55e-111: 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) <= -8.6e-51) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= 1.55e-111) 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) <= -8.6e-51) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= 1.55e-111) 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], -8.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], 1.55e-111], 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 -8.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 1.55 \cdot 10^{-111}:\\
\;\;\;\;\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 < -8.5999999999999995e-51Initial program 89.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.5
Applied rewrites57.5%
if -8.5999999999999995e-51 < y < 1.55000000000000007e-111Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8
Applied rewrites52.8%
if 1.55000000000000007e-111 < y Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
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
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-/.f6443.5
Applied rewrites43.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -9.6e-59)
(/ x (* z (- z (fmin y t))))
(if (<= z 3e-80)
(/ (/ x (fmin y t)) (fmax y t))
(/ x (* z (- z (fmax y t)))))))double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.6e-59) {
tmp = x / (z * (z - fmin(y, t)));
} else if (z <= 3e-80) {
tmp = (x / fmin(y, t)) / fmax(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 (z <= (-9.6d-59)) then
tmp = x / (z * (z - fmin(y, t)))
else if (z <= 3d-80) then
tmp = (x / fmin(y, t)) / fmax(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 (z <= -9.6e-59) {
tmp = x / (z * (z - fmin(y, t)));
} else if (z <= 3e-80) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else {
tmp = x / (z * (z - fmax(y, t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.6e-59: tmp = x / (z * (z - fmin(y, t))) elif z <= 3e-80: tmp = (x / fmin(y, t)) / fmax(y, t) else: tmp = x / (z * (z - fmax(y, t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.6e-59) tmp = Float64(x / Float64(z * Float64(z - fmin(y, t)))); elseif (z <= 3e-80) tmp = Float64(Float64(x / fmin(y, t)) / fmax(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 (z <= -9.6e-59) tmp = x / (z * (z - min(y, t))); elseif (z <= 3e-80) tmp = (x / min(y, t)) / max(y, t); else tmp = x / (z * (z - max(y, t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.6e-59], N[(x / N[(z * N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-80], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{min}\left(y, t\right)\right)}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-80}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\end{array}
if z < -9.6000000000000006e-59Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.9
Applied rewrites52.9%
if -9.6000000000000006e-59 < z < 3.00000000000000007e-80Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
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
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-/.f6443.5
Applied rewrites43.5%
if 3.00000000000000007e-80 < z Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y 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 (fmin y t)) (fmax y t))))
(if (<= (fmin y t) -2.65e-31)
t_1
(if (<= (fmin y t) 1.55e-111) (/ x (* z (- z (fmax y t)))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / fmin(y, t)) / fmax(y, t);
double tmp;
if (fmin(y, t) <= -2.65e-31) {
tmp = t_1;
} else if (fmin(y, t) <= 1.55e-111) {
tmp = x / (z * (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 / fmin(y, t)) / fmax(y, t)
if (fmin(y, t) <= (-2.65d-31)) then
tmp = t_1
else if (fmin(y, t) <= 1.55d-111) then
tmp = x / (z * (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 / fmin(y, t)) / fmax(y, t);
double tmp;
if (fmin(y, t) <= -2.65e-31) {
tmp = t_1;
} else if (fmin(y, t) <= 1.55e-111) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / fmin(y, t)) / fmax(y, t) tmp = 0 if fmin(y, t) <= -2.65e-31: tmp = t_1 elif fmin(y, t) <= 1.55e-111: tmp = x / (z * (z - fmax(y, t))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / fmin(y, t)) / fmax(y, t)) tmp = 0.0 if (fmin(y, t) <= -2.65e-31) tmp = t_1; elseif (fmin(y, t) <= 1.55e-111) tmp = Float64(x / Float64(z * Float64(z - fmax(y, t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / min(y, t)) / max(y, t); tmp = 0.0; if (min(y, t) <= -2.65e-31) tmp = t_1; elseif (min(y, t) <= 1.55e-111) tmp = x / (z * (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 / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[y, t], $MachinePrecision], -2.65e-31], t$95$1, If[LessEqual[N[Min[y, t], $MachinePrecision], 1.55e-111], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -2.65 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 1.55 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.65e-31 or 1.55000000000000007e-111 < y Initial program 89.0%
Taylor expanded in z around 0
Applied rewrites57.8%
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
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-/.f6443.5
Applied rewrites43.5%
if -2.65e-31 < y < 1.55000000000000007e-111Initial program 89.0%
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.9
Applied rewrites96.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6452.8
Applied rewrites52.8%
(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.0%
Taylor expanded in z around 0
Applied rewrites57.8%
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
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-/.f6443.5
Applied rewrites43.5%
(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.0%
Taylor expanded in z around 0
lower-*.f6440.0
Applied rewrites40.0%
herbie shell --seed 2025172
(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))))