
(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 22 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 (- x y) (/ 60.0 (- z t)) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
return fma((x - y), (60.0 / (z - t)), (120.0 * a));
}
function code(x, y, z, t, a) return fma(Float64(x - y), Float64(60.0 / Float64(z - t)), Float64(120.0 * a)) end
code[x_, y_, z_, t_, a_] := N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x - y, \frac{60}{z - t}, 120 \cdot a\right)
\end{array}
Initial program 99.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (* (- x y) 60.0) (- z t))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, (((x - y) * 60.0) / (z - t)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{\left(x - y\right) \cdot 60}{z - t}\right)
\end{array}
Initial program 99.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.1e+23)
(fma a 120.0 (* (/ (- x y) t) -60.0))
(if (<= t 8.5e-34)
(fma (/ (- x y) z) 60.0 (* 120.0 a))
(fma (- x y) (/ -60.0 t) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.1e+23) {
tmp = fma(a, 120.0, (((x - y) / t) * -60.0));
} else if (t <= 8.5e-34) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = fma((x - y), (-60.0 / t), (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.1e+23) tmp = fma(a, 120.0, Float64(Float64(Float64(x - y) / t) * -60.0)); elseif (t <= 8.5e-34) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = fma(Float64(x - y), Float64(-60.0 / t), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.1e+23], N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-34], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(-60.0 / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{t} \cdot -60\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{-60}{t}, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -2.1000000000000001e23Initial program 99.5%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6487.6
Applied rewrites87.6%
if -2.1000000000000001e23 < t < 8.5000000000000001e-34Initial program 99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
if 8.5000000000000001e-34 < t Initial program 99.0%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.0
Applied rewrites99.0%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
lower-/.f6483.8
Applied rewrites83.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x y) t)))
(if (<= t -2.1e+23)
(fma a 120.0 (* t_1 -60.0))
(if (<= t 8.5e-34)
(fma (/ (- x y) z) 60.0 (* 120.0 a))
(fma t_1 -60.0 (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - y) / t;
double tmp;
if (t <= -2.1e+23) {
tmp = fma(a, 120.0, (t_1 * -60.0));
} else if (t <= 8.5e-34) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = fma(t_1, -60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - y) / t) tmp = 0.0 if (t <= -2.1e+23) tmp = fma(a, 120.0, Float64(t_1 * -60.0)); elseif (t <= 8.5e-34) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = fma(t_1, -60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -2.1e+23], N[(a * 120.0 + N[(t$95$1 * -60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-34], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, t\_1 \cdot -60\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -60, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -2.1000000000000001e23Initial program 99.5%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6487.6
Applied rewrites87.6%
if -2.1000000000000001e23 < t < 8.5000000000000001e-34Initial program 99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
if 8.5000000000000001e-34 < t Initial program 99.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6483.8
Applied rewrites83.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) -60.0 (* 120.0 a))))
(if (<= t -2.1e+23)
t_1
(if (<= t 8.5e-34) (fma (/ (- x y) z) 60.0 (* 120.0 a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), -60.0, (120.0 * a));
double tmp;
if (t <= -2.1e+23) {
tmp = t_1;
} else if (t <= 8.5e-34) {
tmp = fma(((x - y) / z), 60.0, (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)) tmp = 0.0 if (t <= -2.1e+23) tmp = t_1; elseif (t <= 8.5e-34) tmp = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+23], t$95$1, If[LessEqual[t, 8.5e-34], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.1000000000000001e23 or 8.5000000000000001e-34 < t Initial program 99.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6485.6
Applied rewrites85.6%
if -2.1000000000000001e23 < t < 8.5000000000000001e-34Initial program 99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y (- z t)) -60.0 (* 120.0 a))))
(if (<= a -2.9e-187)
t_1
(if (<= a 1e-81) (/ (* (- x y) 60.0) (- z t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / (z - t)), -60.0, (120.0 * a));
double tmp;
if (a <= -2.9e-187) {
tmp = t_1;
} else if (a <= 1e-81) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / Float64(z - t)), -60.0, Float64(120.0 * a)) tmp = 0.0 if (a <= -2.9e-187) tmp = t_1; elseif (a <= 1e-81) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.9e-187], t$95$1, If[LessEqual[a, 1e-81], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{z - t}, -60, 120 \cdot a\right)\\
\mathbf{if}\;a \leq -2.9 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 10^{-81}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.89999999999999988e-187 or 9.9999999999999996e-82 < a Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6480.8
Applied rewrites80.8%
if -2.89999999999999988e-187 < a < 9.9999999999999996e-82Initial program 99.4%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6483.6
Applied rewrites83.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.4e+55) (* 120.0 a) (if (<= a 7.6e-43) (/ (* (- x y) 60.0) (- z t)) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.4e+55) {
tmp = 120.0 * a;
} else if (a <= 7.6e-43) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.4d+55)) then
tmp = 120.0d0 * a
else if (a <= 7.6d-43) then
tmp = ((x - y) * 60.0d0) / (z - t)
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.4e+55) {
tmp = 120.0 * a;
} else if (a <= 7.6e-43) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.4e+55: tmp = 120.0 * a elif a <= 7.6e-43: tmp = ((x - y) * 60.0) / (z - t) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.4e+55) tmp = Float64(120.0 * a); elseif (a <= 7.6e-43) tmp = Float64(Float64(Float64(x - y) * 60.0) / Float64(z - t)); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.4e+55) tmp = 120.0 * a; elseif (a <= 7.6e-43) tmp = ((x - y) * 60.0) / (z - t); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.4e+55], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 7.6e-43], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+55}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.3999999999999998e55 or 7.59999999999999939e-43 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6474.8
Applied rewrites74.8%
if -3.3999999999999998e55 < a < 7.59999999999999939e-43Initial program 99.3%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6474.1
Applied rewrites74.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.4e+55) (* 120.0 a) (if (<= a 7.6e-43) (* (- x y) (/ 60.0 (- z t))) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.4e+55) {
tmp = 120.0 * a;
} else if (a <= 7.6e-43) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.4d+55)) then
tmp = 120.0d0 * a
else if (a <= 7.6d-43) then
tmp = (x - y) * (60.0d0 / (z - t))
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.4e+55) {
tmp = 120.0 * a;
} else if (a <= 7.6e-43) {
tmp = (x - y) * (60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.4e+55: tmp = 120.0 * a elif a <= 7.6e-43: tmp = (x - y) * (60.0 / (z - t)) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.4e+55) tmp = Float64(120.0 * a); elseif (a <= 7.6e-43) tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.4e+55) tmp = 120.0 * a; elseif (a <= 7.6e-43) tmp = (x - y) * (60.0 / (z - t)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.4e+55], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 7.6e-43], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+55}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{-43}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.3999999999999998e55 or 7.59999999999999939e-43 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6474.8
Applied rewrites74.8%
if -3.3999999999999998e55 < a < 7.59999999999999939e-43Initial program 99.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in a around 0
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f6474.6
Applied rewrites74.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6e-9)
(fma a 120.0 (* (/ y t) 60.0))
(if (<= t 3e-195)
(fma a 120.0 (* (/ x z) 60.0))
(if (<= t 4.1e-35)
(fma a 120.0 (* (/ y z) -60.0))
(fma a 120.0 (* (/ x t) -60.0))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6e-9) {
tmp = fma(a, 120.0, ((y / t) * 60.0));
} else if (t <= 3e-195) {
tmp = fma(a, 120.0, ((x / z) * 60.0));
} else if (t <= 4.1e-35) {
tmp = fma(a, 120.0, ((y / z) * -60.0));
} else {
tmp = fma(a, 120.0, ((x / t) * -60.0));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6e-9) tmp = fma(a, 120.0, Float64(Float64(y / t) * 60.0)); elseif (t <= 3e-195) tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); elseif (t <= 4.1e-35) tmp = fma(a, 120.0, Float64(Float64(y / z) * -60.0)); else tmp = fma(a, 120.0, Float64(Float64(x / t) * -60.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6e-9], N[(a * 120.0 + N[(N[(y / t), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-195], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e-35], N[(a * 120.0 + N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{t} \cdot 60\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-195}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{z} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{t} \cdot -60\right)\\
\end{array}
\end{array}
if t < -5.99999999999999996e-9Initial program 99.5%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6485.9
Applied rewrites85.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-/.f64N/A
lift-*.f6471.6
Applied rewrites71.6%
if -5.99999999999999996e-9 < t < 3e-195Initial program 99.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6485.6
Applied rewrites85.6%
Taylor expanded in x around inf
Applied rewrites62.7%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
if 3e-195 < t < 4.10000000000000026e-35Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6466.7
Applied rewrites66.7%
Taylor expanded in z around inf
Applied rewrites55.8%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6455.9
Applied rewrites55.9%
if 4.10000000000000026e-35 < t Initial program 99.0%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.1
Applied rewrites99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6483.8
Applied rewrites83.8%
Taylor expanded in x around inf
lower-/.f6470.8
Applied rewrites70.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6e-9)
(fma a 120.0 (* (/ y t) 60.0))
(if (<= t 3e-195)
(fma a 120.0 (* (/ x z) 60.0))
(if (<= t 3700.0)
(fma a 120.0 (* (/ y z) -60.0))
(fma (/ y t) 60.0 (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6e-9) {
tmp = fma(a, 120.0, ((y / t) * 60.0));
} else if (t <= 3e-195) {
tmp = fma(a, 120.0, ((x / z) * 60.0));
} else if (t <= 3700.0) {
tmp = fma(a, 120.0, ((y / z) * -60.0));
} else {
tmp = fma((y / t), 60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6e-9) tmp = fma(a, 120.0, Float64(Float64(y / t) * 60.0)); elseif (t <= 3e-195) tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); elseif (t <= 3700.0) tmp = fma(a, 120.0, Float64(Float64(y / z) * -60.0)); else tmp = fma(Float64(y / t), 60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6e-9], N[(a * 120.0 + N[(N[(y / t), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-195], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3700.0], N[(a * 120.0 + N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{t} \cdot 60\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-195}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{elif}\;t \leq 3700:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{z} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, 60, 120 \cdot a\right)\\
\end{array}
\end{array}
if t < -5.99999999999999996e-9Initial program 99.5%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6485.9
Applied rewrites85.9%
Taylor expanded in x around 0
*-commutativeN/A
lift-/.f64N/A
lift-*.f6471.6
Applied rewrites71.6%
if -5.99999999999999996e-9 < t < 3e-195Initial program 99.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6485.6
Applied rewrites85.6%
Taylor expanded in x around inf
Applied rewrites62.7%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
if 3e-195 < t < 3700Initial program 99.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6467.5
Applied rewrites67.5%
Taylor expanded in z around inf
Applied rewrites55.2%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6455.3
Applied rewrites55.3%
if 3700 < t Initial program 99.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6480.0
Applied rewrites80.0%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f6473.1
Applied rewrites73.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y t) 60.0 (* 120.0 a))))
(if (<= t -6e-9)
t_1
(if (<= t 3e-195)
(fma a 120.0 (* (/ x z) 60.0))
(if (<= t 3700.0) (fma a 120.0 (* (/ y z) -60.0)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / t), 60.0, (120.0 * a));
double tmp;
if (t <= -6e-9) {
tmp = t_1;
} else if (t <= 3e-195) {
tmp = fma(a, 120.0, ((x / z) * 60.0));
} else if (t <= 3700.0) {
tmp = fma(a, 120.0, ((y / z) * -60.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / t), 60.0, Float64(120.0 * a)) tmp = 0.0 if (t <= -6e-9) tmp = t_1; elseif (t <= 3e-195) tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); elseif (t <= 3700.0) tmp = fma(a, 120.0, Float64(Float64(y / z) * -60.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e-9], t$95$1, If[LessEqual[t, 3e-195], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3700.0], N[(a * 120.0 + N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, 60, 120 \cdot a\right)\\
\mathbf{if}\;t \leq -6 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-195}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{elif}\;t \leq 3700:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{z} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.99999999999999996e-9 or 3700 < t Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6479.4
Applied rewrites79.4%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f6472.3
Applied rewrites72.3%
if -5.99999999999999996e-9 < t < 3e-195Initial program 99.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6485.6
Applied rewrites85.6%
Taylor expanded in x around inf
Applied rewrites62.7%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
if 3e-195 < t < 3700Initial program 99.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6467.5
Applied rewrites67.5%
Taylor expanded in z around inf
Applied rewrites55.2%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6455.3
Applied rewrites55.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y t) 60.0 (* 120.0 a))))
(if (<= t -2.35e+35)
t_1
(if (<= t 3700.0) (fma a 120.0 (* (/ y z) -60.0)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / t), 60.0, (120.0 * a));
double tmp;
if (t <= -2.35e+35) {
tmp = t_1;
} else if (t <= 3700.0) {
tmp = fma(a, 120.0, ((y / z) * -60.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / t), 60.0, Float64(120.0 * a)) tmp = 0.0 if (t <= -2.35e+35) tmp = t_1; elseif (t <= 3700.0) tmp = fma(a, 120.0, Float64(Float64(y / z) * -60.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e+35], t$95$1, If[LessEqual[t, 3700.0], N[(a * 120.0 + N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{t}, 60, 120 \cdot a\right)\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3700:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{z} \cdot -60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.35000000000000017e35 or 3700 < t Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6480.1
Applied rewrites80.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f6473.7
Applied rewrites73.7%
if -2.35000000000000017e35 < t < 3700Initial program 99.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6469.5
Applied rewrites69.5%
Taylor expanded in z around inf
Applied rewrites60.3%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f6460.4
Applied rewrites60.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.2e+95)
(* 120.0 a)
(if (<= a -4.3e-183)
(fma (/ y t) 60.0 (* 120.0 a))
(if (<= a 2.65e-235)
(/ (* 60.0 x) (- z t))
(if (<= a 4.8e-83) (* (/ y (- z t)) -60.0) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.2e+95) {
tmp = 120.0 * a;
} else if (a <= -4.3e-183) {
tmp = fma((y / t), 60.0, (120.0 * a));
} else if (a <= 2.65e-235) {
tmp = (60.0 * x) / (z - t);
} else if (a <= 4.8e-83) {
tmp = (y / (z - t)) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.2e+95) tmp = Float64(120.0 * a); elseif (a <= -4.3e-183) tmp = fma(Float64(y / t), 60.0, Float64(120.0 * a)); elseif (a <= 2.65e-235) tmp = Float64(Float64(60.0 * x) / Float64(z - t)); elseif (a <= 4.8e-83) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.2e+95], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -4.3e-183], N[(N[(y / t), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.65e-235], N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e-83], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+95}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -4.3 \cdot 10^{-183}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, 60, 120 \cdot a\right)\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{-235}:\\
\;\;\;\;\frac{60 \cdot x}{z - t}\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{-83}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -6.2000000000000006e95 or 4.8000000000000002e-83 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6473.1
Applied rewrites73.1%
if -6.2000000000000006e95 < a < -4.30000000000000017e-183Initial program 99.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f6445.5
Applied rewrites45.5%
if -4.30000000000000017e-183 < a < 2.6500000000000001e-235Initial program 99.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6447.2
Applied rewrites47.2%
if 2.6500000000000001e-235 < a < 4.8000000000000002e-83Initial program 99.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6442.0
Applied rewrites42.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.8e-52)
(* 120.0 a)
(if (<= a 9.5e-269)
(* (/ (- x y) t) -60.0)
(if (<= a 4.8e-83) (* (/ y (- z t)) -60.0) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-52) {
tmp = 120.0 * a;
} else if (a <= 9.5e-269) {
tmp = ((x - y) / t) * -60.0;
} else if (a <= 4.8e-83) {
tmp = (y / (z - t)) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.8d-52)) then
tmp = 120.0d0 * a
else if (a <= 9.5d-269) then
tmp = ((x - y) / t) * (-60.0d0)
else if (a <= 4.8d-83) then
tmp = (y / (z - t)) * (-60.0d0)
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-52) {
tmp = 120.0 * a;
} else if (a <= 9.5e-269) {
tmp = ((x - y) / t) * -60.0;
} else if (a <= 4.8e-83) {
tmp = (y / (z - t)) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e-52: tmp = 120.0 * a elif a <= 9.5e-269: tmp = ((x - y) / t) * -60.0 elif a <= 4.8e-83: tmp = (y / (z - t)) * -60.0 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e-52) tmp = Float64(120.0 * a); elseif (a <= 9.5e-269) tmp = Float64(Float64(Float64(x - y) / t) * -60.0); elseif (a <= 4.8e-83) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e-52) tmp = 120.0 * a; elseif (a <= 9.5e-269) tmp = ((x - y) / t) * -60.0; elseif (a <= 4.8e-83) tmp = (y / (z - t)) * -60.0; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e-52], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 9.5e-269], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[a, 4.8e-83], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-52}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-269}:\\
\;\;\;\;\frac{x - y}{t} \cdot -60\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{-83}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -1.79999999999999994e-52 or 4.8000000000000002e-83 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6469.1
Applied rewrites69.1%
if -1.79999999999999994e-52 < a < 9.5000000000000006e-269Initial program 99.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.3
Applied rewrites99.3%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6499.7
Applied rewrites99.7%
Taylor expanded in z around 0
associate-*r/N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6454.6
Applied rewrites54.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6444.6
Applied rewrites44.6%
if 9.5000000000000006e-269 < a < 4.8000000000000002e-83Initial program 99.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6442.7
Applied rewrites42.7%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.8e-52)
(* 120.0 a)
(if (<= a 3.6e-140)
(* (/ (- x y) t) -60.0)
(if (<= a 4.6e-82) (* (/ (- x y) z) 60.0) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-52) {
tmp = 120.0 * a;
} else if (a <= 3.6e-140) {
tmp = ((x - y) / t) * -60.0;
} else if (a <= 4.6e-82) {
tmp = ((x - y) / z) * 60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.8d-52)) then
tmp = 120.0d0 * a
else if (a <= 3.6d-140) then
tmp = ((x - y) / t) * (-60.0d0)
else if (a <= 4.6d-82) then
tmp = ((x - y) / z) * 60.0d0
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-52) {
tmp = 120.0 * a;
} else if (a <= 3.6e-140) {
tmp = ((x - y) / t) * -60.0;
} else if (a <= 4.6e-82) {
tmp = ((x - y) / z) * 60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e-52: tmp = 120.0 * a elif a <= 3.6e-140: tmp = ((x - y) / t) * -60.0 elif a <= 4.6e-82: tmp = ((x - y) / z) * 60.0 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e-52) tmp = Float64(120.0 * a); elseif (a <= 3.6e-140) tmp = Float64(Float64(Float64(x - y) / t) * -60.0); elseif (a <= 4.6e-82) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e-52) tmp = 120.0 * a; elseif (a <= 3.6e-140) tmp = ((x - y) / t) * -60.0; elseif (a <= 4.6e-82) tmp = ((x - y) / z) * 60.0; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e-52], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 3.6e-140], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[a, 4.6e-82], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-52}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{-140}:\\
\;\;\;\;\frac{x - y}{t} \cdot -60\\
\mathbf{elif}\;a \leq 4.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -1.79999999999999994e-52 or 4.59999999999999994e-82 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6469.2
Applied rewrites69.2%
if -1.79999999999999994e-52 < a < 3.6e-140Initial program 99.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.3
Applied rewrites99.3%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6499.7
Applied rewrites99.7%
Taylor expanded in z around 0
associate-*r/N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.6
Applied rewrites53.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6444.1
Applied rewrites44.1%
if 3.6e-140 < a < 4.59999999999999994e-82Initial program 99.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6457.8
Applied rewrites57.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.8e-52) (* 120.0 a) (if (<= a 2.75e-87) (* (/ (- x y) t) -60.0) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-52) {
tmp = 120.0 * a;
} else if (a <= 2.75e-87) {
tmp = ((x - y) / t) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.8d-52)) then
tmp = 120.0d0 * a
else if (a <= 2.75d-87) then
tmp = ((x - y) / t) * (-60.0d0)
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.8e-52) {
tmp = 120.0 * a;
} else if (a <= 2.75e-87) {
tmp = ((x - y) / t) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.8e-52: tmp = 120.0 * a elif a <= 2.75e-87: tmp = ((x - y) / t) * -60.0 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.8e-52) tmp = Float64(120.0 * a); elseif (a <= 2.75e-87) tmp = Float64(Float64(Float64(x - y) / t) * -60.0); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.8e-52) tmp = 120.0 * a; elseif (a <= 2.75e-87) tmp = ((x - y) / t) * -60.0; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e-52], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 2.75e-87], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-52}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 2.75 \cdot 10^{-87}:\\
\;\;\;\;\frac{x - y}{t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -1.79999999999999994e-52 or 2.7500000000000002e-87 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6469.0
Applied rewrites69.0%
if -1.79999999999999994e-52 < a < 2.7500000000000002e-87Initial program 99.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.3
Applied rewrites99.3%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lower-fma.f64N/A
+-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
lift-*.f6499.7
Applied rewrites99.7%
Taylor expanded in z around 0
associate-*r/N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.6
Applied rewrites53.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift--.f6443.2
Applied rewrites43.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+230)
(/ (* 60.0 y) t)
(if (<= t_1 2e+146) (* 120.0 a) (* (/ x z) 60.0)))))
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+230) {
tmp = (60.0 * y) / t;
} else if (t_1 <= 2e+146) {
tmp = 120.0 * a;
} else {
tmp = (x / z) * 60.0;
}
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+230)) then
tmp = (60.0d0 * y) / t
else if (t_1 <= 2d+146) then
tmp = 120.0d0 * a
else
tmp = (x / z) * 60.0d0
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+230) {
tmp = (60.0 * y) / t;
} else if (t_1 <= 2e+146) {
tmp = 120.0 * a;
} else {
tmp = (x / z) * 60.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+230: tmp = (60.0 * y) / t elif t_1 <= 2e+146: tmp = 120.0 * a else: tmp = (x / z) * 60.0 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+230) tmp = Float64(Float64(60.0 * y) / t); elseif (t_1 <= 2e+146) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x / z) * 60.0); 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+230) tmp = (60.0 * y) / t; elseif (t_1 <= 2e+146) tmp = 120.0 * a; else tmp = (x / z) * 60.0; 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+230], N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+146], N[(120.0 * a), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * 60.0), $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^{+230}:\\
\;\;\;\;\frac{60 \cdot y}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+146}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.0000000000000002e230Initial program 96.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6450.1
Applied rewrites50.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6432.4
Applied rewrites32.4%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6431.9
Applied rewrites31.9%
if -2.0000000000000002e230 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999987e146Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.9
Applied rewrites59.9%
if 1.99999999999999987e146 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6459.4
Applied rewrites59.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6431.0
Applied rewrites31.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* 60.0 y) t)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -2e+230) t_1 (if (<= t_2 5e+142) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * y) / t;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+230) {
tmp = t_1;
} else if (t_2 <= 5e+142) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (60.0d0 * y) / t
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-2d+230)) then
tmp = t_1
else if (t_2 <= 5d+142) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * y) / t;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+230) {
tmp = t_1;
} else if (t_2 <= 5e+142) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * y) / t t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -2e+230: tmp = t_1 elif t_2 <= 5e+142: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * y) / t) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -2e+230) tmp = t_1; elseif (t_2 <= 5e+142) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * y) / t; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -2e+230) tmp = t_1; elseif (t_2 <= 5e+142) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * y), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+230], t$95$1, If[LessEqual[t$95$2, 5e+142], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot y}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+142}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.0000000000000002e230 or 5.0000000000000001e142 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6430.0
Applied rewrites30.0%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6429.7
Applied rewrites29.7%
if -2.0000000000000002e230 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.0000000000000001e142Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6460.0
Applied rewrites60.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y t) 60.0)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -2e+230) t_1 (if (<= t_2 5e+142) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / t) * 60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+230) {
tmp = t_1;
} else if (t_2 <= 5e+142) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y / t) * 60.0d0
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-2d+230)) then
tmp = t_1
else if (t_2 <= 5d+142) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / t) * 60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+230) {
tmp = t_1;
} else if (t_2 <= 5e+142) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / t) * 60.0 t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -2e+230: tmp = t_1 elif t_2 <= 5e+142: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / t) * 60.0) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -2e+230) tmp = t_1; elseif (t_2 <= 5e+142) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / t) * 60.0; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -2e+230) tmp = t_1; elseif (t_2 <= 5e+142) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * 60.0), $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+230], t$95$1, If[LessEqual[t$95$2, 5e+142], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t} \cdot 60\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+142}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.0000000000000002e230 or 5.0000000000000001e142 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6447.6
Applied rewrites47.6%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6430.0
Applied rewrites30.0%
if -2.0000000000000002e230 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.0000000000000001e142Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6460.0
Applied rewrites60.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+257)
(* (/ x t) -60.0)
(if (<= t_1 1e+176) (* 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 <= -2e+257) {
tmp = (x / t) * -60.0;
} else if (t_1 <= 1e+176) {
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 <= (-2d+257)) then
tmp = (x / t) * (-60.0d0)
else if (t_1 <= 1d+176) 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 <= -2e+257) {
tmp = (x / t) * -60.0;
} else if (t_1 <= 1e+176) {
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 <= -2e+257: tmp = (x / t) * -60.0 elif t_1 <= 1e+176: 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 <= -2e+257) tmp = Float64(Float64(x / t) * -60.0); elseif (t_1 <= 1e+176) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 * 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 <= -2e+257) tmp = (x / t) * -60.0; elseif (t_1 <= 1e+176) 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, -2e+257], N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+176], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 * x), $MachinePrecision] / t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+257}:\\
\;\;\;\;\frac{x}{t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 10^{+176}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60 \cdot x}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000006e257Initial program 95.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6451.8
Applied rewrites51.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6437.1
Applied rewrites37.1%
if -2.00000000000000006e257 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e176Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6458.1
Applied rewrites58.1%
if 1e176 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6450.2
Applied rewrites50.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6432.1
Applied rewrites32.1%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ x t) -60.0)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -2e+257) t_1 (if (<= t_2 1e+176) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+257) {
tmp = t_1;
} else if (t_2 <= 1e+176) {
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 = (x / t) * (-60.0d0)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-2d+257)) then
tmp = t_1
else if (t_2 <= 1d+176) 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 = (x / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+257) {
tmp = t_1;
} else if (t_2 <= 1e+176) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x / t) * -60.0 t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -2e+257: tmp = t_1 elif t_2 <= 1e+176: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x / t) * -60.0) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -2e+257) tmp = t_1; elseif (t_2 <= 1e+176) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x / t) * -60.0; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -2e+257) tmp = t_1; elseif (t_2 <= 1e+176) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * -60.0), $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+257], t$95$1, If[LessEqual[t$95$2, 1e+176], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t} \cdot -60\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+176}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000006e257 or 1e176 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6450.7
Applied rewrites50.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6433.9
Applied rewrites33.9%
if -2.00000000000000006e257 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1e176Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6458.1
Applied rewrites58.1%
(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.3%
Taylor expanded in z around inf
lower-*.f6450.0
Applied rewrites50.0%
herbie shell --seed 2025106
(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)))