
(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.
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 (* 9.0 x) (/ y z) (fma (* -4.0 a) t (/ b z))) (/ 1.0 c))))
(if (<= z -320000.0)
t_1
(if (<= z 1.65e-55)
(/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((9.0 * x), (y / z), fma((-4.0 * a), t, (b / z))) * (1.0 / c);
double tmp;
if (z <= -320000.0) {
tmp = t_1;
} else if (z <= 1.65e-55) {
tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(9.0 * x), Float64(y / z), fma(Float64(-4.0 * a), t, Float64(b / z))) * Float64(1.0 / c)) tmp = 0.0 if (z <= -320000.0) tmp = t_1; elseif (z <= 1.65e-55) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, 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.
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[(N[(9.0 * x), $MachinePrecision] * N[(y / z), $MachinePrecision] + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -320000.0], t$95$1, If[LessEqual[z, 1.65e-55], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(9 \cdot x, \frac{y}{z}, \mathsf{fma}\left(-4 \cdot a, t, \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{if}\;z \leq -320000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2e5 or 1.65e-55 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
if -3.2e5 < z < 1.65e-55Initial program 79.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites79.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* t -4.0) a (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -2.05e-128)
t_1
(if (<= z 4.8e-77)
(/ (* (/ 1.0 c) (fma (* a (* -4.0 z)) t (fma (* y x) 9.0 b))) z)
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((t * -4.0), a, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -2.05e-128) {
tmp = t_1;
} else if (z <= 4.8e-77) {
tmp = ((1.0 / c) * fma((a * (-4.0 * z)), t, fma((y * x), 9.0, b))) / z;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(t * -4.0), a, Float64(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -2.05e-128) tmp = t_1; elseif (z <= 4.8e-77) tmp = Float64(Float64(Float64(1.0 / c) * fma(Float64(a * Float64(-4.0 * z)), t, fma(Float64(y * x), 9.0, b))) / z); 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.
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[(N[(t * -4.0), $MachinePrecision] * a + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.05e-128], t$95$1, If[LessEqual[z, 4.8e-77], N[(N[(N[(1.0 / c), $MachinePrecision] * N[(N[(a * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t \cdot -4, a, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{1}{c} \cdot \mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.05e-128 or 4.7999999999999998e-77 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Applied rewrites87.2%
if -2.05e-128 < z < 4.7999999999999998e-77Initial program 79.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites79.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* t -4.0) a (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -2.05e-128)
t_1
(if (<= z 4.8e-77)
(/ (/ (fma (* a (* -4.0 z)) t (fma (* y x) 9.0 b)) c) z)
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((t * -4.0), a, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -2.05e-128) {
tmp = t_1;
} else if (z <= 4.8e-77) {
tmp = (fma((a * (-4.0 * z)), t, fma((y * x), 9.0, b)) / c) / z;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(t * -4.0), a, Float64(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -2.05e-128) tmp = t_1; elseif (z <= 4.8e-77) tmp = Float64(Float64(fma(Float64(a * Float64(-4.0 * z)), t, fma(Float64(y * x), 9.0, b)) / c) / z); 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.
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[(N[(t * -4.0), $MachinePrecision] * a + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.05e-128], t$95$1, If[LessEqual[z, 4.8e-77], N[(N[(N[(N[(a * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t \cdot -4, a, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.05e-128 or 4.7999999999999998e-77 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Applied rewrites87.2%
if -2.05e-128 < z < 4.7999999999999998e-77Initial program 79.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* t -4.0) a (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -7.5e-28)
t_1
(if (<= z 4.8e-77)
(/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((t * -4.0), a, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -7.5e-28) {
tmp = t_1;
} else if (z <= 4.8e-77) {
tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(t * -4.0), a, Float64(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -7.5e-28) tmp = t_1; elseif (z <= 4.8e-77) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, 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.
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[(N[(t * -4.0), $MachinePrecision] * a + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -7.5e-28], t$95$1, If[LessEqual[z, 4.8e-77], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t \cdot -4, a, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, \mathsf{fma}\left(y \cdot x, 9, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.5000000000000003e-28 or 4.7999999999999998e-77 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Applied rewrites87.2%
if -7.5000000000000003e-28 < z < 4.7999999999999998e-77Initial program 79.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
Applied rewrites79.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* t -4.0) a (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -2e-7)
t_1
(if (<= z 2.56e-79)
(/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) b)) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((t * -4.0), a, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -2e-7) {
tmp = t_1;
} else if (z <= 2.56e-79) {
tmp = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), b)) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(t * -4.0), a, Float64(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -2e-7) tmp = t_1; elseif (z <= 2.56e-79) tmp = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), 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.
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[(N[(t * -4.0), $MachinePrecision] * a + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2e-7], t$95$1, If[LessEqual[z, 2.56e-79], N[(N[(N[(y * 9.0), $MachinePrecision] * x + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t \cdot -4, a, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.56 \cdot 10^{-79}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9999999999999999e-7 or 2.5599999999999999e-79 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Applied rewrites87.2%
if -1.9999999999999999e-7 < z < 2.5599999999999999e-79Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* t -4.0) a (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -8e-28)
t_1
(if (<= z 1e-79)
(/ (fma (* 9.0 x) y (fma -4.0 (* (* a t) z) b)) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((t * -4.0), a, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -8e-28) {
tmp = t_1;
} else if (z <= 1e-79) {
tmp = fma((9.0 * x), y, fma(-4.0, ((a * t) * z), b)) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(t * -4.0), a, Float64(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -8e-28) tmp = t_1; elseif (z <= 1e-79) tmp = Float64(fma(Float64(9.0 * x), y, fma(-4.0, Float64(Float64(a * t) * z), 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.
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[(N[(t * -4.0), $MachinePrecision] * a + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -8e-28], t$95$1, If[LessEqual[z, 1e-79], N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(-4.0 * N[(N[(a * t), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t \cdot -4, a, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -8 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-79}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, \mathsf{fma}\left(-4, \left(a \cdot t\right) \cdot z, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999977e-28 or 1e-79 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Applied rewrites87.2%
if -7.99999999999999977e-28 < z < 1e-79Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 (* t -4.0) a (/ (fma (* y 9.0) x b) z)) c)))
(if (<= z -1.3e-131)
t_1
(if (<= z 6.6e-125) (/ 1.0 (/ (* c z) (+ b (* 9.0 (* x y))))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma((t * -4.0), a, (fma((y * 9.0), x, b) / z)) / c;
double tmp;
if (z <= -1.3e-131) {
tmp = t_1;
} else if (z <= 6.6e-125) {
tmp = 1.0 / ((c * z) / (b + (9.0 * (x * y))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(Float64(t * -4.0), a, Float64(fma(Float64(y * 9.0), x, b) / z)) / c) tmp = 0.0 if (z <= -1.3e-131) tmp = t_1; elseif (z <= 6.6e-125) tmp = Float64(1.0 / Float64(Float64(c * z) / Float64(b + Float64(9.0 * Float64(x * y))))); 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.
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[(N[(t * -4.0), $MachinePrecision] * a + N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1.3e-131], t$95$1, If[LessEqual[z, 6.6e-125], N[(1.0 / N[(N[(c * z), $MachinePrecision] / N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t \cdot -4, a, \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-125}:\\
\;\;\;\;\frac{1}{\frac{c \cdot z}{b + 9 \cdot \left(x \cdot y\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.29999999999999998e-131 or 6.6000000000000001e-125 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Applied rewrites87.2%
if -1.29999999999999998e-131 < z < 6.6000000000000001e-125Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6435.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6435.7
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.7
Applied rewrites35.7%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.2
Applied rewrites60.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) (/ b z)) c)))
(if (<= z -2.4e+102)
t_1
(if (<= z 2.2e-80)
(* (/ (+ b (* 9.0 (* x y))) c) (/ 1.0 z))
(if (<= z 4.4e+161)
(/ (fma -4.0 (* a t) (* 9.0 (/ (* x y) z))) c)
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma(-4.0, (a * t), (b / z)) / c;
double tmp;
if (z <= -2.4e+102) {
tmp = t_1;
} else if (z <= 2.2e-80) {
tmp = ((b + (9.0 * (x * y))) / c) * (1.0 / z);
} else if (z <= 4.4e+161) {
tmp = fma(-4.0, (a * t), (9.0 * ((x * y) / z))) / c;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(-4.0, Float64(a * t), Float64(b / z)) / c) tmp = 0.0 if (z <= -2.4e+102) tmp = t_1; elseif (z <= 2.2e-80) tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(x * y))) / c) * Float64(1.0 / z)); elseif (z <= 4.4e+161) tmp = Float64(fma(-4.0, Float64(a * t), Float64(9.0 * Float64(Float64(x * y) / 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.
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] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.4e+102], t$95$1, If[LessEqual[z, 2.2e-80], N[(N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+161], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-80}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c} \cdot \frac{1}{z}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+161}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.39999999999999994e102 or 4.4e161 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6464.5
Applied rewrites64.5%
if -2.39999999999999994e102 < z < 2.2000000000000001e-80Initial program 79.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
if 2.2000000000000001e-80 < z < 4.4e161Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.2
Applied rewrites63.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) (/ b z)) c)))
(if (<= z -2.4e+102)
t_1
(if (<= z 4.7e-45) (* (/ (+ b (* 9.0 (* x y))) c) (/ 1.0 z)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma(-4.0, (a * t), (b / z)) / c;
double tmp;
if (z <= -2.4e+102) {
tmp = t_1;
} else if (z <= 4.7e-45) {
tmp = ((b + (9.0 * (x * y))) / c) * (1.0 / z);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(-4.0, Float64(a * t), Float64(b / z)) / c) tmp = 0.0 if (z <= -2.4e+102) tmp = t_1; elseif (z <= 4.7e-45) tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(x * y))) / c) * Float64(1.0 / z)); 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.
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] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.4e+102], t$95$1, If[LessEqual[z, 4.7e-45], N[(N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-45}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.39999999999999994e102 or 4.6999999999999998e-45 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6464.5
Applied rewrites64.5%
if -2.39999999999999994e102 < z < 4.6999999999999998e-45Initial program 79.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) (/ b z)) c)))
(if (<= z -2.4e+102)
t_1
(if (<= z 4.7e-45) (/ (+ b (* 9.0 (* x y))) (* z c)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = fma(-4.0, (a * t), (b / z)) / c;
double tmp;
if (z <= -2.4e+102) {
tmp = t_1;
} else if (z <= 4.7e-45) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(fma(-4.0, Float64(a * t), Float64(b / z)) / c) tmp = 0.0 if (z <= -2.4e+102) tmp = t_1; elseif (z <= 4.7e-45) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / 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.
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] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.4e+102], t$95$1, If[LessEqual[z, 4.7e-45], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-45}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.39999999999999994e102 or 4.6999999999999998e-45 < z Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6464.5
Applied rewrites64.5%
if -2.39999999999999994e102 < z < 4.6999999999999998e-45Initial program 79.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 -2e+111)
(* x (* (/ y (* c z)) 9.0))
(if (<= t_1 2e+244)
(/ (fma -4.0 (* a t) (/ b z)) c)
(* 9.0 (* (/ y c) (/ x z)))))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 tmp;
if (t_1 <= -2e+111) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_1 <= 2e+244) {
tmp = fma(-4.0, (a * t), (b / z)) / c;
} else {
tmp = 9.0 * ((y / c) * (x / z));
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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 <= -2e+111) tmp = Float64(x * Float64(Float64(y / Float64(c * z)) * 9.0)); elseif (t_1 <= 2e+244) tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); else tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, -2e+111], N[(x * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+244], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[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 -2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot \left(\frac{y}{c \cdot z} \cdot 9\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+244}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1.99999999999999991e111Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6437.6
Applied rewrites37.6%
if -1.99999999999999991e111 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000015e244Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
add-to-fraction-revN/A
Applied rewrites85.3%
Taylor expanded in x around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6464.5
Applied rewrites64.5%
if 2.00000000000000015e244 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6435.8
Applied rewrites35.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 -2e+110)
(* x (* (/ y (* c z)) 9.0))
(if (<= t_1 -2e-315)
(* (* -4.0 (* a t)) (/ 1.0 c))
(if (<= t_1 2e-30)
(/ b (* c z))
(if (<= t_1 1e+42)
(* -4.0 (/ (* a t) c))
(* y (/ (* x 9.0) (* c z)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 tmp;
if (t_1 <= -2e+110) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_1 <= -2e-315) {
tmp = (-4.0 * (a * t)) * (1.0 / c);
} else if (t_1 <= 2e-30) {
tmp = b / (c * z);
} else if (t_1 <= 1e+42) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = y * ((x * 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.
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 <= (-2d+110)) then
tmp = x * ((y / (c * z)) * 9.0d0)
else if (t_1 <= (-2d-315)) then
tmp = ((-4.0d0) * (a * t)) * (1.0d0 / c)
else if (t_1 <= 2d-30) then
tmp = b / (c * z)
else if (t_1 <= 1d+42) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = y * ((x * 9.0d0) / (c * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 <= -2e+110) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_1 <= -2e-315) {
tmp = (-4.0 * (a * t)) * (1.0 / c);
} else if (t_1 <= 2e-30) {
tmp = b / (c * z);
} else if (t_1 <= 1e+42) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = y * ((x * 9.0) / (c * z));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [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 <= -2e+110: tmp = x * ((y / (c * z)) * 9.0) elif t_1 <= -2e-315: tmp = (-4.0 * (a * t)) * (1.0 / c) elif t_1 <= 2e-30: tmp = b / (c * z) elif t_1 <= 1e+42: tmp = -4.0 * ((a * t) / c) else: tmp = y * ((x * 9.0) / (c * z)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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 <= -2e+110) tmp = Float64(x * Float64(Float64(y / Float64(c * z)) * 9.0)); elseif (t_1 <= -2e-315) tmp = Float64(Float64(-4.0 * Float64(a * t)) * Float64(1.0 / c)); elseif (t_1 <= 2e-30) tmp = Float64(b / Float64(c * z)); elseif (t_1 <= 1e+42) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(y * Float64(Float64(x * 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])){:}
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 <= -2e+110)
tmp = x * ((y / (c * z)) * 9.0);
elseif (t_1 <= -2e-315)
tmp = (-4.0 * (a * t)) * (1.0 / c);
elseif (t_1 <= 2e-30)
tmp = b / (c * z);
elseif (t_1 <= 1e+42)
tmp = -4.0 * ((a * t) / c);
else
tmp = y * ((x * 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.
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, -2e+110], N[(x * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-315], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-30], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+42], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x * 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])\\\\
[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 -2 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \left(\frac{y}{c \cdot z} \cdot 9\right)\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-315}:\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right)\right) \cdot \frac{1}{c}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-30}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{+42}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x \cdot 9}{c \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e110Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6437.6
Applied rewrites37.6%
if -2e110 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.0000000019e-315Initial program 79.8%
lift-+.f64N/A
add-flipN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate--l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites81.0%
Applied rewrites82.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
if -2.0000000019e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2e-30Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
if 2e-30 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000004e42Initial program 79.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
if 1.00000000000000004e42 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.7
Applied rewrites37.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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))) (t_2 (* (* x 9.0) y)))
(if (<= t_2 -2e+110)
(* x (* (/ y (* c z)) 9.0))
(if (<= t_2 -2e-315)
t_1
(if (<= t_2 2e-30)
(/ b (* c z))
(if (<= t_2 1e+42) t_1 (* y (/ (* x 9.0) (* c z)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
double t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -2e+110) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_2 <= -2e-315) {
tmp = t_1;
} else if (t_2 <= 2e-30) {
tmp = b / (c * z);
} else if (t_2 <= 1e+42) {
tmp = t_1;
} else {
tmp = y * ((x * 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.
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 = (-4.0d0) * ((a * t) / c)
t_2 = (x * 9.0d0) * y
if (t_2 <= (-2d+110)) then
tmp = x * ((y / (c * z)) * 9.0d0)
else if (t_2 <= (-2d-315)) then
tmp = t_1
else if (t_2 <= 2d-30) then
tmp = b / (c * z)
else if (t_2 <= 1d+42) then
tmp = t_1
else
tmp = y * ((x * 9.0d0) / (c * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -2e+110) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_2 <= -2e-315) {
tmp = t_1;
} else if (t_2 <= 2e-30) {
tmp = b / (c * z);
} else if (t_2 <= 1e+42) {
tmp = t_1;
} else {
tmp = y * ((x * 9.0) / (c * z));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [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) t_2 = (x * 9.0) * y tmp = 0 if t_2 <= -2e+110: tmp = x * ((y / (c * z)) * 9.0) elif t_2 <= -2e-315: tmp = t_1 elif t_2 <= 2e-30: tmp = b / (c * z) elif t_2 <= 1e+42: tmp = t_1 else: tmp = y * ((x * 9.0) / (c * z)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(-4.0 * Float64(Float64(a * t) / c)) t_2 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_2 <= -2e+110) tmp = Float64(x * Float64(Float64(y / Float64(c * z)) * 9.0)); elseif (t_2 <= -2e-315) tmp = t_1; elseif (t_2 <= 2e-30) tmp = Float64(b / Float64(c * z)); elseif (t_2 <= 1e+42) tmp = t_1; else tmp = Float64(y * Float64(Float64(x * 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])){:}
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);
t_2 = (x * 9.0) * y;
tmp = 0.0;
if (t_2 <= -2e+110)
tmp = x * ((y / (c * z)) * 9.0);
elseif (t_2 <= -2e-315)
tmp = t_1;
elseif (t_2 <= 2e-30)
tmp = b / (c * z);
elseif (t_2 <= 1e+42)
tmp = t_1;
else
tmp = y * ((x * 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.
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]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+110], N[(x * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-315], t$95$1, If[LessEqual[t$95$2, 2e-30], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+42], t$95$1, N[(y * N[(N[(x * 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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
t_2 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \left(\frac{y}{c \cdot z} \cdot 9\right)\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-315}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-30}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_2 \leq 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x \cdot 9}{c \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e110Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6437.6
Applied rewrites37.6%
if -2e110 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.0000000019e-315 or 2e-30 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000004e42Initial program 79.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
if -2.0000000019e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2e-30Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
if 1.00000000000000004e42 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6437.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.7
Applied rewrites37.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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))) (t_2 (* (* x 9.0) y)))
(if (<= t_2 -2e+110)
(* x (* (/ y (* c z)) 9.0))
(if (<= t_2 -2e-315)
t_1
(if (<= t_2 2e-30)
(/ b (* c z))
(if (<= t_2 1e+42) t_1 (* 9.0 (/ (* x y) (* c z)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
double t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -2e+110) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_2 <= -2e-315) {
tmp = t_1;
} else if (t_2 <= 2e-30) {
tmp = b / (c * z);
} else if (t_2 <= 1e+42) {
tmp = t_1;
} else {
tmp = 9.0 * ((x * y) / (c * z));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 = (-4.0d0) * ((a * t) / c)
t_2 = (x * 9.0d0) * y
if (t_2 <= (-2d+110)) then
tmp = x * ((y / (c * z)) * 9.0d0)
else if (t_2 <= (-2d-315)) then
tmp = t_1
else if (t_2 <= 2d-30) then
tmp = b / (c * z)
else if (t_2 <= 1d+42) then
tmp = t_1
else
tmp = 9.0d0 * ((x * y) / (c * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -2e+110) {
tmp = x * ((y / (c * z)) * 9.0);
} else if (t_2 <= -2e-315) {
tmp = t_1;
} else if (t_2 <= 2e-30) {
tmp = b / (c * z);
} else if (t_2 <= 1e+42) {
tmp = t_1;
} else {
tmp = 9.0 * ((x * y) / (c * z));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [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) t_2 = (x * 9.0) * y tmp = 0 if t_2 <= -2e+110: tmp = x * ((y / (c * z)) * 9.0) elif t_2 <= -2e-315: tmp = t_1 elif t_2 <= 2e-30: tmp = b / (c * z) elif t_2 <= 1e+42: tmp = t_1 else: tmp = 9.0 * ((x * y) / (c * z)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(-4.0 * Float64(Float64(a * t) / c)) t_2 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_2 <= -2e+110) tmp = Float64(x * Float64(Float64(y / Float64(c * z)) * 9.0)); elseif (t_2 <= -2e-315) tmp = t_1; elseif (t_2 <= 2e-30) tmp = Float64(b / Float64(c * z)); elseif (t_2 <= 1e+42) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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);
t_2 = (x * 9.0) * y;
tmp = 0.0;
if (t_2 <= -2e+110)
tmp = x * ((y / (c * z)) * 9.0);
elseif (t_2 <= -2e-315)
tmp = t_1;
elseif (t_2 <= 2e-30)
tmp = b / (c * z);
elseif (t_2 <= 1e+42)
tmp = t_1;
else
tmp = 9.0 * ((x * y) / (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.
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]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+110], N[(x * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e-315], t$95$1, If[LessEqual[t$95$2, 2e-30], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+42], t$95$1, N[(9.0 * N[(N[(x * y), $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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
t_2 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \left(\frac{y}{c \cdot z} \cdot 9\right)\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-315}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-30}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_2 \leq 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e110Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6437.6
Applied rewrites37.6%
if -2e110 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.0000000019e-315 or 2e-30 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000004e42Initial program 79.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
if -2.0000000019e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2e-30Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
if 1.00000000000000004e42 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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)))
(t_2 (* (* x 9.0) y))
(t_3 (* 9.0 (/ (* x y) (* c z)))))
(if (<= t_2 -2e+110)
t_3
(if (<= t_2 -2e-315)
t_1
(if (<= t_2 2e-30) (/ b (* c z)) (if (<= t_2 1e+42) t_1 t_3))))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
double t_2 = (x * 9.0) * y;
double t_3 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_2 <= -2e+110) {
tmp = t_3;
} else if (t_2 <= -2e-315) {
tmp = t_1;
} else if (t_2 <= 2e-30) {
tmp = b / (c * z);
} else if (t_2 <= 1e+42) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * ((a * t) / c)
t_2 = (x * 9.0d0) * y
t_3 = 9.0d0 * ((x * y) / (c * z))
if (t_2 <= (-2d+110)) then
tmp = t_3
else if (t_2 <= (-2d-315)) then
tmp = t_1
else if (t_2 <= 2d-30) then
tmp = b / (c * z)
else if (t_2 <= 1d+42) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 t_2 = (x * 9.0) * y;
double t_3 = 9.0 * ((x * y) / (c * z));
double tmp;
if (t_2 <= -2e+110) {
tmp = t_3;
} else if (t_2 <= -2e-315) {
tmp = t_1;
} else if (t_2 <= 2e-30) {
tmp = b / (c * z);
} else if (t_2 <= 1e+42) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [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) t_2 = (x * 9.0) * y t_3 = 9.0 * ((x * y) / (c * z)) tmp = 0 if t_2 <= -2e+110: tmp = t_3 elif t_2 <= -2e-315: tmp = t_1 elif t_2 <= 2e-30: tmp = b / (c * z) elif t_2 <= 1e+42: tmp = t_1 else: tmp = t_3 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(-4.0 * Float64(Float64(a * t) / c)) t_2 = Float64(Float64(x * 9.0) * y) t_3 = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))) tmp = 0.0 if (t_2 <= -2e+110) tmp = t_3; elseif (t_2 <= -2e-315) tmp = t_1; elseif (t_2 <= 2e-30) tmp = Float64(b / Float64(c * z)); elseif (t_2 <= 1e+42) tmp = t_1; else tmp = t_3; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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);
t_2 = (x * 9.0) * y;
t_3 = 9.0 * ((x * y) / (c * z));
tmp = 0.0;
if (t_2 <= -2e+110)
tmp = t_3;
elseif (t_2 <= -2e-315)
tmp = t_1;
elseif (t_2 <= 2e-30)
tmp = b / (c * z);
elseif (t_2 <= 1e+42)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+110], t$95$3, If[LessEqual[t$95$2, -2e-315], t$95$1, If[LessEqual[t$95$2, 2e-30], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+42], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
t_2 := \left(x \cdot 9\right) \cdot y\\
t_3 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+110}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-315}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-30}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;t\_2 \leq 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e110 or 1.00000000000000004e42 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
if -2e110 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.0000000019e-315 or 2e-30 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000004e42Initial program 79.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
if -2.0000000019e-315 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2e-30Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. 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 (<= z -1.05e+73) t_1 (if (<= z 4.5e-77) (* (/ 1.0 (* c z)) b) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < 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 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -1.05e+73) {
tmp = t_1;
} else if (z <= 4.5e-77) {
tmp = (1.0 / (c * z)) * b;
} 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.
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 (z <= (-1.05d+73)) then
tmp = t_1
else if (z <= 4.5d-77) then
tmp = (1.0d0 / (c * z)) * b
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 (z <= -1.05e+73) {
tmp = t_1;
} else if (z <= 4.5e-77) {
tmp = (1.0 / (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [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 z <= -1.05e+73: tmp = t_1 elif z <= 4.5e-77: tmp = (1.0 / (c * z)) * b else: tmp = t_1 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (z <= -1.05e+73) tmp = t_1; elseif (z <= 4.5e-77) tmp = Float64(Float64(1.0 / Float64(c * z)) * b); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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 (z <= -1.05e+73)
tmp = t_1;
elseif (z <= 4.5e-77)
tmp = (1.0 / (c * z)) * b;
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.
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]), $MachinePrecision]}, If[LessEqual[z, -1.05e+73], t$95$1, If[LessEqual[z, 4.5e-77], N[(N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{1}{c \cdot z} \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0500000000000001e73 or 4.5000000000000001e-77 < z Initial program 79.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
if -1.0500000000000001e73 < z < 4.5000000000000001e-77Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.9
Applied rewrites35.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 c) z)))
(if (<= b -230000000.0)
t_1
(if (<= b 1.12e+147) (* -4.0 (/ (* a t) c)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < 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 = (b / c) / z;
double tmp;
if (b <= -230000000.0) {
tmp = t_1;
} else if (b <= 1.12e+147) {
tmp = -4.0 * ((a * t) / 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.
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 = (b / c) / z
if (b <= (-230000000.0d0)) then
tmp = t_1
else if (b <= 1.12d+147) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
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 = (b / c) / z;
double tmp;
if (b <= -230000000.0) {
tmp = t_1;
} else if (b <= 1.12e+147) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [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 = (b / c) / z tmp = 0 if b <= -230000000.0: tmp = t_1 elif b <= 1.12e+147: tmp = -4.0 * ((a * t) / c) else: tmp = t_1 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) 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 / c) / z) tmp = 0.0 if (b <= -230000000.0) tmp = t_1; elseif (b <= 1.12e+147) tmp = Float64(-4.0 * Float64(Float64(a * t) / 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])){:}
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 = (b / c) / z;
tmp = 0.0;
if (b <= -230000000.0)
tmp = t_1;
elseif (b <= 1.12e+147)
tmp = -4.0 * ((a * t) / 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.
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 / c), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[b, -230000000.0], t$95$1, If[LessEqual[b, 1.12e+147], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / 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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{b}{c}}{z}\\
\mathbf{if}\;b \leq -230000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.12 \cdot 10^{+147}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.3e8 or 1.12e147 < b Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6435.4
Applied rewrites35.4%
if -2.3e8 < b < 1.12e147Initial program 79.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.6
Applied rewrites38.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. 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);
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.
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;
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]) [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]) 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(Float64(b / c) / z) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
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. 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[(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])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{\frac{b}{c}}{z}
\end{array}
Initial program 79.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6435.4
Applied rewrites35.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. 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);
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.
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;
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]) [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]) 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])){:}
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. 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])\\\\
[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.8%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
herbie shell --seed 2025155
(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)))