
(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 21 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
(if (<= z -1.1e+26)
(/ (* y (fma -4.0 (/ (* a t) y) (fma 9.0 (/ x z) (/ b (* y z))))) c)
(if (<= z 3000.0)
(/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
(/ (/ (fma (* x 9.0) y (fma (* (* t a) z) -4.0 b)) z) c))))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 tmp;
if (z <= -1.1e+26) {
tmp = (y * fma(-4.0, ((a * t) / y), fma(9.0, (x / z), (b / (y * z))))) / c;
} else if (z <= 3000.0) {
tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
} else {
tmp = (fma((x * 9.0), y, fma(((t * a) * z), -4.0, b)) / z) / c;
}
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) tmp = 0.0 if (z <= -1.1e+26) tmp = Float64(Float64(y * fma(-4.0, Float64(Float64(a * t) / y), fma(9.0, Float64(x / z), Float64(b / Float64(y * z))))) / c); elseif (z <= 3000.0) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c)); else tmp = Float64(Float64(fma(Float64(x * 9.0), y, fma(Float64(Float64(t * a) * z), -4.0, b)) / z) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.1e+26], N[(N[(y * N[(-4.0 * N[(N[(a * t), $MachinePrecision] / y), $MachinePrecision] + N[(9.0 * N[(x / z), $MachinePrecision] + N[(b / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 3000.0], 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], N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y + N[(N[(N[(t * a), $MachinePrecision] * z), $MachinePrecision] * -4.0 + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $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}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+26}:\\
\;\;\;\;\frac{y \cdot \mathsf{fma}\left(-4, \frac{a \cdot t}{y}, \mathsf{fma}\left(9, \frac{x}{z}, \frac{b}{y \cdot z}\right)\right)}{c}\\
\mathbf{elif}\;z \leq 3000:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot 9, y, \mathsf{fma}\left(\left(t \cdot a\right) \cdot z, -4, b\right)\right)}{z}}{c}\\
\end{array}
\end{array}
if z < -1.10000000000000004e26Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6474.7
Applied rewrites74.7%
if -1.10000000000000004e26 < z < 3e3Initial program 79.5%
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 rewrites80.0%
if 3e3 < z Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
lift-fma.f64N/A
+-commutativeN/A
*-rgt-identityN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
Applied rewrites82.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) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -2e-133)
(/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
(if (<= t_1 0.0)
(/ (fma -4.0 (* a t) (/ b z)) c)
(if (<= t_1 1e+282)
(/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) b)) (* z c))
(fma (* -4.0 a) (/ t c) (* (* 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 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -2e-133) {
tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
} else if (t_1 <= 0.0) {
tmp = fma(-4.0, (a * t), (b / z)) / c;
} else if (t_1 <= 1e+282) {
tmp = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), b)) / (z * c);
} else {
tmp = fma((-4.0 * a), (t / c), ((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(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-133) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c)); elseif (t_1 <= 0.0) tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); elseif (t_1 <= 1e+282) tmp = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c)); else tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * 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[(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]}, If[LessEqual[t$95$1, -2e-133], 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], If[LessEqual[t$95$1, 0.0], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+282], 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], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $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 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-133}:\\
\;\;\;\;\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{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+282}:\\
\;\;\;\;\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}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -2.0000000000000001e-133Initial program 79.5%
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 rewrites80.0%
if -2.0000000000000001e-133 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 1.00000000000000003e282Initial program 79.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negate-revN/A
add-flip-revN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
add-flip-revN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.4%
if 1.00000000000000003e282 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
(t_2 (/ (fma (* y 9.0) x (fma -4.0 (* (* a t) z) b)) (* z c))))
(if (<= t_1 -2e-133)
t_2
(if (<= t_1 0.0)
(/ (fma -4.0 (* a t) (/ b z)) c)
(if (<= t_1 1e+282)
t_2
(fma (* -4.0 a) (/ t c) (* (* 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 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double t_2 = fma((y * 9.0), x, fma(-4.0, ((a * t) * z), b)) / (z * c);
double tmp;
if (t_1 <= -2e-133) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = fma(-4.0, (a * t), (b / z)) / c;
} else if (t_1 <= 1e+282) {
tmp = t_2;
} else {
tmp = fma((-4.0 * a), (t / c), ((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(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) t_2 = Float64(fma(Float64(y * 9.0), x, fma(-4.0, Float64(Float64(a * t) * z), b)) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-133) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); elseif (t_1 <= 1e+282) tmp = t_2; else tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * 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[(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]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$1, -2e-133], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+282], t$95$2, N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $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 := \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}\\
t_2 := \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{if}\;t\_1 \leq -2 \cdot 10^{-133}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+282}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -2.0000000000000001e-133 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 1.00000000000000003e282Initial program 79.5%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negate-revN/A
add-flip-revN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
add-flip-revN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
add-flip-revN/A
Applied rewrites80.4%
if -2.0000000000000001e-133 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
if 1.00000000000000003e282 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.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 (if (<= (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2e+247) (/ (/ (fma (* x 9.0) y (fma (* (* t a) z) -4.0 b)) z) c) (fma (* -4.0 a) (/ t c) (* (* 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 tmp;
if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= 2e+247) {
tmp = (fma((x * 9.0), y, fma(((t * a) * z), -4.0, b)) / z) / c;
} else {
tmp = fma((-4.0 * a), (t / c), ((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) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) <= 2e+247) tmp = Float64(Float64(fma(Float64(x * 9.0), y, fma(Float64(Float64(t * a) * z), -4.0, b)) / z) / c); else tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * 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_] := If[LessEqual[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], 2e+247], N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y + N[(N[(N[(t * a), $MachinePrecision] * z), $MachinePrecision] * -4.0 + b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $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}
\mathbf{if}\;\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} \leq 2 \cdot 10^{+247}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x \cdot 9, y, \mathsf{fma}\left(\left(t \cdot a\right) \cdot z, -4, b\right)\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 1.9999999999999999e247Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
lift-fma.f64N/A
+-commutativeN/A
*-rgt-identityN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
Applied rewrites82.8%
if 1.9999999999999999e247 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_1 -1e-144)
(/ (fma (* (* -4.0 z) a) t (fma (* y x) 9.0 b)) (* z c))
(if (<= t_1 2e+178)
(/ (/ (fma (* t (* -4.0 a)) z (fma (* x y) 9.0 b)) c) z)
(fma (* -4.0 a) (/ t c) (* (* 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 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_1 <= -1e-144) {
tmp = fma(((-4.0 * z) * a), t, fma((y * x), 9.0, b)) / (z * c);
} else if (t_1 <= 2e+178) {
tmp = (fma((t * (-4.0 * a)), z, fma((x * y), 9.0, b)) / c) / z;
} else {
tmp = fma((-4.0 * a), (t / c), ((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(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -1e-144) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, fma(Float64(y * x), 9.0, b)) / Float64(z * c)); elseif (t_1 <= 2e+178) tmp = Float64(Float64(fma(Float64(t * Float64(-4.0 * a)), z, fma(Float64(x * y), 9.0, b)) / c) / z); else tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * 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[(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]}, If[LessEqual[t$95$1, -1e-144], 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], If[LessEqual[t$95$1, 2e+178], N[(N[(N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * z + N[(N[(x * y), $MachinePrecision] * 9.0 + b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $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 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-144}:\\
\;\;\;\;\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{elif}\;t\_1 \leq 2 \cdot 10^{+178}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(t \cdot \left(-4 \cdot a\right), z, \mathsf{fma}\left(x \cdot y, 9, b\right)\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -9.9999999999999995e-145Initial program 79.5%
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 rewrites80.0%
if -9.9999999999999995e-145 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 2.0000000000000001e178Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Applied rewrites80.9%
if 2.0000000000000001e178 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.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
(let* ((t_1 (fma (* y x) 9.0 b))
(t_2 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))))
(if (<= t_2 -2e-89)
(/ (fma (* (* -4.0 z) a) t t_1) (* z c))
(if (<= t_2 5e+181)
(/ (/ (fma (* a (* -4.0 z)) t t_1) z) c)
(fma (* -4.0 a) (/ t c) (* (* 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 = fma((y * x), 9.0, b);
double t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
double tmp;
if (t_2 <= -2e-89) {
tmp = fma(((-4.0 * z) * a), t, t_1) / (z * c);
} else if (t_2 <= 5e+181) {
tmp = (fma((a * (-4.0 * z)), t, t_1) / z) / c;
} else {
tmp = fma((-4.0 * a), (t / c), ((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 = fma(Float64(y * x), 9.0, b) t_2 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) tmp = 0.0 if (t_2 <= -2e-89) tmp = Float64(fma(Float64(Float64(-4.0 * z) * a), t, t_1) / Float64(z * c)); elseif (t_2 <= 5e+181) tmp = Float64(Float64(fma(Float64(a * Float64(-4.0 * z)), t, t_1) / z) / c); else tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * 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[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -2e-89], N[(N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t + t$95$1), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+181], N[(N[(N[(N[(a * N[(-4.0 * z), $MachinePrecision]), $MachinePrecision] * t + t$95$1), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $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 := \mathsf{fma}\left(y \cdot x, 9, b\right)\\
t_2 := \frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-4 \cdot z\right) \cdot a, t, t\_1\right)}{z \cdot c}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+181}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(a \cdot \left(-4 \cdot z\right), t, t\_1\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -2.00000000000000008e-89Initial program 79.5%
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 rewrites80.0%
if -2.00000000000000008e-89 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 5.0000000000000003e181Initial program 79.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.1%
if 5.0000000000000003e181 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.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
(if (<= b -1.7e+71)
(fma (* t -4.0) (/ a c) (/ b (* c z)))
(if (<= b -5.2e-135)
(fma (* -4.0 a) (/ t c) (* (* 9.0 x) (/ y (* c z))))
(if (<= b 1e-30)
(/ (fma -4.0 (* a t) (* 9.0 (/ (* x y) z))) c)
(/ (fma -4.0 (* a t) (/ b z)) c)))))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 tmp;
if (b <= -1.7e+71) {
tmp = fma((t * -4.0), (a / c), (b / (c * z)));
} else if (b <= -5.2e-135) {
tmp = fma((-4.0 * a), (t / c), ((9.0 * x) * (y / (c * z))));
} else if (b <= 1e-30) {
tmp = fma(-4.0, (a * t), (9.0 * ((x * y) / z))) / c;
} else {
tmp = fma(-4.0, (a * t), (b / z)) / c;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.7e+71) tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z))); elseif (b <= -5.2e-135) tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * z)))); elseif (b <= 1e-30) tmp = Float64(fma(-4.0, Float64(a * t), Float64(9.0 * Float64(Float64(x * y) / z))) / c); else tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1.7e+71], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5.2e-135], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-30], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{elif}\;b \leq -5.2 \cdot 10^{-135}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\mathbf{elif}\;b \leq 10^{-30}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if b < -1.6999999999999999e71Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
lift-fma.f64N/A
add-flipN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
sub-flipN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
associate-/l*N/A
Applied rewrites62.9%
if -1.6999999999999999e71 < b < -5.20000000000000008e-135Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.6%
if -5.20000000000000008e-135 < b < 1e-30Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.8
Applied rewrites63.8%
if 1e-30 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.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 (* (* x 9.0) y)))
(if (<= t_1 -4e+158)
(fma (/ x z) (/ (* y 9.0) c) (* (/ (* a t) c) -4.0))
(if (<= t_1 2.0)
(fma (* t -4.0) (/ a c) (/ b (* c z)))
(fma (* -4.0 a) (/ t c) (* (* 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 = (x * 9.0) * y;
double tmp;
if (t_1 <= -4e+158) {
tmp = fma((x / z), ((y * 9.0) / c), (((a * t) / c) * -4.0));
} else if (t_1 <= 2.0) {
tmp = fma((t * -4.0), (a / c), (b / (c * z)));
} else {
tmp = fma((-4.0 * a), (t / c), ((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(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -4e+158) tmp = fma(Float64(x / z), Float64(Float64(y * 9.0) / c), Float64(Float64(Float64(a * t) / c) * -4.0)); elseif (t_1 <= 2.0) tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z))); else tmp = fma(Float64(-4.0 * a), Float64(t / c), Float64(Float64(9.0 * x) * Float64(y / Float64(c * 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, -4e+158], N[(N[(x / z), $MachinePrecision] * N[(N[(y * 9.0), $MachinePrecision] / c), $MachinePrecision] + N[(N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision] + N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $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 -4 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, \frac{y \cdot 9}{c}, \frac{a \cdot t}{c} \cdot -4\right)\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot a, \frac{t}{c}, \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -3.99999999999999981e158Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites62.1%
if -3.99999999999999981e158 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
lift-fma.f64N/A
add-flipN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
sub-flipN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
associate-/l*N/A
Applied rewrites62.9%
if 2 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.0
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6464.6
Applied rewrites64.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
(if (<= b -3e+33)
(fma (* t -4.0) (/ a c) (/ b (* c z)))
(if (<= b 1e-30)
(/ (fma -4.0 (* a t) (* 9.0 (/ (* x y) z))) c)
(/ (fma -4.0 (* a t) (/ b z)) c))))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 tmp;
if (b <= -3e+33) {
tmp = fma((t * -4.0), (a / c), (b / (c * z)));
} else if (b <= 1e-30) {
tmp = fma(-4.0, (a * t), (9.0 * ((x * y) / z))) / c;
} else {
tmp = fma(-4.0, (a * t), (b / z)) / c;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -3e+33) tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z))); elseif (b <= 1e-30) tmp = Float64(fma(-4.0, Float64(a * t), Float64(9.0 * Float64(Float64(x * y) / z))) / c); else tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3e+33], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-30], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{elif}\;b \leq 10^{-30}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, 9 \cdot \frac{x \cdot y}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if b < -2.99999999999999984e33Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
lift-fma.f64N/A
add-flipN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
sub-flipN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
associate-/l*N/A
Applied rewrites62.9%
if -2.99999999999999984e33 < b < 1e-30Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.8
Applied rewrites63.8%
if 1e-30 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.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 (* (* x 9.0) y)))
(if (<= t_1 -5e+184)
(/ (* 9.0 (* (/ y z) x)) c)
(if (<= t_1 1e+104)
(fma (* t -4.0) (/ a c) (/ b (* c z)))
(/ (/ (fma (* y x) 9.0 b) z) c)))))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 <= -5e+184) {
tmp = (9.0 * ((y / z) * x)) / c;
} else if (t_1 <= 1e+104) {
tmp = fma((t * -4.0), (a / c), (b / (c * z)));
} else {
tmp = (fma((y * x), 9.0, b) / z) / c;
}
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 <= -5e+184) tmp = Float64(Float64(9.0 * Float64(Float64(y / z) * x)) / c); elseif (t_1 <= 1e+104) tmp = fma(Float64(t * -4.0), Float64(a / c), Float64(b / Float64(c * z))); else tmp = Float64(Float64(fma(Float64(y * x), 9.0, b) / z) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+184], N[(N[(9.0 * N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+104], N[(N[(t * -4.0), $MachinePrecision] * N[(a / c), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $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 -5 \cdot 10^{+184}:\\
\;\;\;\;\frac{9 \cdot \left(\frac{y}{z} \cdot x\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot -4, \frac{a}{c}, \frac{b}{c \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.9999999999999999e184Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.8
Applied rewrites35.8%
if -4.9999999999999999e184 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e104Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
lift-fma.f64N/A
add-flipN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
sub-flipN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
associate-/l*N/A
Applied rewrites62.9%
if 1e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.1
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f6459.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.1
Applied rewrites59.1%
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 -1e+87)
(/ (fma (* y 9.0) x b) (* z c))
(if (<= t_1 1e+104)
(/ (fma -4.0 (* a t) (/ b z)) c)
(/ (/ (fma (* y x) 9.0 b) z) c)))))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 <= -1e+87) {
tmp = fma((y * 9.0), x, b) / (z * c);
} else if (t_1 <= 1e+104) {
tmp = fma(-4.0, (a * t), (b / z)) / c;
} else {
tmp = (fma((y * x), 9.0, b) / z) / c;
}
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 <= -1e+87) tmp = Float64(fma(Float64(y * 9.0), x, b) / Float64(z * c)); elseif (t_1 <= 1e+104) tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); else tmp = Float64(Float64(fma(Float64(y * x), 9.0, b) / z) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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, -1e+87], N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+104], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $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 -1 \cdot 10^{+87}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 10^{+104}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999996e86Initial program 79.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.1
Applied rewrites60.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
if -9.9999999999999996e86 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e104Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
if 1e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.1
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f6459.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.1
Applied rewrites59.1%
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)) (t_2 (/ (fma (* y 9.0) x b) (* z c))))
(if (<= t_1 -1e+87)
t_2
(if (<= t_1 1e+104) (/ (fma -4.0 (* a t) (/ b z)) c) t_2))))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 t_2 = fma((y * 9.0), x, b) / (z * c);
double tmp;
if (t_1 <= -1e+87) {
tmp = t_2;
} else if (t_1 <= 1e+104) {
tmp = fma(-4.0, (a * t), (b / z)) / c;
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(fma(Float64(y * 9.0), x, b) / Float64(z * c)) tmp = 0.0 if (t_1 <= -1e+87) tmp = t_2; elseif (t_1 <= 1e+104) tmp = Float64(fma(-4.0, Float64(a * t), Float64(b / z)) / c); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+87], t$95$2, If[LessEqual[t$95$1, 1e+104], N[(N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+87}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+104}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot t, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.9999999999999996e86 or 1e104 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 79.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.1
Applied rewrites60.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
if -9.9999999999999996e86 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1e104Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+r+N/A
div-addN/A
lower-+.f64N/A
Applied rewrites68.8%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
Taylor expanded in c around 0
lower-/.f64N/A
lower-fma.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 (* -4.0 (/ (* a t) c))))
(if (<= z -1.8e+145)
t_1
(if (<= z 1.2e+178) (/ (fma (* y 9.0) x 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 = -4.0 * ((a * t) / c);
double tmp;
if (z <= -1.8e+145) {
tmp = t_1;
} else if (z <= 1.2e+178) {
tmp = fma((y * 9.0), x, 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(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (z <= -1.8e+145) tmp = t_1; elseif (z <= 1.2e+178) tmp = Float64(fma(Float64(y * 9.0), x, 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[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+145], t$95$1, If[LessEqual[z, 1.2e+178], N[(N[(N[(y * 9.0), $MachinePrecision] * x + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[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.8 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+178}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot 9, x, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.79999999999999987e145 or 1.2e178 < z Initial program 79.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if -1.79999999999999987e145 < z < 1.2e178Initial program 79.5%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6460.1
Applied rewrites60.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6460.1
Applied rewrites60.1%
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 (<= b -9e+59)
(/ b (* c z))
(if (<= b -7.2e-78)
t_1
(if (<= b -7.4e-177)
(/ (* (* 9.0 y) (/ x z)) c)
(if (<= b 5.2e-272)
t_1
(if (<= b 2.6e-26)
(/ (/ (* (* 9.0 x) y) z) c)
(if (<= b 7e+163) t_1 (/ (/ b z) c)))))))))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 (b <= -9e+59) {
tmp = b / (c * z);
} else if (b <= -7.2e-78) {
tmp = t_1;
} else if (b <= -7.4e-177) {
tmp = ((9.0 * y) * (x / z)) / c;
} else if (b <= 5.2e-272) {
tmp = t_1;
} else if (b <= 2.6e-26) {
tmp = (((9.0 * x) * y) / z) / c;
} else if (b <= 7e+163) {
tmp = t_1;
} else {
tmp = (b / z) / c;
}
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 (b <= (-9d+59)) then
tmp = b / (c * z)
else if (b <= (-7.2d-78)) then
tmp = t_1
else if (b <= (-7.4d-177)) then
tmp = ((9.0d0 * y) * (x / z)) / c
else if (b <= 5.2d-272) then
tmp = t_1
else if (b <= 2.6d-26) then
tmp = (((9.0d0 * x) * y) / z) / c
else if (b <= 7d+163) then
tmp = t_1
else
tmp = (b / z) / c
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 (b <= -9e+59) {
tmp = b / (c * z);
} else if (b <= -7.2e-78) {
tmp = t_1;
} else if (b <= -7.4e-177) {
tmp = ((9.0 * y) * (x / z)) / c;
} else if (b <= 5.2e-272) {
tmp = t_1;
} else if (b <= 2.6e-26) {
tmp = (((9.0 * x) * y) / z) / c;
} else if (b <= 7e+163) {
tmp = t_1;
} else {
tmp = (b / z) / c;
}
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 b <= -9e+59: tmp = b / (c * z) elif b <= -7.2e-78: tmp = t_1 elif b <= -7.4e-177: tmp = ((9.0 * y) * (x / z)) / c elif b <= 5.2e-272: tmp = t_1 elif b <= 2.6e-26: tmp = (((9.0 * x) * y) / z) / c elif b <= 7e+163: tmp = t_1 else: tmp = (b / z) / c 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 (b <= -9e+59) tmp = Float64(b / Float64(c * z)); elseif (b <= -7.2e-78) tmp = t_1; elseif (b <= -7.4e-177) tmp = Float64(Float64(Float64(9.0 * y) * Float64(x / z)) / c); elseif (b <= 5.2e-272) tmp = t_1; elseif (b <= 2.6e-26) tmp = Float64(Float64(Float64(Float64(9.0 * x) * y) / z) / c); elseif (b <= 7e+163) tmp = t_1; else tmp = Float64(Float64(b / z) / c); 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 (b <= -9e+59)
tmp = b / (c * z);
elseif (b <= -7.2e-78)
tmp = t_1;
elseif (b <= -7.4e-177)
tmp = ((9.0 * y) * (x / z)) / c;
elseif (b <= 5.2e-272)
tmp = t_1;
elseif (b <= 2.6e-26)
tmp = (((9.0 * x) * y) / z) / c;
elseif (b <= 7e+163)
tmp = t_1;
else
tmp = (b / z) / c;
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[b, -9e+59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.2e-78], t$95$1, If[LessEqual[b, -7.4e-177], N[(N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 5.2e-272], t$95$1, If[LessEqual[b, 2.6e-26], N[(N[(N[(N[(9.0 * x), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 7e+163], t$95$1, N[(N[(b / z), $MachinePrecision] / c), $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}\\
\mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -7.4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{\left(9 \cdot x\right) \cdot y}{z}}{c}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -8.99999999999999919e59Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if -8.99999999999999919e59 < b < -7.2000000000000005e-78 or -7.39999999999999986e-177 < b < 5.19999999999999983e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163Initial program 79.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if -7.2000000000000005e-78 < b < -7.39999999999999986e-177Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
if 5.19999999999999983e-272 < b < 2.6000000000000001e-26Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-/.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
if 7.0000000000000005e163 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in b around inf
lower-/.f6433.0
Applied rewrites33.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 (* -4.0 (/ (* a t) c))))
(if (<= b -9e+59)
(/ b (* c z))
(if (<= b -7.2e-78)
t_1
(if (<= b -7.4e-177)
(/ (* (* 9.0 y) (/ x z)) c)
(if (<= b 5.2e-272)
t_1
(if (<= b 2.6e-26)
(/ (* 9.0 (/ (* x y) z)) c)
(if (<= b 7e+163) t_1 (/ (/ b z) c)))))))))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 (b <= -9e+59) {
tmp = b / (c * z);
} else if (b <= -7.2e-78) {
tmp = t_1;
} else if (b <= -7.4e-177) {
tmp = ((9.0 * y) * (x / z)) / c;
} else if (b <= 5.2e-272) {
tmp = t_1;
} else if (b <= 2.6e-26) {
tmp = (9.0 * ((x * y) / z)) / c;
} else if (b <= 7e+163) {
tmp = t_1;
} else {
tmp = (b / z) / c;
}
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 (b <= (-9d+59)) then
tmp = b / (c * z)
else if (b <= (-7.2d-78)) then
tmp = t_1
else if (b <= (-7.4d-177)) then
tmp = ((9.0d0 * y) * (x / z)) / c
else if (b <= 5.2d-272) then
tmp = t_1
else if (b <= 2.6d-26) then
tmp = (9.0d0 * ((x * y) / z)) / c
else if (b <= 7d+163) then
tmp = t_1
else
tmp = (b / z) / c
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 (b <= -9e+59) {
tmp = b / (c * z);
} else if (b <= -7.2e-78) {
tmp = t_1;
} else if (b <= -7.4e-177) {
tmp = ((9.0 * y) * (x / z)) / c;
} else if (b <= 5.2e-272) {
tmp = t_1;
} else if (b <= 2.6e-26) {
tmp = (9.0 * ((x * y) / z)) / c;
} else if (b <= 7e+163) {
tmp = t_1;
} else {
tmp = (b / z) / c;
}
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 b <= -9e+59: tmp = b / (c * z) elif b <= -7.2e-78: tmp = t_1 elif b <= -7.4e-177: tmp = ((9.0 * y) * (x / z)) / c elif b <= 5.2e-272: tmp = t_1 elif b <= 2.6e-26: tmp = (9.0 * ((x * y) / z)) / c elif b <= 7e+163: tmp = t_1 else: tmp = (b / z) / c 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 (b <= -9e+59) tmp = Float64(b / Float64(c * z)); elseif (b <= -7.2e-78) tmp = t_1; elseif (b <= -7.4e-177) tmp = Float64(Float64(Float64(9.0 * y) * Float64(x / z)) / c); elseif (b <= 5.2e-272) tmp = t_1; elseif (b <= 2.6e-26) tmp = Float64(Float64(9.0 * Float64(Float64(x * y) / z)) / c); elseif (b <= 7e+163) tmp = t_1; else tmp = Float64(Float64(b / z) / c); 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 (b <= -9e+59)
tmp = b / (c * z);
elseif (b <= -7.2e-78)
tmp = t_1;
elseif (b <= -7.4e-177)
tmp = ((9.0 * y) * (x / z)) / c;
elseif (b <= 5.2e-272)
tmp = t_1;
elseif (b <= 2.6e-26)
tmp = (9.0 * ((x * y) / z)) / c;
elseif (b <= 7e+163)
tmp = t_1;
else
tmp = (b / z) / c;
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[b, -9e+59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.2e-78], t$95$1, If[LessEqual[b, -7.4e-177], N[(N[(N[(9.0 * y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 5.2e-272], t$95$1, If[LessEqual[b, 2.6e-26], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 7e+163], t$95$1, N[(N[(b / z), $MachinePrecision] / c), $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}\\
\mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -7.4 \cdot 10^{-177}:\\
\;\;\;\;\frac{\left(9 \cdot y\right) \cdot \frac{x}{z}}{c}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -8.99999999999999919e59Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if -8.99999999999999919e59 < b < -7.2000000000000005e-78 or -7.39999999999999986e-177 < b < 5.19999999999999983e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163Initial program 79.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if -7.2000000000000005e-78 < b < -7.39999999999999986e-177Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6
Applied rewrites35.6%
if 5.19999999999999983e-272 < b < 2.6000000000000001e-26Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
if 7.0000000000000005e163 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in b around inf
lower-/.f6433.0
Applied rewrites33.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 (* -4.0 (/ (* a t) c))))
(if (<= b -1.7e+71)
(/ b (* c z))
(if (<= b -4.6e-182)
(* 9.0 (/ (* x y) (* c z)))
(if (<= b 5.2e-272)
t_1
(if (<= b 2.6e-26)
(/ (* 9.0 (/ (* x y) z)) c)
(if (<= b 7e+163) t_1 (/ (/ b z) c))))))))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 (b <= -1.7e+71) {
tmp = b / (c * z);
} else if (b <= -4.6e-182) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (b <= 5.2e-272) {
tmp = t_1;
} else if (b <= 2.6e-26) {
tmp = (9.0 * ((x * y) / z)) / c;
} else if (b <= 7e+163) {
tmp = t_1;
} else {
tmp = (b / z) / c;
}
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 (b <= (-1.7d+71)) then
tmp = b / (c * z)
else if (b <= (-4.6d-182)) then
tmp = 9.0d0 * ((x * y) / (c * z))
else if (b <= 5.2d-272) then
tmp = t_1
else if (b <= 2.6d-26) then
tmp = (9.0d0 * ((x * y) / z)) / c
else if (b <= 7d+163) then
tmp = t_1
else
tmp = (b / z) / c
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 (b <= -1.7e+71) {
tmp = b / (c * z);
} else if (b <= -4.6e-182) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (b <= 5.2e-272) {
tmp = t_1;
} else if (b <= 2.6e-26) {
tmp = (9.0 * ((x * y) / z)) / c;
} else if (b <= 7e+163) {
tmp = t_1;
} else {
tmp = (b / z) / c;
}
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 b <= -1.7e+71: tmp = b / (c * z) elif b <= -4.6e-182: tmp = 9.0 * ((x * y) / (c * z)) elif b <= 5.2e-272: tmp = t_1 elif b <= 2.6e-26: tmp = (9.0 * ((x * y) / z)) / c elif b <= 7e+163: tmp = t_1 else: tmp = (b / z) / c 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 (b <= -1.7e+71) tmp = Float64(b / Float64(c * z)); elseif (b <= -4.6e-182) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); elseif (b <= 5.2e-272) tmp = t_1; elseif (b <= 2.6e-26) tmp = Float64(Float64(9.0 * Float64(Float64(x * y) / z)) / c); elseif (b <= 7e+163) tmp = t_1; else tmp = Float64(Float64(b / z) / c); 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 (b <= -1.7e+71)
tmp = b / (c * z);
elseif (b <= -4.6e-182)
tmp = 9.0 * ((x * y) / (c * z));
elseif (b <= 5.2e-272)
tmp = t_1;
elseif (b <= 2.6e-26)
tmp = (9.0 * ((x * y) / z)) / c;
elseif (b <= 7e+163)
tmp = t_1;
else
tmp = (b / z) / c;
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[b, -1.7e+71], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.6e-182], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-272], t$95$1, If[LessEqual[b, 2.6e-26], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[b, 7e+163], t$95$1, N[(N[(b / z), $MachinePrecision] / c), $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}\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -4.6 \cdot 10^{-182}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -1.6999999999999999e71Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if -1.6999999999999999e71 < b < -4.5999999999999998e-182Initial program 79.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.5
Applied rewrites36.5%
if -4.5999999999999998e-182 < b < 5.19999999999999983e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163Initial program 79.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if 5.19999999999999983e-272 < b < 2.6000000000000001e-26Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
if 7.0000000000000005e163 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in b around inf
lower-/.f6433.0
Applied rewrites33.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 (* 9.0 (/ (* x y) (* c z)))) (t_2 (* -4.0 (/ (* a t) c))))
(if (<= b -1.7e+71)
(/ b (* c z))
(if (<= b -4.6e-182)
t_1
(if (<= b 6.8e-272)
t_2
(if (<= b 2.6e-26) t_1 (if (<= b 7e+163) t_2 (/ (/ b z) c))))))))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 = 9.0 * ((x * y) / (c * z));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (b <= -1.7e+71) {
tmp = b / (c * z);
} else if (b <= -4.6e-182) {
tmp = t_1;
} else if (b <= 6.8e-272) {
tmp = t_2;
} else if (b <= 2.6e-26) {
tmp = t_1;
} else if (b <= 7e+163) {
tmp = t_2;
} else {
tmp = (b / z) / c;
}
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 = 9.0d0 * ((x * y) / (c * z))
t_2 = (-4.0d0) * ((a * t) / c)
if (b <= (-1.7d+71)) then
tmp = b / (c * z)
else if (b <= (-4.6d-182)) then
tmp = t_1
else if (b <= 6.8d-272) then
tmp = t_2
else if (b <= 2.6d-26) then
tmp = t_1
else if (b <= 7d+163) then
tmp = t_2
else
tmp = (b / z) / c
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 = 9.0 * ((x * y) / (c * z));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (b <= -1.7e+71) {
tmp = b / (c * z);
} else if (b <= -4.6e-182) {
tmp = t_1;
} else if (b <= 6.8e-272) {
tmp = t_2;
} else if (b <= 2.6e-26) {
tmp = t_1;
} else if (b <= 7e+163) {
tmp = t_2;
} else {
tmp = (b / z) / c;
}
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 = 9.0 * ((x * y) / (c * z)) t_2 = -4.0 * ((a * t) / c) tmp = 0 if b <= -1.7e+71: tmp = b / (c * z) elif b <= -4.6e-182: tmp = t_1 elif b <= 6.8e-272: tmp = t_2 elif b <= 2.6e-26: tmp = t_1 elif b <= 7e+163: tmp = t_2 else: tmp = (b / z) / c 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(9.0 * Float64(Float64(x * y) / Float64(c * z))) t_2 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (b <= -1.7e+71) tmp = Float64(b / Float64(c * z)); elseif (b <= -4.6e-182) tmp = t_1; elseif (b <= 6.8e-272) tmp = t_2; elseif (b <= 2.6e-26) tmp = t_1; elseif (b <= 7e+163) tmp = t_2; else tmp = Float64(Float64(b / z) / c); 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 = 9.0 * ((x * y) / (c * z));
t_2 = -4.0 * ((a * t) / c);
tmp = 0.0;
if (b <= -1.7e+71)
tmp = b / (c * z);
elseif (b <= -4.6e-182)
tmp = t_1;
elseif (b <= 6.8e-272)
tmp = t_2;
elseif (b <= 2.6e-26)
tmp = t_1;
elseif (b <= 7e+163)
tmp = t_2;
else
tmp = (b / z) / c;
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[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.7e+71], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.6e-182], t$95$1, If[LessEqual[b, 6.8e-272], t$95$2, If[LessEqual[b, 2.6e-26], t$95$1, If[LessEqual[b, 7e+163], t$95$2, N[(N[(b / z), $MachinePrecision] / c), $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 := 9 \cdot \frac{x \cdot y}{c \cdot z}\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq -4.6 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-272}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -1.6999999999999999e71Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if -1.6999999999999999e71 < b < -4.5999999999999998e-182 or 6.8000000000000006e-272 < b < 2.6000000000000001e-26Initial program 79.5%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6436.5
Applied rewrites36.5%
if -4.5999999999999998e-182 < b < 6.8000000000000006e-272 or 2.6000000000000001e-26 < b < 7.0000000000000005e163Initial program 79.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if 7.0000000000000005e163 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in b around inf
lower-/.f6433.0
Applied rewrites33.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 (if (<= b -9e+59) (/ b (* c z)) (if (<= b 7e+163) (* -4.0 (/ (* a t) c)) (/ (/ b z) c))))
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 tmp;
if (b <= -9e+59) {
tmp = b / (c * z);
} else if (b <= 7e+163) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (b / z) / c;
}
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) :: tmp
if (b <= (-9d+59)) then
tmp = b / (c * z)
else if (b <= 7d+163) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = (b / z) / c
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 tmp;
if (b <= -9e+59) {
tmp = b / (c * z);
} else if (b <= 7e+163) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = (b / z) / c;
}
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): tmp = 0 if b <= -9e+59: tmp = b / (c * z) elif b <= 7e+163: tmp = -4.0 * ((a * t) / c) else: tmp = (b / z) / c 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) tmp = 0.0 if (b <= -9e+59) tmp = Float64(b / Float64(c * z)); elseif (b <= 7e+163) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(Float64(b / z) / c); 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)
tmp = 0.0;
if (b <= -9e+59)
tmp = b / (c * z);
elseif (b <= 7e+163)
tmp = -4.0 * ((a * t) / c);
else
tmp = (b / z) / c;
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_] := If[LessEqual[b, -9e+59], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e+163], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $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}
\mathbf{if}\;b \leq -9 \cdot 10^{+59}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;b \leq 7 \cdot 10^{+163}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -8.99999999999999919e59Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if -8.99999999999999919e59 < b < 7.0000000000000005e163Initial program 79.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if 7.0000000000000005e163 < b Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in b around inf
lower-/.f6433.0
Applied rewrites33.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 (if (<= (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -5e+99) (/ b (* c z)) (/ (/ b z) c)))
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 tmp;
if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99) {
tmp = b / (c * z);
} else {
tmp = (b / z) / c;
}
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) :: tmp
if ((((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)) <= (-5d+99)) then
tmp = b / (c * z)
else
tmp = (b / z) / c
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 tmp;
if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99) {
tmp = b / (c * z);
} else {
tmp = (b / z) / c;
}
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): tmp = 0 if (((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99: tmp = b / (c * z) else: tmp = (b / z) / c 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) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) <= -5e+99) tmp = Float64(b / Float64(c * z)); else tmp = Float64(Float64(b / z) / c); 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)
tmp = 0.0;
if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -5e+99)
tmp = b / (c * z);
else
tmp = (b / z) / c;
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_] := If[LessEqual[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], -5e+99], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $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}
\mathbf{if}\;\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} \leq -5 \cdot 10^{+99}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -5.00000000000000008e99Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if -5.00000000000000008e99 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 79.5%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
add-to-fractionN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites80.0%
Taylor expanded in b around inf
lower-/.f6433.0
Applied rewrites33.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 (if (<= c 1e+29) (/ b (* c z)) (/ (/ 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) {
double tmp;
if (c <= 1e+29) {
tmp = b / (c * z);
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (c <= 1d+29) then
tmp = b / (c * z)
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (c <= 1e+29) {
tmp = b / (c * z);
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) [x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if c <= 1e+29: tmp = b / (c * z) else: tmp = (b / c) / z return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (c <= 1e+29) tmp = Float64(b / Float64(c * z)); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (c <= 1e+29)
tmp = b / (c * z);
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, 1e+29], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\\\
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq 10^{+29}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if c < 9.99999999999999914e28Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
if 9.99999999999999914e28 < c Initial program 79.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6434.2
Applied rewrites34.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 (/ 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.5%
Taylor expanded in b around inf
lower-/.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
herbie shell --seed 2025156
(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)))