
(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}
Sampling outcomes in binary64 precision:
Herbie found 21 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(Float64(60.0 / Float64(z - t)) * Float64(x - y))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{60}{z - t} \cdot \left(x - y\right)\right)
\end{array}
Initial program 99.4%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.4
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+95)
(* x (/ 60.0 (- z t)))
(if (<= t_1 -5e+48)
(/ (* -60.0 y) (- z t))
(if (<= t_1 4e-198)
(* 120.0 a)
(if (<= t_1 2e+49)
(fma (/ x t) -60.0 (* 120.0 a))
(* (- x y) (/ 60.0 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = (-60.0 * y) / (z - t);
} else if (t_1 <= 4e-198) {
tmp = 120.0 * a;
} else if (t_1 <= 2e+49) {
tmp = fma((x / t), -60.0, (120.0 * a));
} else {
tmp = (x - y) * (60.0 / 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 <= -1e+95) tmp = Float64(x * Float64(60.0 / Float64(z - t))); elseif (t_1 <= -5e+48) tmp = Float64(Float64(-60.0 * y) / Float64(z - t)); elseif (t_1 <= 4e-198) tmp = Float64(120.0 * a); elseif (t_1 <= 2e+49) tmp = fma(Float64(x / t), -60.0, Float64(120.0 * a)); else tmp = Float64(Float64(x - y) * Float64(60.0 / z)); end return 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+95], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+48], N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-198], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$1, 2e+49], N[(N[(x / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / 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 -1 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-198}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, -60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000002e95Initial program 96.5%
Taylor expanded in a around 0
Applied rewrites79.5%
Taylor expanded in x around inf
Applied rewrites53.0%
if -1.00000000000000002e95 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48Initial program 99.8%
Taylor expanded in y around inf
Applied rewrites65.3%
Applied rewrites65.4%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 3.9999999999999996e-198Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites81.0%
if 3.9999999999999996e-198 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 1.99999999999999989e49Initial program 99.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in a around inf
Applied rewrites98.1%
Taylor expanded in y around 0
Applied rewrites75.3%
Taylor expanded in z around 0
Applied rewrites65.8%
if 1.99999999999999989e49 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
Applied rewrites83.5%
Taylor expanded in z around inf
Applied rewrites58.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ 60.0 (- z t))))
(t_2 (* y (/ -60.0 (- z t))))
(t_3 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_3 -1e+95)
t_1
(if (<= t_3 -5e+48)
t_2
(if (<= t_3 4e+48) (* 120.0 a) (if (<= t_3 2e+153) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (60.0 / (z - t));
double t_2 = y * (-60.0 / (z - t));
double t_3 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_3 <= -1e+95) {
tmp = t_1;
} else if (t_3 <= -5e+48) {
tmp = t_2;
} else if (t_3 <= 4e+48) {
tmp = 120.0 * a;
} else if (t_3 <= 2e+153) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = x * (60.0d0 / (z - t))
t_2 = y * ((-60.0d0) / (z - t))
t_3 = (60.0d0 * (x - y)) / (z - t)
if (t_3 <= (-1d+95)) then
tmp = t_1
else if (t_3 <= (-5d+48)) then
tmp = t_2
else if (t_3 <= 4d+48) then
tmp = 120.0d0 * a
else if (t_3 <= 2d+153) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (60.0 / (z - t));
double t_2 = y * (-60.0 / (z - t));
double t_3 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_3 <= -1e+95) {
tmp = t_1;
} else if (t_3 <= -5e+48) {
tmp = t_2;
} else if (t_3 <= 4e+48) {
tmp = 120.0 * a;
} else if (t_3 <= 2e+153) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (60.0 / (z - t)) t_2 = y * (-60.0 / (z - t)) t_3 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_3 <= -1e+95: tmp = t_1 elif t_3 <= -5e+48: tmp = t_2 elif t_3 <= 4e+48: tmp = 120.0 * a elif t_3 <= 2e+153: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(60.0 / Float64(z - t))) t_2 = Float64(y * Float64(-60.0 / Float64(z - t))) t_3 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_3 <= -1e+95) tmp = t_1; elseif (t_3 <= -5e+48) tmp = t_2; elseif (t_3 <= 4e+48) tmp = Float64(120.0 * a); elseif (t_3 <= 2e+153) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (60.0 / (z - t)); t_2 = y * (-60.0 / (z - t)); t_3 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_3 <= -1e+95) tmp = t_1; elseif (t_3 <= -5e+48) tmp = t_2; elseif (t_3 <= 4e+48) tmp = 120.0 * a; elseif (t_3 <= 2e+153) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+95], t$95$1, If[LessEqual[t$95$3, -5e+48], t$95$2, If[LessEqual[t$95$3, 4e+48], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$3, 2e+153], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{60}{z - t}\\
t_2 := y \cdot \frac{-60}{z - t}\\
t_3 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+48}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000002e95 or 4.00000000000000018e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e153Initial program 97.9%
Taylor expanded in a around 0
Applied rewrites79.1%
Taylor expanded in x around inf
Applied rewrites52.4%
if -1.00000000000000002e95 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48 or 2e153 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.7%
Taylor expanded in y around inf
Applied rewrites61.1%
Applied rewrites61.0%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.00000000000000018e48Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites73.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- x y) (/ 60.0 (- z t)))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -5e+48)
t_1
(if (<= t_2 4e-198)
(* 120.0 a)
(if (<= t_2 4e+48) (fma (/ x t) -60.0 (* 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 - t));
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+48) {
tmp = t_1;
} else if (t_2 <= 4e-198) {
tmp = 120.0 * a;
} else if (t_2 <= 4e+48) {
tmp = fma((x / t), -60.0, (120.0 * a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+48) tmp = t_1; elseif (t_2 <= 4e-198) tmp = Float64(120.0 * a); elseif (t_2 <= 4e+48) tmp = fma(Float64(x / t), -60.0, Float64(120.0 * a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(60.0 / 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+48], t$95$1, If[LessEqual[t$95$2, 4e-198], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 4e+48], N[(N[(x / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot \frac{60}{z - t}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-198}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, -60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48 or 4.00000000000000018e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.6%
Taylor expanded in a around 0
Applied rewrites81.8%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 3.9999999999999996e-198Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites81.0%
if 3.9999999999999996e-198 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 4.00000000000000018e48Initial program 99.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.9
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in a around inf
Applied rewrites98.1%
Taylor expanded in y around 0
Applied rewrites76.5%
Taylor expanded in z around 0
Applied rewrites66.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+95)
(* x (/ 60.0 (- z t)))
(if (<= t_1 -5e+48)
(/ (* -60.0 y) (- z t))
(if (<= t_1 5e+63) (* 120.0 a) (* (- x y) (/ 60.0 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = (-60.0 * y) / (z - t);
} else if (t_1 <= 5e+63) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / 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 <= (-1d+95)) then
tmp = x * (60.0d0 / (z - t))
else if (t_1 <= (-5d+48)) then
tmp = ((-60.0d0) * y) / (z - t)
else if (t_1 <= 5d+63) then
tmp = 120.0d0 * a
else
tmp = (x - y) * (60.0d0 / 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = (-60.0 * y) / (z - t);
} else if (t_1 <= 5e+63) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+95: tmp = x * (60.0 / (z - t)) elif t_1 <= -5e+48: tmp = (-60.0 * y) / (z - t) elif t_1 <= 5e+63: tmp = 120.0 * a else: tmp = (x - y) * (60.0 / 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 <= -1e+95) tmp = Float64(x * Float64(60.0 / Float64(z - t))); elseif (t_1 <= -5e+48) tmp = Float64(Float64(-60.0 * y) / Float64(z - t)); elseif (t_1 <= 5e+63) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x - y) * Float64(60.0 / 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 <= -1e+95) tmp = x * (60.0 / (z - t)); elseif (t_1 <= -5e+48) tmp = (-60.0 * y) / (z - t); elseif (t_1 <= 5e+63) tmp = 120.0 * a; else tmp = (x - y) * (60.0 / 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, -1e+95], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+48], N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+63], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / 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 -1 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;\frac{-60 \cdot y}{z - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+63}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000002e95Initial program 96.5%
Taylor expanded in a around 0
Applied rewrites79.5%
Taylor expanded in x around inf
Applied rewrites53.0%
if -1.00000000000000002e95 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48Initial program 99.8%
Taylor expanded in y around inf
Applied rewrites65.3%
Applied rewrites65.4%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000011e63Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites72.4%
if 5.00000000000000011e63 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
Applied rewrites84.9%
Taylor expanded in z around inf
Applied rewrites59.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+95)
(* x (/ 60.0 (- z t)))
(if (<= t_1 -5e+48)
(* (/ y (- z t)) -60.0)
(if (<= t_1 5e+63) (* 120.0 a) (* (- x y) (/ 60.0 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 5e+63) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / 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 <= (-1d+95)) then
tmp = x * (60.0d0 / (z - t))
else if (t_1 <= (-5d+48)) then
tmp = (y / (z - t)) * (-60.0d0)
else if (t_1 <= 5d+63) then
tmp = 120.0d0 * a
else
tmp = (x - y) * (60.0d0 / 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = (y / (z - t)) * -60.0;
} else if (t_1 <= 5e+63) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+95: tmp = x * (60.0 / (z - t)) elif t_1 <= -5e+48: tmp = (y / (z - t)) * -60.0 elif t_1 <= 5e+63: tmp = 120.0 * a else: tmp = (x - y) * (60.0 / 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 <= -1e+95) tmp = Float64(x * Float64(60.0 / Float64(z - t))); elseif (t_1 <= -5e+48) tmp = Float64(Float64(y / Float64(z - t)) * -60.0); elseif (t_1 <= 5e+63) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x - y) * Float64(60.0 / 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 <= -1e+95) tmp = x * (60.0 / (z - t)); elseif (t_1 <= -5e+48) tmp = (y / (z - t)) * -60.0; elseif (t_1 <= 5e+63) tmp = 120.0 * a; else tmp = (x - y) * (60.0 / 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, -1e+95], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+48], N[(N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision] * -60.0), $MachinePrecision], If[LessEqual[t$95$1, 5e+63], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / 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 -1 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;\frac{y}{z - t} \cdot -60\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+63}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000002e95Initial program 96.5%
Taylor expanded in a around 0
Applied rewrites79.5%
Taylor expanded in x around inf
Applied rewrites53.0%
if -1.00000000000000002e95 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48Initial program 99.8%
Taylor expanded in y around inf
Applied rewrites65.3%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000011e63Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites72.4%
if 5.00000000000000011e63 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
Applied rewrites84.9%
Taylor expanded in z around inf
Applied rewrites59.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -1e+95)
(* x (/ 60.0 (- z t)))
(if (<= t_1 -5e+48)
(* y (/ -60.0 (- z t)))
(if (<= t_1 5e+63) (* 120.0 a) (* (- x y) (/ 60.0 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = y * (-60.0 / (z - t));
} else if (t_1 <= 5e+63) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / 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 <= (-1d+95)) then
tmp = x * (60.0d0 / (z - t))
else if (t_1 <= (-5d+48)) then
tmp = y * ((-60.0d0) / (z - t))
else if (t_1 <= 5d+63) then
tmp = 120.0d0 * a
else
tmp = (x - y) * (60.0d0 / 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 <= -1e+95) {
tmp = x * (60.0 / (z - t));
} else if (t_1 <= -5e+48) {
tmp = y * (-60.0 / (z - t));
} else if (t_1 <= 5e+63) {
tmp = 120.0 * a;
} else {
tmp = (x - y) * (60.0 / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -1e+95: tmp = x * (60.0 / (z - t)) elif t_1 <= -5e+48: tmp = y * (-60.0 / (z - t)) elif t_1 <= 5e+63: tmp = 120.0 * a else: tmp = (x - y) * (60.0 / 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 <= -1e+95) tmp = Float64(x * Float64(60.0 / Float64(z - t))); elseif (t_1 <= -5e+48) tmp = Float64(y * Float64(-60.0 / Float64(z - t))); elseif (t_1 <= 5e+63) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x - y) * Float64(60.0 / 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 <= -1e+95) tmp = x * (60.0 / (z - t)); elseif (t_1 <= -5e+48) tmp = y * (-60.0 / (z - t)); elseif (t_1 <= 5e+63) tmp = 120.0 * a; else tmp = (x - y) * (60.0 / 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, -1e+95], N[(x * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+48], N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+63], N[(120.0 * a), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / 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 -1 \cdot 10^{+95}:\\
\;\;\;\;x \cdot \frac{60}{z - t}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{-60}{z - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+63}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.00000000000000002e95Initial program 96.5%
Taylor expanded in a around 0
Applied rewrites79.5%
Taylor expanded in x around inf
Applied rewrites53.0%
if -1.00000000000000002e95 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48Initial program 99.8%
Taylor expanded in y around inf
Applied rewrites65.3%
Applied rewrites65.2%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000011e63Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites72.4%
if 5.00000000000000011e63 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in a around 0
Applied rewrites84.9%
Taylor expanded in z around inf
Applied rewrites59.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- x y) t) -60.0)) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -5e+48)
t_1
(if (<= t_2 5e+63)
(* 120.0 a)
(if (<= t_2 1e+82) (* x (/ 60.0 z)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+48) {
tmp = t_1;
} else if (t_2 <= 5e+63) {
tmp = 120.0 * a;
} else if (t_2 <= 1e+82) {
tmp = x * (60.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x - y) / t) * (-60.0d0)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-5d+48)) then
tmp = t_1
else if (t_2 <= 5d+63) then
tmp = 120.0d0 * a
else if (t_2 <= 1d+82) then
tmp = x * (60.0d0 / z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((x - y) / t) * -60.0;
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -5e+48) {
tmp = t_1;
} else if (t_2 <= 5e+63) {
tmp = 120.0 * a;
} else if (t_2 <= 1e+82) {
tmp = x * (60.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((x - y) / t) * -60.0 t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -5e+48: tmp = t_1 elif t_2 <= 5e+63: tmp = 120.0 * a elif t_2 <= 1e+82: tmp = x * (60.0 / z) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(x - y) / t) * -60.0) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -5e+48) tmp = t_1; elseif (t_2 <= 5e+63) tmp = Float64(120.0 * a); elseif (t_2 <= 1e+82) tmp = Float64(x * Float64(60.0 / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((x - y) / t) * -60.0; t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -5e+48) tmp = t_1; elseif (t_2 <= 5e+63) tmp = 120.0 * a; elseif (t_2 <= 1e+82) tmp = x * (60.0 / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+48], t$95$1, If[LessEqual[t$95$2, 5e+63], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 1e+82], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - y}{t} \cdot -60\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+63}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 10^{+82}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -4.99999999999999973e48 or 9.9999999999999996e81 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 98.6%
Taylor expanded in a around 0
Applied rewrites80.8%
Taylor expanded in x around inf
Applied rewrites38.2%
Taylor expanded in z around 0
Applied rewrites44.8%
if -4.99999999999999973e48 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000011e63Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites72.4%
if 5.00000000000000011e63 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 9.9999999999999996e81Initial program 99.3%
Taylor expanded in a around 0
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites72.0%
Taylor expanded in z around inf
Applied rewrites72.0%
Final simplification63.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ 60.0 z))) (t_2 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_2 -2e+137)
t_1
(if (<= t_2 5e+63)
(* 120.0 a)
(if (<= t_2 2e+153) t_1 (* (/ y z) -60.0))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (60.0 / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+137) {
tmp = t_1;
} else if (t_2 <= 5e+63) {
tmp = 120.0 * a;
} else if (t_2 <= 2e+153) {
tmp = t_1;
} else {
tmp = (y / z) * -60.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (60.0d0 / z)
t_2 = (60.0d0 * (x - y)) / (z - t)
if (t_2 <= (-2d+137)) then
tmp = t_1
else if (t_2 <= 5d+63) then
tmp = 120.0d0 * a
else if (t_2 <= 2d+153) then
tmp = t_1
else
tmp = (y / z) * (-60.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (60.0 / z);
double t_2 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_2 <= -2e+137) {
tmp = t_1;
} else if (t_2 <= 5e+63) {
tmp = 120.0 * a;
} else if (t_2 <= 2e+153) {
tmp = t_1;
} else {
tmp = (y / z) * -60.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x * (60.0 / z) t_2 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_2 <= -2e+137: tmp = t_1 elif t_2 <= 5e+63: tmp = 120.0 * a elif t_2 <= 2e+153: tmp = t_1 else: tmp = (y / z) * -60.0 return tmp
function code(x, y, z, t, a) t_1 = Float64(x * Float64(60.0 / z)) t_2 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_2 <= -2e+137) tmp = t_1; elseif (t_2 <= 5e+63) tmp = Float64(120.0 * a); elseif (t_2 <= 2e+153) tmp = t_1; else tmp = Float64(Float64(y / z) * -60.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x * (60.0 / z); t_2 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_2 <= -2e+137) tmp = t_1; elseif (t_2 <= 5e+63) tmp = 120.0 * a; elseif (t_2 <= 2e+153) tmp = t_1; else tmp = (y / z) * -60.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(60.0 / 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, -2e+137], t$95$1, If[LessEqual[t$95$2, 5e+63], N[(120.0 * a), $MachinePrecision], If[LessEqual[t$95$2, 2e+153], t$95$1, N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{60}{z}\\
t_2 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+63}:\\
\;\;\;\;120 \cdot a\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot -60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -2.0000000000000001e137 or 5.00000000000000011e63 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 2e153Initial program 97.5%
Taylor expanded in a around 0
Applied rewrites83.7%
Taylor expanded in x around inf
Applied rewrites55.8%
Taylor expanded in z around inf
Applied rewrites41.1%
if -2.0000000000000001e137 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.00000000000000011e63Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites68.0%
if 2e153 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in y around inf
Applied rewrites58.8%
Taylor expanded in z around inf
Applied rewrites43.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (or (<= t_1 -2e+162) (not (<= t_1 5e+189)))
(* y (/ 60.0 t))
(* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -2e+162) || !(t_1 <= 5e+189)) {
tmp = y * (60.0 / t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if ((t_1 <= (-2d+162)) .or. (.not. (t_1 <= 5d+189))) then
tmp = y * (60.0d0 / t)
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if ((t_1 <= -2e+162) || !(t_1 <= 5e+189)) {
tmp = y * (60.0 / t);
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if (t_1 <= -2e+162) or not (t_1 <= 5e+189): tmp = y * (60.0 / t) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if ((t_1 <= -2e+162) || !(t_1 <= 5e+189)) tmp = Float64(y * Float64(60.0 / t)); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if ((t_1 <= -2e+162) || ~((t_1 <= 5e+189))) tmp = y * (60.0 / t); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+162], N[Not[LessEqual[t$95$1, 5e+189]], $MachinePrecision]], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+162} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+189}\right):\\
\;\;\;\;y \cdot \frac{60}{t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999999e162 or 5.0000000000000004e189 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 97.1%
Taylor expanded in y around inf
Applied rewrites57.7%
Taylor expanded in z around 0
Applied rewrites41.9%
Applied rewrites41.9%
if -1.9999999999999999e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.0000000000000004e189Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites61.0%
Final simplification58.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* 60.0 (- x y)) (- z t))))
(if (<= t_1 -2e+162)
(* y (/ 60.0 t))
(if (<= t_1 5e+189) (* 120.0 a) (* (/ y t) 60.0)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+162) {
tmp = y * (60.0 / t);
} else if (t_1 <= 5e+189) {
tmp = 120.0 * a;
} else {
tmp = (y / t) * 60.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (60.0d0 * (x - y)) / (z - t)
if (t_1 <= (-2d+162)) then
tmp = y * (60.0d0 / t)
else if (t_1 <= 5d+189) then
tmp = 120.0d0 * a
else
tmp = (y / t) * 60.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (60.0 * (x - y)) / (z - t);
double tmp;
if (t_1 <= -2e+162) {
tmp = y * (60.0 / t);
} else if (t_1 <= 5e+189) {
tmp = 120.0 * a;
} else {
tmp = (y / t) * 60.0;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (60.0 * (x - y)) / (z - t) tmp = 0 if t_1 <= -2e+162: tmp = y * (60.0 / t) elif t_1 <= 5e+189: tmp = 120.0 * a else: tmp = (y / t) * 60.0 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+162) tmp = Float64(y * Float64(60.0 / t)); elseif (t_1 <= 5e+189) tmp = Float64(120.0 * a); else tmp = Float64(Float64(y / t) * 60.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (60.0 * (x - y)) / (z - t); tmp = 0.0; if (t_1 <= -2e+162) tmp = y * (60.0 / t); elseif (t_1 <= 5e+189) tmp = 120.0 * a; else tmp = (y / t) * 60.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+162], N[(y * N[(60.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+189], N[(120.0 * a), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 60.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{60 \cdot \left(x - y\right)}{z - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+162}:\\
\;\;\;\;y \cdot \frac{60}{t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+189}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 60\\
\end{array}
\end{array}
if (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < -1.9999999999999999e162Initial program 93.8%
Taylor expanded in y around inf
Applied rewrites51.0%
Taylor expanded in z around 0
Applied rewrites44.6%
Applied rewrites44.6%
if -1.9999999999999999e162 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) < 5.0000000000000004e189Initial program 99.8%
Taylor expanded in z around inf
Applied rewrites61.0%
if 5.0000000000000004e189 < (/.f64 (*.f64 #s(literal 60 binary64) (-.f64 x y)) (-.f64 z t)) Initial program 99.6%
Taylor expanded in y around inf
Applied rewrites62.7%
Taylor expanded in z around 0
Applied rewrites39.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x (- z t)) 60.0 (* 120.0 a))) (t_2 (/ (- x y) z)))
(if (<= z -6.8e+52)
(fma a 120.0 (* t_2 60.0))
(if (<= z -1.6e-38)
t_1
(if (<= z 7.5e-114)
(fma a 120.0 (* (/ (- x y) t) -60.0))
(if (<= z 4500.0) t_1 (fma t_2 60.0 (* 120.0 a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / (z - t)), 60.0, (120.0 * a));
double t_2 = (x - y) / z;
double tmp;
if (z <= -6.8e+52) {
tmp = fma(a, 120.0, (t_2 * 60.0));
} else if (z <= -1.6e-38) {
tmp = t_1;
} else if (z <= 7.5e-114) {
tmp = fma(a, 120.0, (((x - y) / t) * -60.0));
} else if (z <= 4500.0) {
tmp = t_1;
} else {
tmp = fma(t_2, 60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)) t_2 = Float64(Float64(x - y) / z) tmp = 0.0 if (z <= -6.8e+52) tmp = fma(a, 120.0, Float64(t_2 * 60.0)); elseif (z <= -1.6e-38) tmp = t_1; elseif (z <= 7.5e-114) tmp = fma(a, 120.0, Float64(Float64(Float64(x - y) / t) * -60.0)); elseif (z <= 4500.0) tmp = t_1; else tmp = fma(t_2, 60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -6.8e+52], N[(a * 120.0 + N[(t$95$2 * 60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-38], t$95$1, If[LessEqual[z, 7.5e-114], N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4500.0], t$95$1, N[(t$95$2 * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
t_2 := \frac{x - y}{z}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, t\_2 \cdot 60\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-114}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{t} \cdot -60\right)\\
\mathbf{elif}\;z \leq 4500:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 60, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -6.8e52Initial program 99.8%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in z around inf
Applied rewrites95.3%
if -6.8e52 < z < -1.59999999999999989e-38 or 7.5000000000000002e-114 < z < 4500Initial program 97.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6497.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
Applied rewrites87.8%
if -1.59999999999999989e-38 < z < 7.5000000000000002e-114Initial program 99.7%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
Applied rewrites92.2%
if 4500 < z Initial program 99.7%
Taylor expanded in z around inf
Applied rewrites91.7%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x (- z t)) 60.0 (* 120.0 a)))
(t_2 (fma (/ (- x y) z) 60.0 (* 120.0 a))))
(if (<= z -6.8e+52)
t_2
(if (<= z -1.6e-38)
t_1
(if (<= z 7.5e-114)
(fma a 120.0 (* (/ (- x y) t) -60.0))
(if (<= z 4500.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / (z - t)), 60.0, (120.0 * a));
double t_2 = fma(((x - y) / z), 60.0, (120.0 * a));
double tmp;
if (z <= -6.8e+52) {
tmp = t_2;
} else if (z <= -1.6e-38) {
tmp = t_1;
} else if (z <= 7.5e-114) {
tmp = fma(a, 120.0, (((x - y) / t) * -60.0));
} else if (z <= 4500.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)) t_2 = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)) tmp = 0.0 if (z <= -6.8e+52) tmp = t_2; elseif (z <= -1.6e-38) tmp = t_1; elseif (z <= 7.5e-114) tmp = fma(a, 120.0, Float64(Float64(Float64(x - y) / t) * -60.0)); elseif (z <= 4500.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+52], t$95$2, If[LessEqual[z, -1.6e-38], t$95$1, If[LessEqual[z, 7.5e-114], N[(a * 120.0 + N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4500.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
t_2 := \mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-114}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{x - y}{t} \cdot -60\right)\\
\mathbf{elif}\;z \leq 4500:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.8e52 or 4500 < z Initial program 99.7%
Taylor expanded in z around inf
Applied rewrites93.5%
if -6.8e52 < z < -1.59999999999999989e-38 or 7.5000000000000002e-114 < z < 4500Initial program 97.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6497.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
Applied rewrites87.8%
if -1.59999999999999989e-38 < z < 7.5000000000000002e-114Initial program 99.7%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around 0
Applied rewrites92.2%
Final simplification92.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ x (- z t)) 60.0 (* 120.0 a)))
(t_2 (fma (/ (- x y) z) 60.0 (* 120.0 a))))
(if (<= z -6.8e+52)
t_2
(if (<= z -2.1e-41)
t_1
(if (<= z 7.5e-114)
(fma (/ (- x y) t) -60.0 (* 120.0 a))
(if (<= z 4500.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x / (z - t)), 60.0, (120.0 * a));
double t_2 = fma(((x - y) / z), 60.0, (120.0 * a));
double tmp;
if (z <= -6.8e+52) {
tmp = t_2;
} else if (z <= -2.1e-41) {
tmp = t_1;
} else if (z <= 7.5e-114) {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
} else if (z <= 4500.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)) t_2 = fma(Float64(Float64(x - y) / z), 60.0, Float64(120.0 * a)) tmp = 0.0 if (z <= -6.8e+52) tmp = t_2; elseif (z <= -2.1e-41) tmp = t_1; elseif (z <= 7.5e-114) tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); elseif (z <= 4500.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e+52], t$95$2, If[LessEqual[z, -2.1e-41], t$95$1, If[LessEqual[z, 7.5e-114], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4500.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
t_2 := \mathsf{fma}\left(\frac{x - y}{z}, 60, 120 \cdot a\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-114}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\mathbf{elif}\;z \leq 4500:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.8e52 or 4500 < z Initial program 99.7%
Taylor expanded in z around inf
Applied rewrites93.5%
if -6.8e52 < z < -2.10000000000000013e-41 or 7.5000000000000002e-114 < z < 4500Initial program 97.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6497.5
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
Applied rewrites87.8%
if -2.10000000000000013e-41 < z < 7.5000000000000002e-114Initial program 99.7%
Taylor expanded in z around 0
Applied rewrites92.2%
Final simplification92.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.3e+64) (not (<= x 1.6e+58))) (fma (/ x (- z t)) 60.0 (* 120.0 a)) (fma a 120.0 (/ (* -60.0 y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.3e+64) || !(x <= 1.6e+58)) {
tmp = fma((x / (z - t)), 60.0, (120.0 * a));
} else {
tmp = fma(a, 120.0, ((-60.0 * y) / (z - t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.3e+64) || !(x <= 1.6e+58)) tmp = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)); else tmp = fma(a, 120.0, Float64(Float64(-60.0 * y) / Float64(z - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.3e+64], N[Not[LessEqual[x, 1.6e+58]], $MachinePrecision]], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(a * 120.0 + N[(N[(-60.0 * y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+64} \lor \neg \left(x \leq 1.6 \cdot 10^{+58}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{-60 \cdot y}{z - t}\right)\\
\end{array}
\end{array}
if x < -2.3e64 or 1.60000000000000008e58 < x Initial program 98.6%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6498.7
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
Applied rewrites90.9%
if -2.3e64 < x < 1.60000000000000008e58Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites95.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6495.7
Applied rewrites95.7%
Final simplification94.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e-41) (not (<= z 7.5e-114))) (fma (/ x (- z t)) 60.0 (* 120.0 a)) (fma (/ (- x y) t) -60.0 (* 120.0 a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e-41) || !(z <= 7.5e-114)) {
tmp = fma((x / (z - t)), 60.0, (120.0 * a));
} else {
tmp = fma(((x - y) / t), -60.0, (120.0 * a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e-41) || !(z <= 7.5e-114)) tmp = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)); else tmp = fma(Float64(Float64(x - y) / t), -60.0, Float64(120.0 * a)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e-41], N[Not[LessEqual[z, 7.5e-114]], $MachinePrecision]], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * -60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-41} \lor \neg \left(z \leq 7.5 \cdot 10^{-114}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, -60, 120 \cdot a\right)\\
\end{array}
\end{array}
if z < -2.10000000000000013e-41 or 7.5000000000000002e-114 < z Initial program 99.2%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.2
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
Applied rewrites82.1%
if -2.10000000000000013e-41 < z < 7.5000000000000002e-114Initial program 99.7%
Taylor expanded in z around 0
Applied rewrites92.2%
Final simplification85.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.52e+153)
(fma a 120.0 (* (/ y z) -60.0))
(if (<= y 2.3e+90)
(fma (/ x (- z t)) 60.0 (* 120.0 a))
(* (- x y) (/ 60.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.52e+153) {
tmp = fma(a, 120.0, ((y / z) * -60.0));
} else if (y <= 2.3e+90) {
tmp = fma((x / (z - t)), 60.0, (120.0 * a));
} else {
tmp = (x - y) * (60.0 / (z - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.52e+153) tmp = fma(a, 120.0, Float64(Float64(y / z) * -60.0)); elseif (y <= 2.3e+90) tmp = fma(Float64(x / Float64(z - t)), 60.0, Float64(120.0 * a)); else tmp = Float64(Float64(x - y) * Float64(60.0 / Float64(z - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.52e+153], N[(a * 120.0 + N[(N[(y / z), $MachinePrecision] * -60.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+90], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * 60.0 + N[(120.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(a, 120, \frac{y}{z} \cdot -60\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z - t}, 60, 120 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{60}{z - t}\\
\end{array}
\end{array}
if y < -1.52e153Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.6
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites68.1%
Taylor expanded in x around 0
Applied rewrites68.1%
if -1.52e153 < y < 2.3e90Initial program 99.7%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
remove-double-negN/A
lower-fma.f6499.8
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
Applied rewrites88.6%
if 2.3e90 < y Initial program 97.6%
Taylor expanded in a around 0
Applied rewrites76.6%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.45e+153) (not (<= y 2.3e+90))) (* y (/ -60.0 (- z t))) (* 120.0 a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.45e+153) || !(y <= 2.3e+90)) {
tmp = y * (-60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.45d+153)) .or. (.not. (y <= 2.3d+90))) then
tmp = y * ((-60.0d0) / (z - t))
else
tmp = 120.0d0 * a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.45e+153) || !(y <= 2.3e+90)) {
tmp = y * (-60.0 / (z - t));
} else {
tmp = 120.0 * a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.45e+153) or not (y <= 2.3e+90): tmp = y * (-60.0 / (z - t)) else: tmp = 120.0 * a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.45e+153) || !(y <= 2.3e+90)) tmp = Float64(y * Float64(-60.0 / Float64(z - t))); else tmp = Float64(120.0 * a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.45e+153) || ~((y <= 2.3e+90))) tmp = y * (-60.0 / (z - t)); else tmp = 120.0 * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.45e+153], N[Not[LessEqual[y, 2.3e+90]], $MachinePrecision]], N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(120.0 * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+153} \lor \neg \left(y \leq 2.3 \cdot 10^{+90}\right):\\
\;\;\;\;y \cdot \frac{-60}{z - t}\\
\mathbf{else}:\\
\;\;\;\;120 \cdot a\\
\end{array}
\end{array}
if y < -1.45000000000000001e153 or 2.3e90 < y Initial program 98.3%
Taylor expanded in y around inf
Applied rewrites63.6%
Applied rewrites63.7%
if -1.45000000000000001e153 < y < 2.3e90Initial program 99.7%
Taylor expanded in z around inf
Applied rewrites62.5%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -7e+188) (* x (/ 60.0 z)) (if (<= x 3.1e+250) (* 120.0 a) (* x (/ -60.0 t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7e+188) {
tmp = x * (60.0 / z);
} else if (x <= 3.1e+250) {
tmp = 120.0 * a;
} else {
tmp = x * (-60.0 / t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-7d+188)) then
tmp = x * (60.0d0 / z)
else if (x <= 3.1d+250) then
tmp = 120.0d0 * a
else
tmp = x * ((-60.0d0) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -7e+188) {
tmp = x * (60.0 / z);
} else if (x <= 3.1e+250) {
tmp = 120.0 * a;
} else {
tmp = x * (-60.0 / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -7e+188: tmp = x * (60.0 / z) elif x <= 3.1e+250: tmp = 120.0 * a else: tmp = x * (-60.0 / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -7e+188) tmp = Float64(x * Float64(60.0 / z)); elseif (x <= 3.1e+250) tmp = Float64(120.0 * a); else tmp = Float64(x * Float64(-60.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -7e+188) tmp = x * (60.0 / z); elseif (x <= 3.1e+250) tmp = 120.0 * a; else tmp = x * (-60.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -7e+188], N[(x * N[(60.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e+250], N[(120.0 * a), $MachinePrecision], N[(x * N[(-60.0 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+188}:\\
\;\;\;\;x \cdot \frac{60}{z}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+250}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-60}{t}\\
\end{array}
\end{array}
if x < -7.00000000000000016e188Initial program 99.7%
Taylor expanded in a around 0
Applied rewrites78.3%
Taylor expanded in x around inf
Applied rewrites74.3%
Taylor expanded in z around inf
Applied rewrites61.6%
if -7.00000000000000016e188 < x < 3.1000000000000001e250Initial program 99.7%
Taylor expanded in z around inf
Applied rewrites58.8%
if 3.1000000000000001e250 < x Initial program 91.9%
Taylor expanded in a around 0
Applied rewrites83.4%
Taylor expanded in x around inf
Applied rewrites83.4%
Taylor expanded in z around 0
Applied rewrites58.6%
(FPCore (x y z t a) :precision binary64 (if (<= x 3.1e+250) (* 120.0 a) (* (/ x t) -60.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 3.1e+250) {
tmp = 120.0 * a;
} else {
tmp = (x / t) * -60.0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= 3.1d+250) then
tmp = 120.0d0 * a
else
tmp = (x / t) * (-60.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= 3.1e+250) {
tmp = 120.0 * a;
} else {
tmp = (x / t) * -60.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= 3.1e+250: tmp = 120.0 * a else: tmp = (x / t) * -60.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= 3.1e+250) tmp = Float64(120.0 * a); else tmp = Float64(Float64(x / t) * -60.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= 3.1e+250) tmp = 120.0 * a; else tmp = (x / t) * -60.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, 3.1e+250], N[(120.0 * a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * -60.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.1 \cdot 10^{+250}:\\
\;\;\;\;120 \cdot a\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot -60\\
\end{array}
\end{array}
if x < 3.1000000000000001e250Initial program 99.7%
Taylor expanded in z around inf
Applied rewrites55.1%
if 3.1000000000000001e250 < x Initial program 91.9%
Taylor expanded in a around 0
Applied rewrites83.4%
Taylor expanded in x around inf
Applied rewrites83.4%
Taylor expanded in z around 0
Applied rewrites58.5%
Taylor expanded in x around inf
Applied rewrites58.5%
Final simplification55.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.4%
Taylor expanded in z around inf
Applied rewrites53.2%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (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 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2025022
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))