
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (- 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.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.3
Applied rewrites99.3%
lift-fma.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
lift-*.f64N/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.2%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/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
(if (<= y -5.5e+43)
(fma a 120.0 (/ (* -60.0 y) (- z t)))
(if (<= y 4.2e+19)
(fma a 120.0 (* (/ x (- z t)) 60.0))
(+ (* (/ -60.0 (- z t)) y) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.5e+43) {
tmp = fma(a, 120.0, ((-60.0 * y) / (z - t)));
} else if (y <= 4.2e+19) {
tmp = fma(a, 120.0, ((x / (z - t)) * 60.0));
} else {
tmp = ((-60.0 / (z - t)) * y) + (a * 120.0);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.5e+43) tmp = fma(a, 120.0, Float64(Float64(-60.0 * y) / Float64(z - t))); elseif (y <= 4.2e+19) tmp = fma(a, 120.0, Float64(Float64(x / Float64(z - t)) * 60.0)); else tmp = Float64(Float64(Float64(-60.0 / Float64(z - t)) * y) + Float64(a * 120.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.5e+43], N[(a * 120.0 + N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+19], N[(a * 120.0 + N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z - t} \cdot 60\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{z - t} \cdot y + a \cdot 120\\
\end{array}
\end{array}
if y < -5.49999999999999989e43Initial program 98.7%
Taylor expanded in x around 0
lower-*.f6484.7
Applied rewrites84.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6484.8
Applied rewrites84.8%
if -5.49999999999999989e43 < y < 4.2e19Initial program 99.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.6
Applied rewrites99.6%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6493.5
Applied rewrites93.5%
if 4.2e19 < y Initial program 99.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
distribute-lft-out--N/A
lower-*.f64N/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift--.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-/.f64N/A
lift--.f6484.5
Applied rewrites84.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* -60.0 y) (- z t)))))
(if (<= y -5.5e+43)
t_1
(if (<= y 4.2e+19) (fma a 120.0 (* (/ x (- z t)) 60.0)) 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 <= -5.5e+43) {
tmp = t_1;
} else if (y <= 4.2e+19) {
tmp = fma(a, 120.0, ((x / (z - t)) * 60.0));
} 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 <= -5.5e+43) tmp = t_1; elseif (y <= 4.2e+19) tmp = fma(a, 120.0, Float64(Float64(x / Float64(z - t)) * 60.0)); 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, -5.5e+43], t$95$1, If[LessEqual[y, 4.2e+19], N[(a * 120.0 + N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0), $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 -5.5 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z - t} \cdot 60\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.49999999999999989e43 or 4.2e19 < y Initial program 98.9%
Taylor expanded in x around 0
lower-*.f6484.4
Applied rewrites84.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6484.5
Applied rewrites84.5%
if -5.49999999999999989e43 < y < 4.2e19Initial program 99.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.6
Applied rewrites99.6%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6493.5
Applied rewrites93.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* (/ x (- z t)) 60.0))))
(if (<= a -7.5e-73)
t_1
(if (<= a 6.7e-62) (* (- x y) (/ 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, ((x / (z - t)) * 60.0));
double tmp;
if (a <= -7.5e-73) {
tmp = t_1;
} else if (a <= 6.7e-62) {
tmp = (x - y) * (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(x / Float64(z - t)) * 60.0)) tmp = 0.0 if (a <= -7.5e-73) tmp = t_1; elseif (a <= 6.7e-62) tmp = Float64(Float64(x - y) * Float64(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[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e-73], t$95$1, If[LessEqual[a, 6.7e-62], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{x}{z - t} \cdot 60\right)\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.7 \cdot 10^{-62}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.5e-73 or 6.69999999999999992e-62 < a Initial program 99.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6485.6
Applied rewrites85.6%
if -7.5e-73 < a < 6.69999999999999992e-62Initial 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--.f6479.9
Applied rewrites79.9%
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--.f6480.3
Applied rewrites80.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) -60.0 (* 120.0 a))))
(if (<= t -3.4e+15)
t_1
(if (<= t 1.9e-36) (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 <= -3.4e+15) {
tmp = t_1;
} else if (t <= 1.9e-36) {
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 <= -3.4e+15) tmp = t_1; elseif (t <= 1.9e-36) 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, -3.4e+15], t$95$1, If[LessEqual[t, 1.9e-36], 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 -3.4 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.4e15 or 1.89999999999999985e-36 < t Initial program 99.1%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6485.7
Applied rewrites85.7%
if -3.4e15 < t < 1.89999999999999985e-36Initial program 99.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6481.6
Applied rewrites81.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* (/ x z) 60.0))))
(if (<= a -4.1e+23)
t_1
(if (<= a -2e-17)
(fma (/ (- x y) t) -60.0 (* 120.0 a))
(if (<= a 7.5e-62) (* (- x y) (/ 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, ((x / z) * 60.0));
double tmp;
if (a <= -4.1e+23) {
tmp = t_1;
} else if (a <= -2e-17) {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
} else if (a <= 7.5e-62) {
tmp = (x - y) * (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(x / z) * 60.0)) tmp = 0.0 if (a <= -4.1e+23) tmp = t_1; elseif (a <= -2e-17) tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); elseif (a <= 7.5e-62) tmp = Float64(Float64(x - y) * Float64(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[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.1e+23], t$95$1, If[LessEqual[a, -2e-17], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.5e-62], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-62}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.09999999999999996e23 or 7.5000000000000003e-62 < a Initial program 99.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6486.9
Applied rewrites86.9%
Taylor expanded in z around inf
lower-/.f6469.0
Applied rewrites69.0%
if -4.09999999999999996e23 < a < -2.00000000000000014e-17Initial program 99.4%
Taylor expanded in z around 0
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f64N/A
lower-*.f6463.1
Applied rewrites63.1%
if -2.00000000000000014e-17 < a < 7.5000000000000003e-62Initial 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--.f6477.2
Applied rewrites77.2%
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--.f6477.7
Applied rewrites77.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* (/ x z) 60.0))))
(if (<= a -1.05e-9)
t_1
(if (<= a 7.5e-62) (* (- x y) (/ 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, ((x / z) * 60.0));
double tmp;
if (a <= -1.05e-9) {
tmp = t_1;
} else if (a <= 7.5e-62) {
tmp = (x - y) * (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(x / z) * 60.0)) tmp = 0.0 if (a <= -1.05e-9) tmp = t_1; elseif (a <= 7.5e-62) tmp = Float64(Float64(x - y) * Float64(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[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.05e-9], t$95$1, If[LessEqual[a, 7.5e-62], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-62}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.0500000000000001e-9 or 7.5000000000000003e-62 < a Initial program 99.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6486.5
Applied rewrites86.5%
Taylor expanded in z around inf
lower-/.f6468.3
Applied rewrites68.3%
if -1.0500000000000001e-9 < a < 7.5000000000000003e-62Initial 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--.f6476.8
Applied rewrites76.8%
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--.f6477.3
Applied rewrites77.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.5e-73)
(fma a 120.0 (* (/ x t) -60.0))
(if (<= a -1.95e-257)
(* (/ y (- z t)) -60.0)
(if (<= a 5.2e-183)
(* (/ (- x y) z) 60.0)
(if (<= a 6.5e-62) (/ (* -60.0 (- x y)) t) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e-73) {
tmp = fma(a, 120.0, ((x / t) * -60.0));
} else if (a <= -1.95e-257) {
tmp = (y / (z - t)) * -60.0;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = (-60.0 * (x - y)) / t;
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.5e-73) tmp = fma(a, 120.0, Float64(Float64(x / t) * -60.0)); elseif (a <= -1.95e-257) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (a <= 5.2e-183) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (a <= 6.5e-62) tmp = Float64(Float64(-60.0 * Float64(x - y)) / t); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.5e-73], N[(a * 120.0 + N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.95e-257], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[a, 5.2e-183], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[a, 6.5e-62], N[(N[(-60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{t} \cdot -60\right)\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-257}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-60 \cdot \left(x - y\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -7.5e-73Initial program 99.4%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6485.6
Applied rewrites85.6%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
if -7.5e-73 < a < -1.9500000000000001e-257Initial program 99.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6442.2
Applied rewrites42.2%
if -1.9500000000000001e-257 < a < 5.1999999999999998e-183Initial 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--.f6487.1
Applied rewrites87.1%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6446.7
Applied rewrites46.7%
if 5.1999999999999998e-183 < a < 6.50000000000000026e-62Initial program 98.9%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6472.3
Applied rewrites72.3%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6437.0
Applied rewrites37.0%
if 6.50000000000000026e-62 < a Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6470.4
Applied rewrites70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.2e-16)
(* 120.0 a)
(if (<= a -6e-257)
(/ (* -60.0 y) (- z t))
(if (<= a 5.2e-183)
(* (/ (- x y) z) 60.0)
(if (<= a 6.5e-62) (/ (* -60.0 (- x y)) t) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-16) {
tmp = 120.0 * a;
} else if (a <= -6e-257) {
tmp = (-60.0 * y) / (z - t);
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = (-60.0 * (x - y)) / t;
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.2d-16)) then
tmp = 120.0d0 * a
else if (a <= (-6d-257)) then
tmp = ((-60.0d0) * y) / (z - t)
else if (a <= 5.2d-183) then
tmp = ((x - y) / z) * 60.0d0
else if (a <= 6.5d-62) then
tmp = ((-60.0d0) * (x - y)) / t
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-16) {
tmp = 120.0 * a;
} else if (a <= -6e-257) {
tmp = (-60.0 * y) / (z - t);
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = (-60.0 * (x - y)) / t;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e-16: tmp = 120.0 * a elif a <= -6e-257: tmp = (-60.0 * y) / (z - t) elif a <= 5.2e-183: tmp = ((x - y) / z) * 60.0 elif a <= 6.5e-62: tmp = (-60.0 * (x - y)) / t else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e-16) tmp = Float64(120.0 * a); elseif (a <= -6e-257) tmp = Float64(Float64(-60.0 * y) / Float64(z - t)); elseif (a <= 5.2e-183) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (a <= 6.5e-62) tmp = Float64(Float64(-60.0 * Float64(x - y)) / t); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.2e-16) tmp = 120.0 * a; elseif (a <= -6e-257) tmp = (-60.0 * y) / (z - t); elseif (a <= 5.2e-183) tmp = ((x - y) / z) * 60.0; elseif (a <= 6.5e-62) tmp = (-60.0 * (x - y)) / t; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e-16], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -6e-257], N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-183], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[a, 6.5e-62], N[(N[(-60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-16}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-257}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t}\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-60 \cdot \left(x - y\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.20000000000000023e-16 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6472.5
Applied rewrites72.5%
if -3.20000000000000023e-16 < a < -5.9999999999999999e-257Initial 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--.f6472.1
Applied rewrites72.1%
Taylor expanded in x around inf
Applied rewrites37.1%
Taylor expanded in x around 0
lower-*.f6437.9
Applied rewrites37.9%
if -5.9999999999999999e-257 < a < 5.1999999999999998e-183Initial 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--.f6487.1
Applied rewrites87.1%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6446.7
Applied rewrites46.7%
if 5.1999999999999998e-183 < a < 6.50000000000000026e-62Initial program 98.9%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6472.3
Applied rewrites72.3%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6437.0
Applied rewrites37.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.2e-16)
(* 120.0 a)
(if (<= a -1.95e-257)
(* (/ y (- z t)) -60.0)
(if (<= a 5.2e-183)
(* (/ (- x y) z) 60.0)
(if (<= a 6.5e-62) (/ (* -60.0 (- x y)) t) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-16) {
tmp = 120.0 * a;
} else if (a <= -1.95e-257) {
tmp = (y / (z - t)) * -60.0;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = (-60.0 * (x - y)) / t;
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.2d-16)) then
tmp = 120.0d0 * a
else if (a <= (-1.95d-257)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (a <= 5.2d-183) then
tmp = ((x - y) / z) * 60.0d0
else if (a <= 6.5d-62) then
tmp = ((-60.0d0) * (x - y)) / t
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-16) {
tmp = 120.0 * a;
} else if (a <= -1.95e-257) {
tmp = (y / (z - t)) * -60.0;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = (-60.0 * (x - y)) / t;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.2e-16: tmp = 120.0 * a elif a <= -1.95e-257: tmp = (y / (z - t)) * -60.0 elif a <= 5.2e-183: tmp = ((x - y) / z) * 60.0 elif a <= 6.5e-62: tmp = (-60.0 * (x - y)) / t else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e-16) tmp = Float64(120.0 * a); elseif (a <= -1.95e-257) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (a <= 5.2e-183) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (a <= 6.5e-62) tmp = Float64(Float64(-60.0 * Float64(x - y)) / t); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.2e-16) tmp = 120.0 * a; elseif (a <= -1.95e-257) tmp = (y / (z - t)) * -60.0; elseif (a <= 5.2e-183) tmp = ((x - y) / z) * 60.0; elseif (a <= 6.5e-62) tmp = (-60.0 * (x - y)) / t; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e-16], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -1.95e-257], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[a, 5.2e-183], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[a, 6.5e-62], N[(N[(-60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-16}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -1.95 \cdot 10^{-257}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-60 \cdot \left(x - y\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -3.20000000000000023e-16 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6472.5
Applied rewrites72.5%
if -3.20000000000000023e-16 < a < -1.9500000000000001e-257Initial program 99.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6438.2
Applied rewrites38.2%
if -1.9500000000000001e-257 < a < 5.1999999999999998e-183Initial 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--.f6487.1
Applied rewrites87.1%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6446.7
Applied rewrites46.7%
if 5.1999999999999998e-183 < a < 6.50000000000000026e-62Initial program 98.9%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6472.3
Applied rewrites72.3%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6437.0
Applied rewrites37.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* -60.0 (- x y)) t)))
(if (<= a -2.7e-10)
(* 120.0 a)
(if (<= a -3.4e-212)
t_1
(if (<= a 5.2e-183)
(* (/ (- x y) z) 60.0)
(if (<= a 6.5e-62) t_1 (* 120.0 a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (-60.0 * (x - y)) / t;
double tmp;
if (a <= -2.7e-10) {
tmp = 120.0 * a;
} else if (a <= -3.4e-212) {
tmp = t_1;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = ((-60.0d0) * (x - y)) / t
if (a <= (-2.7d-10)) then
tmp = 120.0d0 * a
else if (a <= (-3.4d-212)) then
tmp = t_1
else if (a <= 5.2d-183) then
tmp = ((x - y) / z) * 60.0d0
else if (a <= 6.5d-62) then
tmp = t_1
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 t_1 = (-60.0 * (x - y)) / t;
double tmp;
if (a <= -2.7e-10) {
tmp = 120.0 * a;
} else if (a <= -3.4e-212) {
tmp = t_1;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = t_1;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (-60.0 * (x - y)) / t tmp = 0 if a <= -2.7e-10: tmp = 120.0 * a elif a <= -3.4e-212: tmp = t_1 elif a <= 5.2e-183: tmp = ((x - y) / z) * 60.0 elif a <= 6.5e-62: tmp = t_1 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-60.0 * Float64(x - y)) / t) tmp = 0.0 if (a <= -2.7e-10) tmp = Float64(120.0 * a); elseif (a <= -3.4e-212) tmp = t_1; elseif (a <= 5.2e-183) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (a <= 6.5e-62) tmp = t_1; else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (-60.0 * (x - y)) / t; tmp = 0.0; if (a <= -2.7e-10) tmp = 120.0 * a; elseif (a <= -3.4e-212) tmp = t_1; elseif (a <= 5.2e-183) tmp = ((x - y) / z) * 60.0; elseif (a <= 6.5e-62) tmp = t_1; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(-60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[a, -2.7e-10], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -3.4e-212], t$95$1, If[LessEqual[a, 5.2e-183], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[a, 6.5e-62], t$95$1, N[(120.0 * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-60 \cdot \left(x - y\right)}{t}\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{-10}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.7e-10 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6472.7
Applied rewrites72.7%
if -2.7e-10 < a < -3.39999999999999998e-212 or 5.1999999999999998e-183 < a < 6.50000000000000026e-62Initial 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--.f6469.6
Applied rewrites69.6%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6437.2
Applied rewrites37.2%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6436.9
Applied rewrites36.9%
if -3.39999999999999998e-212 < a < 5.1999999999999998e-183Initial 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--.f6487.2
Applied rewrites87.2%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- x y) t) -60.0)))
(if (<= a -2.7e-10)
(* 120.0 a)
(if (<= a -3.4e-212)
t_1
(if (<= a 5.2e-183)
(* (/ (- x y) z) 60.0)
(if (<= a 6.5e-62) t_1 (* 120.0 a)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double tmp;
if (a <= -2.7e-10) {
tmp = 120.0 * a;
} else if (a <= -3.4e-212) {
tmp = t_1;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = ((x - y) / t) * (-60.0d0)
if (a <= (-2.7d-10)) then
tmp = 120.0d0 * a
else if (a <= (-3.4d-212)) then
tmp = t_1
else if (a <= 5.2d-183) then
tmp = ((x - y) / z) * 60.0d0
else if (a <= 6.5d-62) then
tmp = t_1
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 t_1 = ((x - y) / t) * -60.0;
double tmp;
if (a <= -2.7e-10) {
tmp = 120.0 * a;
} else if (a <= -3.4e-212) {
tmp = t_1;
} else if (a <= 5.2e-183) {
tmp = ((x - y) / z) * 60.0;
} else if (a <= 6.5e-62) {
tmp = t_1;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) / t) * -60.0 tmp = 0 if a <= -2.7e-10: tmp = 120.0 * a elif a <= -3.4e-212: tmp = t_1 elif a <= 5.2e-183: tmp = ((x - y) / z) * 60.0 elif a <= 6.5e-62: tmp = t_1 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) / t) * -60.0) tmp = 0.0 if (a <= -2.7e-10) tmp = Float64(120.0 * a); elseif (a <= -3.4e-212) tmp = t_1; elseif (a <= 5.2e-183) tmp = Float64(Float64(Float64(x - y) / z) * 60.0); elseif (a <= 6.5e-62) tmp = t_1; else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) / t) * -60.0; tmp = 0.0; if (a <= -2.7e-10) tmp = 120.0 * a; elseif (a <= -3.4e-212) tmp = t_1; elseif (a <= 5.2e-183) tmp = ((x - y) / z) * 60.0; elseif (a <= 6.5e-62) tmp = t_1; else tmp = 120.0 * a; 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]}, If[LessEqual[a, -2.7e-10], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, -3.4e-212], t$95$1, If[LessEqual[a, 5.2e-183], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[a, 6.5e-62], t$95$1, N[(120.0 * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t} \cdot -60\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{-10}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{x - y}{z} \cdot 60\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.7e-10 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6472.7
Applied rewrites72.7%
if -2.7e-10 < a < -3.39999999999999998e-212 or 5.1999999999999998e-183 < a < 6.50000000000000026e-62Initial 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--.f6469.6
Applied rewrites69.6%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6437.2
Applied rewrites37.2%
if -3.39999999999999998e-212 < a < 5.1999999999999998e-183Initial 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--.f6487.2
Applied rewrites87.2%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6446.8
Applied rewrites46.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 9.5e+20) (fma a 120.0 (* (/ x z) 60.0)) (* (/ y (- z t)) -60.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 9.5e+20) {
tmp = fma(a, 120.0, ((x / z) * 60.0));
} else {
tmp = (y / (z - t)) * -60.0;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= 9.5e+20) tmp = fma(a, 120.0, Float64(Float64(x / z) * 60.0)); else tmp = Float64(Float64(y / Float64(z - t)) * -60.0); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 9.5e+20], N[(a * 120.0 + N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x}{z} \cdot 60\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\end{array}
\end{array}
if y < 9.5e20Initial program 99.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6481.5
Applied rewrites81.5%
Taylor expanded in z around inf
lower-/.f6458.9
Applied rewrites58.9%
if 9.5e20 < y Initial program 99.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6444.1
Applied rewrites44.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e-10) (* 120.0 a) (if (<= a 6.5e-62) (* (/ (- x y) t) -60.0) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e-10) {
tmp = 120.0 * a;
} else if (a <= 6.5e-62) {
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 <= (-2.7d-10)) then
tmp = 120.0d0 * a
else if (a <= 6.5d-62) 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 <= -2.7e-10) {
tmp = 120.0 * a;
} else if (a <= 6.5e-62) {
tmp = ((x - y) / t) * -60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e-10: tmp = 120.0 * a elif a <= 6.5e-62: 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 <= -2.7e-10) tmp = Float64(120.0 * a); elseif (a <= 6.5e-62) 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 <= -2.7e-10) tmp = 120.0 * a; elseif (a <= 6.5e-62) 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, -2.7e-10], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 6.5e-62], 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 -2.7 \cdot 10^{-10}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{x - y}{t} \cdot -60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -2.7e-10 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6472.7
Applied rewrites72.7%
if -2.7e-10 < a < 6.50000000000000026e-62Initial 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--.f6476.8
Applied rewrites76.8%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6441.0
Applied rewrites41.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+246)
(* (/ x z) 60.0)
(if (<= t_1 1e+184) (* 120.0 a) (/ (* x 60.0) (- 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+246) {
tmp = (x / z) * 60.0;
} else if (t_1 <= 1e+184) {
tmp = 120.0 * a;
} else {
tmp = (x * 60.0) / -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+246)) then
tmp = (x / z) * 60.0d0
else if (t_1 <= 1d+184) then
tmp = 120.0d0 * a
else
tmp = (x * 60.0d0) / -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+246) {
tmp = (x / z) * 60.0;
} else if (t_1 <= 1e+184) {
tmp = 120.0 * a;
} else {
tmp = (x * 60.0) / -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+246: tmp = (x / z) * 60.0 elif t_1 <= 1e+184: tmp = 120.0 * a else: tmp = (x * 60.0) / -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+246) tmp = Float64(Float64(x / z) * 60.0); elseif (t_1 <= 1e+184) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x * 60.0) / Float64(-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+246) tmp = (x / z) * 60.0; elseif (t_1 <= 1e+184) tmp = 120.0 * a; else tmp = (x * 60.0) / -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+246], N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+184], N[(120.0 * a), $MachinePrecision], N[(N[(x * 60.0), $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^{+246}:\\
\;\;\;\;\frac{x}{z} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 10^{+184}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 60}{-t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000014e246Initial program 94.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6493.1
Applied rewrites93.1%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6459.6
Applied rewrites59.6%
Taylor expanded in x around inf
lower-/.f6433.5
Applied rewrites33.5%
if -2.00000000000000014e246 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e184Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.9
Applied rewrites59.9%
if 1.00000000000000002e184 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.4%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6490.9
Applied rewrites90.9%
Taylor expanded in x around inf
Applied rewrites50.2%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6431.0
Applied rewrites31.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+246)
(* (/ x z) 60.0)
(if (<= t_1 1e+184) (* 120.0 a) (* (/ x t) -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+246) {
tmp = (x / z) * 60.0;
} else if (t_1 <= 1e+184) {
tmp = 120.0 * a;
} else {
tmp = (x / t) * -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+246)) then
tmp = (x / z) * 60.0d0
else if (t_1 <= 1d+184) then
tmp = 120.0d0 * a
else
tmp = (x / t) * (-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+246) {
tmp = (x / z) * 60.0;
} else if (t_1 <= 1e+184) {
tmp = 120.0 * a;
} else {
tmp = (x / t) * -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+246: tmp = (x / z) * 60.0 elif t_1 <= 1e+184: tmp = 120.0 * a else: tmp = (x / t) * -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+246) tmp = Float64(Float64(x / z) * 60.0); elseif (t_1 <= 1e+184) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x / t) * -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+246) tmp = (x / z) * 60.0; elseif (t_1 <= 1e+184) tmp = 120.0 * a; else tmp = (x / t) * -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+246], N[(N[(x / z), $MachinePrecision] * 60.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+184], N[(120.0 * a), $MachinePrecision], N[(N[(x / t), $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^{+246}:\\
\;\;\;\;\frac{x}{z} \cdot 60\\
\mathbf{elif}\;t\_1 \leq 10^{+184}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot -60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.00000000000000014e246Initial program 94.8%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6493.1
Applied rewrites93.1%
Taylor expanded in z around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6459.6
Applied rewrites59.6%
Taylor expanded in x around inf
lower-/.f6433.5
Applied rewrites33.5%
if -2.00000000000000014e246 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000002e184Initial program 99.8%
Taylor expanded in z around inf
lower-*.f6459.9
Applied rewrites59.9%
if 1.00000000000000002e184 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.4%
Taylor expanded in a around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6490.9
Applied rewrites90.9%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6455.3
Applied rewrites55.3%
Taylor expanded in x around inf
Applied rewrites31.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.5e-163) (* 120.0 a) (if (<= a 6.5e-62) (/ (* y 60.0) t) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e-163) {
tmp = 120.0 * a;
} else if (a <= 6.5e-62) {
tmp = (y * 60.0) / 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 <= (-5.5d-163)) then
tmp = 120.0d0 * a
else if (a <= 6.5d-62) then
tmp = (y * 60.0d0) / 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 <= -5.5e-163) {
tmp = 120.0 * a;
} else if (a <= 6.5e-62) {
tmp = (y * 60.0) / t;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e-163: tmp = 120.0 * a elif a <= 6.5e-62: tmp = (y * 60.0) / t else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e-163) tmp = Float64(120.0 * a); elseif (a <= 6.5e-62) tmp = Float64(Float64(y * 60.0) / 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 <= -5.5e-163) tmp = 120.0 * a; elseif (a <= 6.5e-62) tmp = (y * 60.0) / t; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e-163], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 6.5e-62], N[(N[(y * 60.0), $MachinePrecision] / t), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{-163}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{y \cdot 60}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -5.4999999999999998e-163 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6466.3
Applied rewrites66.3%
if -5.4999999999999998e-163 < a < 6.50000000000000026e-62Initial 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--.f6481.8
Applied rewrites81.8%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6443.6
Applied rewrites43.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.6
Applied rewrites24.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6424.5
Applied rewrites24.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.5e-163) (* 120.0 a) (if (<= a 6.5e-62) (* (/ y t) 60.0) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e-163) {
tmp = 120.0 * a;
} else if (a <= 6.5e-62) {
tmp = (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 <= (-5.5d-163)) then
tmp = 120.0d0 * a
else if (a <= 6.5d-62) then
tmp = (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 <= -5.5e-163) {
tmp = 120.0 * a;
} else if (a <= 6.5e-62) {
tmp = (y / t) * 60.0;
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e-163: tmp = 120.0 * a elif a <= 6.5e-62: tmp = (y / t) * 60.0 else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e-163) tmp = Float64(120.0 * a); elseif (a <= 6.5e-62) tmp = Float64(Float64(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 <= -5.5e-163) tmp = 120.0 * a; elseif (a <= 6.5e-62) tmp = (y / t) * 60.0; else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e-163], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 6.5e-62], N[(N[(y / t), $MachinePrecision] * 60.0), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{-163}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{y}{t} \cdot 60\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if a < -5.4999999999999998e-163 or 6.50000000000000026e-62 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6466.3
Applied rewrites66.3%
if -5.4999999999999998e-163 < a < 6.50000000000000026e-62Initial 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--.f6481.8
Applied rewrites81.8%
Taylor expanded in z around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6443.6
Applied rewrites43.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.6
Applied rewrites24.6%
(FPCore (x y z t a) :precision binary64 (* 120.0 a))
double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = 120.0d0 * a
end function
public static double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
def code(x, y, z, t, a): return 120.0 * a
function code(x, y, z, t, a) return Float64(120.0 * a) end
function tmp = code(x, y, z, t, a) tmp = 120.0 * a; end
code[x_, y_, z_, t_, a_] := N[(120.0 * a), $MachinePrecision]
\begin{array}{l}
\\
120 \cdot a
\end{array}
Initial program 99.2%
Taylor expanded in z around inf
lower-*.f6451.7
Applied rewrites51.7%
herbie shell --seed 2025101
(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)))