
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ 60.0 (/ (- z t) (- x y)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, (60.0 / ((z - t) / (x - y))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(60.0 / Float64(Float64(z - t) / Float64(x - y)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)
\end{array}
Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* (- x y) (/ -60.0 (- t z)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((x - y) * (-60.0 / (t - z))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(x - y) * Float64(-60.0 / Float64(t - z)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(x - y), $MachinePrecision] * N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \left(x - y\right) \cdot \frac{-60}{t - z}\right)
\end{array}
Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.25e-10)
(fma a 120.0 (/ (* 60.0 x) (- z t)))
(if (<= x 3.85e+115)
(fma a 120.0 (/ (* -60.0 y) (- z t)))
(fma a 120.0 (/ 60.0 (/ (- z t) x))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.25e-10) {
tmp = fma(a, 120.0, ((60.0 * x) / (z - t)));
} else if (x <= 3.85e+115) {
tmp = fma(a, 120.0, ((-60.0 * y) / (z - t)));
} else {
tmp = fma(a, 120.0, (60.0 / ((z - t) / x)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.25e-10) tmp = fma(a, 120.0, Float64(Float64(60.0 * x) / Float64(z - t))); elseif (x <= 3.85e+115) tmp = fma(a, 120.0, Float64(Float64(-60.0 * y) / Float64(z - t))); else tmp = fma(a, 120.0, Float64(60.0 / Float64(Float64(z - t) / x))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.25e-10], N[(a * 120.0 + N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.85e+115], N[(a * 120.0 + N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60 \cdot x}{z - t}\right)\\
\mathbf{elif}\;x \leq 3.85 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x}}\right)\\
\end{array}
\end{array}
if x < -2.25e-10Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6475.0
Applied rewrites75.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6475.0
Applied rewrites75.0%
if -2.25e-10 < x < 3.84999999999999984e115Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6475.0
Applied rewrites75.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6475.0
Applied rewrites75.0%
Taylor expanded in x around 0
lower-*.f6474.8
Applied rewrites74.8%
if 3.84999999999999984e115 < x Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower--.f6475.1
Applied rewrites75.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (/ (* 60.0 x) (- z t)))))
(if (<= x -2.25e-10)
t_1
(if (<= x 3.85e+115) (fma a 120.0 (/ (* -60.0 y) (- 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 * x) / (z - t)));
double tmp;
if (x <= -2.25e-10) {
tmp = t_1;
} else if (x <= 3.85e+115) {
tmp = fma(a, 120.0, ((-60.0 * y) / (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 * x) / Float64(z - t))) tmp = 0.0 if (x <= -2.25e-10) tmp = t_1; elseif (x <= 3.85e+115) tmp = fma(a, 120.0, Float64(Float64(-60.0 * y) / 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 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.25e-10], t$95$1, If[LessEqual[x, 3.85e+115], N[(a * 120.0 + N[(N[(-60.0 * y), $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 x}{z - t}\right)\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.85 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.25e-10 or 3.84999999999999984e115 < x Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6475.0
Applied rewrites75.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6475.0
Applied rewrites75.0%
if -2.25e-10 < x < 3.84999999999999984e115Initial program 99.5%
Taylor expanded in x around inf
lower-*.f6475.0
Applied rewrites75.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6475.0
Applied rewrites75.0%
Taylor expanded in x around 0
lower-*.f6474.8
Applied rewrites74.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 60.0 (/ (- x y) z) (* 120.0 a))))
(if (<= z -3.2e-56)
t_1
(if (<= z -1.75e-202)
(* 60.0 (/ (- x y) (- z t)))
(if (<= z 1.9e-69) (fma -60.0 (/ (- x y) t) (* 120.0 a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(60.0, ((x - y) / z), (120.0 * a));
double tmp;
if (z <= -3.2e-56) {
tmp = t_1;
} else if (z <= -1.75e-202) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (z <= 1.9e-69) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(60.0, Float64(Float64(x - y) / z), Float64(120.0 * a)) tmp = 0.0 if (z <= -3.2e-56) tmp = t_1; elseif (z <= -1.75e-202) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (z <= 1.9e-69) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e-56], t$95$1, If[LessEqual[z, -1.75e-202], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-69], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(60, \frac{x - y}{z}, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-202}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-69}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.19999999999999986e-56 or 1.8999999999999999e-69 < z Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if -3.19999999999999986e-56 < z < -1.75e-202Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -1.75e-202 < z < 1.8999999999999999e-69Initial program 99.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6465.1
Applied rewrites65.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e-49)
(fma a 120.0 (/ 60.0 (/ z x)))
(if (<= z -1.75e-202)
(* 60.0 (/ (- x y) (- z t)))
(if (<= z 9e-47)
(fma -60.0 (/ (- x y) t) (* 120.0 a))
(fma 60.0 (/ x z) (* 120.0 a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-49) {
tmp = fma(a, 120.0, (60.0 / (z / x)));
} else if (z <= -1.75e-202) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (z <= 9e-47) {
tmp = fma(-60.0, ((x - y) / t), (120.0 * a));
} else {
tmp = fma(60.0, (x / z), (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e-49) tmp = fma(a, 120.0, Float64(60.0 / Float64(z / x))); elseif (z <= -1.75e-202) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (z <= 9e-47) tmp = fma(-60.0, Float64(Float64(x - y) / t), Float64(120.0 * a)); else tmp = fma(60.0, Float64(x / z), Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-49], N[(a * 120.0 + N[(60.0 / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.75e-202], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-47], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(60.0 * N[(x / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-49}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{\frac{z}{x}}\right)\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-202}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-47}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{x - y}{t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z}, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -6e-49Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
frac-2negN/A
lower-/.f64N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f64N/A
lower--.f6475.1
Applied rewrites75.1%
Taylor expanded in z around inf
lower-/.f6453.5
Applied rewrites53.5%
if -6e-49 < z < -1.75e-202Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -1.75e-202 < z < 9e-47Initial program 99.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6465.1
Applied rewrites65.1%
if 9e-47 < z Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
Taylor expanded in x around inf
lower-/.f6453.5
Applied rewrites53.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e-13)
(* 60.0 (/ (- x y) (- z t)))
(if (<= t_1 1e+56) (* 120.0 a) (* (/ -60.0 (- t z)) (- x y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e-13) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / (t - z)) * (x - y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-5d-13)) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if (t_1 <= 1d+56) then
tmp = 120.0d0 * a
else
tmp = ((-60.0d0) / (t - z)) * (x - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e-13) {
tmp = 60.0 * ((x - y) / (z - t));
} else if (t_1 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = (-60.0 / (t - z)) * (x - y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e-13: tmp = 60.0 * ((x - y) / (z - t)) elif t_1 <= 1e+56: tmp = 120.0 * a else: tmp = (-60.0 / (t - z)) * (x - y) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -5e-13) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (t_1 <= 1e+56) tmp = Float64(120.0 * a); else tmp = Float64(Float64(-60.0 / Float64(t - z)) * Float64(x - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -5e-13) tmp = 60.0 * ((x - y) / (z - t)); elseif (t_1 <= 1e+56) tmp = 120.0 * a; else tmp = (-60.0 / (t - z)) * (x - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-13], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+56], N[(120.0 * a), $MachinePrecision], N[(N[(-60.0 / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-13}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;t\_1 \leq 10^{+56}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{t - z} \cdot \left(x - y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999999e-13Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -4.9999999999999999e-13 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000009e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 1.00000000000000009e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
metadata-evalN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2negN/A
lift-/.f64N/A
lower-*.f6451.1
Applied rewrites51.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ (- x y) (- z t)))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e-13) t_1 (if (<= t_2 1e+56) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e-13) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * ((x - y) / (z - t))
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d-13)) then
tmp = t_1
else if (t_2 <= 1d+56) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / (z - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e-13) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / (z - t)) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e-13: tmp = t_1 elif t_2 <= 1e+56: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e-13) tmp = t_1; elseif (t_2 <= 1e+56) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * ((x - y) / (z - t)); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e-13) tmp = t_1; elseif (t_2 <= 1e+56) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-13], t$95$1, If[LessEqual[t$95$2, 1e+56], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z - t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+56}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999999e-13 or 1.00000000000000009e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
if -4.9999999999999999e-13 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000009e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a)
:precision binary64
(if (<= x -3.1e+124)
(* 60.0 (/ x (- z t)))
(if (<= x 1.85e+177)
(fma -60.0 (/ y z) (* 120.0 a))
(/ 60.0 (/ (- z t) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.1e+124) {
tmp = 60.0 * (x / (z - t));
} else if (x <= 1.85e+177) {
tmp = fma(-60.0, (y / z), (120.0 * a));
} else {
tmp = 60.0 / ((z - t) / x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.1e+124) tmp = Float64(60.0 * Float64(x / Float64(z - t))); elseif (x <= 1.85e+177) tmp = fma(-60.0, Float64(y / z), Float64(120.0 * a)); else tmp = Float64(60.0 / Float64(Float64(z - t) / x)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.1e+124], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e+177], N[(-60.0 * N[(y / z), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(60.0 / N[(N[(z - t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+124}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+177}:\\
\;\;\;\;\mathsf{fma}\left(-60, \frac{y}{z}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{60}{\frac{z - t}{x}}\\
\end{array}
\end{array}
if x < -3.1000000000000002e124Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
if -3.1000000000000002e124 < x < 1.85000000000000007e177Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
if 1.85000000000000007e177 < x Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6427.0
Applied rewrites27.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+88)
(/ (* x 60.0) (- z t))
(if (<= t_1 1e+48) (* 120.0 a) (* 60.0 (/ x (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+88) {
tmp = (x * 60.0) / (z - t);
} else if (t_1 <= 1e+48) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (x / (z - t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-1d+88)) then
tmp = (x * 60.0d0) / (z - t)
else if (t_1 <= 1d+48) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 * (x / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -1e+88) {
tmp = (x * 60.0) / (z - t);
} else if (t_1 <= 1e+48) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (x / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+88: tmp = (x * 60.0) / (z - t) elif t_1 <= 1e+48: tmp = 120.0 * a else: tmp = 60.0 * (x / (z - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+88) tmp = Float64(Float64(x * 60.0) / Float64(z - t)); elseif (t_1 <= 1e+48) tmp = Float64(120.0 * a); else tmp = Float64(60.0 * Float64(x / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -1e+88) tmp = (x * 60.0) / (z - t); elseif (t_1 <= 1e+48) tmp = 120.0 * a; else tmp = 60.0 * (x / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+88], N[(N[(x * 60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+48], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+88}:\\
\;\;\;\;\frac{x \cdot 60}{z - t}\\
\mathbf{elif}\;t\_1 \leq 10^{+48}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999959e87Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6427.0
Applied rewrites27.0%
if -9.99999999999999959e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000004e48Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 1.00000000000000004e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ x (- z t)))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+88) t_1 (if (<= t_2 1e+48) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (x / (z - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+88) {
tmp = t_1;
} else if (t_2 <= 1e+48) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * (x / (z - t))
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+88)) then
tmp = t_1
else if (t_2 <= 1d+48) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (x / (z - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+88) {
tmp = t_1;
} else if (t_2 <= 1e+48) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * (x / (z - t)) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+88: tmp = t_1 elif t_2 <= 1e+48: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(x / Float64(z - t))) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+88) tmp = t_1; elseif (t_2 <= 1e+48) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * (x / (z - t)); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+88) tmp = t_1; elseif (t_2 <= 1e+48) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+88], t$95$1, If[LessEqual[t$95$2, 1e+48], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+48}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999959e87 or 1.00000000000000004e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
if -9.99999999999999959e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000004e48Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* (- x y) 60.0) z)) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+88) t_1 (if (<= t_2 1e+56) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) * 60.0) / z;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+88) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
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) * 60.0d0) / z
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+88)) then
tmp = t_1
else if (t_2 <= 1d+56) 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) * 60.0) / z;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+88) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) * 60.0) / z t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+88: tmp = t_1 elif t_2 <= 1e+56: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) * 60.0) / z) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+88) tmp = t_1; elseif (t_2 <= 1e+56) 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) * 60.0) / z; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+88) tmp = t_1; elseif (t_2 <= 1e+56) 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] * 60.0), $MachinePrecision] / z), $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+88], t$95$1, If[LessEqual[t$95$2, 1e+56], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x - y\right) \cdot 60}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+56}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999959e87 or 1.00000000000000009e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.0
Applied rewrites28.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6428.0
Applied rewrites28.0%
if -9.99999999999999959e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000009e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* 60.0 (/ (- x y) z))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -1e+88) t_1 (if (<= t_2 1e+56) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+88) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 60.0d0 * ((x - y) / z)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-1d+88)) then
tmp = t_1
else if (t_2 <= 1d+56) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * ((x - y) / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -1e+88) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 60.0 * ((x - y) / z) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -1e+88: tmp = t_1 elif t_2 <= 1e+56: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(Float64(x - y) / z)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -1e+88) tmp = t_1; elseif (t_2 <= 1e+56) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 60.0 * ((x - y) / z); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -1e+88) tmp = t_1; elseif (t_2 <= 1e+56) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+88], t$95$1, If[LessEqual[t$95$2, 1e+56], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 60 \cdot \frac{x - y}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+56}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -9.99999999999999959e87 or 1.00000000000000009e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in z around inf
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6428.0
Applied rewrites28.0%
if -9.99999999999999959e87 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000009e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+250)
(* -60.0 (/ x t))
(if (<= t_1 2e+56) (* 120.0 a) (/ (* 60.0 y) (- t z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e+250) {
tmp = -60.0 * (x / t);
} else if (t_1 <= 2e+56) {
tmp = 120.0 * a;
} else {
tmp = (60.0 * y) / (t - z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-5d+250)) then
tmp = (-60.0d0) * (x / t)
else if (t_1 <= 2d+56) then
tmp = 120.0d0 * a
else
tmp = (60.0d0 * y) / (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e+250) {
tmp = -60.0 * (x / t);
} else if (t_1 <= 2e+56) {
tmp = 120.0 * a;
} else {
tmp = (60.0 * y) / (t - z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+250: tmp = -60.0 * (x / t) elif t_1 <= 2e+56: tmp = 120.0 * a else: tmp = (60.0 * y) / (t - z) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -5e+250) tmp = Float64(-60.0 * Float64(x / t)); elseif (t_1 <= 2e+56) tmp = Float64(120.0 * a); else tmp = Float64(Float64(60.0 * y) / Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -5e+250) tmp = -60.0 * (x / t); elseif (t_1 <= 2e+56) tmp = 120.0 * a; else tmp = (60.0 * y) / (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+250], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+56], N[(120.0 * a), $MachinePrecision], N[(N[(60.0 * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+250}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+56}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{60 \cdot y}{t - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000002e250Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6416.8
Applied rewrites16.8%
if -5.0000000000000002e250 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000018e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 2.00000000000000018e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6426.9
Applied rewrites26.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+250)
(* -60.0 (/ x t))
(if (<= t_1 2e+56) (* 120.0 a) (* -60.0 (/ y (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e+250) {
tmp = -60.0 * (x / t);
} else if (t_1 <= 2e+56) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-5d+250)) then
tmp = (-60.0d0) * (x / t)
else if (t_1 <= 2d+56) then
tmp = 120.0d0 * a
else
tmp = (-60.0d0) * (y / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e+250) {
tmp = -60.0 * (x / t);
} else if (t_1 <= 2e+56) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (y / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+250: tmp = -60.0 * (x / t) elif t_1 <= 2e+56: tmp = 120.0 * a else: tmp = -60.0 * (y / (z - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -5e+250) tmp = Float64(-60.0 * Float64(x / t)); elseif (t_1 <= 2e+56) tmp = Float64(120.0 * a); else tmp = Float64(-60.0 * Float64(y / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -5e+250) tmp = -60.0 * (x / t); elseif (t_1 <= 2e+56) tmp = 120.0 * a; else tmp = -60.0 * (y / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+250], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+56], N[(120.0 * a), $MachinePrecision], N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+250}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+56}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{y}{z - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -5.0000000000000002e250Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6416.8
Applied rewrites16.8%
if -5.0000000000000002e250 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2.00000000000000018e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
if 2.00000000000000018e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ x t))) (t_2 (/ (* 60.0 (- x y)) (- z t)))) (if (<= t_2 -5e+250) t_1 (if (<= t_2 1e+56) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (x / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+250) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-60.0d0) * (x / t)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+250)) then
tmp = t_1
else if (t_2 <= 1d+56) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (x / t);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+250) {
tmp = t_1;
} else if (t_2 <= 1e+56) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (x / t) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+250: tmp = t_1 elif t_2 <= 1e+56: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(x / t)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+250) tmp = t_1; elseif (t_2 <= 1e+56) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (x / t); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+250) tmp = t_1; elseif (t_2 <= 1e+56) tmp = 120.0 * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+250], t$95$1, If[LessEqual[t$95$2, 1e+56], N[(120.0 * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -60 \cdot \frac{x}{t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+250}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+56}:\\
\;\;\;\;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.0000000000000002e250 or 1.00000000000000009e56 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.0
Applied rewrites27.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f6416.8
Applied rewrites16.8%
if -5.0000000000000002e250 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.00000000000000009e56Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
(FPCore (x y z t a) :precision binary64 (* 120.0 a))
double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = 120.0d0 * a
end function
public static double code(double x, double y, double z, double t, double a) {
return 120.0 * a;
}
def code(x, y, z, t, a): return 120.0 * a
function code(x, y, z, t, a) return Float64(120.0 * a) end
function tmp = code(x, y, z, t, a) tmp = 120.0 * a; end
code[x_, y_, z_, t_, a_] := N[(120.0 * a), $MachinePrecision]
\begin{array}{l}
\\
120 \cdot a
\end{array}
Initial program 99.5%
Taylor expanded in z around inf
lower-*.f6450.3
Applied rewrites50.3%
herbie shell --seed 2025151
(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)))