
(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 (/ (- 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
(if (<= z -31.0)
(fma a 120.0 (* 60.0 (/ (- x y) z)))
(if (<= z -3.1e-139)
(fma a 120.0 (/ (* 60.0 y) (- t z)))
(if (<= z 430.0)
(fma -60.0 (/ (- x y) t) (* 120.0 a))
(fma a 120.0 (* (- x y) (/ 60.0 z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -31.0) {
tmp = fma(a, 120.0, (60.0 * ((x - y) / z)));
} else if (z <= -3.1e-139) {
tmp = fma(a, 120.0, ((60.0 * y) / (t - z)));
} else if (z <= 430.0) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else {
tmp = fma(a, 120.0, ((x - y) * (60.0 / z)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -31.0) tmp = fma(a, 120.0, Float64(60.0 * Float64(Float64(x - y) / z))); elseif (z <= -3.1e-139) tmp = fma(a, 120.0, Float64(Float64(60.0 * y) / Float64(t - z))); elseif (z <= 430.0) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(x - y) * Float64(60.0 / z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -31.0], N[(a * 120.0 + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.1e-139], N[(a * 120.0 + N[(N[(60.0 * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 430.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -31:\\
\;\;\;\;\mathsf{fma}\left(a, 120, 60 \cdot \frac{x - y}{z}\right)\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-139}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot y}{t - z}\right)\\
\mathbf{elif}\;z \leq 430:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \left(x - y\right) \cdot \frac{60}{z}\right)\\
\end{array}
\end{array}
if z < -31Initial 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-*.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
if -31 < z < -3.0999999999999999e-139Initial program 99.2%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.2
Applied rewrites99.2%
Taylor expanded in x around 0
lower-*.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6474.5
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6474.5
Applied rewrites74.5%
if -3.0999999999999999e-139 < z < 430Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
if 430 < 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%
Taylor expanded in z around inf
lower-/.f6463.9
Applied rewrites63.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* 60.0 y) (- t z)))))
(if (<= y -1.02e-38)
t_1
(if (<= y 1.05e+98) (fma a 120.0 (/ (* 60.0 x) (- 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) / (t - z)));
double tmp;
if (y <= -1.02e-38) {
tmp = t_1;
} else if (y <= 1.05e+98) {
tmp = fma(a, 120.0, ((60.0 * x) / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(60.0 * y) / Float64(t - z))) tmp = 0.0 if (y <= -1.02e-38) tmp = t_1; elseif (y <= 1.05e+98) tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / 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[(N[(60.0 * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e-38], t$95$1, If[LessEqual[y, 1.05e+98], N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{60 \cdot y}{t - z}\right)\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.01999999999999998e-38 or 1.05000000000000002e98 < y Initial program 99.2%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.2
Applied rewrites99.2%
Taylor expanded in x around 0
lower-*.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6474.5
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f6474.5
Applied rewrites74.5%
if -1.01999999999999998e-38 < y < 1.05000000000000002e98Initial program 99.2%
Taylor expanded in x around inf
lower-*.f6475.1
Applied rewrites75.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6475.1
Applied rewrites75.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.75e-88)
(fma a 120.0 (* 60.0 (/ (- x y) z)))
(if (<= z 430.0)
(fma -60.0 (/ (- x y) t) (* 120.0 a))
(fma a 120.0 (* (- x y) (/ 60.0 z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-88) {
tmp = fma(a, 120.0, (60.0 * ((x - y) / z)));
} else if (z <= 430.0) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else {
tmp = fma(a, 120.0, ((x - y) * (60.0 / z)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-88) tmp = fma(a, 120.0, Float64(60.0 * Float64(Float64(x - y) / z))); elseif (z <= 430.0) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(x - y) * Float64(60.0 / z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e-88], N[(a * 120.0 + N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 430.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(60.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-88}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, 60 \cdot \frac{x - y}{z}\right)\\
\mathbf{elif}\;z \leq 430:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \left(x - y\right) \cdot \frac{60}{z}\right)\\
\end{array}
\end{array}
if z < -1.7500000000000001e-88Initial 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-*.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
if -1.7500000000000001e-88 < z < 430Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
if 430 < 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%
Taylor expanded in z around inf
lower-/.f6463.9
Applied rewrites63.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* 60.0 (/ (- x y) z)))))
(if (<= z -1.75e-88)
t_1
(if (<= z 430.0) (fma -60.0 (/ (- x y) 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, (60.0 * ((x - y) / z)));
double tmp;
if (z <= -1.75e-88) {
tmp = t_1;
} else if (z <= 430.0) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(60.0 * Float64(Float64(x - y) / z))) tmp = 0.0 if (z <= -1.75e-88) tmp = t_1; elseif (z <= 430.0) tmp = fma(-60.0, Float64(Float64(x - y) / 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[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e-88], t$95$1, If[LessEqual[z, 430.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, 60 \cdot \frac{x - y}{z}\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 430:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e-88 or 430 < 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%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
if -1.7500000000000001e-88 < z < 430Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ (- x y) z) (* 120.0 a))))
(if (<= z -1.75e-88)
t_1
(if (<= z 550.0) (fma -60.0 (/ (- x y) t) (* 120.0 a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(60.0, ((x - y) / z), (120.0 * a));
double tmp;
if (z <= -1.75e-88) {
tmp = t_1;
} else if (z <= 550.0) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(60.0, Float64(Float64(x - y) / z), Float64(120.0 * a)) tmp = 0.0 if (z <= -1.75e-88) tmp = t_1; elseif (z <= 550.0) tmp = fma(-60.0, Float64(Float64(x - y) / 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[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e-88], t$95$1, If[LessEqual[z, 550.0], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 550:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7500000000000001e-88 or 550 < z Initial program 99.2%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.9
Applied rewrites63.9%
if -1.7500000000000001e-88 < z < 550Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.8e-113)
(* 120.0 a)
(if (<= a 3.2e-48)
(/ (- y x) (* 0.016666666666666666 (- t z)))
(* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e-113) {
tmp = 120.0 * a;
} else if (a <= 3.2e-48) {
tmp = (y - x) / (0.016666666666666666 * (t - z));
} 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 <= (-3.8d-113)) then
tmp = 120.0d0 * a
else if (a <= 3.2d-48) then
tmp = (y - x) / (0.016666666666666666d0 * (t - z))
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 <= -3.8e-113) {
tmp = 120.0 * a;
} else if (a <= 3.2e-48) {
tmp = (y - x) / (0.016666666666666666 * (t - z));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.8e-113: tmp = 120.0 * a elif a <= 3.2e-48: tmp = (y - x) / (0.016666666666666666 * (t - z)) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e-113) tmp = Float64(120.0 * a); elseif (a <= 3.2e-48) tmp = Float64(Float64(y - x) / Float64(0.016666666666666666 * Float64(t - z))); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.8e-113) tmp = 120.0 * a; elseif (a <= 3.2e-48) tmp = (y - x) / (0.016666666666666666 * (t - z)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e-113], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 3.2e-48], N[(N[(y - x), $MachinePrecision] / N[(0.016666666666666666 * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-113}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-48}:\\
\;\;\;\;\frac{y - x}{0.016666666666666666 \cdot \left(t - z\right)}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.79999999999999983e-113 or 3.1999999999999998e-48 < a Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if -3.79999999999999983e-113 < a < 3.1999999999999998e-48Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-timesN/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
mult-flip-revN/A
lower-/.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval51.1
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.8e-113) (* 120.0 a) (if (<= a 3.2e-48) (* (/ 60.0 (- t z)) (- y x)) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e-113) {
tmp = 120.0 * a;
} else if (a <= 3.2e-48) {
tmp = (60.0 / (t - z)) * (y - x);
} 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 <= (-3.8d-113)) then
tmp = 120.0d0 * a
else if (a <= 3.2d-48) then
tmp = (60.0d0 / (t - z)) * (y - x)
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 <= -3.8e-113) {
tmp = 120.0 * a;
} else if (a <= 3.2e-48) {
tmp = (60.0 / (t - z)) * (y - x);
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.8e-113: tmp = 120.0 * a elif a <= 3.2e-48: tmp = (60.0 / (t - z)) * (y - x) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e-113) tmp = Float64(120.0 * a); elseif (a <= 3.2e-48) tmp = Float64(Float64(60.0 / Float64(t - z)) * Float64(y - x)); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.8e-113) tmp = 120.0 * a; elseif (a <= 3.2e-48) tmp = (60.0 / (t - z)) * (y - x); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e-113], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 3.2e-48], N[(N[(60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-113}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-48}:\\
\;\;\;\;\frac{60}{t - z} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.79999999999999983e-113 or 3.1999999999999998e-48 < a Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if -3.79999999999999983e-113 < a < 3.1999999999999998e-48Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
lift-*.f64N/A
metadata-evalN/A
lift-/.f64N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-timesN/A
lift-*.f64N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6451.1
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.8e-113) (* 120.0 a) (if (<= a 3.2e-48) (* 60.0 (/ (- x y) (- z t))) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e-113) {
tmp = 120.0 * a;
} else if (a <= 3.2e-48) {
tmp = 60.0 * ((x - 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 <= (-3.8d-113)) then
tmp = 120.0d0 * a
else if (a <= 3.2d-48) then
tmp = 60.0d0 * ((x - 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 <= -3.8e-113) {
tmp = 120.0 * a;
} else if (a <= 3.2e-48) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.8e-113: tmp = 120.0 * a elif a <= 3.2e-48: tmp = 60.0 * ((x - y) / (z - t)) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e-113) tmp = Float64(120.0 * a); elseif (a <= 3.2e-48) tmp = Float64(60.0 * Float64(Float64(x - 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 <= -3.8e-113) tmp = 120.0 * a; elseif (a <= 3.2e-48) tmp = 60.0 * ((x - y) / (z - t)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e-113], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 3.2e-48], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{-113}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{-48}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.79999999999999983e-113 or 3.1999999999999998e-48 < a Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if -3.79999999999999983e-113 < a < 3.1999999999999998e-48Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ (- x y) z))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -5e+98)
t_1
(if (<= t_2 5e+15)
(* 120.0 a)
(if (<= t_2 1e+89) (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 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+98) {
tmp = t_1;
} else if (t_2 <= 5e+15) {
tmp = 120.0 * a;
} else if (t_2 <= 1e+89) {
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(Float64(x - y) / z)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+98) tmp = t_1; elseif (t_2 <= 5e+15) tmp = Float64(120.0 * a); elseif (t_2 <= 1e+89) 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[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+98], t$95$1, If[LessEqual[t$95$2, 5e+15], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 1e+89], 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{x - y}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+15}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{t} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e98 or 9.99999999999999995e88 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
if -4.9999999999999998e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5e15Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 5e15 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999995e88Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
Taylor expanded in x around inf
lower-/.f6454.4
Applied rewrites54.4%
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.4
Applied rewrites54.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ (- x y) z))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -5e+98)
t_1
(if (<= t_2 5e+15)
(* 120.0 a)
(if (<= t_2 1e+89) (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 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+98) {
tmp = t_1;
} else if (t_2 <= 5e+15) {
tmp = 120.0 * a;
} else if (t_2 <= 1e+89) {
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(Float64(x - y) / z)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+98) tmp = t_1; elseif (t_2 <= 5e+15) tmp = Float64(120.0 * a); elseif (t_2 <= 1e+89) 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[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+98], t$95$1, If[LessEqual[t$95$2, 5e+15], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 1e+89], 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{x - y}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+15}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e98 or 9.99999999999999995e88 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
if -4.9999999999999998e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5e15Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 5e15 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999995e88Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
Taylor expanded in x around inf
lower-/.f6454.4
Applied rewrites54.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ (- x y) z))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+98) t_1 (if (<= t_2 4e+62) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+98) {
tmp = t_1;
} else if (t_2 <= 4e+62) {
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) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * ((x - y) / z)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+98)) then
tmp = t_1
else if (t_2 <= 4d+62) 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 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+98) {
tmp = t_1;
} else if (t_2 <= 4e+62) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / z) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+98: tmp = t_1 elif t_2 <= 4e+62: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / z)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+98) tmp = t_1; elseif (t_2 <= 4e+62) 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 * ((x - y) / z); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+98) tmp = t_1; elseif (t_2 <= 4e+62) 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[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+98], t$95$1, If[LessEqual[t$95$2, 4e+62], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+62}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999998e98 or 4.00000000000000014e62 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
if -4.9999999999999998e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.00000000000000014e62Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ y (- z t)))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+158) t_1 (if (<= t_2 2e+69) (* 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 t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+158) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
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) :: t_2
real(8) :: tmp
t_1 = (-60.0d0) * (y / (z - t))
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+158)) then
tmp = t_1
else if (t_2 <= 2d+69) 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 t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+158) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+158: tmp = t_1 elif t_2 <= 2e+69: 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))) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+158) tmp = t_1; elseif (t_2 <= 2e+69) 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)); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+158) tmp = t_1; elseif (t_2 <= 2e+69) 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]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+158], t$95$1, If[LessEqual[t$95$2, 2e+69], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999953e157 or 2.0000000000000001e69 < (/.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-*.f6462.7
Applied rewrites62.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.8
Applied rewrites26.8%
if -9.99999999999999953e157 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e69Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ (- x y) t))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+189) t_1 (if (<= t_2 2e+69) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * ((x - y) / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+189) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
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) :: t_2
real(8) :: tmp
t_1 = (-60.0d0) * ((x - y) / t)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+189)) then
tmp = t_1
else if (t_2 <= 2d+69) 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 * ((x - y) / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+189) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * ((x - y) / t) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+189: tmp = t_1 elif t_2 <= 2e+69: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(Float64(x - y) / t)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+189) tmp = t_1; elseif (t_2 <= 2e+69) 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 * ((x - y) / t); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+189) tmp = t_1; elseif (t_2 <= 2e+69) 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[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+189], t$95$1, If[LessEqual[t$95$2, 2e+69], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{x - y}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000004e189 or 2.0000000000000001e69 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.2
Applied rewrites28.2%
if -5.0000000000000004e189 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e69Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+189)
(* 60.0 (/ y t))
(if (<= t_1 2e+69) (* 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 <= -5e+189) {
tmp = 60.0 * (y / t);
} else if (t_1 <= 2e+69) {
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 <= (-5d+189)) then
tmp = 60.0d0 * (y / t)
else if (t_1 <= 2d+69) 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 <= -5e+189) {
tmp = 60.0 * (y / t);
} else if (t_1 <= 2e+69) {
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 <= -5e+189: tmp = 60.0 * (y / t) elif t_1 <= 2e+69: 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 <= -5e+189) tmp = Float64(60.0 * Float64(y / t)); elseif (t_1 <= 2e+69) 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 <= -5e+189) tmp = 60.0 * (y / t); elseif (t_1 <= 2e+69) 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, -5e+189], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+69], 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 -5 \cdot 10^{+189}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;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)) < -5.0000000000000004e189Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
if -5.0000000000000004e189 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e69Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 2.0000000000000001e69 < (/.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-*.f6462.7
Applied rewrites62.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+189)
(* 60.0 (/ y t))
(if (<= t_1 2e+69) (* 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 <= -5e+189) {
tmp = 60.0 * (y / t);
} else if (t_1 <= 2e+69) {
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 <= (-5d+189)) then
tmp = 60.0d0 * (y / t)
else if (t_1 <= 2d+69) 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 <= -5e+189) {
tmp = 60.0 * (y / t);
} else if (t_1 <= 2e+69) {
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 <= -5e+189: tmp = 60.0 * (y / t) elif t_1 <= 2e+69: 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 <= -5e+189) tmp = Float64(60.0 * Float64(y / t)); elseif (t_1 <= 2e+69) tmp = Float64(120.0 * a); else tmp = Float64(Float64(60.0 * 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 <= -5e+189) tmp = 60.0 * (y / t); elseif (t_1 <= 2e+69) 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, -5e+189], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+69], N[(120.0 * a), $MachinePrecision], N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+189}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000004e189Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
if -5.0000000000000004e189 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e69Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 2.0000000000000001e69 < (/.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-*.f6462.7
Applied rewrites62.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6415.7
Applied rewrites15.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ y t))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+189) t_1 (if (<= t_2 2e+69) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (y / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+189) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
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) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * (y / t)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+189)) then
tmp = t_1
else if (t_2 <= 2d+69) 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 / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+189) {
tmp = t_1;
} else if (t_2 <= 2e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (y / t) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+189: tmp = t_1 elif t_2 <= 2e+69: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(y / t)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+189) tmp = t_1; elseif (t_2 <= 2e+69) 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 / t); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+189) tmp = t_1; elseif (t_2 <= 2e+69) 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 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+189], t$95$1, If[LessEqual[t$95$2, 2e+69], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{y}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+69}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000004e189 or 2.0000000000000001e69 < (/.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-*.f6462.7
Applied rewrites62.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
if -5.0000000000000004e189 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.0000000000000001e69Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (if (<= (/ (* 60.0 (- x y)) (- z t)) -2e+218) (* -60.0 (/ x t)) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((60.0 * (x - y)) / (z - t)) <= -2e+218) {
tmp = -60.0 * (x / 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 (((60.0d0 * (x - y)) / (z - t)) <= (-2d+218)) then
tmp = (-60.0d0) * (x / 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 (((60.0 * (x - y)) / (z - t)) <= -2e+218) {
tmp = -60.0 * (x / t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((60.0 * (x - y)) / (z - t)) <= -2e+218: tmp = -60.0 * (x / t) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) <= -2e+218) tmp = Float64(-60.0 * Float64(x / t)); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((60.0 * (x - y)) / (z - t)) <= -2e+218) tmp = -60.0 * (x / t); else tmp = 120.0 * a; 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+218], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{60 \cdot \left(x - y\right)}{z - t} \leq -2 \cdot 10^{+218}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000017e218Initial program 99.2%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
if -2.00000000000000017e218 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(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.3
Applied rewrites50.3%
herbie shell --seed 2025150
(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)))