
(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 23 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 (* (/ -60.0 (- z t)) (- y x))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((-60.0 / (z - t)) * (y - x)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(-60.0 / Float64(z - t)) * Float64(y - x))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{-60}{z - t} \cdot \left(y - x\right)\right)
\end{array}
Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (/ (* 60.0 x) (- z t)) (* a 120.0))))
(if (<= x -1.2e+160)
t_1
(if (<= x 5.5e+55) (fma a 120.0 (/ (* y -60.0) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((60.0 * x) / (z - t)) + (a * 120.0);
double tmp;
if (x <= -1.2e+160) {
tmp = t_1;
} else if (x <= 5.5e+55) {
tmp = fma(a, 120.0, ((y * -60.0) / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(60.0 * x) / Float64(z - t)) + Float64(a * 120.0)) tmp = 0.0 if (x <= -1.2e+160) tmp = t_1; elseif (x <= 5.5e+55) tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+160], t$95$1, If[LessEqual[x, 5.5e+55], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot x}{z - t} + a \cdot 120\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.2000000000000001e160 or 5.5000000000000004e55 < x Initial program 99.4%
Taylor expanded in x around inf
lower-*.f6474.7
Applied rewrites74.7%
if -1.2000000000000001e160 < x < 5.5000000000000004e55Initial program 99.4%
Taylor expanded in x around 0
lower-*.f6474.4
Applied rewrites74.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6474.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ 60.0 (- z t)) (- x y))))
(if (<= x -1.75e+192)
t_1
(if (<= x 1.9e+102) (fma a 120.0 (/ (* y -60.0) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 / (z - t)) * (x - y);
double tmp;
if (x <= -1.75e+192) {
tmp = t_1;
} else if (x <= 1.9e+102) {
tmp = fma(a, 120.0, ((y * -60.0) / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)) tmp = 0.0 if (x <= -1.75e+192) tmp = t_1; elseif (x <= 1.9e+102) tmp = fma(a, 120.0, Float64(Float64(y * -60.0) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+192], t$95$1, If[LessEqual[x, 1.9e+102], N[(a * 120.0 + N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60}{z - t} \cdot \left(x - y\right)\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot -60}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.74999999999999991e192 or 1.89999999999999989e102 < x Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
if -1.74999999999999991e192 < x < 1.89999999999999989e102Initial program 99.4%
Taylor expanded in x around 0
lower-*.f6474.4
Applied rewrites74.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6474.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.8e-56)
(fma -60.0 (/ (- x y) t) (* 120.0 a))
(if (<= t 7.4e-38)
(fma a 120.0 (* (/ -60.0 z) (- y x)))
(fma a 120.0 (* (/ 60.0 t) (- y x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e-56) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else if (t <= 7.4e-38) {
tmp = fma(a, 120.0, ((-60.0 / z) * (y - x)));
} else {
tmp = fma(a, 120.0, ((60.0 / t) * (y - x)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.8e-56) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); elseif (t <= 7.4e-38) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * Float64(y - x))); else tmp = fma(a, 120.0, Float64(Float64(60.0 / t) * Float64(y - x))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.8e-56], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.4e-38], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(60.0 / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-56}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{t} \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if t < -5.79999999999999982e-56Initial program 99.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.7
Applied rewrites63.7%
if -5.79999999999999982e-56 < t < 7.4e-38Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6463.4
Applied rewrites63.4%
if 7.4e-38 < t Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in z around 0
lower-/.f6463.7
Applied rewrites63.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* 120.0 a))))
(if (<= t -5.8e-56)
t_1
(if (<= t 7.4e-38) (fma a 120.0 (* (/ -60.0 z) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, ((x - y) / t), (120.0 * a));
double tmp;
if (t <= -5.8e-56) {
tmp = t_1;
} else if (t <= 7.4e-38) {
tmp = fma(a, 120.0, ((-60.0 / z) * (y - x)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)) tmp = 0.0 if (t <= -5.8e-56) tmp = t_1; elseif (t <= 7.4e-38) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * Float64(y - x))); 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] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e-56], t$95$1, If[LessEqual[t, 7.4e-38], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.79999999999999982e-56 or 7.4e-38 < t Initial program 99.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.7
Applied rewrites63.7%
if -5.79999999999999982e-56 < t < 7.4e-38Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6463.4
Applied rewrites63.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* 120.0 a))))
(if (<= t -5.8e-56)
t_1
(if (<= t 7.4e-38) (fma 60.0 (/ (- x y) z) (* 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) / t), (120.0 * a));
double tmp;
if (t <= -5.8e-56) {
tmp = t_1;
} else if (t <= 7.4e-38) {
tmp = fma(60.0, ((x - y) / z), (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) / t), Float64(120.0 * a)) tmp = 0.0 if (t <= -5.8e-56) tmp = t_1; elseif (t <= 7.4e-38) tmp = fma(60.0, Float64(Float64(x - y) / z), 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] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e-56], t$95$1, If[LessEqual[t, 7.4e-38], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $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}{t}, 120 \cdot a\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.4 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.79999999999999982e-56 or 7.4e-38 < t Initial program 99.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.7
Applied rewrites63.7%
if -5.79999999999999982e-56 < t < 7.4e-38Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ x z) (* 120.0 a))))
(if (<= z -2e+136)
t_1
(if (<= z -3.8e+37)
(fma a 120.0 (* (/ -60.0 z) y))
(if (<= z -2.05e-56)
(* (/ 60.0 (- z t)) (- x y))
(if (<= z 8000000000000.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 / z), (120.0 * a));
double tmp;
if (z <= -2e+136) {
tmp = t_1;
} else if (z <= -3.8e+37) {
tmp = fma(a, 120.0, ((-60.0 / z) * y));
} else if (z <= -2.05e-56) {
tmp = (60.0 / (z - t)) * (x - y);
} else if (z <= 8000000000000.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(x / z), Float64(120.0 * a)) tmp = 0.0 if (z <= -2e+136) tmp = t_1; elseif (z <= -3.8e+37) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * y)); elseif (z <= -2.05e-56) tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)); elseif (z <= 8000000000000.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[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+136], t$95$1, If[LessEqual[z, -3.8e+37], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.05e-56], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8000000000000.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}{z}, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot y\right)\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-56}:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\mathbf{elif}\;z \leq 8000000000000:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.00000000000000012e136 or 8e12 < z Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around inf
lower-/.f6454.1
Applied rewrites54.1%
if -2.00000000000000012e136 < z < -3.7999999999999999e37Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in z around inf
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in x around 0
Applied rewrites53.9%
if -3.7999999999999999e37 < z < -2.0500000000000001e-56Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
if -2.0500000000000001e-56 < z < 8e12Initial program 99.4%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.7
Applied rewrites63.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -24000000.0)
(* 120.0 a)
(if (<= a 1e-51)
(* (/ 60.0 (- z t)) (- x y))
(if (<= a 8.2e+163) (fma 60.0 (/ x z) (* 120.0 a)) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -24000000.0) {
tmp = 120.0 * a;
} else if (a <= 1e-51) {
tmp = (60.0 / (z - t)) * (x - y);
} else if (a <= 8.2e+163) {
tmp = fma(60.0, (x / z), (120.0 * a));
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -24000000.0) tmp = Float64(120.0 * a); elseif (a <= 1e-51) tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - y)); elseif (a <= 8.2e+163) tmp = fma(60.0, Float64(x / z), Float64(120.0 * a)); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -24000000.0], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 1e-51], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+163], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -24000000:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 10^{-51}:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.4e7 or 8.1999999999999998e163 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if -2.4e7 < a < 1e-51Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
metadata-evalN/A
distribute-neg-fracN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6451.6
Applied rewrites51.6%
if 1e-51 < a < 8.1999999999999998e163Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around inf
lower-/.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -24000000.0)
(* 120.0 a)
(if (<= a 1e-51)
(* 60.0 (/ (- x y) (- z t)))
(if (<= a 8.2e+163) (fma 60.0 (/ x z) (* 120.0 a)) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -24000000.0) {
tmp = 120.0 * a;
} else if (a <= 1e-51) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (a <= 8.2e+163) {
tmp = fma(60.0, (x / z), (120.0 * a));
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -24000000.0) tmp = Float64(120.0 * a); elseif (a <= 1e-51) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (a <= 8.2e+163) tmp = fma(60.0, Float64(x / z), Float64(120.0 * a)); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -24000000.0], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 1e-51], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.2e+163], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -24000000:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 10^{-51}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+163}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.4e7 or 8.1999999999999998e163 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if -2.4e7 < a < 1e-51Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
if 1e-51 < a < 8.1999999999999998e163Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around inf
lower-/.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* (/ 60.0 t) y))))
(if (<= t -4.9e-56)
t_1
(if (<= t 30000000000000.0) (fma 60.0 (/ x z) (* 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 / t) * y));
double tmp;
if (t <= -4.9e-56) {
tmp = t_1;
} else if (t <= 30000000000000.0) {
tmp = fma(60.0, (x / z), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(60.0 / t) * y)) tmp = 0.0 if (t <= -4.9e-56) tmp = t_1; elseif (t <= 30000000000000.0) tmp = fma(60.0, Float64(x / z), 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[(N[(60.0 / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.9e-56], t$95$1, If[LessEqual[t, 30000000000000.0], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{60}{t} \cdot y\right)\\
\mathbf{if}\;t \leq -4.9 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 30000000000000:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.9e-56 or 3e13 < t Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in z around 0
lower-/.f6463.7
Applied rewrites63.7%
Taylor expanded in x around 0
Applied rewrites54.3%
if -4.9e-56 < t < 3e13Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around inf
lower-/.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.25e+46)
(* 120.0 a)
(if (<= t -5.8e-56)
(* -60.0 (/ y (- z t)))
(if (<= t 2.4e+19)
(fma 60.0 (/ x z) (* 120.0 a))
(if (<= t 8.4e+93) (* -60.0 (/ (- x y) t)) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.25e+46) {
tmp = 120.0 * a;
} else if (t <= -5.8e-56) {
tmp = -60.0 * (y / (z - t));
} else if (t <= 2.4e+19) {
tmp = fma(60.0, (x / z), (120.0 * a));
} else if (t <= 8.4e+93) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.25e+46) tmp = Float64(120.0 * a); elseif (t <= -5.8e-56) tmp = Float64(-60.0 * Float64(y / Float64(z - t))); elseif (t <= 2.4e+19) tmp = fma(60.0, Float64(x / z), Float64(120.0 * a)); elseif (t <= 8.4e+93) tmp = Float64(-60.0 * Float64(Float64(x - y) / t)); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.25e+46], N[(120.0 * a), $MachinePrecision], If[LessEqual[t, -5.8e-56], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+19], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.4e+93], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{+46}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-56}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+93}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if t < -2.25000000000000005e46 or 8.39999999999999921e93 < t Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if -2.25000000000000005e46 < t < -5.79999999999999982e-56Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
if -5.79999999999999982e-56 < t < 2.4e19Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around inf
lower-/.f6454.1
Applied rewrites54.1%
if 2.4e19 < t < 8.39999999999999921e93Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
(FPCore (x y z t a)
:precision binary64
(if (<= x -1.75e+192)
(* (/ 60.0 (- z t)) x)
(if (<= x 1.25e-89)
(fma -60.0 (/ y z) (* 120.0 a))
(if (<= x 1.9e+102) (* 120.0 a) (/ (* 60.0 x) (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.75e+192) {
tmp = (60.0 / (z - t)) * x;
} else if (x <= 1.25e-89) {
tmp = fma(-60.0, (y / z), (120.0 * a));
} else if (x <= 1.9e+102) {
tmp = 120.0 * a;
} else {
tmp = (60.0 * x) / (z - t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.75e+192) tmp = Float64(Float64(60.0 / Float64(z - t)) * x); elseif (x <= 1.25e-89) tmp = fma(-60.0, Float64(y / z), Float64(120.0 * a)); elseif (x <= 1.9e+102) tmp = Float64(120.0 * a); else tmp = Float64(Float64(60.0 * x) / Float64(z - t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.75e+192], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 1.25e-89], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e+102], N[(120.0 * a), $MachinePrecision], N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+192}:\\
\;\;\;\;\frac{60}{z - t} \cdot x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-89}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, 120 \cdot a\right)\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+102}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot x}{z - t}\\
\end{array}
\end{array}
if x < -1.74999999999999991e192Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*r*N/A
mult-flip-revN/A
lower-*.f64N/A
lower-/.f6427.4
Applied rewrites27.4%
if -1.74999999999999991e192 < x < 1.24999999999999992e-89Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6453.9
Applied rewrites53.9%
if 1.24999999999999992e-89 < x < 1.89999999999999989e102Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if 1.89999999999999989e102 < x Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6427.3
Applied rewrites27.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+25)
(/ (* (- y x) 60.0) t)
(if (<= t_1 2e+98) (* 120.0 a) (* (/ 60.0 (- z t)) x)))))
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+25) {
tmp = ((y - x) * 60.0) / t;
} else if (t_1 <= 2e+98) {
tmp = 120.0 * a;
} else {
tmp = (60.0 / (z - t)) * x;
}
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+25)) then
tmp = ((y - x) * 60.0d0) / t
else if (t_1 <= 2d+98) then
tmp = 120.0d0 * a
else
tmp = (60.0d0 / (z - t)) * x
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+25) {
tmp = ((y - x) * 60.0) / t;
} else if (t_1 <= 2e+98) {
tmp = 120.0 * a;
} else {
tmp = (60.0 / (z - t)) * x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+25: tmp = ((y - x) * 60.0) / t elif t_1 <= 2e+98: tmp = 120.0 * a else: tmp = (60.0 / (z - t)) * x 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+25) tmp = Float64(Float64(Float64(y - x) * 60.0) / t); elseif (t_1 <= 2e+98) tmp = Float64(120.0 * a); else tmp = Float64(Float64(60.0 / Float64(z - t)) * x); 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+25) tmp = ((y - x) * 60.0) / t; elseif (t_1 <= 2e+98) tmp = 120.0 * a; else tmp = (60.0 / (z - t)) * x; 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+25], N[(N[(N[(y - x), $MachinePrecision] * 60.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+98], N[(120.0 * a), $MachinePrecision], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $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^{+25}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot 60}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{z - t} \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000024e25Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-outN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f6429.1
Applied rewrites29.1%
if -5.00000000000000024e25 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e98Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if 2e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*r*N/A
mult-flip-revN/A
lower-*.f64N/A
lower-/.f6427.4
Applied rewrites27.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+25)
(/ (* (- y x) 60.0) t)
(if (<= t_1 2e+98) (* 120.0 a) (* 60.0 (/ x (- z 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+25) {
tmp = ((y - x) * 60.0) / t;
} else if (t_1 <= 2e+98) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (x / (z - t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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+25)) then
tmp = ((y - x) * 60.0d0) / t
else if (t_1 <= 2d+98) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 * (x / (z - 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+25) {
tmp = ((y - x) * 60.0) / t;
} else if (t_1 <= 2e+98) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (x / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+25: tmp = ((y - x) * 60.0) / t elif t_1 <= 2e+98: tmp = 120.0 * a else: tmp = 60.0 * (x / (z - 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+25) tmp = Float64(Float64(Float64(y - x) * 60.0) / t); elseif (t_1 <= 2e+98) tmp = Float64(120.0 * a); else tmp = Float64(60.0 * Float64(x / Float64(z - 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+25) tmp = ((y - x) * 60.0) / t; elseif (t_1 <= 2e+98) tmp = 120.0 * a; else tmp = 60.0 * (x / (z - 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+25], N[(N[(N[(y - x), $MachinePrecision] * 60.0), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+98], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $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^{+25}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot 60}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000024e25Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-outN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f6429.1
Applied rewrites29.1%
if -5.00000000000000024e25 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e98Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if 2e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* (- y x) 60.0) t)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+25) t_1 (if (<= t_2 2e+98) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - x) * 60.0) / t;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+25) {
tmp = t_1;
} else if (t_2 <= 2e+98) {
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 = ((y - x) * 60.0d0) / t
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+25)) then
tmp = t_1
else if (t_2 <= 2d+98) 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 = ((y - x) * 60.0) / t;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+25) {
tmp = t_1;
} else if (t_2 <= 2e+98) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - x) * 60.0) / t t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+25: tmp = t_1 elif t_2 <= 2e+98: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - x) * 60.0) / t) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+25) tmp = t_1; elseif (t_2 <= 2e+98) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - x) * 60.0) / t; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+25) tmp = t_1; elseif (t_2 <= 2e+98) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - x), $MachinePrecision] * 60.0), $MachinePrecision] / t), $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+25], t$95$1, If[LessEqual[t$95$2, 2e+98], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - x\right) \cdot 60}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;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.00000000000000024e25 or 2e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-outN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f6429.1
Applied rewrites29.1%
if -5.00000000000000024e25 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e98Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ -60.0 t) (- x y))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+25) t_1 (if (<= t_2 2e+98) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (-60.0 / t) * (x - y);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+25) {
tmp = t_1;
} else if (t_2 <= 2e+98) {
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) / t) * (x - y)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+25)) then
tmp = t_1
else if (t_2 <= 2d+98) 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 / t) * (x - y);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+25) {
tmp = t_1;
} else if (t_2 <= 2e+98) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (-60.0 / t) * (x - y) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+25: tmp = t_1 elif t_2 <= 2e+98: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-60.0 / t) * Float64(x - y)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+25) tmp = t_1; elseif (t_2 <= 2e+98) 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 / t) * (x - y); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+25) tmp = t_1; elseif (t_2 <= 2e+98) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(-60.0 / t), $MachinePrecision] * N[(x - y), $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+25], t$95$1, If[LessEqual[t$95$2, 2e+98], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-60}{t} \cdot \left(x - y\right)\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;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.00000000000000024e25 or 2e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*l/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f6429.2
Applied rewrites29.2%
if -5.00000000000000024e25 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e98Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
(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+25) t_1 (if (<= t_2 2e+98) (* 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+25) {
tmp = t_1;
} else if (t_2 <= 2e+98) {
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+25)) then
tmp = t_1
else if (t_2 <= 2d+98) 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+25) {
tmp = t_1;
} else if (t_2 <= 2e+98) {
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+25: tmp = t_1 elif t_2 <= 2e+98: 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+25) tmp = t_1; elseif (t_2 <= 2e+98) 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+25) tmp = t_1; elseif (t_2 <= 2e+98) 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+25], t$95$1, If[LessEqual[t$95$2, 2e+98], 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^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+98}:\\
\;\;\;\;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.00000000000000024e25 or 2e98 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
if -5.00000000000000024e25 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e98Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.4e-78) (* 120.0 a) (if (<= a 4.2e-52) (* -60.0 (/ y (- z t))) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.4e-78) {
tmp = 120.0 * a;
} else if (a <= 4.2e-52) {
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 <= (-2.4d-78)) then
tmp = 120.0d0 * a
else if (a <= 4.2d-52) 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 <= -2.4e-78) {
tmp = 120.0 * a;
} else if (a <= 4.2e-52) {
tmp = -60.0 * (y / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.4e-78: tmp = 120.0 * a elif a <= 4.2e-52: 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 <= -2.4e-78) tmp = Float64(120.0 * a); elseif (a <= 4.2e-52) 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 <= -2.4e-78) tmp = 120.0 * a; elseif (a <= 4.2e-52) 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, -2.4e-78], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 4.2e-52], 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 -2.4 \cdot 10^{-78}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-52}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.4e-78 or 4.1999999999999997e-52 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if -2.4e-78 < a < 4.1999999999999997e-52Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ x z))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+156) t_1 (if (<= t_2 1e+114) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (x / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+156) {
tmp = t_1;
} else if (t_2 <= 1e+114) {
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 / z)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+156)) then
tmp = t_1
else if (t_2 <= 1d+114) 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 / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+156) {
tmp = t_1;
} else if (t_2 <= 1e+114) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (x / z) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+156: tmp = t_1 elif t_2 <= 1e+114: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(x / z)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+156) tmp = t_1; elseif (t_2 <= 1e+114) 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 / z); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+156) tmp = t_1; elseif (t_2 <= 1e+114) 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[(x / 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+156], t$95$1, If[LessEqual[t$95$2, 1e+114], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+114}:\\
\;\;\;\;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.99999999999999992e156 or 1e114 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
if -4.99999999999999992e156 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e114Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
(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 -4e+186) t_1 (if (<= t_2 2e+160) (* 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 <= -4e+186) {
tmp = t_1;
} else if (t_2 <= 2e+160) {
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 <= (-4d+186)) then
tmp = t_1
else if (t_2 <= 2d+160) 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 <= -4e+186) {
tmp = t_1;
} else if (t_2 <= 2e+160) {
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 <= -4e+186: tmp = t_1 elif t_2 <= 2e+160: 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 <= -4e+186) tmp = t_1; elseif (t_2 <= 2e+160) 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 <= -4e+186) tmp = t_1; elseif (t_2 <= 2e+160) 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, -4e+186], t$95$1, If[LessEqual[t$95$2, 2e+160], 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 -4 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+160}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -3.99999999999999992e186 or 2.00000000000000001e160 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.6
Applied rewrites51.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
if -3.99999999999999992e186 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000001e160Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+156)
(* -60.0 (/ x t))
(if (<= t_1 2e+193) (* 120.0 a) (* (/ -60.0 t) x)))))
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+156) {
tmp = -60.0 * (x / t);
} else if (t_1 <= 2e+193) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / t) * x;
}
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+156)) then
tmp = (-60.0d0) * (x / t)
else if (t_1 <= 2d+193) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) / t) * x
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+156) {
tmp = -60.0 * (x / t);
} else if (t_1 <= 2e+193) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / t) * x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+156: tmp = -60.0 * (x / t) elif t_1 <= 2e+193: tmp = 120.0 * a else: tmp = (-60.0 / t) * x 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+156) tmp = Float64(-60.0 * Float64(x / t)); elseif (t_1 <= 2e+193) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 / t) * x); 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+156) tmp = -60.0 * (x / t); elseif (t_1 <= 2e+193) tmp = 120.0 * a; else tmp = (-60.0 / t) * x; 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+156], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+193], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 / t), $MachinePrecision] * x), $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^{+156}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+193}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{t} \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999992e156Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6416.6
Applied rewrites16.6%
if -4.99999999999999992e156 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000013e193Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
if 2.00000000000000013e193 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6416.6
Applied rewrites16.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*l/N/A
metadata-evalN/A
lower-/.f6416.6
Applied rewrites16.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ x t))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+156) t_1 (if (<= t_2 2e+193) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (x / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+156) {
tmp = t_1;
} else if (t_2 <= 2e+193) {
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 / t)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+156)) then
tmp = t_1
else if (t_2 <= 2d+193) 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 / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+156) {
tmp = t_1;
} else if (t_2 <= 2e+193) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (x / t) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+156: tmp = t_1 elif t_2 <= 2e+193: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(x / t)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+156) tmp = t_1; elseif (t_2 <= 2e+193) 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 / t); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+156) tmp = t_1; elseif (t_2 <= 2e+193) 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[(x / 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+156], t$95$1, If[LessEqual[t$95$2, 2e+193], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{x}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+193}:\\
\;\;\;\;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.99999999999999992e156 or 2.00000000000000013e193 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.4
Applied rewrites27.4%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6416.6
Applied rewrites16.6%
if -4.99999999999999992e156 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000013e193Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.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.4%
Taylor expanded in z around inf
lower-*.f6449.8
Applied rewrites49.8%
herbie shell --seed 2025149
(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)))