
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (- y x) (/ (- z t) -60.0))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((y - x) / ((z - t) / -60.0)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(y - x) / Float64(Float64(z - t) / -60.0))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(y - x), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] / -60.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{y - x}{\frac{z - t}{-60}}\right)
\end{array}
Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
metadata-evalN/A
distribute-frac-neg2N/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (- x y) (* (- t z) -0.016666666666666666))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) / ((t - z) * -0.016666666666666666)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) / Float64(Float64(t - z) * -0.016666666666666666))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{x - y}{\left(t - z\right) \cdot -0.016666666666666666}\right)
\end{array}
Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
mult-flipN/A
lower-*.f64N/A
metadata-eval99.8
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* (- x y) (/ -60.0 (- t z)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) * (-60.0 / (t - z))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) * Float64(-60.0 / Float64(t - z)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \left(x - y\right) \cdot \frac{-60}{t - z}\right)
\end{array}
Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ y (/ (- z t) -60.0)))))
(if (<= y -46.0)
t_1
(if (<= y 9.5e+66) (fma 60.0 (/ x (- z t)) (* 120.0 a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, (y / ((z - t) / -60.0)));
double tmp;
if (y <= -46.0) {
tmp = t_1;
} else if (y <= 9.5e+66) {
tmp = fma(60.0, (x / (z - t)), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(y / Float64(Float64(z - t) / -60.0))) tmp = 0.0 if (y <= -46.0) tmp = t_1; elseif (y <= 9.5e+66) tmp = fma(60.0, Float64(x / Float64(z - t)), Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(y / N[(N[(z - t), $MachinePrecision] / -60.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -46.0], t$95$1, If[LessEqual[y, 9.5e+66], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{y}{\frac{z - t}{-60}}\right)\\
\mathbf{if}\;y \leq -46:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -46 or 9.50000000000000051e66 < y Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
metadata-evalN/A
distribute-frac-neg2N/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites74.5%
if -46 < y < 9.50000000000000051e66Initial program 99.2%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.6
Applied rewrites75.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ y (- z t)) (* 120.0 a))))
(if (<= y -46.0)
t_1
(if (<= y 9.5e+66) (fma 60.0 (/ x (- z t)) (* 120.0 a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, (y / (z - t)), (120.0 * a));
double tmp;
if (y <= -46.0) {
tmp = t_1;
} else if (y <= 9.5e+66) {
tmp = fma(60.0, (x / (z - t)), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(y / Float64(z - t)), Float64(120.0 * a)) tmp = 0.0 if (y <= -46.0) tmp = t_1; elseif (y <= 9.5e+66) tmp = fma(60.0, Float64(x / Float64(z - t)), Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -46.0], t$95$1, If[LessEqual[y, 9.5e+66], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z - t}, 120 \cdot a\right)\\
\mathbf{if}\;y \leq -46:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -46 or 9.50000000000000051e66 < y Initial program 99.2%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6474.5
Applied rewrites74.5%
if -46 < y < 9.50000000000000051e66Initial program 99.2%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.6
Applied rewrites75.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ y (- z t)) (* 120.0 a))))
(if (<= a -2.65e+38)
t_1
(if (<= a 2.85e-120) (* 60.0 (/ (- x y) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, (y / (z - t)), (120.0 * a));
double tmp;
if (a <= -2.65e+38) {
tmp = t_1;
} else if (a <= 2.85e-120) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(y / Float64(z - t)), Float64(120.0 * a)) tmp = 0.0 if (a <= -2.65e+38) tmp = t_1; elseif (a <= 2.85e-120) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.65e+38], t$95$1, If[LessEqual[a, 2.85e-120], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z - t}, 120 \cdot a\right)\\
\mathbf{if}\;a \leq -2.65 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.85 \cdot 10^{-120}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.65000000000000012e38 or 2.85000000000000015e-120 < a Initial program 99.2%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6474.5
Applied rewrites74.5%
if -2.65000000000000012e38 < a < 2.85000000000000015e-120Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.2
Applied rewrites51.2%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.65e+38)
(fma a 120.0 (* -60.0 (/ y z)))
(if (<= a 1.3e-103)
(* 60.0 (/ (- x y) (- z t)))
(fma (/ 60.0 z) (- y) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.65e+38) {
tmp = fma(a, 120.0, (-60.0 * (y / z)));
} else if (a <= 1.3e-103) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = fma((60.0 / z), -y, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.65e+38) tmp = fma(a, 120.0, Float64(-60.0 * Float64(y / z))); elseif (a <= 1.3e-103) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = fma(Float64(60.0 / z), Float64(-y), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.65e+38], N[(a * 120.0 + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3e-103], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(60.0 / z), $MachinePrecision] * (-y) + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.65 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, -60 \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-103}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{60}{z}, -y, 120 \cdot a\right)\\
\end{array}
\end{array}
if a < -2.65000000000000012e38Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
metadata-evalN/A
distribute-frac-neg2N/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Taylor expanded in x around 0
Applied rewrites54.6%
if -2.65000000000000012e38 < a < 1.29999999999999998e-103Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.2
Applied rewrites51.2%
if 1.29999999999999998e-103 < a Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6463.6
Applied rewrites63.6%
Taylor expanded in x around 0
lower-*.f6454.6
Applied rewrites54.6%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-neg.f64N/A
lower-neg.f64N/A
Applied rewrites54.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* -60.0 (/ y z)))))
(if (<= a -2.65e+38)
t_1
(if (<= a 1.3e-103) (* 60.0 (/ (- x y) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, (-60.0 * (y / z)));
double tmp;
if (a <= -2.65e+38) {
tmp = t_1;
} else if (a <= 1.3e-103) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(-60.0 * Float64(y / z))) tmp = 0.0 if (a <= -2.65e+38) tmp = t_1; elseif (a <= 1.3e-103) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.65e+38], t$95$1, If[LessEqual[a, 1.3e-103], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, -60 \cdot \frac{y}{z}\right)\\
\mathbf{if}\;a \leq -2.65 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-103}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.65000000000000012e38 or 1.29999999999999998e-103 < a Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
metadata-evalN/A
distribute-frac-neg2N/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Taylor expanded in x around 0
Applied rewrites54.6%
if -2.65000000000000012e38 < a < 1.29999999999999998e-103Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.2
Applied rewrites51.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* -60.0 (/ y z)))))
(if (<= z -3.8e-8)
t_1
(if (<= z 1.7e-113) (fma a 120.0 (* (/ x t) -60.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, (-60.0 * (y / z)));
double tmp;
if (z <= -3.8e-8) {
tmp = t_1;
} else if (z <= 1.7e-113) {
tmp = fma(a, 120.0, ((x / t) * -60.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(-60.0 * Float64(y / z))) tmp = 0.0 if (z <= -3.8e-8) tmp = t_1; elseif (z <= 1.7e-113) tmp = fma(a, 120.0, Float64(Float64(x / t) * -60.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-8], t$95$1, If[LessEqual[z, 1.7e-113], N[(a * 120.0 + N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, -60 \cdot \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-113}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{t} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.80000000000000028e-8 or 1.7000000000000001e-113 < z Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
metadata-evalN/A
distribute-frac-neg2N/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Taylor expanded in x around 0
Applied rewrites54.6%
if -3.80000000000000028e-8 < z < 1.7000000000000001e-113Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in x around inf
lower-/.f6454.5
Applied rewrites54.5%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6454.5
Applied rewrites54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* 60.0 (/ x z)))))
(if (<= z -3.8e-14)
t_1
(if (<= z 1.6e+97) (fma a 120.0 (* (/ x t) -60.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, (60.0 * (x / z)));
double tmp;
if (z <= -3.8e-14) {
tmp = t_1;
} else if (z <= 1.6e+97) {
tmp = fma(a, 120.0, ((x / t) * -60.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(60.0 * Float64(x / z))) tmp = 0.0 if (z <= -3.8e-14) tmp = t_1; elseif (z <= 1.6e+97) tmp = fma(a, 120.0, Float64(Float64(x / t) * -60.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-14], t$95$1, If[LessEqual[z, 1.6e+97], N[(a * 120.0 + N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, 60 \cdot \frac{x}{z}\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+97}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{t} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.8000000000000002e-14 or 1.60000000000000008e97 < z Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
metadata-evalN/A
distribute-frac-neg2N/A
frac-2neg-revN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6463.6
Applied rewrites63.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f6454.6
Applied rewrites54.6%
if -3.8000000000000002e-14 < z < 1.60000000000000008e97Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in x around inf
lower-/.f6454.5
Applied rewrites54.5%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6454.5
Applied rewrites54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))))
(if (<= y -1.86e+152)
t_1
(if (<= y 1.2e+127) (fma a 120.0 (* (/ x t) -60.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -1.86e+152) {
tmp = t_1;
} else if (y <= 1.2e+127) {
tmp = fma(a, 120.0, ((x / t) * -60.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -1.86e+152) tmp = t_1; elseif (y <= 1.2e+127) tmp = fma(a, 120.0, Float64(Float64(x / t) * -60.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.86e+152], t$95$1, If[LessEqual[y, 1.2e+127], N[(a * 120.0 + N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -1.86 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{t} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.8599999999999999e152 or 1.2000000000000001e127 < y Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.6
Applied rewrites26.6%
if -1.8599999999999999e152 < y < 1.2000000000000001e127Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in x around inf
lower-/.f6454.5
Applied rewrites54.5%
lift-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6454.5
Applied rewrites54.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -60.0 (/ y (- z t)))))
(if (<= y -1.86e+152)
t_1
(if (<= y 1.2e+127) (fma -60.0 (/ x t) (* 120.0 a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -1.86e+152) {
tmp = t_1;
} else if (y <= 1.2e+127) {
tmp = fma(-60.0, (x / t), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -1.86e+152) tmp = t_1; elseif (y <= 1.2e+127) tmp = fma(-60.0, Float64(x / t), Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.86e+152], t$95$1, If[LessEqual[y, 1.2e+127], N[(-60.0 * N[(x / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -1.86 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.8599999999999999e152 or 1.2000000000000001e127 < y Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.6
Applied rewrites26.6%
if -1.8599999999999999e152 < y < 1.2000000000000001e127Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in x around inf
lower-/.f6454.5
Applied rewrites54.5%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3e+20)
(* 120.0 a)
(if (<= a 1.8e-290)
(* x (/ 60.0 (- z t)))
(if (<= a 2.6e-139) (* -60.0 (/ y (- z t))) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+20) {
tmp = 120.0 * a;
} else if (a <= 1.8e-290) {
tmp = x * (60.0 / (z - t));
} else if (a <= 2.6e-139) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = 120.0 * a;
}
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, a)
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), intent (in) :: a
real(8) :: tmp
if (a <= (-3d+20)) then
tmp = 120.0d0 * a
else if (a <= 1.8d-290) then
tmp = x * (60.0d0 / (z - t))
else if (a <= 2.6d-139) then
tmp = (-60.0d0) * (y / (z - t))
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+20) {
tmp = 120.0 * a;
} else if (a <= 1.8e-290) {
tmp = x * (60.0 / (z - t));
} else if (a <= 2.6e-139) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3e+20: tmp = 120.0 * a elif a <= 1.8e-290: tmp = x * (60.0 / (z - t)) elif a <= 2.6e-139: tmp = -60.0 * (y / (z - t)) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3e+20) tmp = Float64(120.0 * a); elseif (a <= 1.8e-290) tmp = Float64(x * Float64(60.0 / Float64(z - t))); elseif (a <= 2.6e-139) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3e+20) tmp = 120.0 * a; elseif (a <= 1.8e-290) tmp = x * (60.0 / (z - t)); elseif (a <= 2.6e-139) tmp = -60.0 * (y / (z - t)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3e+20], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 1.8e-290], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e-139], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+20}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-290}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-139}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3e20 or 2.5999999999999998e-139 < a Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
if -3e20 < a < 1.7999999999999999e-290Initial program 99.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6427.6
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6427.6
Applied rewrites27.6%
if 1.7999999999999999e-290 < a < 2.5999999999999998e-139Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3e+20)
(* 120.0 a)
(if (<= a 1.8e-290)
(* 60.0 (/ x (- z t)))
(if (<= a 2.6e-139) (* -60.0 (/ y (- z t))) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+20) {
tmp = 120.0 * a;
} else if (a <= 1.8e-290) {
tmp = 60.0 * (x / (z - t));
} else if (a <= 2.6e-139) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = 120.0 * a;
}
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, a)
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), intent (in) :: a
real(8) :: tmp
if (a <= (-3d+20)) then
tmp = 120.0d0 * a
else if (a <= 1.8d-290) then
tmp = 60.0d0 * (x / (z - t))
else if (a <= 2.6d-139) then
tmp = (-60.0d0) * (y / (z - t))
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e+20) {
tmp = 120.0 * a;
} else if (a <= 1.8e-290) {
tmp = 60.0 * (x / (z - t));
} else if (a <= 2.6e-139) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3e+20: tmp = 120.0 * a elif a <= 1.8e-290: tmp = 60.0 * (x / (z - t)) elif a <= 2.6e-139: tmp = -60.0 * (y / (z - t)) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3e+20) tmp = Float64(120.0 * a); elseif (a <= 1.8e-290) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif (a <= 2.6e-139) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3e+20) tmp = 120.0 * a; elseif (a <= 1.8e-290) tmp = 60.0 * (x / (z - t)); elseif (a <= 2.6e-139) tmp = -60.0 * (y / (z - t)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3e+20], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 1.8e-290], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e-139], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+20}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-290}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-139}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3e20 or 2.5999999999999998e-139 < a Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
if -3e20 < a < 1.7999999999999999e-290Initial program 99.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if 1.7999999999999999e-290 < a < 2.5999999999999998e-139Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ y (- z t))))) (if (<= y -1.76e+103) t_1 (if (<= y 1.1e+90) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -1.76e+103) {
tmp = t_1;
} else if (y <= 1.1e+90) {
tmp = 120.0 * a;
} 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, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (-60.0d0) * (y / (z - t))
if (y <= (-1.76d+103)) then
tmp = t_1
else if (y <= 1.1d+90) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -1.76e+103) {
tmp = t_1;
} else if (y <= 1.1e+90) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) tmp = 0 if y <= -1.76e+103: tmp = t_1 elif y <= 1.1e+90: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -1.76e+103) tmp = t_1; elseif (y <= 1.1e+90) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); tmp = 0.0; if (y <= -1.76e+103) tmp = t_1; elseif (y <= 1.1e+90) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.76e+103], t$95$1, If[LessEqual[y, 1.1e+90], N[(120.0 * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -1.76 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+90}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.76000000000000006e103 or 1.09999999999999995e90 < y Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.6
Applied rewrites26.6%
if -1.76000000000000006e103 < y < 1.09999999999999995e90Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+287)
(* 60.0 (/ x z))
(if (<= t_1 2e+130) (* 120.0 a) (/ 60.0 (/ t y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+287) {
tmp = 60.0 * (x / z);
} else if (t_1 <= 2e+130) {
tmp = 120.0 * a;
} else {
tmp = 60.0 / (t / y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+287)) then
tmp = 60.0d0 * (x / z)
else if (t_1 <= 2d+130) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+287) {
tmp = 60.0 * (x / z);
} else if (t_1 <= 2e+130) {
tmp = 120.0 * a;
} else {
tmp = 60.0 / (t / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+287: tmp = 60.0 * (x / z) elif t_1 <= 2e+130: tmp = 120.0 * a else: tmp = 60.0 / (t / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+287) tmp = Float64(60.0 * Float64(x / z)); elseif (t_1 <= 2e+130) tmp = Float64(120.0 * a); else tmp = Float64(60.0 / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+287) tmp = 60.0 * (x / z); elseif (t_1 <= 2e+130) tmp = 120.0 * a; else tmp = 60.0 / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+287], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+130], N[(120.0 * a), $MachinePrecision], N[(60.0 / N[(t / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+287}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+130}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{t}{y}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.0000000000000001e287Initial program 99.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
Taylor expanded in z around inf
lower-/.f6416.1
Applied rewrites16.1%
if -1.0000000000000001e287 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e130Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
if 2.0000000000000001e130 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.9
Applied rewrites15.9%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f6415.9
Applied rewrites15.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+287)
(* 60.0 (/ x z))
(if (<= t_1 2e+130) (* 120.0 a) (* 60.0 (/ y t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+287) {
tmp = 60.0 * (x / z);
} else if (t_1 <= 2e+130) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (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, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+287)) then
tmp = 60.0d0 * (x / z)
else if (t_1 <= 2d+130) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+287) {
tmp = 60.0 * (x / z);
} else if (t_1 <= 2e+130) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+287: tmp = 60.0 * (x / z) elif t_1 <= 2e+130: tmp = 120.0 * a else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+287) tmp = Float64(60.0 * Float64(x / z)); elseif (t_1 <= 2e+130) tmp = Float64(120.0 * a); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+287) tmp = 60.0 * (x / z); elseif (t_1 <= 2e+130) tmp = 120.0 * a; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+287], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+130], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+287}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+130}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.0000000000000001e287Initial program 99.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
Taylor expanded in z around inf
lower-/.f6416.1
Applied rewrites16.1%
if -1.0000000000000001e287 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e130Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
if 2.0000000000000001e130 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.9
Applied rewrites15.9%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* 60.0 (- x y)) (- z t)) 2e+130) (* 120.0 a) (* 60.0 (/ y t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= 2e+130) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (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, a)
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), intent (in) :: a
real(8) :: tmp
if (((60.0d0 * (x - y)) / (z - t)) <= 2d+130) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= 2e+130) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((60.0 * (x - y)) / (z - t)) <= 2e+130: tmp = 120.0 * a else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) <= 2e+130) tmp = Float64(120.0 * a); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((60.0 * (x - y)) / (z - t)) <= 2e+130) tmp = 120.0 * a; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], 2e+130], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{60 \cdot \left(x - y\right)}{z - t} \leq 2 \cdot 10^{+130}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e130Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
if 2.0000000000000001e130 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.9
Applied rewrites15.9%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* 60.0 (- x y)) (- z t)) 5e+168) (* 120.0 a) (* -60.0 (/ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= 5e+168) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (x / 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, a)
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), intent (in) :: a
real(8) :: tmp
if (((60.0d0 * (x - y)) / (z - t)) <= 5d+168) then
tmp = 120.0d0 * a
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= 5e+168) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((60.0 * (x - y)) / (z - t)) <= 5e+168: tmp = 120.0 * a else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) <= 5e+168) tmp = Float64(120.0 * a); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((60.0 * (x - y)) / (z - t)) <= 5e+168) tmp = 120.0 * a; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], 5e+168], N[(120.0 * a), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{60 \cdot \left(x - y\right)}{z - t} \leq 5 \cdot 10^{+168}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.99999999999999967e168Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
if 4.99999999999999967e168 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.3
Applied rewrites63.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f6416.8
Applied rewrites16.8%
(FPCore (x y z t a) :precision binary64 (* 120.0 a))
double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
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, a)
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), intent (in) :: a
code = 120.0d0 * a
end function
public static double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
def code(x, y, z, t, a): return 120.0 * a
function code(x, y, z, t, a) return Float64(120.0 * a) end
function tmp = code(x, y, z, t, a) tmp = 120.0 * a; end
code[x_, y_, z_, t_, a_] := N[(120.0 * a), $MachinePrecision]
\begin{array}{l}
\\
120 \cdot a
\end{array}
Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.2
Applied rewrites50.2%
herbie shell --seed 2025156
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))