
(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]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (* (/ -60.0 (- z t)) (- y x))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, ((-60.0 / (z - t)) * (y - x)));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(Float64(-60.0 / Float64(z - t)) * Float64(y - x))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(a, 120, \frac{-60}{z - t} \cdot \left(y - x\right)\right)
Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.4e+121)
(fma a 120.0 (/ (* y 60.0) (- t z)))
(if (<= y 1.1e-18)
(fma 60.0 (/ x (- z t)) (* 120.0 a))
(fma a 120.0 (* (/ -60.0 (- z t)) y)))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.4e+121) {
tmp = fma(a, 120.0, ((y * 60.0) / (t - z)));
} else if (y <= 1.1e-18) {
tmp = fma(60.0, (x / (z - t)), (120.0 * a));
} else {
tmp = fma(a, 120.0, ((-60.0 / (z - t)) * y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.4e+121) tmp = fma(a, 120.0, Float64(Float64(y * 60.0) / Float64(t - z))); elseif (y <= 1.1e-18) tmp = fma(60.0, Float64(x / Float64(z - t)), Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(-60.0 / Float64(z - t)) * y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.4e+121], N[(a * 120.0 + N[(N[(y * 60.0), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-18], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot 60}{t - z}\right)\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z - t} \cdot y\right)\\
\end{array}
if y < -1.40000000000000003e121Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
lower-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6475.2
Applied rewrites75.2%
if -1.40000000000000003e121 < y < 1.0999999999999999e-18Initial program 99.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.9
Applied rewrites75.9%
if 1.0999999999999999e-18 < y Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* (/ -60.0 (- z t)) y))))
(if (<= y -1.4e+121)
t_1
(if (<= y 1.1e-18) (fma 60.0 (/ x (- z t)) (* 120.0 a)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, ((-60.0 / (z - t)) * y));
double tmp;
if (y <= -1.4e+121) {
tmp = t_1;
} else if (y <= 1.1e-18) {
tmp = fma(60.0, (x / (z - t)), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(-60.0 / Float64(z - t)) * y)) tmp = 0.0 if (y <= -1.4e+121) tmp = t_1; elseif (y <= 1.1e-18) tmp = fma(60.0, Float64(x / Float64(z - t)), Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * 120.0 + N[(N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+121], t$95$1, If[LessEqual[y, 1.1e-18], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{-60}{z - t} \cdot y\right)\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.40000000000000003e121 or 1.0999999999999999e-18 < y Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
if -1.40000000000000003e121 < y < 1.0999999999999999e-18Initial program 99.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.9
Applied rewrites75.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ y (- z t)) (* 120.0 a))))
(if (<= y -1.4e+121)
t_1
(if (<= y 1.1e-18) (fma 60.0 (/ x (- z t)) (* 120.0 a)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, (y / (z - t)), (120.0 * a));
double tmp;
if (y <= -1.4e+121) {
tmp = t_1;
} else if (y <= 1.1e-18) {
tmp = fma(60.0, (x / (z - t)), (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(y / Float64(z - t)), Float64(120.0 * a)) tmp = 0.0 if (y <= -1.4e+121) tmp = t_1; elseif (y <= 1.1e-18) tmp = fma(60.0, Float64(x / Float64(z - 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[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+121], t$95$1, If[LessEqual[y, 1.1e-18], N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z - t}, 120 \cdot a\right)\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(60, \frac{x}{z - t}, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.40000000000000003e121 or 1.0999999999999999e-18 < y Initial program 99.3%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.4
Applied rewrites75.4%
if -1.40000000000000003e121 < y < 1.0999999999999999e-18Initial program 99.3%
Taylor expanded in y around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.9
Applied rewrites75.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma -60.0 (/ y (- z t)) (* 120.0 a))))
(if (<= a -2.8e-37)
t_1
(if (<= a 1.25e-76) (* 60.0 (/ (- x y) (- z t))) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(-60.0, (y / (z - t)), (120.0 * a));
double tmp;
if (a <= -2.8e-37) {
tmp = t_1;
} else if (a <= 1.25e-76) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(-60.0, Float64(y / Float64(z - t)), Float64(120.0 * a)) tmp = 0.0 if (a <= -2.8e-37) tmp = t_1; elseif (a <= 1.25e-76) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(-60.0 * N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.8e-37], t$95$1, If[LessEqual[a, 1.25e-76], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(-60, \frac{y}{z - t}, 120 \cdot a\right)\\
\mathbf{if}\;a \leq -2.8 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-76}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -2.8000000000000001e-37 or 1.2499999999999999e-76 < a Initial program 99.3%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6475.4
Applied rewrites75.4%
if -2.8000000000000001e-37 < a < 1.2499999999999999e-76Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e+16) (fma a 120.0 (* (/ 60.0 t) y)) (if (<= a 6200000000.0) (* 60.0 (/ (- x y) (- z t))) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+16) {
tmp = fma(a, 120.0, ((60.0 / t) * y));
} else if (a <= 6200000000.0) {
tmp = 60.0 * ((x - y) / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+16) tmp = fma(a, 120.0, Float64(Float64(60.0 / t) * y)); elseif (a <= 6200000000.0) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); else tmp = Float64(120.0 * a); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+16], N[(a * 120.0 + N[(N[(60.0 / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6200000000.0], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{t} \cdot y\right)\\
\mathbf{elif}\;a \leq 6200000000:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
if a < -9.5e16Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
Taylor expanded in z around 0
lower-/.f6454.9
Applied rewrites54.9%
if -9.5e16 < a < 6.2e9Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
if 6.2e9 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.8e+88)
(fma a 120.0 (* (/ 60.0 t) y))
(if (<= t -2.4e-144)
(fma a 120.0 (* (/ -60.0 z) y))
(if (<= t 2.5e-71)
(* 60.0 (/ (- x y) z))
(fma a 120.0 (/ (* y 60.0) t))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e+88) {
tmp = fma(a, 120.0, ((60.0 / t) * y));
} else if (t <= -2.4e-144) {
tmp = fma(a, 120.0, ((-60.0 / z) * y));
} else if (t <= 2.5e-71) {
tmp = 60.0 * ((x - y) / z);
} else {
tmp = fma(a, 120.0, ((y * 60.0) / t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.8e+88) tmp = fma(a, 120.0, Float64(Float64(60.0 / t) * y)); elseif (t <= -2.4e-144) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * y)); elseif (t <= 2.5e-71) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); else tmp = fma(a, 120.0, Float64(Float64(y * 60.0) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.8e+88], N[(a * 120.0 + N[(N[(60.0 / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.4e-144], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-71], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(y * 60.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{60}{t} \cdot y\right)\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot y\right)\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-71}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y \cdot 60}{t}\right)\\
\end{array}
if t < -5.7999999999999999e88Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
Taylor expanded in z around 0
lower-/.f6454.9
Applied rewrites54.9%
if -5.7999999999999999e88 < t < -2.39999999999999994e-144Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
Taylor expanded in z around inf
lower-/.f6455.7
Applied rewrites55.7%
if -2.39999999999999994e-144 < t < 2.49999999999999999e-71Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6428.3
Applied rewrites28.3%
if 2.49999999999999999e-71 < t Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
lower-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6475.2
Applied rewrites75.2%
Taylor expanded in z around 0
Applied rewrites54.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma a 120.0 (* (/ 60.0 t) y))))
(if (<= t -5.8e+88)
t_1
(if (<= t -2.4e-144)
(fma a 120.0 (* (/ -60.0 z) y))
(if (<= t 2.5e-71) (* 60.0 (/ (- x y) z)) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(a, 120.0, ((60.0 / t) * y));
double tmp;
if (t <= -5.8e+88) {
tmp = t_1;
} else if (t <= -2.4e-144) {
tmp = fma(a, 120.0, ((-60.0 / z) * y));
} else if (t <= 2.5e-71) {
tmp = 60.0 * ((x - y) / z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(a, 120.0, Float64(Float64(60.0 / t) * y)) tmp = 0.0 if (t <= -5.8e+88) tmp = t_1; elseif (t <= -2.4e-144) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * y)); elseif (t <= 2.5e-71) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); 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 / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e+88], t$95$1, If[LessEqual[t, -2.4e-144], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e-71], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 120, \frac{60}{t} \cdot y\right)\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot y\right)\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-71}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -5.7999999999999999e88 or 2.49999999999999999e-71 < t Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
Taylor expanded in z around 0
lower-/.f6454.9
Applied rewrites54.9%
if -5.7999999999999999e88 < t < -2.39999999999999994e-144Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
Taylor expanded in z around inf
lower-/.f6455.7
Applied rewrites55.7%
if -2.39999999999999994e-144 < t < 2.49999999999999999e-71Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6428.3
Applied rewrites28.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 60.0 (/ x (- z t)))))
(if (<= x -2.8e+151)
t_1
(if (<= x 3.05e+57) (fma a 120.0 (* (/ -60.0 z) y)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = 60.0 * (x / (z - t));
double tmp;
if (x <= -2.8e+151) {
tmp = t_1;
} else if (x <= 3.05e+57) {
tmp = fma(a, 120.0, ((-60.0 / z) * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(60.0 * Float64(x / Float64(z - t))) tmp = 0.0 if (x <= -2.8e+151) tmp = t_1; elseif (x <= 3.05e+57) tmp = fma(a, 120.0, Float64(Float64(-60.0 / z) * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(60.0 * N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+151], t$95$1, If[LessEqual[x, 3.05e+57], N[(a * 120.0 + N[(N[(-60.0 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := 60 \cdot \frac{x}{z - t}\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{+57}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60}{z} \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -2.79999999999999987e151 or 3.04999999999999988e57 < x Initial program 99.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.4
Applied rewrites26.4%
if -2.79999999999999987e151 < x < 3.04999999999999988e57Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
sub-negate-revN/A
lift--.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.5%
Taylor expanded in z around inf
lower-/.f6455.7
Applied rewrites55.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -5900000000000.0) (* 120.0 a) (if (<= a 7.8e-59) (* 60.0 (/ (- x y) z)) (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5900000000000.0) {
tmp = 120.0 * a;
} else if (a <= 7.8e-59) {
tmp = 60.0 * ((x - y) / z);
} 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 <= (-5900000000000.0d0)) then
tmp = 120.0d0 * a
else if (a <= 7.8d-59) then
tmp = 60.0d0 * ((x - y) / z)
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 <= -5900000000000.0) {
tmp = 120.0 * a;
} else if (a <= 7.8e-59) {
tmp = 60.0 * ((x - y) / z);
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5900000000000.0: tmp = 120.0 * a elif a <= 7.8e-59: tmp = 60.0 * ((x - y) / z) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5900000000000.0) tmp = Float64(120.0 * a); elseif (a <= 7.8e-59) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5900000000000.0) tmp = 120.0 * a; elseif (a <= 7.8e-59) tmp = 60.0 * ((x - y) / z); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5900000000000.0], N[(120.0 * a), $MachinePrecision], If[LessEqual[a, 7.8e-59], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -5900000000000:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-59}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
if a < -5.9e12 or 7.80000000000000038e-59 < a Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6451.6
Applied rewrites51.6%
if -5.9e12 < a < 7.80000000000000038e-59Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f6428.3
Applied rewrites28.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* -60.0 (/ y (- z t))))) (if (<= y -2.35e+107) t_1 (if (<= y 9e+133) (* 120.0 a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -2.35e+107) {
tmp = t_1;
} else if (y <= 9e+133) {
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) :: tmp
t_1 = (-60.0d0) * (y / (z - t))
if (y <= (-2.35d+107)) then
tmp = t_1
else if (y <= 9d+133) then
tmp = 120.0d0 * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -60.0 * (y / (z - t));
double tmp;
if (y <= -2.35e+107) {
tmp = t_1;
} else if (y <= 9e+133) {
tmp = 120.0 * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -60.0 * (y / (z - t)) tmp = 0 if y <= -2.35e+107: tmp = t_1 elif y <= 9e+133: tmp = 120.0 * a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(-60.0 * Float64(y / Float64(z - t))) tmp = 0.0 if (y <= -2.35e+107) tmp = t_1; elseif (y <= 9e+133) tmp = Float64(120.0 * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -60.0 * (y / (z - t)); tmp = 0.0; if (y <= -2.35e+107) tmp = t_1; elseif (y <= 9e+133) 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[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.35e+107], t$95$1, If[LessEqual[y, 9e+133], N[(120.0 * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -60 \cdot \frac{y}{z - t}\\
\mathbf{if}\;y \leq -2.35 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+133}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.35e107 or 8.9999999999999997e133 < y Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.5
Applied rewrites27.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6415.5
Applied rewrites15.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.0
Applied rewrites26.0%
if -2.35e107 < y < 8.9999999999999997e133Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -5e+202)
(* 60.0 (/ x z))
(if (<= t_1 2e+185) (* 120.0 a) (* -60.0 (/ x t))))))double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e+202) {
tmp = 60.0 * (x / z);
} else if (t_1 <= 2e+185) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-5d+202)) then
tmp = 60.0d0 * (x / z)
else if (t_1 <= 2d+185) then
tmp = 120.0d0 * a
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -5e+202) {
tmp = 60.0 * (x / z);
} else if (t_1 <= 2e+185) {
tmp = 120.0 * a;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -5e+202: tmp = 60.0 * (x / z) elif t_1 <= 2e+185: tmp = 120.0 * a else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -5e+202) tmp = Float64(60.0 * Float64(x / z)); elseif (t_1 <= 2e+185) tmp = Float64(120.0 * a); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -5e+202) tmp = 60.0 * (x / z); elseif (t_1 <= 2e+185) tmp = 120.0 * a; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+202], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+185], N[(120.0 * a), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+202}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+185}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.9999999999999999e202Initial program 99.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower--.f6426.4
Applied rewrites26.4%
Taylor expanded in z around inf
lower-/.f6416.2
Applied rewrites16.2%
if -4.9999999999999999e202 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e185Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6451.6
Applied rewrites51.6%
if 2e185 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.5
Applied rewrites27.5%
Taylor expanded in x around inf
lower-/.f6415.5
Applied rewrites15.5%
(FPCore (x y z t a) :precision binary64 (if (<= y 9e+133) (* 120.0 a) (* 60.0 (/ y t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 9e+133) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 9d+133) then
tmp = 120.0d0 * a
else
tmp = 60.0d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 9e+133) {
tmp = 120.0 * a;
} else {
tmp = 60.0 * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 9e+133: tmp = 120.0 * a else: tmp = 60.0 * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 9e+133) tmp = Float64(120.0 * a); else tmp = Float64(60.0 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 9e+133) tmp = 120.0 * a; else tmp = 60.0 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 9e+133], N[(120.0 * a), $MachinePrecision], N[(60.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y \leq 9 \cdot 10^{+133}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{y}{t}\\
\end{array}
if y < 8.9999999999999997e133Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6451.6
Applied rewrites51.6%
if 8.9999999999999997e133 < y Initial program 99.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in z around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f6427.5
Applied rewrites27.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6415.5
Applied rewrites15.5%
(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]
120 \cdot a
Initial program 99.3%
Taylor expanded in z around inf
lower-*.f6451.6
Applied rewrites51.6%
herbie shell --seed 2025176
(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)))