
(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.5%
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 y) (- z t)) (* a 120.0))))
(if (<= y -4.6e+66)
t_1
(if (<= y 2.9e+16) (+ (/ (* 60.0 x) (- z t)) (* a 120.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((-60.0 * y) / (z - t)) + (a * 120.0);
double tmp;
if (y <= -4.6e+66) {
tmp = t_1;
} else if (y <= 2.9e+16) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (((-60.0d0) * y) / (z - t)) + (a * 120.0d0)
if (y <= (-4.6d+66)) then
tmp = t_1
else if (y <= 2.9d+16) then
tmp = ((60.0d0 * x) / (z - t)) + (a * 120.0d0)
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)) + (a * 120.0);
double tmp;
if (y <= -4.6e+66) {
tmp = t_1;
} else if (y <= 2.9e+16) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((-60.0 * y) / (z - t)) + (a * 120.0) tmp = 0 if y <= -4.6e+66: tmp = t_1 elif y <= 2.9e+16: tmp = ((60.0 * x) / (z - t)) + (a * 120.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(-60.0 * y) / Float64(z - t)) + Float64(a * 120.0)) tmp = 0.0 if (y <= -4.6e+66) tmp = t_1; elseif (y <= 2.9e+16) tmp = Float64(Float64(Float64(60.0 * x) / Float64(z - t)) + Float64(a * 120.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((-60.0 * y) / (z - t)) + (a * 120.0); tmp = 0.0; if (y <= -4.6e+66) tmp = t_1; elseif (y <= 2.9e+16) tmp = ((60.0 * x) / (z - t)) + (a * 120.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+66], t$95$1, If[LessEqual[y, 2.9e+16], N[(N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-60 \cdot y}{z - t} + a \cdot 120\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;\frac{60 \cdot x}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.6e66 or 2.9e16 < y Initial program 99.5%
Taylor expanded in x around 0
lower-*.f6475.7
Applied rewrites75.7%
if -4.6e66 < y < 2.9e16Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6474.5
Applied rewrites74.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.4e-46)
(fma a 120.0 (* 60.0 (/ (- y x) t)))
(if (<= t 4e-166)
(fma 60.0 (/ (- x y) z) (* 120.0 a))
(if (<= t 1.65e-31)
(+ (/ (* -60.0 y) (- z t)) (* a 120.0))
(fma -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.4e-46) {
tmp = fma(a, 120.0, (60.0 * ((y - x) / t)));
} else if (t <= 4e-166) {
tmp = fma(60.0, ((x - y) / z), (120.0 * a));
} else if (t <= 1.65e-31) {
tmp = ((-60.0 * y) / (z - t)) + (a * 120.0);
} else {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.4e-46) tmp = fma(a, 120.0, Float64(60.0 * Float64(Float64(y - x) / t))); elseif (t <= 4e-166) tmp = fma(60.0, Float64(Float64(x - y) / z), Float64(120.0 * a)); elseif (t <= 1.65e-31) tmp = Float64(Float64(Float64(-60.0 * y) / Float64(z - t)) + Float64(a * 120.0)); else tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e-46], N[(a * 120.0 + N[(60.0 * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-166], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-31], N[(N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, 60 \cdot \frac{y - x}{t}\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-31}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -2.40000000000000013e-46Initial program 99.5%
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-*.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
if -2.40000000000000013e-46 < t < 4.00000000000000016e-166Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
if 4.00000000000000016e-166 < t < 1.65e-31Initial program 99.5%
Taylor expanded in x around 0
lower-*.f6475.7
Applied rewrites75.7%
if 1.65e-31 < t Initial program 99.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.9
Applied rewrites63.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* 60.0 (/ (- y x) t)))))
(if (<= t -2.4e-46)
t_1
(if (<= t 3.05e-108) (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(a, 120.0, (60.0 * ((y - x) / t)));
double tmp;
if (t <= -2.4e-46) {
tmp = t_1;
} else if (t <= 3.05e-108) {
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(a, 120.0, Float64(60.0 * Float64(Float64(y - x) / t))) tmp = 0.0 if (t <= -2.4e-46) tmp = t_1; elseif (t <= 3.05e-108) 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[(a * 120.0 + N[(60.0 * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e-46], t$95$1, If[LessEqual[t, 3.05e-108], 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(a, 120, 60 \cdot \frac{y - x}{t}\right)\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.05 \cdot 10^{-108}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.40000000000000013e-46 or 3.05000000000000004e-108 < t Initial program 99.5%
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-*.f64N/A
lower-/.f64N/A
lower--.f6463.9
Applied rewrites63.9%
if -2.40000000000000013e-46 < t < 3.05000000000000004e-108Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ (- x y) t) (* 120.0 a))))
(if (<= t -2.4e-46)
t_1
(if (<= t 3.05e-108) (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 <= -2.4e-46) {
tmp = t_1;
} else if (t <= 3.05e-108) {
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 <= -2.4e-46) tmp = t_1; elseif (t <= 3.05e-108) 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, -2.4e-46], t$95$1, If[LessEqual[t, 3.05e-108], 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 -2.4 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.05 \cdot 10^{-108}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.40000000000000013e-46 or 3.05000000000000004e-108 < t Initial program 99.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.9
Applied rewrites63.9%
if -2.40000000000000013e-46 < t < 3.05000000000000004e-108Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e-6)
(fma a 120.0 (* (/ -60.0 z) y))
(if (<= z 7.2e-236)
(fma -60.0 (/ (- x y) t) (* 120.0 a))
(if (<= z 2.25e-10)
(* 60.0 (/ (- x y) (- z t)))
(fma 60.0 (/ x z) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-6) {
tmp = fma(a, 120.0, ((-60.0 / z) * y));
} else if (z <= 7.2e-236) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else if (z <= 2.25e-10) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = fma(60.0, (x / z), (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e-6) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * y)); elseif (z <= 7.2e-236) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); elseif (z <= 2.25e-10) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = fma(60.0, Float64(x / z), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e-6], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-236], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e-10], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot y\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-236}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-10}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -5.20000000000000019e-6Initial program 99.5%
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.5
Applied rewrites63.5%
Taylor expanded in x around 0
Applied rewrites54.8%
if -5.20000000000000019e-6 < z < 7.20000000000000015e-236Initial program 99.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.9
Applied rewrites63.9%
if 7.20000000000000015e-236 < z < 2.25e-10Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
if 2.25e-10 < z Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around inf
lower-/.f6454.7
Applied rewrites54.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+115)
(* 60.0 (/ (- x y) (- z t)))
(if (<= t_1 5e-61) (* 120.0 a) (* (/ 60.0 (- z t)) (- x 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 <= -2e+115) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= 5e-61) {
tmp = 120.0 * a;
} else {
tmp = (60.0 / (z - t)) * (x - 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 <= (-2d+115)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (t_1 <= 5d-61) then
tmp = 120.0d0 * a
else
tmp = (60.0d0 / (z - t)) * (x - 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 <= -2e+115) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= 5e-61) {
tmp = 120.0 * a;
} else {
tmp = (60.0 / (z - t)) * (x - y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+115: tmp = 60.0 * ((x - y) / (z - t)) elif t_1 <= 5e-61: tmp = 120.0 * a else: tmp = (60.0 / (z - t)) * (x - 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 <= -2e+115) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (t_1 <= 5e-61) tmp = Float64(120.0 * a); else tmp = Float64(Float64(60.0 / Float64(z - t)) * Float64(x - 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 <= -2e+115) tmp = 60.0 * ((x - y) / (z - t)); elseif (t_1 <= 5e-61) tmp = 120.0 * a; else tmp = (60.0 / (z - t)) * (x - 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, -2e+115], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-61], N[(120.0 * a), $MachinePrecision], N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - 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 -2 \cdot 10^{+115}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-61}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{z - t} \cdot \left(x - y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e115Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
if -2e115 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e-61Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.9999999999999999e-61 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
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-/.f6450.8
Applied rewrites50.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ (- x y) (- z t)))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -2e+115) t_1 (if (<= t_2 5e-61) (* 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 - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 5e-61) {
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))
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-2d+115)) then
tmp = t_1
else if (t_2 <= 5d-61) 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 - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 5e-61) {
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)) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -2e+115: tmp = t_1 elif t_2 <= 5e-61: 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) / Float64(z - t))) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -2e+115) tmp = t_1; elseif (t_2 <= 5e-61) 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)); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -2e+115) tmp = t_1; elseif (t_2 <= 5e-61) 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] / 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, -2e+115], t$95$1, If[LessEqual[t$95$2, 5e-61], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z - t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-61}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e115 or 4.9999999999999999e-61 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
if -2e115 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e-61Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
(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 -2e+115)
t_1
(if (<= t_2 5e-61)
(* 120.0 a)
(if (<= t_2 1e-9)
(* 60.0 (/ x (- z t)))
(if (<= t_2 1e+91) (fma -60.0 (/ y z) (* 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 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 5e-61) {
tmp = 120.0 * a;
} else if (t_2 <= 1e-9) {
tmp = 60.0 * (x / (z - t));
} else if (t_2 <= 1e+91) {
tmp = fma(-60.0, (y / z), (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 <= -2e+115) tmp = t_1; elseif (t_2 <= 5e-61) tmp = Float64(120.0 * a); elseif (t_2 <= 1e-9) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif (t_2 <= 1e+91) tmp = fma(-60.0, Float64(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] / 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, -2e+115], t$95$1, If[LessEqual[t$95$2, 5e-61], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 1e-9], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+91], N[(-60.0 * N[(y / z), $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 -2 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-61}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 10^{-9}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;t\_2 \leq 10^{+91}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, 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)) < -2e115 or 1.00000000000000008e91 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.0
Applied rewrites28.0%
if -2e115 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e-61Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.9999999999999999e-61 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000006e-9Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.3
Applied rewrites26.3%
if 1.00000000000000006e-9 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000008e91Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
(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 -2e+115)
t_1
(if (<= t_2 5e-61)
(* 120.0 a)
(if (<= t_2 1e-9)
(* 60.0 (/ x (- z t)))
(if (<= t_2 4e+64) (* 60.0 (/ y (- t z))) 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 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 5e-61) {
tmp = 120.0 * a;
} else if (t_2 <= 1e-9) {
tmp = 60.0 * (x / (z - t));
} else if (t_2 <= 4e+64) {
tmp = 60.0 * (y / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 <= (-2d+115)) then
tmp = t_1
else if (t_2 <= 5d-61) then
tmp = 120.0d0 * a
else if (t_2 <= 1d-9) then
tmp = 60.0d0 * (x / (z - t))
else if (t_2 <= 4d+64) then
tmp = 60.0d0 * (y / (t - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 5e-61) {
tmp = 120.0 * a;
} else if (t_2 <= 1e-9) {
tmp = 60.0 * (x / (z - t));
} else if (t_2 <= 4e+64) {
tmp = 60.0 * (y / (t - z));
} 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 <= -2e+115: tmp = t_1 elif t_2 <= 5e-61: tmp = 120.0 * a elif t_2 <= 1e-9: tmp = 60.0 * (x / (z - t)) elif t_2 <= 4e+64: tmp = 60.0 * (y / (t - z)) 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 <= -2e+115) tmp = t_1; elseif (t_2 <= 5e-61) tmp = Float64(120.0 * a); elseif (t_2 <= 1e-9) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif (t_2 <= 4e+64) tmp = Float64(60.0 * Float64(y / Float64(t - z))); 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 <= -2e+115) tmp = t_1; elseif (t_2 <= 5e-61) tmp = 120.0 * a; elseif (t_2 <= 1e-9) tmp = 60.0 * (x / (z - t)); elseif (t_2 <= 4e+64) tmp = 60.0 * (y / (t - z)); 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, -2e+115], t$95$1, If[LessEqual[t$95$2, 5e-61], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 1e-9], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+64], N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $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 -2 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-61}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 10^{-9}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+64}:\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e115 or 4.00000000000000009e64 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.0
Applied rewrites28.0%
if -2e115 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e-61Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.9999999999999999e-61 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000006e-9Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.3
Applied rewrites26.3%
if 1.00000000000000006e-9 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.00000000000000009e64Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6474.5
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.5
Applied rewrites74.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.5e+17)
(* 120.0 a)
(if (<= a -2.7e-285)
(fma a 120.0 (* (/ -60.0 z) y))
(if (<= a 7.2e-218)
(/ (* (- y x) 60.0) t)
(fma a 120.0 (* (/ x z) 60.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e+17) {
tmp = 120.0 * a;
} else if (a <= -2.7e-285) {
tmp = fma(a, 120.0, ((-60.0 / z) * y));
} else if (a <= 7.2e-218) {
tmp = ((y - x) * 60.0) / t;
} else {
tmp = fma(a, 120.0, ((x / z) * 60.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.5e+17) tmp = Float64(120.0 * a); elseif (a <= -2.7e-285) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * y)); elseif (a <= 7.2e-218) tmp = Float64(Float64(Float64(y - x) * 60.0) / t); else tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e+17], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -2.7e-285], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-218], N[(N[(N[(y - x), $MachinePrecision] * 60.0), $MachinePrecision] / t), $MachinePrecision], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+17}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-285}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot y\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-218}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot 60}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\end{array}
\end{array}
if a < -4.5e17Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if -4.5e17 < a < -2.6999999999999998e-285Initial program 99.5%
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.5
Applied rewrites63.5%
Taylor expanded in x around 0
Applied rewrites54.8%
if -2.6999999999999998e-285 < a < 7.20000000000000023e-218Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
sub-negate-revN/A
lower--.f6428.8
Applied rewrites28.8%
if 7.20000000000000023e-218 < a Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around inf
lower-/.f6454.7
Applied rewrites54.7%
lift-fma.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
metadata-evalN/A
distribute-lft-neg-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6454.7
Applied rewrites54.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.5e+17)
(* 120.0 a)
(if (<= a -2.7e-285)
(fma -60.0 (/ y z) (* 120.0 a))
(if (<= a 7.2e-218)
(/ (* (- y x) 60.0) t)
(fma a 120.0 (* (/ x z) 60.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e+17) {
tmp = 120.0 * a;
} else if (a <= -2.7e-285) {
tmp = fma(-60.0, (y / z), (120.0 * a));
} else if (a <= 7.2e-218) {
tmp = ((y - x) * 60.0) / t;
} else {
tmp = fma(a, 120.0, ((x / z) * 60.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.5e+17) tmp = Float64(120.0 * a); elseif (a <= -2.7e-285) tmp = fma(-60.0, Float64(y / z), Float64(120.0 * a)); elseif (a <= 7.2e-218) tmp = Float64(Float64(Float64(y - x) * 60.0) / t); else tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e+17], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -2.7e-285], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-218], N[(N[(N[(y - x), $MachinePrecision] * 60.0), $MachinePrecision] / t), $MachinePrecision], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+17}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-285}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, 120 \cdot a\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-218}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot 60}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\end{array}
\end{array}
if a < -4.5e17Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if -4.5e17 < a < -2.6999999999999998e-285Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
if -2.6999999999999998e-285 < a < 7.20000000000000023e-218Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
sub-negate-revN/A
lower--.f6428.8
Applied rewrites28.8%
if 7.20000000000000023e-218 < a Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around inf
lower-/.f6454.7
Applied rewrites54.7%
lift-fma.f64N/A
+-commutativeN/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
metadata-evalN/A
distribute-lft-neg-outN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6454.7
Applied rewrites54.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4.5e+17)
(* 120.0 a)
(if (<= a -2.7e-285)
(fma -60.0 (/ y z) (* 120.0 a))
(if (<= a 7.2e-218)
(/ (* (- y x) 60.0) t)
(fma 60.0 (/ x z) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e+17) {
tmp = 120.0 * a;
} else if (a <= -2.7e-285) {
tmp = fma(-60.0, (y / z), (120.0 * a));
} else if (a <= 7.2e-218) {
tmp = ((y - x) * 60.0) / t;
} else {
tmp = fma(60.0, (x / z), (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.5e+17) tmp = Float64(120.0 * a); elseif (a <= -2.7e-285) tmp = fma(-60.0, Float64(y / z), Float64(120.0 * a)); elseif (a <= 7.2e-218) tmp = Float64(Float64(Float64(y - x) * 60.0) / t); else tmp = fma(60.0, Float64(x / z), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e+17], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -2.7e-285], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.2e-218], N[(N[(N[(y - x), $MachinePrecision] * 60.0), $MachinePrecision] / t), $MachinePrecision], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+17}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-285}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, 120 \cdot a\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-218}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot 60}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\end{array}
\end{array}
if a < -4.5e17Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if -4.5e17 < a < -2.6999999999999998e-285Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
if -2.6999999999999998e-285 < a < 7.20000000000000023e-218Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-/.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
sub-negate-revN/A
lower--.f6428.8
Applied rewrites28.8%
if 7.20000000000000023e-218 < a Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around inf
lower-/.f6454.7
Applied rewrites54.7%
(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 -2e+115) t_1 (if (<= t_2 1e+91) (* 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 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 1e+91) {
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 <= (-2d+115)) then
tmp = t_1
else if (t_2 <= 1d+91) 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 <= -2e+115) {
tmp = t_1;
} else if (t_2 <= 1e+91) {
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 <= -2e+115: tmp = t_1 elif t_2 <= 1e+91: 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 <= -2e+115) tmp = t_1; elseif (t_2 <= 1e+91) 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 <= -2e+115) tmp = t_1; elseif (t_2 <= 1e+91) 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, -2e+115], t$95$1, If[LessEqual[t$95$2, 1e+91], 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 -2 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+91}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2e115 or 1.00000000000000008e91 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.0
Applied rewrites28.0%
if -2e115 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000008e91Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ y (- t z)))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -4e+130)
t_1
(if (<= t_2 200000.0)
(* 120.0 a)
(if (<= t_2 5e+302) t_1 (* -60.0 (/ x t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (y / (t - z));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -4e+130) {
tmp = t_1;
} else if (t_2 <= 200000.0) {
tmp = 120.0 * a;
} else if (t_2 <= 5e+302) {
tmp = t_1;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * (y / (t - z))
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-4d+130)) then
tmp = t_1
else if (t_2 <= 200000.0d0) then
tmp = 120.0d0 * a
else if (t_2 <= 5d+302) then
tmp = t_1
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (y / (t - z));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -4e+130) {
tmp = t_1;
} else if (t_2 <= 200000.0) {
tmp = 120.0 * a;
} else if (t_2 <= 5e+302) {
tmp = t_1;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (y / (t - z)) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -4e+130: tmp = t_1 elif t_2 <= 200000.0: tmp = 120.0 * a elif t_2 <= 5e+302: tmp = t_1 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(y / Float64(t - z))) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -4e+130) tmp = t_1; elseif (t_2 <= 200000.0) tmp = Float64(120.0 * a); elseif (t_2 <= 5e+302) tmp = t_1; else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * (y / (t - z)); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -4e+130) tmp = t_1; elseif (t_2 <= 200000.0) tmp = 120.0 * a; elseif (t_2 <= 5e+302) tmp = t_1; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(y / N[(t - z), $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, -4e+130], t$95$1, If[LessEqual[t$95$2, 200000.0], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 5e+302], t$95$1, N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{y}{t - z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 200000:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.0000000000000002e130 or 2e5 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5e302Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6474.5
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.5
Applied rewrites74.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if -4.0000000000000002e130 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e5Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 5e302 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
Taylor expanded in x around inf
lower-/.f6415.7
Applied rewrites15.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -4e+130)
(* 60.0 (/ y (- t z)))
(if (<= t_1 5e-61) (* 120.0 a) (* (/ -60.0 t) (- x 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 <= -4e+130) {
tmp = 60.0 * (y / (t - z));
} else if (t_1 <= 5e-61) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / t) * (x - 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 <= (-4d+130)) then
tmp = 60.0d0 * (y / (t - z))
else if (t_1 <= 5d-61) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) / t) * (x - 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 <= -4e+130) {
tmp = 60.0 * (y / (t - z));
} else if (t_1 <= 5e-61) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / t) * (x - y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -4e+130: tmp = 60.0 * (y / (t - z)) elif t_1 <= 5e-61: tmp = 120.0 * a else: tmp = (-60.0 / t) * (x - 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 <= -4e+130) tmp = Float64(60.0 * Float64(y / Float64(t - z))); elseif (t_1 <= 5e-61) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 / t) * Float64(x - 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 <= -4e+130) tmp = 60.0 * (y / (t - z)); elseif (t_1 <= 5e-61) tmp = 120.0 * a; else tmp = (-60.0 / t) * (x - 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, -4e+130], N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-61], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 / t), $MachinePrecision] * N[(x - 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 -4 \cdot 10^{+130}:\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-61}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{t} \cdot \left(x - y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.0000000000000002e130Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6474.5
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.5
Applied rewrites74.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if -4.0000000000000002e130 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.9999999999999999e-61Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.9999999999999999e-61 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
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--.f6428.9
Applied rewrites28.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -4e+130)
(* 60.0 (/ y (- t z)))
(if (<= t_1 1e+163) (* 120.0 a) (* -60.0 (/ (- x 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 <= -4e+130) {
tmp = 60.0 * (y / (t - z));
} else if (t_1 <= 1e+163) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * ((x - 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 <= (-4d+130)) then
tmp = 60.0d0 * (y / (t - z))
else if (t_1 <= 1d+163) then
tmp = 120.0d0 * a
else
tmp = (-60.0d0) * ((x - 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 <= -4e+130) {
tmp = 60.0 * (y / (t - z));
} else if (t_1 <= 1e+163) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * ((x - y) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -4e+130: tmp = 60.0 * (y / (t - z)) elif t_1 <= 1e+163: tmp = 120.0 * a else: tmp = -60.0 * ((x - 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 <= -4e+130) tmp = Float64(60.0 * Float64(y / Float64(t - z))); elseif (t_1 <= 1e+163) tmp = Float64(120.0 * a); else tmp = Float64(-60.0 * Float64(Float64(x - 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 <= -4e+130) tmp = 60.0 * (y / (t - z)); elseif (t_1 <= 1e+163) tmp = 120.0 * a; else tmp = -60.0 * ((x - 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, -4e+130], N[(60.0 * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+163], N[(120.0 * a), $MachinePrecision], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+130}:\\
\;\;\;\;60 \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t\_1 \leq 10^{+163}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.0000000000000002e130Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6474.5
Applied rewrites74.5%
lift-+.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6474.5
lift-*.f64N/A
*-commutativeN/A
lift-*.f6474.5
Applied rewrites74.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if -4.0000000000000002e130 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999994e162Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 9.9999999999999994e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+183)
(* -60.0 (/ y z))
(if (<= t_1 5e+123) (* 120.0 a) (* (/ 60.0 z) 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 <= -1e+183) {
tmp = -60.0 * (y / z);
} else if (t_1 <= 5e+123) {
tmp = 120.0 * a;
} else {
tmp = (60.0 / z) * 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 <= (-1d+183)) then
tmp = (-60.0d0) * (y / z)
else if (t_1 <= 5d+123) then
tmp = 120.0d0 * a
else
tmp = (60.0d0 / z) * 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 <= -1e+183) {
tmp = -60.0 * (y / z);
} else if (t_1 <= 5e+123) {
tmp = 120.0 * a;
} else {
tmp = (60.0 / z) * x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+183: tmp = -60.0 * (y / z) elif t_1 <= 5e+123: tmp = 120.0 * a else: tmp = (60.0 / z) * 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 <= -1e+183) tmp = Float64(-60.0 * Float64(y / z)); elseif (t_1 <= 5e+123) tmp = Float64(120.0 * a); else tmp = Float64(Float64(60.0 / z) * 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 <= -1e+183) tmp = -60.0 * (y / z); elseif (t_1 <= 5e+123) tmp = 120.0 * a; else tmp = (60.0 / z) * 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, -1e+183], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+123], N[(120.0 * a), $MachinePrecision], N[(N[(60.0 / z), $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 -1 \cdot 10^{+183}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+123}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{z} \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999947e182Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
if -9.99999999999999947e182 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.99999999999999974e123Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.99999999999999974e123 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f6415.8
Applied rewrites15.8%
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*r*N/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 -1e+183)
(* -60.0 (/ y z))
(if (<= t_1 5e+123) (* 120.0 a) (* 60.0 (/ x z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+183) {
tmp = -60.0 * (y / z);
} else if (t_1 <= 5e+123) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (x / z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+183)) then
tmp = (-60.0d0) * (y / z)
else if (t_1 <= 5d+123) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+183) {
tmp = -60.0 * (y / z);
} else if (t_1 <= 5e+123) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (x / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+183: tmp = -60.0 * (y / z) elif t_1 <= 5e+123: tmp = 120.0 * a else: tmp = 60.0 * (x / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+183) tmp = Float64(-60.0 * Float64(y / z)); elseif (t_1 <= 5e+123) tmp = Float64(120.0 * a); else tmp = Float64(60.0 * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+183) tmp = -60.0 * (y / z); elseif (t_1 <= 5e+123) tmp = 120.0 * a; else tmp = 60.0 * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+183], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+123], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+183}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+123}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999947e182Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
if -9.99999999999999947e182 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.99999999999999974e123Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.99999999999999974e123 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in x around inf
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 -1e+183)
(* -60.0 (/ y z))
(if (<= t_1 2e+154) (* 120.0 a) (* -60.0 (/ x t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+183) {
tmp = -60.0 * (y / z);
} else if (t_1 <= 2e+154) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+183)) then
tmp = (-60.0d0) * (y / z)
else if (t_1 <= 2d+154) then
tmp = 120.0d0 * a
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+183) {
tmp = -60.0 * (y / z);
} else if (t_1 <= 2e+154) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+183: tmp = -60.0 * (y / z) elif t_1 <= 2e+154: tmp = 120.0 * a else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+183) tmp = Float64(-60.0 * Float64(y / z)); elseif (t_1 <= 2e+154) tmp = Float64(120.0 * a); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+183) tmp = -60.0 * (y / z); elseif (t_1 <= 2e+154) tmp = 120.0 * a; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+183], N[(-60.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+154], N[(120.0 * a), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+183}:\\
\;\;\;\;-60 \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999947e182Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6416.1
Applied rewrites16.1%
if -9.99999999999999947e182 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000007e154Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
if 2.00000000000000007e154 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
Taylor expanded in x around inf
lower-/.f6415.7
Applied rewrites15.7%
(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+195) t_1 (if (<= t_2 2e+154) (* 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+195) {
tmp = t_1;
} else if (t_2 <= 2e+154) {
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+195)) then
tmp = t_1
else if (t_2 <= 2d+154) 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+195) {
tmp = t_1;
} else if (t_2 <= 2e+154) {
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+195: tmp = t_1 elif t_2 <= 2e+154: 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+195) tmp = t_1; elseif (t_2 <= 2e+154) 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+195) tmp = t_1; elseif (t_2 <= 2e+154) 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+195], t$95$1, If[LessEqual[t$95$2, 2e+154], 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^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+154}:\\
\;\;\;\;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.9999999999999998e195 or 2.00000000000000007e154 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
Taylor expanded in x around inf
lower-/.f6415.7
Applied rewrites15.7%
if -4.9999999999999998e195 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000007e154Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.4e+240) (* 60.0 (/ y t)) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.4e+240) {
tmp = 60.0 * (y / 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 (y <= (-3.4d+240)) then
tmp = 60.0d0 * (y / 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 (y <= -3.4e+240) {
tmp = 60.0 * (y / t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.4e+240: tmp = 60.0 * (y / t) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.4e+240) tmp = Float64(60.0 * Float64(y / t)); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.4e+240) tmp = 60.0 * (y / t); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.4e+240], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+240}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if y < -3.40000000000000008e240Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.9
Applied rewrites28.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6417.1
Applied rewrites17.1%
if -3.40000000000000008e240 < y Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
(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.5%
Taylor expanded in z around inf
lower-*.f6450.6
Applied rewrites50.6%
herbie shell --seed 2025162
(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)))