
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (fma (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c)))
(if (<= z -5e+50)
t_1
(if (<= z 1e-25)
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma((a * t), -4.0, (fma((y * x), 9.0, b) / z)) / c;
double tmp;
if (z <= -5e+50) {
tmp = t_1;
} else if (z <= 1e-25) {
tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * x), 9.0, b) / z)) / c) tmp = 0.0 if (z <= -5e+50) tmp = t_1; elseif (z <= 1e-25) tmp = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -5e+50], t$95$1, If[LessEqual[z, 1e-25], N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{-25}:\\
\;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5e50 or 1.00000000000000004e-25 < z Initial program 63.8%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6481.7
Applied rewrites81.7%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6488.3
Applied rewrites88.3%
if -5e50 < z < 1.00000000000000004e-25Initial program 94.4%
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) 5e+245) (/ (fma (* a t) -4.0 (/ (fma (* y x) 9.0 b) z)) c) (- (* (/ (* -9.0 x) (* c z)) y))))
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) <= 5e+245) {
tmp = fma((a * t), -4.0, (fma((y * x), 9.0, b) / z)) / c;
} else {
tmp = -(((-9.0 * x) / (c * z)) * y);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(Float64(x * 9.0) * y) <= 5e+245) tmp = Float64(fma(Float64(a * t), -4.0, Float64(fma(Float64(y * x), 9.0, b) / z)) / c); else tmp = Float64(-Float64(Float64(Float64(-9.0 * x) / Float64(c * z)) * y)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision], 5e+245], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], (-N[(N[(N[(-9.0 * x), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision])]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot 9\right) \cdot y \leq 5 \cdot 10^{+245}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-\frac{-9 \cdot x}{c \cdot z} \cdot y\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.00000000000000034e245Initial program 81.1%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.4
Applied rewrites86.4%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6488.0
Applied rewrites88.0%
if 5.00000000000000034e245 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 65.2%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6476.8
Applied rewrites76.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6476.4
Applied rewrites76.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -2e+122)
(/ (fma (* a t) -4.0 (* (/ (* y x) z) 9.0)) c)
(if (<= t_1 5e+100)
(/ (fma (* a t) -4.0 (/ b z)) c)
(- (* (/ (- (* (/ x c) -9.0) (/ b (* c y))) z) y))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -2e+122) {
tmp = fma((a * t), -4.0, (((y * x) / z) * 9.0)) / c;
} else if (t_1 <= 5e+100) {
tmp = fma((a * t), -4.0, (b / z)) / c;
} else {
tmp = -(((((x / c) * -9.0) - (b / (c * y))) / z) * y);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -2e+122) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) / z) * 9.0)) / c); elseif (t_1 <= 5e+100) tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); else tmp = Float64(-Float64(Float64(Float64(Float64(Float64(x / c) * -9.0) - Float64(b / Float64(c * y))) / z) * y)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+122], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 5e+100], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], (-N[(N[(N[(N[(N[(x / c), $MachinePrecision] * -9.0), $MachinePrecision] - N[(b / N[(c * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * y), $MachinePrecision])]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+122}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{y \cdot x}{z} \cdot 9\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+100}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\frac{x}{c} \cdot -9 - \frac{b}{c \cdot y}}{z} \cdot y\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e122Initial program 75.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6475.8
Applied rewrites75.8%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6476.4
Applied rewrites76.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f6470.8
Applied rewrites70.8%
if -2.00000000000000003e122 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999999e100Initial program 82.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6491.2
Applied rewrites91.2%
Taylor expanded in x around 0
Applied rewrites78.9%
if 4.9999999999999999e100 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 72.4%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6473.5
Applied rewrites73.5%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -2e+122)
(/ (fma (* a t) -4.0 (* (/ (* y x) z) 9.0)) c)
(if (<= t_1 5e+100)
(/ (fma (* a t) -4.0 (/ b z)) c)
(- (/ (* (- (* (/ x c) -9.0) (/ b (* c y))) y) z))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -2e+122) {
tmp = fma((a * t), -4.0, (((y * x) / z) * 9.0)) / c;
} else if (t_1 <= 5e+100) {
tmp = fma((a * t), -4.0, (b / z)) / c;
} else {
tmp = -(((((x / c) * -9.0) - (b / (c * y))) * y) / z);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -2e+122) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) / z) * 9.0)) / c); elseif (t_1 <= 5e+100) tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); else tmp = Float64(-Float64(Float64(Float64(Float64(Float64(x / c) * -9.0) - Float64(b / Float64(c * y))) * y) / z)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+122], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 5e+100], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], (-N[(N[(N[(N[(N[(x / c), $MachinePrecision] * -9.0), $MachinePrecision] - N[(b / N[(c * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / z), $MachinePrecision])]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+122}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{y \cdot x}{z} \cdot 9\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+100}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\left(\frac{x}{c} \cdot -9 - \frac{b}{c \cdot y}\right) \cdot y}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e122Initial program 75.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6475.8
Applied rewrites75.8%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6476.4
Applied rewrites76.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f6470.8
Applied rewrites70.8%
if -2.00000000000000003e122 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999999e100Initial program 82.7%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6491.2
Applied rewrites91.2%
Taylor expanded in x around 0
Applied rewrites78.9%
if 4.9999999999999999e100 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 72.4%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.6%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -2e+122)
(/ (fma (* a t) -4.0 (* (/ (* y x) z) 9.0)) c)
(if (<= t_1 1e+210)
(/ (fma (* a t) -4.0 (/ b z)) c)
(- (* (/ (* -9.0 x) (* c z)) y))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -2e+122) {
tmp = fma((a * t), -4.0, (((y * x) / z) * 9.0)) / c;
} else if (t_1 <= 1e+210) {
tmp = fma((a * t), -4.0, (b / z)) / c;
} else {
tmp = -(((-9.0 * x) / (c * z)) * y);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -2e+122) tmp = Float64(fma(Float64(a * t), -4.0, Float64(Float64(Float64(y * x) / z) * 9.0)) / c); elseif (t_1 <= 1e+210) tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); else tmp = Float64(-Float64(Float64(Float64(-9.0 * x) / Float64(c * z)) * y)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+122], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+210], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], (-N[(N[(N[(-9.0 * x), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision])]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+122}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{y \cdot x}{z} \cdot 9\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+210}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-\frac{-9 \cdot x}{c \cdot z} \cdot y\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e122Initial program 75.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6475.8
Applied rewrites75.8%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6476.4
Applied rewrites76.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lift-*.f6470.8
Applied rewrites70.8%
if -2.00000000000000003e122 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999927e209Initial program 82.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6490.6
Applied rewrites90.6%
Taylor expanded in x around 0
Applied rewrites75.9%
if 9.99999999999999927e209 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 68.2%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6475.3
Applied rewrites75.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6475.0
Applied rewrites75.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)))
(if (<= t_1 -2e+122)
(- (* (* (/ (/ x c) z) -9.0) y))
(if (<= t_1 1e+210)
(/ (fma (* a t) -4.0 (/ b z)) c)
(- (* (/ (* -9.0 x) (* c z)) y))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if (t_1 <= -2e+122) {
tmp = -((((x / c) / z) * -9.0) * y);
} else if (t_1 <= 1e+210) {
tmp = fma((a * t), -4.0, (b / z)) / c;
} else {
tmp = -(((-9.0 * x) / (c * z)) * y);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -2e+122) tmp = Float64(-Float64(Float64(Float64(Float64(x / c) / z) * -9.0) * y)); elseif (t_1 <= 1e+210) tmp = Float64(fma(Float64(a * t), -4.0, Float64(b / z)) / c); else tmp = Float64(-Float64(Float64(Float64(-9.0 * x) / Float64(c * z)) * y)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+122], (-N[(N[(N[(N[(x / c), $MachinePrecision] / z), $MachinePrecision] * -9.0), $MachinePrecision] * y), $MachinePrecision]), If[LessEqual[t$95$1, 1e+210], N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], (-N[(N[(N[(-9.0 * x), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision])]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+122}:\\
\;\;\;\;-\left(\frac{\frac{x}{c}}{z} \cdot -9\right) \cdot y\\
\mathbf{elif}\;t\_1 \leq 10^{+210}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a \cdot t, -4, \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-\frac{-9 \cdot x}{c \cdot z} \cdot y\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000003e122Initial program 75.0%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6468.4
Applied rewrites68.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
if -2.00000000000000003e122 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999927e209Initial program 82.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
Taylor expanded in c around 0
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lift-fma.f64N/A
lift-*.f6490.6
Applied rewrites90.6%
Taylor expanded in x around 0
Applied rewrites75.9%
if 9.99999999999999927e209 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 68.2%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6475.3
Applied rewrites75.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6475.0
Applied rewrites75.0%
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 -5.8e+96) (* (* -4.0 a) (/ t c)) (if (<= z 7.5e+94) (/ (fma (* y x) 9.0 b) (* z c)) (* -4.0 (/ (* a t) 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 <= -5.8e+96) {
tmp = (-4.0 * a) * (t / c);
} else if (z <= 7.5e+94) {
tmp = fma((y * x), 9.0, b) / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -5.8e+96) tmp = Float64(Float64(-4.0 * a) * Float64(t / c)); elseif (z <= 7.5e+94) tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -5.8e+96], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+94], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+96}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot \frac{t}{c}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+94}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -5.79999999999999955e96Initial program 55.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6479.6
Applied rewrites79.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6477.8
Applied rewrites77.8%
Taylor expanded in z around inf
associate-*r/N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-/.f6459.8
Applied rewrites59.8%
if -5.79999999999999955e96 < z < 7.49999999999999978e94Initial program 91.9%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6473.9
Applied rewrites73.9%
if 7.49999999999999978e94 < z Initial program 57.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6459.7
Applied rewrites59.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= z -5.8e+96) (* (* -4.0 a) (/ t c)) (if (<= z 7.5e+94) (/ (fma (* 9.0 x) y b) (* c z)) (* -4.0 (/ (* a t) 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 <= -5.8e+96) {
tmp = (-4.0 * a) * (t / c);
} else if (z <= 7.5e+94) {
tmp = fma((9.0 * x), y, b) / (c * z);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -5.8e+96) tmp = Float64(Float64(-4.0 * a) * Float64(t / c)); elseif (z <= 7.5e+94) tmp = Float64(fma(Float64(9.0 * x), y, b) / Float64(c * z)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -5.8e+96], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+94], N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+96}:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot \frac{t}{c}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+94}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -5.79999999999999955e96Initial program 55.0%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6479.6
Applied rewrites79.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6477.8
Applied rewrites77.8%
Taylor expanded in z around inf
associate-*r/N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-/.f6459.8
Applied rewrites59.8%
if -5.79999999999999955e96 < z < 7.49999999999999978e94Initial program 91.9%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.4
Applied rewrites86.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.0
Applied rewrites87.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-/.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f6473.9
Applied rewrites73.9%
if 7.49999999999999978e94 < z Initial program 57.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6459.7
Applied rewrites59.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* (/ a c) -4.0) t)))
(if (<= b -6e+86)
(/ b (* z c))
(if (<= b -4e-5)
t_1
(if (<= b -5.2e-131)
(- (* (* (/ (/ x c) z) -9.0) y))
(if (<= b 4.6) t_1 (/ (/ b z) c)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((a / c) * -4.0) * t;
double tmp;
if (b <= -6e+86) {
tmp = b / (z * c);
} else if (b <= -4e-5) {
tmp = t_1;
} else if (b <= -5.2e-131) {
tmp = -((((x / c) / z) * -9.0) * y);
} else if (b <= 4.6) {
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.
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 = ((a / c) * (-4.0d0)) * t
if (b <= (-6d+86)) then
tmp = b / (z * c)
else if (b <= (-4d-5)) then
tmp = t_1
else if (b <= (-5.2d-131)) then
tmp = -((((x / c) / z) * (-9.0d0)) * y)
else if (b <= 4.6d0) 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;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((a / c) * -4.0) * t;
double tmp;
if (b <= -6e+86) {
tmp = b / (z * c);
} else if (b <= -4e-5) {
tmp = t_1;
} else if (b <= -5.2e-131) {
tmp = -((((x / c) / z) * -9.0) * y);
} else if (b <= 4.6) {
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]) def code(x, y, z, t, a, b, c): t_1 = ((a / c) * -4.0) * t tmp = 0 if b <= -6e+86: tmp = b / (z * c) elif b <= -4e-5: tmp = t_1 elif b <= -5.2e-131: tmp = -((((x / c) / z) * -9.0) * y) elif b <= 4.6: 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]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(a / c) * -4.0) * t) tmp = 0.0 if (b <= -6e+86) tmp = Float64(b / Float64(z * c)); elseif (b <= -4e-5) tmp = t_1; elseif (b <= -5.2e-131) tmp = Float64(-Float64(Float64(Float64(Float64(x / c) / z) * -9.0) * y)); elseif (b <= 4.6) 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = ((a / c) * -4.0) * t;
tmp = 0.0;
if (b <= -6e+86)
tmp = b / (z * c);
elseif (b <= -4e-5)
tmp = t_1;
elseif (b <= -5.2e-131)
tmp = -((((x / c) / z) * -9.0) * y);
elseif (b <= 4.6)
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.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[b, -6e+86], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4e-5], t$95$1, If[LessEqual[b, -5.2e-131], (-N[(N[(N[(N[(x / c), $MachinePrecision] / z), $MachinePrecision] * -9.0), $MachinePrecision] * y), $MachinePrecision]), If[LessEqual[b, 4.6], 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])\\
\\
\begin{array}{l}
t_1 := \left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{if}\;b \leq -6 \cdot 10^{+86}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq -4 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -5.2 \cdot 10^{-131}:\\
\;\;\;\;-\left(\frac{\frac{x}{c}}{z} \cdot -9\right) \cdot y\\
\mathbf{elif}\;b \leq 4.6:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -5.99999999999999954e86Initial program 79.1%
Taylor expanded in b around inf
Applied rewrites57.8%
if -5.99999999999999954e86 < b < -4.00000000000000033e-5 or -5.19999999999999993e-131 < b < 4.5999999999999996Initial program 79.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6447.6
Applied rewrites47.6%
if -4.00000000000000033e-5 < b < -5.19999999999999993e-131Initial program 80.8%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6443.6
Applied rewrites43.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6442.7
Applied rewrites42.7%
if 4.5999999999999996 < b Initial program 79.1%
Taylor expanded in b around inf
Applied rewrites19.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6417.2
Applied rewrites17.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= b -5.5e+87) (/ b (* z c)) (if (<= b 2.5) (* (* -4.0 a) (/ t c)) (/ (/ b z) c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.5e+87) {
tmp = b / (z * c);
} else if (b <= 2.5) {
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.
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 <= (-5.5d+87)) then
tmp = b / (z * c)
else if (b <= 2.5d0) 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;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.5e+87) {
tmp = b / (z * c);
} else if (b <= 2.5) {
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]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -5.5e+87: tmp = b / (z * c) elif b <= 2.5: 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]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -5.5e+87) tmp = Float64(b / Float64(z * c)); elseif (b <= 2.5) tmp = Float64(Float64(-4.0 * a) * Float64(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])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -5.5e+87)
tmp = b / (z * c);
elseif (b <= 2.5)
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. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -5.5e+87], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5], N[(N[(-4.0 * a), $MachinePrecision] * N[(t / 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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+87}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq 2.5:\\
\;\;\;\;\left(-4 \cdot a\right) \cdot \frac{t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -5.50000000000000022e87Initial program 79.0%
Taylor expanded in b around inf
Applied rewrites57.7%
if -5.50000000000000022e87 < b < 2.5Initial program 79.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.2
Applied rewrites85.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.5
Applied rewrites84.5%
Taylor expanded in z around inf
associate-*r/N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-/.f6446.5
Applied rewrites46.5%
if 2.5 < b Initial program 80.9%
Taylor expanded in b around inf
Applied rewrites50.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6448.5
Applied rewrites48.5%
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 -6e+86) (/ b (* z c)) (if (<= b 4.6) (* (* (/ a c) -4.0) t) (/ (/ b z) c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -6e+86) {
tmp = b / (z * c);
} else if (b <= 4.6) {
tmp = ((a / c) * -4.0) * t;
} 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.
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 <= (-6d+86)) then
tmp = b / (z * c)
else if (b <= 4.6d0) then
tmp = ((a / c) * (-4.0d0)) * t
else
tmp = (b / z) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -6e+86) {
tmp = b / (z * c);
} else if (b <= 4.6) {
tmp = ((a / c) * -4.0) * t;
} else {
tmp = (b / z) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -6e+86: tmp = b / (z * c) elif b <= 4.6: tmp = ((a / c) * -4.0) * t else: tmp = (b / z) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -6e+86) tmp = Float64(b / Float64(z * c)); elseif (b <= 4.6) tmp = Float64(Float64(Float64(a / c) * -4.0) * t); 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -6e+86)
tmp = b / (z * c);
elseif (b <= 4.6)
tmp = ((a / c) * -4.0) * t;
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. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -6e+86], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.6], N[(N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision] * t), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{+86}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq 4.6:\\
\;\;\;\;\left(\frac{a}{c} \cdot -4\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -5.99999999999999954e86Initial program 79.1%
Taylor expanded in b around inf
Applied rewrites57.8%
if -5.99999999999999954e86 < b < 4.5999999999999996Initial program 79.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lift-/.f6446.8
Applied rewrites46.8%
if 4.5999999999999996 < b Initial program 80.9%
Taylor expanded in b around inf
Applied rewrites50.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6448.4
Applied rewrites48.4%
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 -5.5e+87) (/ b (* z c)) (if (<= b 2.5) (* -4.0 (/ (* a t) c)) (/ (/ b z) c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.5e+87) {
tmp = b / (z * c);
} else if (b <= 2.5) {
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.
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 <= (-5.5d+87)) then
tmp = b / (z * c)
else if (b <= 2.5d0) 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;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -5.5e+87) {
tmp = b / (z * c);
} else if (b <= 2.5) {
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]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -5.5e+87: tmp = b / (z * c) elif b <= 2.5: 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]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -5.5e+87) tmp = Float64(b / Float64(z * c)); elseif (b <= 2.5) 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -5.5e+87)
tmp = b / (z * c);
elseif (b <= 2.5)
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. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -5.5e+87], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+87}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;b \leq 2.5:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -5.50000000000000022e87Initial program 79.0%
Taylor expanded in b around inf
Applied rewrites57.7%
if -5.50000000000000022e87 < b < 2.5Initial program 79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6445.9
Applied rewrites45.9%
if 2.5 < b Initial program 80.9%
Taylor expanded in b around inf
Applied rewrites50.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6448.5
Applied rewrites48.5%
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+80) (/ b (* z c)) (/ (/ b z) c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -2e+80) {
tmp = b / (z * 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.
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)) <= (-2d+80)) then
tmp = b / (z * 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;
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)) <= -2e+80) {
tmp = b / (z * c);
} else {
tmp = (b / z) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= -2e+80: tmp = b / (z * c) else: tmp = (b / z) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) 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+80) tmp = Float64(b / Float64(z * 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])){:}
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)) <= -2e+80)
tmp = b / (z * 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. 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+80], N[(b / N[(z * 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])\\
\\
\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^{+80}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\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)) < -2e80Initial program 87.1%
Taylor expanded in b around inf
Applied rewrites37.7%
if -2e80 < (/.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 76.0%
Taylor expanded in b around inf
Applied rewrites34.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
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. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
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 / (z * c)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * 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 / (z * 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(z * c)) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 79.7%
Taylor expanded in b around inf
Applied rewrites35.3%
herbie shell --seed 2025118
(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)))