
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ (* (- x y) 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.3
Applied rewrites99.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* -60.0 y) (- z t)))))
(if (<= y -3.5e+22)
t_1
(if (<= y 1.05e-67) (fma a 120.0 (/ (* x 60.0) (- z t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, ((-60.0 * y) / (z - t)));
double tmp;
if (y <= -3.5e+22) {
tmp = t_1;
} else if (y <= 1.05e-67) {
tmp = fma(a, 120.0, ((x * 60.0) / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(-60.0 * y) / Float64(z - t))) tmp = 0.0 if (y <= -3.5e+22) tmp = t_1; elseif (y <= 1.05e-67) tmp = fma(a, 120.0, Float64(Float64(x * 60.0) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+22], t$95$1, If[LessEqual[y, 1.05e-67], N[(a * 120.0 + N[(N[(x * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x \cdot 60}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.5e22 or 1.0500000000000001e-67 < y 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%
Taylor expanded in x around 0
lower-*.f6482.8
Applied rewrites82.8%
if -3.5e22 < y < 1.0500000000000001e-67Initial program 99.6%
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.7
Applied rewrites99.7%
Taylor expanded in x around inf
Applied rewrites94.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* -60.0 y) (- z t)))))
(if (<= y -3.5e+22)
t_1
(if (<= y 1.05e-67) (fma (/ x (- z t)) 60.0 (* 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) / (z - t)));
double tmp;
if (y <= -3.5e+22) {
tmp = t_1;
} else if (y <= 1.05e-67) {
tmp = fma((x / (z - t)), 60.0, (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(-60.0 * y) / Float64(z - t))) tmp = 0.0 if (y <= -3.5e+22) tmp = t_1; elseif (y <= 1.05e-67) tmp = fma(Float64(x / Float64(z - t)), 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[(a * 120.0 + N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+22], t$95$1, If[LessEqual[y, 1.05e-67], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.5e22 or 1.0500000000000001e-67 < y 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%
Taylor expanded in x around 0
lower-*.f6482.8
Applied rewrites82.8%
if -3.5e22 < y < 1.0500000000000001e-67Initial program 99.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6494.9
Applied rewrites94.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) z) 60.0 (* 120.0 a))))
(if (<= z -7.8e-104)
t_1
(if (<= z 3.9e-15) (fma (/ (- x y) t) -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) / z), 60.0, (120.0 * a));
double tmp;
if (z <= -7.8e-104) {
tmp = t_1;
} else if (z <= 3.9e-15) {
tmp = fma(((x - y) / t), -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) / z), 60.0, Float64(120.0 * a)) tmp = 0.0 if (z <= -7.8e-104) tmp = t_1; elseif (z <= 3.9e-15) tmp = fma(Float64(Float64(x - y) / t), -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] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e-104], t$95$1, If[LessEqual[z, 3.9e-15], N[(N[(N[(x - y), $MachinePrecision] / t), $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}{z}, 60, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.8000000000000004e-104 or 3.90000000000000026e-15 < z Initial program 99.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6483.1
Applied rewrites83.1%
if -7.8000000000000004e-104 < z < 3.90000000000000026e-15Initial program 99.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6484.9
Applied rewrites84.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x (- z t)) 60.0 (* 120.0 a))))
(if (<= a -1.65e-99)
t_1
(if (<= a 2.3e-68) (/ (* (- x y) 60.0) (- z t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / (z - t)), 60.0, (120.0 * a));
double tmp;
if (a <= -1.65e-99) {
tmp = t_1;
} else if (a <= 2.3e-68) {
tmp = ((x - y) * 60.0) / (z - t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)) tmp = 0.0 if (a <= -1.65e-99) tmp = t_1; elseif (a <= 2.3e-68) 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[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e-99], t$95$1, If[LessEqual[a, 2.3e-68], 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{x}{z - t}, 60, 120 \cdot a\right)\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.64999999999999993e-99 or 2.29999999999999997e-68 < a Initial program 99.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6483.4
Applied rewrites83.4%
if -1.64999999999999993e-99 < a < 2.29999999999999997e-68Initial program 99.2%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6480.8
Applied rewrites80.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.8e-13) (* 120.0 a) (if (<= a 3900000000000.0) (/ (* (- 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 <= -2.8e-13) {
tmp = 120.0 * a;
} else if (a <= 3900000000000.0) {
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 <= (-2.8d-13)) then
tmp = 120.0d0 * a
else if (a <= 3900000000000.0d0) 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 <= -2.8e-13) {
tmp = 120.0 * a;
} else if (a <= 3900000000000.0) {
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 <= -2.8e-13: tmp = 120.0 * a elif a <= 3900000000000.0: 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 <= -2.8e-13) tmp = Float64(120.0 * a); elseif (a <= 3900000000000.0) 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 <= -2.8e-13) tmp = 120.0 * a; elseif (a <= 3900000000000.0) 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, -2.8e-13], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 3900000000000.0], 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 -2.8 \cdot 10^{-13}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 3900000000000:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.8000000000000002e-13 or 3.9e12 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6474.1
Applied rewrites74.1%
if -2.8000000000000002e-13 < a < 3.9e12Initial program 99.2%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6474.9
Applied rewrites74.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.8e-13) (* 120.0 a) (if (<= a 35.0) (* (- 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 <= -2.8e-13) {
tmp = 120.0 * a;
} else if (a <= 35.0) {
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 <= (-2.8d-13)) then
tmp = 120.0d0 * a
else if (a <= 35.0d0) 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 <= -2.8e-13) {
tmp = 120.0 * a;
} else if (a <= 35.0) {
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 <= -2.8e-13: tmp = 120.0 * a elif a <= 35.0: 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 <= -2.8e-13) tmp = Float64(120.0 * a); elseif (a <= 35.0) 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 <= -2.8e-13) tmp = 120.0 * a; elseif (a <= 35.0) 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, -2.8e-13], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 35.0], 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 -2.8 \cdot 10^{-13}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 35:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.8000000000000002e-13 or 35 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6473.7
Applied rewrites73.7%
if -2.8000000000000002e-13 < a < 35Initial program 99.2%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6475.4
Applied rewrites75.4%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/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--.f6475.9
Applied rewrites75.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7e-28)
(* 120.0 a)
(if (<= a 9.5e-295)
(/ (* (- x y) 60.0) z)
(if (<= a 2.7e-56) (* (/ (- x y) t) -60.0) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7e-28) {
tmp = 120.0 * a;
} else if (a <= 9.5e-295) {
tmp = ((x - y) * 60.0) / z;
} else if (a <= 2.7e-56) {
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 <= (-7d-28)) then
tmp = 120.0d0 * a
else if (a <= 9.5d-295) then
tmp = ((x - y) * 60.0d0) / z
else if (a <= 2.7d-56) 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 <= -7e-28) {
tmp = 120.0 * a;
} else if (a <= 9.5e-295) {
tmp = ((x - y) * 60.0) / z;
} else if (a <= 2.7e-56) {
tmp = ((x - y) / t) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7e-28: tmp = 120.0 * a elif a <= 9.5e-295: tmp = ((x - y) * 60.0) / z elif a <= 2.7e-56: 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 <= -7e-28) tmp = Float64(120.0 * a); elseif (a <= 9.5e-295) tmp = Float64(Float64(Float64(x - y) * 60.0) / z); elseif (a <= 2.7e-56) 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 <= -7e-28) tmp = 120.0 * a; elseif (a <= 9.5e-295) tmp = ((x - y) * 60.0) / z; elseif (a <= 2.7e-56) 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, -7e-28], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 9.5e-295], N[(N[(N[(x - y), $MachinePrecision] * 60.0), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 2.7e-56], 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 -7 \cdot 10^{-28}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-295}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot 60}{z}\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-56}:\\
\;\;\;\;\frac{x - y}{t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -6.9999999999999999e-28 or 2.69999999999999995e-56 < a Initial program 99.4%
Taylor expanded in z around inf
lower-*.f6470.8
Applied rewrites70.8%
if -6.9999999999999999e-28 < a < 9.5e-295Initial program 99.1%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6478.5
Applied rewrites78.5%
Taylor expanded in z around inf
Applied rewrites41.9%
if 9.5e-295 < a < 2.69999999999999995e-56Initial 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--.f6477.9
Applied rewrites77.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6442.3
Applied rewrites42.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -9e-99)
(* 120.0 a)
(if (<= a -8.8e-285)
(* (/ y (- z t)) -60.0)
(if (<= a 2.7e-56) (* (/ (- x y) t) -60.0) (* 120.0 a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e-99) {
tmp = 120.0 * a;
} else if (a <= -8.8e-285) {
tmp = (y / (z - t)) * -60.0;
} else if (a <= 2.7e-56) {
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 <= (-9d-99)) then
tmp = 120.0d0 * a
else if (a <= (-8.8d-285)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (a <= 2.7d-56) 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 <= -9e-99) {
tmp = 120.0 * a;
} else if (a <= -8.8e-285) {
tmp = (y / (z - t)) * -60.0;
} else if (a <= 2.7e-56) {
tmp = ((x - y) / t) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9e-99: tmp = 120.0 * a elif a <= -8.8e-285: tmp = (y / (z - t)) * -60.0 elif a <= 2.7e-56: 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 <= -9e-99) tmp = Float64(120.0 * a); elseif (a <= -8.8e-285) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (a <= 2.7e-56) 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 <= -9e-99) tmp = 120.0 * a; elseif (a <= -8.8e-285) tmp = (y / (z - t)) * -60.0; elseif (a <= 2.7e-56) 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, -9e-99], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -8.8e-285], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[a, 2.7e-56], 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 -9 \cdot 10^{-99}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -8.8 \cdot 10^{-285}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-56}:\\
\;\;\;\;\frac{x - y}{t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -9.0000000000000006e-99 or 2.69999999999999995e-56 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6467.8
Applied rewrites67.8%
if -9.0000000000000006e-99 < a < -8.7999999999999996e-285Initial program 99.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6442.0
Applied rewrites42.0%
if -8.7999999999999996e-285 < a < 2.69999999999999995e-56Initial 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--.f6479.7
Applied rewrites79.7%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6443.6
Applied rewrites43.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- x y) t) -60.0)) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -5e+293)
t_1
(if (<= t_2 -2e+83)
(* (/ x (- z t)) 60.0)
(if (<= t_2 1e+69) (* 120.0 a) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+293) {
tmp = t_1;
} else if (t_2 <= -2e+83) {
tmp = (x / (z - t)) * 60.0;
} else if (t_2 <= 1e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x - y) / t) * (-60.0d0)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+293)) then
tmp = t_1
else if (t_2 <= (-2d+83)) then
tmp = (x / (z - t)) * 60.0d0
else if (t_2 <= 1d+69) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+293) {
tmp = t_1;
} else if (t_2 <= -2e+83) {
tmp = (x / (z - t)) * 60.0;
} else if (t_2 <= 1e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) / t) * -60.0 t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+293: tmp = t_1 elif t_2 <= -2e+83: tmp = (x / (z - t)) * 60.0 elif t_2 <= 1e+69: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) / t) * -60.0) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+293) tmp = t_1; elseif (t_2 <= -2e+83) tmp = Float64(Float64(x / Float64(z - t)) * 60.0); elseif (t_2 <= 1e+69) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) / t) * -60.0; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+293) tmp = t_1; elseif (t_2 <= -2e+83) tmp = (x / (z - t)) * 60.0; elseif (t_2 <= 1e+69) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / 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, -5e+293], t$95$1, If[LessEqual[t$95$2, -2e+83], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$2, 1e+69], N[(120.0 * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t} \cdot -60\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+293}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+83}:\\
\;\;\;\;\frac{x}{z - t} \cdot 60\\
\mathbf{elif}\;t\_2 \leq 10^{+69}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.00000000000000033e293 or 1.0000000000000001e69 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.7%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6484.2
Applied rewrites84.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6452.7
Applied rewrites52.7%
if -5.00000000000000033e293 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000006e83Initial program 99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6438.1
Applied rewrites38.1%
if -2.00000000000000006e83 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e69Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6468.5
Applied rewrites68.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ (- x y) t) -60.0)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+57) t_1 (if (<= t_2 1e+69) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+57) {
tmp = t_1;
} else if (t_2 <= 1e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x - y) / t) * (-60.0d0)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+57)) then
tmp = t_1
else if (t_2 <= 1d+69) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+57) {
tmp = t_1;
} else if (t_2 <= 1e+69) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) / t) * -60.0 t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+57: tmp = t_1 elif t_2 <= 1e+69: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) / t) * -60.0) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+57) tmp = t_1; elseif (t_2 <= 1e+69) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) / t) * -60.0; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+57) tmp = t_1; elseif (t_2 <= 1e+69) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / 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, -1e+57], t$95$1, If[LessEqual[t$95$2, 1e+69], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t} \cdot -60\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+69}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000005e57 or 1.0000000000000001e69 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.5%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6480.5
Applied rewrites80.5%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6447.2
Applied rewrites47.2%
if -1.00000000000000005e57 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.0000000000000001e69Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6469.4
Applied rewrites69.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+159)
(* (/ y t) 60.0)
(if (<= t_1 5e+181) (* 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+159) {
tmp = (y / t) * 60.0;
} else if (t_1 <= 5e+181) {
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+159)) then
tmp = (y / t) * 60.0d0
else if (t_1 <= 5d+181) 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+159) {
tmp = (y / t) * 60.0;
} else if (t_1 <= 5e+181) {
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+159: tmp = (y / t) * 60.0 elif t_1 <= 5e+181: 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+159) tmp = Float64(Float64(y / t) * 60.0); elseif (t_1 <= 5e+181) 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+159) tmp = (y / t) * 60.0; elseif (t_1 <= 5e+181) 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+159], N[(N[(y / t), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+181], 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^{+159}:\\
\;\;\;\;\frac{y}{t} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+181}:\\
\;\;\;\;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)) < -1.9999999999999999e159Initial program 97.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6448.2
Applied rewrites48.2%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6429.5
Applied rewrites29.5%
if -1.9999999999999999e159 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.0000000000000003e181Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6461.2
Applied rewrites61.2%
if 5.0000000000000003e181 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6458.2
Applied rewrites58.2%
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 (* (/ y t) 60.0)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -2e+159) t_1 (if (<= t_2 1e+195) (* 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+159) {
tmp = t_1;
} else if (t_2 <= 1e+195) {
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+159)) then
tmp = t_1
else if (t_2 <= 1d+195) 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+159) {
tmp = t_1;
} else if (t_2 <= 1e+195) {
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+159: tmp = t_1 elif t_2 <= 1e+195: 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+159) tmp = t_1; elseif (t_2 <= 1e+195) 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+159) tmp = t_1; elseif (t_2 <= 1e+195) 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+159], t$95$1, If[LessEqual[t$95$2, 1e+195], 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^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+195}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999999e159 or 9.99999999999999977e194 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6448.9
Applied rewrites48.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6431.3
Applied rewrites31.3%
if -1.9999999999999999e159 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.99999999999999977e194Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6460.8
Applied rewrites60.8%
(FPCore (x y z t a) :precision binary64 (* 120.0 a))
double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = 120.0d0 * a
end function
public static double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
def code(x, y, z, t, a): return 120.0 * a
function code(x, y, z, t, a) return Float64(120.0 * a) end
function tmp = code(x, y, z, t, a) tmp = 120.0 * a; end
code[x_, y_, z_, t_, a_] := N[(120.0 * a), $MachinePrecision]
\begin{array}{l}
\\
120 \cdot a
\end{array}
Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
herbie shell --seed 2025117
(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)))