
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(/
(*
b
(+ (/ 1.0 z) (/ (* x (- (* 9.0 (/ y z)) (* 4.0 (/ (* a t) x)))) b)))
c)))
(if (<= z -4.4e+142)
t_1
(if (<= z 2.7e+39)
(/
(+ (* -1.0 (* y (fma -9.0 x (* 4.0 (/ (* a (* t z)) y))))) b)
(* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b * ((1.0 / z) + ((x * ((9.0 * (y / z)) - (4.0 * ((a * t) / x)))) / b))) / c;
double tmp;
if (z <= -4.4e+142) {
tmp = t_1;
} else if (z <= 2.7e+39) {
tmp = ((-1.0 * (y * fma(-9.0, x, (4.0 * ((a * (t * z)) / y))))) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b * Float64(Float64(1.0 / z) + Float64(Float64(x * Float64(Float64(9.0 * Float64(y / z)) - Float64(4.0 * Float64(Float64(a * t) / x)))) / b))) / c) tmp = 0.0 if (z <= -4.4e+142) tmp = t_1; elseif (z <= 2.7e+39) tmp = Float64(Float64(Float64(-1.0 * Float64(y * fma(-9.0, x, Float64(4.0 * Float64(Float64(a * Float64(t * z)) / y))))) + b) / Float64(z * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * N[(N[(1.0 / z), $MachinePrecision] + N[(N[(x * N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -4.4e+142], t$95$1, If[LessEqual[z, 2.7e+39], N[(N[(N[(-1.0 * N[(y * N[(-9.0 * x + N[(4.0 * N[(N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{b \cdot \left(\frac{1}{z} + \frac{x \cdot \left(9 \cdot \frac{y}{z} - 4 \cdot \frac{a \cdot t}{x}\right)}{b}\right)}{c}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+39}:\\
\;\;\;\;\frac{-1 \cdot \left(y \cdot \mathsf{fma}\left(-9, x, 4 \cdot \frac{a \cdot \left(t \cdot z\right)}{y}\right)\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.39999999999999974e142 or 2.70000000000000003e39 < z Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in b around inf
Applied rewrites75.5%
if -4.39999999999999974e142 < z < 2.70000000000000003e39Initial program 79.6%
Taylor expanded in y around -inf
Applied rewrites76.3%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (/ (+ (- t_1 (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_2 -5e-229)
(/ (+ (- t_1 (* (* z 4.0) (* a t))) b) (* z c))
(if (<= t_2 0.0)
(/ (fma -4.0 (/ (* a (* t z)) c) (fma 9.0 (/ (* x y) c) (/ b c))) z)
(if (<= t_2 INFINITY) t_2 (/ (fma -4.0 (* a t) (/ b z)) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = ((t_1 - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_2 <= -5e-229) {
tmp = ((t_1 - ((z * 4.0) * (a * t))) + b) / (z * c);
} else if (t_2 <= 0.0) {
tmp = fma(-4.0, ((a * (t * z)) / c), fma(9.0, ((x * y) / c), (b / c))) / z;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = fma(-4.0, (a * t), (b / z)) / c;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_2 <= -5e-229) tmp = Float64(Float64(Float64(t_1 - Float64(Float64(z * 4.0) * Float64(a * t))) + b) / Float64(z * c)); elseif (t_2 <= 0.0) tmp = Float64(fma(-4.0, Float64(Float64(a * Float64(t * z)) / c), fma(9.0, Float64(Float64(x * y) / c), Float64(b / c))) / z); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-229], N[(N[(N[(t$95$1 - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(-4.0 * N[(N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-229}:\\
\;\;\;\;\frac{\left(t\_1 - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right) + b}{z \cdot c}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, \frac{a \cdot \left(t \cdot z\right)}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c}, \frac{b}{c}\right)\right)}{z}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -5.00000000000000016e-229Initial program 79.6%
Applied rewrites80.4%
if -5.00000000000000016e-229 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 79.6%
Taylor expanded in z around 0
Applied rewrites75.9%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 79.6%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in t around 0
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(/
(* x (- (fma 9.0 (/ y z) (/ b (* x z))) (* 4.0 (/ (* a t) x))))
c)))
(if (<= z -1.65e+40)
t_1
(if (<= z 7.5e+127)
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * (fma(9.0, (y / z), (b / (x * z))) - (4.0 * ((a * t) / x)))) / c;
double tmp;
if (z <= -1.65e+40) {
tmp = t_1;
} else if (z <= 7.5e+127) {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * Float64(fma(9.0, Float64(y / z), Float64(b / Float64(x * z))) - Float64(4.0 * Float64(Float64(a * t) / x)))) / c) tmp = 0.0 if (z <= -1.65e+40) tmp = t_1; elseif (z <= 7.5e+127) tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * N[(N[(9.0 * N[(y / z), $MachinePrecision] + N[(b / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.65e+40], t$95$1, If[LessEqual[z, 7.5e+127], N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(\mathsf{fma}\left(9, \frac{y}{z}, \frac{b}{x \cdot z}\right) - 4 \cdot \frac{a \cdot t}{x}\right)}{c}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+127}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.6499999999999999e40 or 7.4999999999999996e127 < z Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
if -1.6499999999999999e40 < z < 7.4999999999999996e127Initial program 79.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (/ (+ (- t_1 (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_2 -2e-265)
(/ (+ (- t_1 (* (* z 4.0) (* a t))) b) (* z c))
(if (<= t_2 0.0)
(/ (* x (fma 9.0 (/ y c) (/ b (* c x)))) z)
(if (<= t_2 INFINITY) t_2 (/ (fma -4.0 (* a t) (/ b z)) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = ((t_1 - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_2 <= -2e-265) {
tmp = ((t_1 - ((z * 4.0) * (a * t))) + b) / (z * c);
} else if (t_2 <= 0.0) {
tmp = (x * fma(9.0, (y / c), (b / (c * x)))) / z;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = fma(-4.0, (a * t), (b / z)) / c;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_2 <= -2e-265) tmp = Float64(Float64(Float64(t_1 - Float64(Float64(z * 4.0) * Float64(a * t))) + b) / Float64(z * c)); elseif (t_2 <= 0.0) tmp = Float64(Float64(x * fma(9.0, Float64(y / c), Float64(b / Float64(c * x)))) / z); elseif (t_2 <= Inf) tmp = t_2; else tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-265], N[(N[(N[(t$95$1 - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(9.0 * N[(y / c), $MachinePrecision] + N[(b / N[(c * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-265}:\\
\;\;\;\;\frac{\left(t\_1 - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right) + b}{z \cdot c}\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(9, \frac{y}{c}, \frac{b}{c \cdot x}\right)}{z}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.99999999999999997e-265Initial program 79.6%
Applied rewrites80.4%
if -1.99999999999999997e-265 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in z around 0
Applied rewrites56.5%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 79.6%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in t around 0
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (/ (+ (- t_1 (* (* (* z 4.0) t) a)) b) (* z c)))
(t_3 (/ (+ (- t_1 (* (* z 4.0) (* a t))) b) (* z c))))
(if (<= t_2 -2e-265)
t_3
(if (<= t_2 0.0)
(/ (* x (fma 9.0 (/ y c) (/ b (* c x)))) z)
(if (<= t_2 INFINITY) t_3 (/ (fma -4.0 (* a t) (/ b z)) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = ((t_1 - (((z * 4.0) * t) * a)) + b) / (z * c);
double t_3 = ((t_1 - ((z * 4.0) * (a * t))) + b) / (z * c);
double tmp;
if (t_2 <= -2e-265) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = (x * fma(9.0, (y / c), (b / (c * x)))) / z;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fma(-4.0, (a * t), (b / z)) / c;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(Float64(Float64(t_1 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) t_3 = Float64(Float64(Float64(t_1 - Float64(Float64(z * 4.0) * Float64(a * t))) + b) / Float64(z * c)) tmp = 0.0 if (t_2 <= -2e-265) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(Float64(x * fma(9.0, Float64(y / c), Float64(b / Float64(c * x)))) / z); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$1 - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-265], t$95$3, If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(9.0 * N[(y / c), $MachinePrecision] + N[(b / N[(c * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\left(t\_1 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
t_3 := \frac{\left(t\_1 - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-265}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(9, \frac{y}{c}, \frac{b}{c \cdot x}\right)}{z}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.99999999999999997e-265 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 79.6%
Applied rewrites80.4%
if -1.99999999999999997e-265 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in z around 0
Applied rewrites56.5%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in t around 0
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(fma -4.0 (/ (* a t) c) (fma 9.0 (/ (* x y) (* c z)) (/ b (* c z))))))
(if (<= z -1.1e+137)
t_1
(if (<= z 9.5e+53)
(/
(+ (* -1.0 (* y (fma -9.0 x (* 4.0 (/ (* a (* t z)) y))))) b)
(* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(-4.0, ((a * t) / c), fma(9.0, ((x * y) / (c * z)), (b / (c * z))));
double tmp;
if (z <= -1.1e+137) {
tmp = t_1;
} else if (z <= 9.5e+53) {
tmp = ((-1.0 * (y * fma(-9.0, x, (4.0 * ((a * (t * z)) / y))))) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = fma(-4.0, Float64(Float64(a * t) / c), fma(9.0, Float64(Float64(x * y) / Float64(c * z)), Float64(b / Float64(c * z)))) tmp = 0.0 if (z <= -1.1e+137) tmp = t_1; elseif (z <= 9.5e+53) tmp = Float64(Float64(Float64(-1.0 * Float64(y * fma(-9.0, x, Float64(4.0 * Float64(Float64(a * Float64(t * z)) / y))))) + b) / Float64(z * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+137], t$95$1, If[LessEqual[z, 9.5e+53], N[(N[(N[(-1.0 * N[(y * N[(-9.0 * x + N[(4.0 * N[(N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot z}, \frac{b}{c \cdot z}\right)\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\
\;\;\;\;\frac{-1 \cdot \left(y \cdot \mathsf{fma}\left(-9, x, 4 \cdot \frac{a \cdot \left(t \cdot z\right)}{y}\right)\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.10000000000000008e137 or 9.5000000000000006e53 < z Initial program 79.6%
Taylor expanded in z around inf
Applied rewrites78.3%
if -1.10000000000000008e137 < z < 9.5000000000000006e53Initial program 79.6%
Taylor expanded in y around -inf
Applied rewrites76.3%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(fma -4.0 (/ (* a t) c) (fma 9.0 (/ (* x y) (* c z)) (/ b (* c z))))))
(if (<= z -1.1e+137)
t_1
(if (<= z 9.5e+53)
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(-4.0, ((a * t) / c), fma(9.0, ((x * y) / (c * z)), (b / (c * z))));
double tmp;
if (z <= -1.1e+137) {
tmp = t_1;
} else if (z <= 9.5e+53) {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = fma(-4.0, Float64(Float64(a * t) / c), fma(9.0, Float64(Float64(x * y) / Float64(c * z)), Float64(b / Float64(c * z)))) tmp = 0.0 if (z <= -1.1e+137) tmp = t_1; elseif (z <= 9.5e+53) tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.1e+137], t$95$1, If[LessEqual[z, 9.5e+53], N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, \frac{a \cdot t}{c}, \mathsf{fma}\left(9, \frac{x \cdot y}{c \cdot z}, \frac{b}{c \cdot z}\right)\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+53}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.10000000000000008e137 or 9.5000000000000006e53 < z Initial program 79.6%
Taylor expanded in z around inf
Applied rewrites78.3%
if -1.10000000000000008e137 < z < 9.5000000000000006e53Initial program 79.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (/ (fma (* a t) -4.0 (/ t_1 z)) c)))
(if (<= t_1 -5e+246)
(* x (/ (fma 9.0 (/ y c) (/ b (* c x))) z))
(if (<= t_1 -5e+114)
t_2
(if (<= t_1 5e-91) (/ (- (/ b z) (* (* t 4.0) a)) c) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = fma((a * t), -4.0, (t_1 / z)) / c;
double tmp;
if (t_1 <= -5e+246) {
tmp = x * (fma(9.0, (y / c), (b / (c * x))) / z);
} else if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 5e-91) {
tmp = ((b / z) - ((t * 4.0) * a)) / c;
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(fma(Float64(a * t), -4.0, Float64(t_1 / z)) / c) tmp = 0.0 if (t_1 <= -5e+246) tmp = Float64(x * Float64(fma(9.0, Float64(y / c), Float64(b / Float64(c * x))) / z)); elseif (t_1 <= -5e+114) tmp = t_2; elseif (t_1 <= 5e-91) tmp = Float64(Float64(Float64(b / z) - Float64(Float64(t * 4.0) * a)) / c); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+246], N[(x * N[(N[(9.0 * N[(y / c), $MachinePrecision] + N[(b / N[(c * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 5e-91], N[(N[(N[(b / z), $MachinePrecision] - N[(N[(t * 4.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{t\_1}{z}\right)}{c}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+246}:\\
\;\;\;\;x \cdot \frac{\mathsf{fma}\left(9, \frac{y}{c}, \frac{b}{c \cdot x}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{b}{z} - \left(t \cdot 4\right) \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.99999999999999976e246Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in z around 0
Applied rewrites55.3%
if -4.99999999999999976e246 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114 or 4.99999999999999997e-91 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in b around 0
Applied rewrites55.4%
Taylor expanded in x around 0
Applied rewrites60.4%
Applied rewrites62.3%
if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999997e-91Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (/ (fma (* a t) -4.0 (/ t_1 z)) c)))
(if (<= t_1 -5e+246)
(* x (* (/ y c) (/ 9.0 z)))
(if (<= t_1 -5e+114)
t_2
(if (<= t_1 5e-91) (/ (- (/ b z) (* (* t 4.0) a)) c) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = fma((a * t), -4.0, (t_1 / z)) / c;
double tmp;
if (t_1 <= -5e+246) {
tmp = x * ((y / c) * (9.0 / z));
} else if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 5e-91) {
tmp = ((b / z) - ((t * 4.0) * a)) / c;
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(fma(Float64(a * t), -4.0, Float64(t_1 / z)) / c) tmp = 0.0 if (t_1 <= -5e+246) tmp = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))); elseif (t_1 <= -5e+114) tmp = t_2; elseif (t_1 <= 5e-91) tmp = Float64(Float64(Float64(b / z) - Float64(Float64(t * 4.0) * a)) / c); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+246], N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 5e-91], N[(N[(N[(b / z), $MachinePrecision] - N[(N[(t * 4.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{t\_1}{z}\right)}{c}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+246}:\\
\;\;\;\;x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{b}{z} - \left(t \cdot 4\right) \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.99999999999999976e246Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
Applied rewrites36.7%
if -4.99999999999999976e246 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114 or 4.99999999999999997e-91 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in b around 0
Applied rewrites55.4%
Taylor expanded in x around 0
Applied rewrites60.4%
Applied rewrites62.3%
if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999997e-91Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* x (* (/ y c) (/ 9.0 z)))))
(if (<= t_1 -2e+148)
t_2
(if (<= t_1 1e+132) (/ (- (/ b z) (* (* t 4.0) a)) c) t_2))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y / c) * (9.0 / z));
double tmp;
if (t_1 <= -2e+148) {
tmp = t_2;
} else if (t_1 <= 1e+132) {
tmp = ((b / z) - ((t * 4.0) * a)) / c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = x * ((y / c) * (9.0d0 / z))
if (t_1 <= (-2d+148)) then
tmp = t_2
else if (t_1 <= 1d+132) then
tmp = ((b / z) - ((t * 4.0d0) * a)) / c
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y / c) * (9.0 / z));
double tmp;
if (t_1 <= -2e+148) {
tmp = t_2;
} else if (t_1 <= 1e+132) {
tmp = ((b / z) - ((t * 4.0) * a)) / c;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = x * ((y / c) * (9.0 / z)) tmp = 0 if t_1 <= -2e+148: tmp = t_2 elif t_1 <= 1e+132: tmp = ((b / z) - ((t * 4.0) * a)) / c else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))) tmp = 0.0 if (t_1 <= -2e+148) tmp = t_2; elseif (t_1 <= 1e+132) tmp = Float64(Float64(Float64(b / z) - Float64(Float64(t * 4.0) * a)) / c); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = x * ((y / c) * (9.0 / z));
tmp = 0.0;
if (t_1 <= -2e+148)
tmp = t_2;
elseif (t_1 <= 1e+132)
tmp = ((b / z) - ((t * 4.0) * a)) / c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+148], t$95$2, If[LessEqual[t$95$1, 1e+132], N[(N[(N[(b / z), $MachinePrecision] - N[(N[(t * 4.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+148}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+132}:\\
\;\;\;\;\frac{\frac{b}{z} - \left(t \cdot 4\right) \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.0000000000000001e148 or 9.99999999999999991e131 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
Applied rewrites36.7%
if -2.0000000000000001e148 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999991e131Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* x (* (/ y c) (/ 9.0 z)))))
(if (<= t_1 -2e+148)
t_2
(if (<= t_1 1e+132) (/ (fma -4.0 (* a t) (/ b z)) c) t_2))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y / c) * (9.0 / z));
double tmp;
if (t_1 <= -2e+148) {
tmp = t_2;
} else if (t_1 <= 1e+132) {
tmp = fma(-4.0, (a * t), (b / z)) / c;
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))) tmp = 0.0 if (t_1 <= -2e+148) tmp = t_2; elseif (t_1 <= 1e+132) tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+148], t$95$2, If[LessEqual[t$95$1, 1e+132], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+148}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+132}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.0000000000000001e148 or 9.99999999999999991e131 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
Applied rewrites36.7%
if -2.0000000000000001e148 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999991e131Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in t around 0
Applied rewrites64.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* x (* (/ y c) (/ 9.0 z)))))
(if (<= t_1 -5e+114)
t_2
(if (<= t_1 0.0)
(/ (/ b c) z)
(if (<= t_1 1e+155) (/ (* -4.0 (* a t)) c) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y / c) * (9.0 / z));
double tmp;
if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = x * ((y / c) * (9.0d0 / z))
if (t_1 <= (-5d+114)) then
tmp = t_2
else if (t_1 <= 0.0d0) then
tmp = (b / c) / z
else if (t_1 <= 1d+155) then
tmp = ((-4.0d0) * (a * t)) / c
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y / c) * (9.0 / z));
double tmp;
if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = x * ((y / c) * (9.0 / z)) tmp = 0 if t_1 <= -5e+114: tmp = t_2 elif t_1 <= 0.0: tmp = (b / c) / z elif t_1 <= 1e+155: tmp = (-4.0 * (a * t)) / c else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(x * Float64(Float64(y / c) * Float64(9.0 / z))) tmp = 0.0 if (t_1 <= -5e+114) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 1e+155) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = x * ((y / c) * (9.0 / z));
tmp = 0.0;
if (t_1 <= -5e+114)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = (b / c) / z;
elseif (t_1 <= 1e+155)
tmp = (-4.0 * (a * t)) / c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+155], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := x \cdot \left(\frac{y}{c} \cdot \frac{9}{z}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+155}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114 or 1.00000000000000001e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
Applied rewrites36.7%
if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites35.7%
if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000001e155Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in z around inf
Applied rewrites37.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -5e+114)
(* x (* 9.0 (/ y (* c z))))
(if (<= t_1 0.0)
(/ (/ b c) z)
(if (<= t_1 1e+155)
(/ (* -4.0 (* a t)) c)
(* x (/ (* y 9.0) (* c z))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -5e+114) {
tmp = x * (9.0 * (y / (c * z)));
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = x * ((y * 9.0) / (c * z));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 9.0d0) * y
if (t_1 <= (-5d+114)) then
tmp = x * (9.0d0 * (y / (c * z)))
else if (t_1 <= 0.0d0) then
tmp = (b / c) / z
else if (t_1 <= 1d+155) then
tmp = ((-4.0d0) * (a * t)) / c
else
tmp = x * ((y * 9.0d0) / (c * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -5e+114) {
tmp = x * (9.0 * (y / (c * z)));
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = x * ((y * 9.0) / (c * z));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y tmp = 0 if t_1 <= -5e+114: tmp = x * (9.0 * (y / (c * z))) elif t_1 <= 0.0: tmp = (b / c) / z elif t_1 <= 1e+155: tmp = (-4.0 * (a * t)) / c else: tmp = x * ((y * 9.0) / (c * z)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -5e+114) tmp = Float64(x * Float64(9.0 * Float64(y / Float64(c * z)))); elseif (t_1 <= 0.0) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 1e+155) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = Float64(x * Float64(Float64(y * 9.0) / Float64(c * z))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
tmp = 0.0;
if (t_1 <= -5e+114)
tmp = x * (9.0 * (y / (c * z)));
elseif (t_1 <= 0.0)
tmp = (b / c) / z;
elseif (t_1 <= 1e+155)
tmp = (-4.0 * (a * t)) / c;
else
tmp = x * ((y * 9.0) / (c * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+114], N[(x * N[(9.0 * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+155], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(x * N[(N[(y * 9.0), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;x \cdot \left(9 \cdot \frac{y}{c \cdot z}\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+155}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y \cdot 9}{c \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites35.7%
if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000001e155Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in z around inf
Applied rewrites37.9%
if 1.00000000000000001e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
Applied rewrites36.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* x (* 9.0 (/ y (* c z))))))
(if (<= t_1 -5e+114)
t_2
(if (<= t_1 0.0)
(/ (/ b c) z)
(if (<= t_1 1e+155) (/ (* -4.0 (* a t)) c) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * (9.0 * (y / (c * z)));
double tmp;
if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = x * (9.0d0 * (y / (c * z)))
if (t_1 <= (-5d+114)) then
tmp = t_2
else if (t_1 <= 0.0d0) then
tmp = (b / c) / z
else if (t_1 <= 1d+155) then
tmp = ((-4.0d0) * (a * t)) / c
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * (9.0 * (y / (c * z)));
double tmp;
if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = x * (9.0 * (y / (c * z))) tmp = 0 if t_1 <= -5e+114: tmp = t_2 elif t_1 <= 0.0: tmp = (b / c) / z elif t_1 <= 1e+155: tmp = (-4.0 * (a * t)) / c else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(x * Float64(9.0 * Float64(y / Float64(c * z)))) tmp = 0.0 if (t_1 <= -5e+114) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 1e+155) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = x * (9.0 * (y / (c * z)));
tmp = 0.0;
if (t_1 <= -5e+114)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = (b / c) / z;
elseif (t_1 <= 1e+155)
tmp = (-4.0 * (a * t)) / c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(9.0 * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+155], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := x \cdot \left(9 \cdot \frac{y}{c \cdot z}\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+155}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114 or 1.00000000000000001e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in x around inf
Applied rewrites36.7%
if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites35.7%
if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000001e155Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in z around inf
Applied rewrites37.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (/ (* x y) (* c z)))))
(if (<= t_1 -5e+114)
t_2
(if (<= t_1 0.0)
(/ (/ b c) z)
(if (<= t_1 1e+155) (/ (* -4.0 (* a t)) c) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * ((x * y) / (c * z))
if (t_1 <= (-5d+114)) then
tmp = t_2
else if (t_1 <= 0.0d0) then
tmp = (b / c) / z
else if (t_1 <= 1d+155) then
tmp = ((-4.0d0) * (a * t)) / c
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_1 <= -5e+114) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (b / c) / z;
} else if (t_1 <= 1e+155) {
tmp = (-4.0 * (a * t)) / c;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * ((x * y) / (c * z)) tmp = 0 if t_1 <= -5e+114: tmp = t_2 elif t_1 <= 0.0: tmp = (b / c) / z elif t_1 <= 1e+155: tmp = (-4.0 * (a * t)) / c else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))) tmp = 0.0 if (t_1 <= -5e+114) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(b / c) / z); elseif (t_1 <= 1e+155) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = 9.0 * ((x * y) / (c * z));
tmp = 0.0;
if (t_1 <= -5e+114)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = (b / c) / z;
elseif (t_1 <= 1e+155)
tmp = (-4.0 * (a * t)) / c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+114], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+155], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+155}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -5.0000000000000001e114 or 1.00000000000000001e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites34.7%
if -5.0000000000000001e114 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites35.7%
if -0.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000001e155Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in z around inf
Applied rewrites37.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (/ (* -4.0 (* a t)) c))) (if (<= a -6.6e-64) t_1 (if (<= a 2.4e+54) (/ (* (/ 1.0 z) b) c) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (a * t)) / c;
double tmp;
if (a <= -6.6e-64) {
tmp = t_1;
} else if (a <= 2.4e+54) {
tmp = ((1.0 / z) * b) / c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = ((-4.0d0) * (a * t)) / c
if (a <= (-6.6d-64)) then
tmp = t_1
else if (a <= 2.4d+54) then
tmp = ((1.0d0 / z) * b) / c
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (a * t)) / c;
double tmp;
if (a <= -6.6e-64) {
tmp = t_1;
} else if (a <= 2.4e+54) {
tmp = ((1.0 / z) * b) / c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (-4.0 * (a * t)) / c tmp = 0 if a <= -6.6e-64: tmp = t_1 elif a <= 2.4e+54: tmp = ((1.0 / z) * b) / c else: tmp = t_1 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * Float64(a * t)) / c) tmp = 0.0 if (a <= -6.6e-64) tmp = t_1; elseif (a <= 2.4e+54) tmp = Float64(Float64(Float64(1.0 / z) * b) / c); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (-4.0 * (a * t)) / c;
tmp = 0.0;
if (a <= -6.6e-64)
tmp = t_1;
elseif (a <= 2.4e+54)
tmp = ((1.0 / z) * b) / c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[a, -6.6e-64], t$95$1, If[LessEqual[a, 2.4e+54], N[(N[(N[(1.0 / z), $MachinePrecision] * b), $MachinePrecision] / c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{1}{z} \cdot b}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.5999999999999999e-64 or 2.39999999999999998e54 < a Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in z around inf
Applied rewrites37.9%
if -6.5999999999999999e-64 < a < 2.39999999999999998e54Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites34.3%
Applied rewrites34.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (/ (* -4.0 (* a t)) c))) (if (<= a -6.6e-64) t_1 (if (<= a 2.4e+54) (/ (/ b z) c) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (a * t)) / c;
double tmp;
if (a <= -6.6e-64) {
tmp = t_1;
} else if (a <= 2.4e+54) {
tmp = (b / z) / c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = ((-4.0d0) * (a * t)) / c
if (a <= (-6.6d-64)) then
tmp = t_1
else if (a <= 2.4d+54) then
tmp = (b / z) / c
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (-4.0 * (a * t)) / c;
double tmp;
if (a <= -6.6e-64) {
tmp = t_1;
} else if (a <= 2.4e+54) {
tmp = (b / z) / c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (-4.0 * (a * t)) / c tmp = 0 if a <= -6.6e-64: tmp = t_1 elif a <= 2.4e+54: tmp = (b / z) / c else: tmp = t_1 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(-4.0 * Float64(a * t)) / c) tmp = 0.0 if (a <= -6.6e-64) tmp = t_1; elseif (a <= 2.4e+54) tmp = Float64(Float64(b / z) / c); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (-4.0 * (a * t)) / c;
tmp = 0.0;
if (a <= -6.6e-64)
tmp = t_1;
elseif (a <= 2.4e+54)
tmp = (b / z) / c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[a, -6.6e-64], t$95$1, If[LessEqual[a, 2.4e+54], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+54}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.5999999999999999e-64 or 2.39999999999999998e54 < a Initial program 79.6%
Taylor expanded in x around inf
Applied rewrites65.5%
Taylor expanded in c around 0
Applied rewrites74.2%
Taylor expanded in z around inf
Applied rewrites37.9%
if -6.5999999999999999e-64 < a < 2.39999999999999998e54Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites34.3%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= x -6.1e+66) (/ b (* c z)) (/ (/ b c) z)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -6.1e+66) {
tmp = b / (c * z);
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (x <= (-6.1d+66)) then
tmp = b / (c * z)
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -6.1e+66) {
tmp = b / (c * z);
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if x <= -6.1e+66: tmp = b / (c * z) else: tmp = (b / c) / z return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -6.1e+66) tmp = Float64(b / Float64(c * z)); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (x <= -6.1e+66)
tmp = b / (c * z);
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -6.1e+66], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.1 \cdot 10^{+66}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if x < -6.10000000000000021e66Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
if -6.10000000000000021e66 < x Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
Applied rewrites35.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = b / (c * z)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (c * z);
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 79.6%
Taylor expanded in b around inf
Applied rewrites36.1%
herbie shell --seed 2025159
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))