
(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 10 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 -1e-310)
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 <= -1e-310) {
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 <= -1e-310) {
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 <= -1e-310: 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 <= -1e-310) 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 <= -1e-310) 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, -1e-310], 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 -1 \cdot 10^{-310}:\\
\;\;\;\;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))) < -9.9999999999999694e-311Initial program 88.9%
if -9.9999999999999694e-311 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) Initial program 88.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
(FPCore (x y z t) :precision binary64 (/ (/ x (- z t)) (- z y)))
double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / (z - t)) / (z - y)
end function
public static double code(double x, double y, double z, double t) {
return (x / (z - t)) / (z - y);
}
def code(x, y, z, t): return (x / (z - t)) / (z - y)
function code(x, y, z, t) return Float64(Float64(x / Float64(z - t)) / Float64(z - y)) end
function tmp = code(x, y, z, t) tmp = (x / (z - t)) / (z - y); end
code[x_, y_, z_, t_] := N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]
\frac{\frac{x}{z - t}}{z - y}
Initial program 88.9%
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--.f6497.2%
Applied rewrites97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) (- z (fmin y t)))))
(if (<= z -7.4e+127)
t_1
(if (<= z 4.2e+126)
(/ x (* (- (fmin y t) z) (- (fmax y t) z)))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / (z - fmin(y, t));
double tmp;
if (z <= -7.4e+127) {
tmp = t_1;
} else if (z <= 4.2e+126) {
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / (z - fmin(y, t))
if (z <= (-7.4d+127)) then
tmp = t_1
else if (z <= 4.2d+126) then
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / (z - fmin(y, t));
double tmp;
if (z <= -7.4e+127) {
tmp = t_1;
} else if (z <= 4.2e+126) {
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / (z - fmin(y, t)) tmp = 0 if z <= -7.4e+127: tmp = t_1 elif z <= 4.2e+126: tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / z) / Float64(z - fmin(y, t))) tmp = 0.0 if (z <= -7.4e+127) tmp = t_1; elseif (z <= 4.2e+126) tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * Float64(fmax(y, t) - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / z) / (z - min(y, t)); tmp = 0.0; if (z <= -7.4e+127) tmp = t_1; elseif (z <= 4.2e+126) tmp = x / ((min(y, t) - z) * (max(y, t) - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / N[(z - N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.4e+127], t$95$1, If[LessEqual[z, 4.2e+126], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z - \mathsf{min}\left(y, t\right)}\\
\mathbf{if}\;z \leq -7.4 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+126}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -7.3999999999999996e127 or 4.1999999999999998e126 < z Initial program 88.9%
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--.f6497.2%
Applied rewrites97.2%
*-rgt-identityN/A
metadata-evalN/A
lower-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
*-rgt-identity97.1%
Applied rewrites97.1%
Taylor expanded in z around inf
lower-/.f6458.2%
Applied rewrites58.2%
if -7.3999999999999996e127 < z < 4.1999999999999998e126Initial program 88.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (/ x z) z)))
(if (<= z -3.9e+130)
t_1
(if (<= z 1e+130) (/ x (* (- y z) (- t z))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -3.9e+130) {
tmp = t_1;
} else if (z <= 1e+130) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x / z) / z
if (z <= (-3.9d+130)) then
tmp = t_1
else if (z <= 1d+130) then
tmp = x / ((y - z) * (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / z) / z;
double tmp;
if (z <= -3.9e+130) {
tmp = t_1;
} else if (z <= 1e+130) {
tmp = x / ((y - z) * (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / z) / z tmp = 0 if z <= -3.9e+130: tmp = t_1 elif z <= 1e+130: tmp = x / ((y - z) * (t - z)) 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.9e+130) tmp = t_1; elseif (z <= 1e+130) tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z))); 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.9e+130) tmp = t_1; elseif (z <= 1e+130) tmp = x / ((y - z) * (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -3.9e+130], t$95$1, If[LessEqual[z, 1e+130], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{+130}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.9000000000000002e130 or 1.0000000000000001e130 < z Initial program 88.9%
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--.f6497.2%
Applied rewrites97.2%
*-rgt-identityN/A
metadata-evalN/A
lower-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
*-rgt-identity97.1%
Applied rewrites97.1%
Taylor expanded in z around inf
lower-/.f6458.2%
Applied rewrites58.2%
Taylor expanded in y around 0
Applied rewrites44.1%
if -3.9000000000000002e130 < z < 1.0000000000000001e130Initial program 88.9%
(FPCore (x y z t)
:precision binary64
(if (<= (fmin y t) -2.9)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) 4e-185)
(/ 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) <= -2.9) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 4e-185) {
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) <= (-2.9d0)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= 4d-185) 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) <= -2.9) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 4e-185) {
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) <= -2.9: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= 4e-185: 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) <= -2.9) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= 4e-185) 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) <= -2.9) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= 4e-185) 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], -2.9], 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], 4e-185], 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 -2.9:\\
\;\;\;\;\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 4 \cdot 10^{-185}:\\
\;\;\;\;\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 < -2.8999999999999999Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.1%
Applied rewrites57.1%
if -2.8999999999999999 < y < 4e-185Initial program 88.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.6%
Applied rewrites53.6%
if 4e-185 < y Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (fmin y t) (- (fmax y t) z)))))
(if (<= (fmin y t) -2.9)
t_1
(if (<= (fmin y t) 6.8e-60) (/ 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) - z));
double tmp;
if (fmin(y, t) <= -2.9) {
tmp = t_1;
} else if (fmin(y, t) <= 6.8e-60) {
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) - z))
if (fmin(y, t) <= (-2.9d0)) then
tmp = t_1
else if (fmin(y, t) <= 6.8d-60) 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) - z));
double tmp;
if (fmin(y, t) <= -2.9) {
tmp = t_1;
} else if (fmin(y, t) <= 6.8e-60) {
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) - z)) tmp = 0 if fmin(y, t) <= -2.9: tmp = t_1 elif fmin(y, t) <= 6.8e-60: tmp = x / (z * (z - fmax(y, t))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))) tmp = 0.0 if (fmin(y, t) <= -2.9) tmp = t_1; elseif (fmin(y, t) <= 6.8e-60) 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) - z)); tmp = 0.0; if (min(y, t) <= -2.9) tmp = t_1; elseif (min(y, t) <= 6.8e-60) 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[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Min[y, t], $MachinePrecision], -2.9], t$95$1, If[LessEqual[N[Min[y, t], $MachinePrecision], 6.8e-60], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -2.9:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 6.8 \cdot 10^{-60}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.8999999999999999 or 6.8000000000000001e-60 < y Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6457.1%
Applied rewrites57.1%
if -2.8999999999999999 < y < 6.8000000000000001e-60Initial program 88.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.6%
Applied rewrites53.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ x (* z (- z t))))) (if (<= z -1.6e-38) t_1 (if (<= z 1.15e-90) (/ x (* t y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - t));
double tmp;
if (z <= -1.6e-38) {
tmp = t_1;
} else if (z <= 1.15e-90) {
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 - t))
if (z <= (-1.6d-38)) then
tmp = t_1
else if (z <= 1.15d-90) 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 - t));
double tmp;
if (z <= -1.6e-38) {
tmp = t_1;
} else if (z <= 1.15e-90) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - t)) tmp = 0 if z <= -1.6e-38: tmp = t_1 elif z <= 1.15e-90: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - t))) tmp = 0.0 if (z <= -1.6e-38) tmp = t_1; elseif (z <= 1.15e-90) 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 - t)); tmp = 0.0; if (z <= -1.6e-38) tmp = t_1; elseif (z <= 1.15e-90) 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 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e-38], t$95$1, If[LessEqual[z, 1.15e-90], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-90}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.5999999999999999e-38 or 1.1499999999999999e-90 < z Initial program 88.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6497.1%
Applied rewrites97.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6453.6%
Applied rewrites53.6%
if -1.5999999999999999e-38 < z < 1.1499999999999999e-90Initial program 88.9%
Taylor expanded in z around 0
lower-*.f6439.4%
Applied rewrites39.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* (- z) (fmax y t)))))
(if (<= z -1.6e-38)
t_1
(if (<= z 2.15e-30) (/ x (* (fmax y t) (fmin y t))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (-z * fmax(y, t));
double tmp;
if (z <= -1.6e-38) {
tmp = t_1;
} else if (z <= 2.15e-30) {
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 * fmax(y, t))
if (z <= (-1.6d-38)) then
tmp = t_1
else if (z <= 2.15d-30) 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 * fmax(y, t));
double tmp;
if (z <= -1.6e-38) {
tmp = t_1;
} else if (z <= 2.15e-30) {
tmp = x / (fmax(y, t) * fmin(y, t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (-z * fmax(y, t)) tmp = 0 if z <= -1.6e-38: tmp = t_1 elif z <= 2.15e-30: tmp = x / (fmax(y, t) * fmin(y, t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(-z) * fmax(y, t))) tmp = 0.0 if (z <= -1.6e-38) tmp = t_1; elseif (z <= 2.15e-30) 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 * max(y, t)); tmp = 0.0; if (z <= -1.6e-38) tmp = t_1; elseif (z <= 2.15e-30) 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[(x / N[((-z) * N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e-38], t$95$1, If[LessEqual[z, 2.15e-30], N[(x / N[(N[Max[y, t], $MachinePrecision] * N[Min[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{\left(-z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\mathsf{max}\left(y, t\right) \cdot \mathsf{min}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.5999999999999999e-38 or 2.1499999999999998e-30 < z Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.1%
Taylor expanded in y around 0
lower-*.f6431.9%
Applied rewrites31.9%
lift-*.f64N/A
metadata-evalN/A
distribute-lft-neg-outN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-rgt-identity31.9%
Applied rewrites31.9%
if -1.5999999999999999e-38 < z < 2.1499999999999998e-30Initial program 88.9%
Taylor expanded in z around 0
lower-*.f6439.4%
Applied rewrites39.4%
(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 88.9%
Taylor expanded in z around 0
lower-*.f6439.4%
Applied rewrites39.4%
herbie shell --seed 2025258
(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))))