
(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}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (/ (fma (* y x) 9.0 b) z) c)))
(if (<= z -1e+59)
(fma a (* t (/ -4.0 c)) t_1)
(if (<= z 2.05e+157)
(/ (+ (fma (* y x) 9.0 (* (* (* -4.0 z) a) t)) b) (* z c))
(fma (* -4.0 t) (/ a 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((y * x), 9.0, b) / z) / c;
double tmp;
if (z <= -1e+59) {
tmp = fma(a, (t * (-4.0 / c)), t_1);
} else if (z <= 2.05e+157) {
tmp = (fma((y * x), 9.0, (((-4.0 * z) * a) * t)) + b) / (z * c);
} else {
tmp = fma((-4.0 * t), (a / c), t_1);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fma(Float64(y * x), 9.0, b) / z) / c) tmp = 0.0 if (z <= -1e+59) tmp = fma(a, Float64(t * Float64(-4.0 / c)), t_1); elseif (z <= 2.05e+157) tmp = Float64(Float64(fma(Float64(y * x), 9.0, Float64(Float64(Float64(-4.0 * z) * a) * t)) + b) / Float64(z * c)); else tmp = fma(Float64(-4.0 * t), Float64(a / c), 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[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1e+59], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 2.05e+157], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * t), $MachinePrecision] * N[(a / c), $MachinePrecision] + t$95$1), $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 := \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(a, t \cdot \frac{-4}{c}, t\_1\right)\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+157}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, \left(\left(-4 \cdot z\right) \cdot a\right) \cdot t\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, \frac{a}{c}, t\_1\right)\\
\end{array}
\end{array}
if z < -9.99999999999999972e58Initial program 46.5%
Taylor expanded in x around 0
Applied rewrites84.9%
Applied rewrites84.2%
Applied rewrites84.1%
if -9.99999999999999972e58 < z < 2.05000000000000008e157Initial program 94.3%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
Applied rewrites94.3%
if 2.05000000000000008e157 < z Initial program 46.2%
Taylor expanded in x around 0
Applied rewrites86.7%
Applied rewrites93.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) (* (* (* z 4.0) t) a)) b) (* z c)))
(t_2 (<= t_1 INFINITY))
(t_3 (/ (fma (* -4.0 t) a (/ (fma (* y x) 9.0 b) z)) c)))
(if (<= t_1 5e+112)
t_3
(if t_2
(/ (fma (* 9.0 x) y (fma (* -4.0 z) (* a t) b)) (* z c))
(if t_2 t_3 (fma a (/ (* -4.0 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 t_1 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
int t_2 = t_1 <= ((double) INFINITY);
double t_3 = fma((-4.0 * t), a, (fma((y * x), 9.0, b) / z)) / c;
double tmp;
if (t_1 <= 5e+112) {
tmp = t_3;
} else if (t_2) {
tmp = fma((9.0 * x), y, fma((-4.0 * z), (a * t), b)) / (z * c);
} else if (t_2) {
tmp = t_3;
} else {
tmp = fma(a, ((-4.0 * t) / c), (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(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) t_2 = t_1 <= Inf t_3 = Float64(fma(Float64(-4.0 * t), a, Float64(fma(Float64(y * x), 9.0, b) / z)) / c) tmp = 0.0 if (t_1 <= 5e+112) tmp = t_3; elseif (t_2) tmp = Float64(fma(Float64(9.0 * x), y, fma(Float64(-4.0 * z), Float64(a * t), b)) / Float64(z * c)); elseif (t_2) tmp = t_3; else tmp = fma(a, Float64(Float64(-4.0 * t) / c), Float64(b / Float64(z * c))); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(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 = LessEqual[t$95$1, Infinity]}, Block[{t$95$3 = N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+112], t$95$3, If[t$95$2, N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(N[(-4.0 * z), $MachinePrecision] * N[(a * t), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[t$95$2, t$95$3, N[(a * N[(N[(-4.0 * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \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 := t\_1 \leq \infty\\
t_3 := \frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+112}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, \mathsf{fma}\left(-4 \cdot z, a \cdot t, b\right)\right)}{z \cdot c}\\
\mathbf{elif}\;t\_2:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-4 \cdot t}{c}, \frac{b}{z \cdot c}\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)) < 5e112 or +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 85.8%
Taylor expanded in x around 0
Applied rewrites88.6%
if 5e112 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.9%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6488.8
Applied rewrites88.8%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Taylor expanded in x around 0
Applied rewrites59.8%
Applied rewrites77.7%
Taylor expanded in x around 0
Applied rewrites80.8%
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 (* (* y x) 9.0)) (t_2 (* (* x 9.0) y)))
(if (<= t_2 (- INFINITY))
(* (* 9.0 (/ x c)) (/ y z))
(if (<= t_2 -2e+18)
(/ (fma (* -4.0 z) (* a t) t_1) (* z c))
(if (<= t_2 -1e-203)
(fma a (* t (/ -4.0 c)) (/ b (* z c)))
(if (<= t_2 2e+51)
(/ (fma (* -4.0 t) a (/ b z)) c)
(if (<= t_2 1e+273)
(/ (fma (* -4.0 t) a (/ t_1 z)) c)
(* (/ (* y 9.0) z) (/ x 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 = (y * x) * 9.0;
double t_2 = (x * 9.0) * y;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (9.0 * (x / c)) * (y / z);
} else if (t_2 <= -2e+18) {
tmp = fma((-4.0 * z), (a * t), t_1) / (z * c);
} else if (t_2 <= -1e-203) {
tmp = fma(a, (t * (-4.0 / c)), (b / (z * c)));
} else if (t_2 <= 2e+51) {
tmp = fma((-4.0 * t), a, (b / z)) / c;
} else if (t_2 <= 1e+273) {
tmp = fma((-4.0 * t), a, (t_1 / z)) / c;
} else {
tmp = ((y * 9.0) / z) * (x / 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(y * x) * 9.0) t_2 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(9.0 * Float64(x / c)) * Float64(y / z)); elseif (t_2 <= -2e+18) tmp = Float64(fma(Float64(-4.0 * z), Float64(a * t), t_1) / Float64(z * c)); elseif (t_2 <= -1e-203) tmp = fma(a, Float64(t * Float64(-4.0 / c)), Float64(b / Float64(z * c))); elseif (t_2 <= 2e+51) tmp = Float64(fma(Float64(-4.0 * t), a, Float64(b / z)) / c); elseif (t_2 <= 1e+273) tmp = Float64(fma(Float64(-4.0 * t), a, Float64(t_1 / z)) / c); else tmp = Float64(Float64(Float64(y * 9.0) / z) * Float64(x / c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(9.0 * N[(x / c), $MachinePrecision]), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e+18], N[(N[(N[(-4.0 * z), $MachinePrecision] * N[(a * t), $MachinePrecision] + t$95$1), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-203], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+51], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$2, 1e+273], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / 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}
t_1 := \left(y \cdot x\right) \cdot 9\\
t_2 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(9 \cdot \frac{x}{c}\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot z, a \cdot t, t\_1\right)}{z \cdot c}\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;\mathsf{fma}\left(a, t \cdot \frac{-4}{c}, \frac{b}{z \cdot c}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+51}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;t\_2 \leq 10^{+273}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{t\_1}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 9}{z} \cdot \frac{x}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -inf.0Initial program 54.0%
Taylor expanded in x around inf
Applied rewrites93.5%
if -inf.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e18Initial program 85.9%
Taylor expanded in b around 0
Applied rewrites77.5%
if -2e18 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203Initial program 87.2%
Taylor expanded in x around 0
Applied rewrites81.0%
Applied rewrites85.1%
Applied rewrites85.0%
Taylor expanded in x around 0
Applied rewrites92.2%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2e51Initial program 78.6%
Taylor expanded in x around 0
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites88.0%
if 2e51 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.99999999999999945e272Initial program 75.9%
Taylor expanded in x around 0
Applied rewrites82.2%
Taylor expanded in x around inf
Applied rewrites78.9%
if 9.99999999999999945e272 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 67.1%
Taylor expanded in x around inf
Applied rewrites95.4%
Applied rewrites95.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (/ b (* z c))))
(if (<= t_1 (- INFINITY))
(* (* 9.0 (/ x c)) (/ y z))
(if (<= t_1 -2e+18)
(/ (fma (* -4.0 z) (* a t) (* (* y x) 9.0)) (* z c))
(if (<= t_1 -1e-203)
(fma a (* t (/ -4.0 c)) t_2)
(if (<= t_1 1e+50)
(/ (fma (* -4.0 t) a (/ b z)) c)
(if (<= t_1 1e+156)
(fma a (/ (* -4.0 t) c) t_2)
(* (/ (* y 9.0) z) (/ x 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 = b / (z * c);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (9.0 * (x / c)) * (y / z);
} else if (t_1 <= -2e+18) {
tmp = fma((-4.0 * z), (a * t), ((y * x) * 9.0)) / (z * c);
} else if (t_1 <= -1e-203) {
tmp = fma(a, (t * (-4.0 / c)), t_2);
} else if (t_1 <= 1e+50) {
tmp = fma((-4.0 * t), a, (b / z)) / c;
} else if (t_1 <= 1e+156) {
tmp = fma(a, ((-4.0 * t) / c), t_2);
} else {
tmp = ((y * 9.0) / z) * (x / c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(b / Float64(z * c)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(9.0 * Float64(x / c)) * Float64(y / z)); elseif (t_1 <= -2e+18) tmp = Float64(fma(Float64(-4.0 * z), Float64(a * t), Float64(Float64(y * x) * 9.0)) / Float64(z * c)); elseif (t_1 <= -1e-203) tmp = fma(a, Float64(t * Float64(-4.0 / c)), t_2); elseif (t_1 <= 1e+50) tmp = Float64(fma(Float64(-4.0 * t), a, Float64(b / z)) / c); elseif (t_1 <= 1e+156) tmp = fma(a, Float64(Float64(-4.0 * t) / c), t_2); else tmp = Float64(Float64(Float64(y * 9.0) / z) * Float64(x / c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(9.0 * N[(x / c), $MachinePrecision]), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e+18], N[(N[(N[(-4.0 * z), $MachinePrecision] * N[(a * t), $MachinePrecision] + N[(N[(y * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -1e-203], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+50], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(a * N[(N[(-4.0 * t), $MachinePrecision] / c), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / 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}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{b}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(9 \cdot \frac{x}{c}\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot z, a \cdot t, \left(y \cdot x\right) \cdot 9\right)}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;\mathsf{fma}\left(a, t \cdot \frac{-4}{c}, t\_2\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-4 \cdot t}{c}, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 9}{z} \cdot \frac{x}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -inf.0Initial program 54.0%
Taylor expanded in x around inf
Applied rewrites93.5%
if -inf.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e18Initial program 85.9%
Taylor expanded in b around 0
Applied rewrites77.5%
if -2e18 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203Initial program 87.2%
Taylor expanded in x around 0
Applied rewrites81.0%
Applied rewrites85.1%
Applied rewrites85.0%
Taylor expanded in x around 0
Applied rewrites92.2%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.0000000000000001e50Initial program 78.4%
Taylor expanded in x around 0
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites87.9%
if 1.0000000000000001e50 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 84.4%
Taylor expanded in x around 0
Applied rewrites75.4%
Applied rewrites85.1%
Taylor expanded in x around 0
Applied rewrites79.7%
if 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 66.7%
Taylor expanded in x around inf
Applied rewrites78.8%
Applied rewrites78.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y))
(t_2 (/ b (* z c)))
(t_3 (* (/ (* y 9.0) z) (/ x c))))
(if (<= t_1 -1e+126)
t_3
(if (<= t_1 -1e-203)
(fma a (* t (/ -4.0 c)) t_2)
(if (<= t_1 1e+50)
(/ (fma (* -4.0 t) a (/ b z)) c)
(if (<= t_1 1e+156) (fma a (/ (* -4.0 t) c) t_2) t_3))))))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 = b / (z * c);
double t_3 = ((y * 9.0) / z) * (x / c);
double tmp;
if (t_1 <= -1e+126) {
tmp = t_3;
} else if (t_1 <= -1e-203) {
tmp = fma(a, (t * (-4.0 / c)), t_2);
} else if (t_1 <= 1e+50) {
tmp = fma((-4.0 * t), a, (b / z)) / c;
} else if (t_1 <= 1e+156) {
tmp = fma(a, ((-4.0 * t) / c), t_2);
} else {
tmp = t_3;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(b / Float64(z * c)) t_3 = Float64(Float64(Float64(y * 9.0) / z) * Float64(x / c)) tmp = 0.0 if (t_1 <= -1e+126) tmp = t_3; elseif (t_1 <= -1e-203) tmp = fma(a, Float64(t * Float64(-4.0 / c)), t_2); elseif (t_1 <= 1e+50) tmp = Float64(fma(Float64(-4.0 * t), a, Float64(b / z)) / c); elseif (t_1 <= 1e+156) tmp = fma(a, Float64(Float64(-4.0 * t) / c), t_2); else tmp = t_3; end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+126], t$95$3, If[LessEqual[t$95$1, -1e-203], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+50], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(a * N[(N[(-4.0 * t), $MachinePrecision] / c), $MachinePrecision] + t$95$2), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \frac{b}{z \cdot c}\\
t_3 := \frac{y \cdot 9}{z} \cdot \frac{x}{c}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+126}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;\mathsf{fma}\left(a, t \cdot \frac{-4}{c}, t\_2\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-4 \cdot t}{c}, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999925e125 or 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 73.0%
Taylor expanded in x around inf
Applied rewrites80.4%
Applied rewrites80.5%
if -9.99999999999999925e125 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203Initial program 83.8%
Taylor expanded in x around 0
Applied rewrites83.1%
Applied rewrites87.7%
Applied rewrites87.6%
Taylor expanded in x around 0
Applied rewrites82.1%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.0000000000000001e50Initial program 78.4%
Taylor expanded in x around 0
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites87.9%
if 1.0000000000000001e50 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 84.4%
Taylor expanded in x around 0
Applied rewrites75.4%
Applied rewrites85.1%
Taylor expanded in x around 0
Applied rewrites79.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 (fma a (* t (/ -4.0 c)) (/ b (* z c))))
(t_2 (* (* x 9.0) y))
(t_3 (* (/ (* y 9.0) z) (/ x c))))
(if (<= t_2 -1e+126)
t_3
(if (<= t_2 -1e-203)
t_1
(if (<= t_2 1e+50)
(/ (fma (* -4.0 t) a (/ b z)) c)
(if (<= t_2 1e+156) t_1 t_3))))))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 / c)), (b / (z * c)));
double t_2 = (x * 9.0) * y;
double t_3 = ((y * 9.0) / z) * (x / c);
double tmp;
if (t_2 <= -1e+126) {
tmp = t_3;
} else if (t_2 <= -1e-203) {
tmp = t_1;
} else if (t_2 <= 1e+50) {
tmp = fma((-4.0 * t), a, (b / z)) / c;
} else if (t_2 <= 1e+156) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = fma(a, Float64(t * Float64(-4.0 / c)), Float64(b / Float64(z * c))) t_2 = Float64(Float64(x * 9.0) * y) t_3 = Float64(Float64(Float64(y * 9.0) / z) * Float64(x / c)) tmp = 0.0 if (t_2 <= -1e+126) tmp = t_3; elseif (t_2 <= -1e-203) tmp = t_1; elseif (t_2 <= 1e+50) tmp = Float64(fma(Float64(-4.0 * t), a, Float64(b / z)) / c); elseif (t_2 <= 1e+156) tmp = t_1; else tmp = t_3; 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[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+126], t$95$3, If[LessEqual[t$95$2, -1e-203], t$95$1, If[LessEqual[t$95$2, 1e+50], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$2, 1e+156], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, t \cdot \frac{-4}{c}, \frac{b}{z \cdot c}\right)\\
t_2 := \left(x \cdot 9\right) \cdot y\\
t_3 := \frac{y \cdot 9}{z} \cdot \frac{x}{c}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+126}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+50}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;t\_2 \leq 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999925e125 or 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 73.0%
Taylor expanded in x around inf
Applied rewrites80.4%
Applied rewrites80.5%
if -9.99999999999999925e125 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -1e-203 or 1.0000000000000001e50 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 83.9%
Taylor expanded in x around 0
Applied rewrites81.1%
Applied rewrites87.0%
Applied rewrites86.9%
Taylor expanded in x around 0
Applied rewrites81.5%
if -1e-203 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.0000000000000001e50Initial program 78.4%
Taylor expanded in x around 0
Applied rewrites92.8%
Taylor expanded in x around 0
Applied rewrites87.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) INFINITY) (/ (fma (* 9.0 x) y (fma (* -4.0 z) (* a t) b)) (* z c)) (fma a (/ (* -4.0 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 ((((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)) <= ((double) INFINITY)) {
tmp = fma((9.0 * x), y, fma((-4.0 * z), (a * t), b)) / (z * c);
} else {
tmp = fma(a, ((-4.0 * t) / c), (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)) <= Inf) tmp = Float64(fma(Float64(9.0 * x), y, fma(Float64(-4.0 * z), Float64(a * t), b)) / Float64(z * c)); else tmp = fma(a, Float64(Float64(-4.0 * t) / c), Float64(b / Float64(z * c))); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := 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], Infinity], N[(N[(N[(9.0 * x), $MachinePrecision] * y + N[(N[(-4.0 * z), $MachinePrecision] * N[(a * t), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(-4.0 * t), $MachinePrecision] / c), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\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 \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, \mathsf{fma}\left(-4 \cdot z, a \cdot t, b\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-4 \cdot t}{c}, \frac{b}{z \cdot c}\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)) < +inf.0Initial program 87.3%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6487.0
Applied rewrites87.0%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Taylor expanded in x around 0
Applied rewrites59.8%
Applied rewrites77.7%
Taylor expanded in x around 0
Applied rewrites80.8%
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+215)
(* (* 9.0 (/ x c)) (/ y z))
(if (<= t_1 -5e-17)
(/ (fma (* 9.0 x) y b) (* z c))
(if (<= t_1 1e+156)
(/ (fma -4.0 (* (* t z) a) b) (* z c))
(* (/ (* y 9.0) z) (/ x 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+215) {
tmp = (9.0 * (x / c)) * (y / z);
} else if (t_1 <= -5e-17) {
tmp = fma((9.0 * x), y, b) / (z * c);
} else if (t_1 <= 1e+156) {
tmp = fma(-4.0, ((t * z) * a), b) / (z * c);
} else {
tmp = ((y * 9.0) / z) * (x / c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if (t_1 <= -1e+215) tmp = Float64(Float64(9.0 * Float64(x / c)) * Float64(y / z)); elseif (t_1 <= -5e-17) tmp = Float64(fma(Float64(9.0 * x), y, b) / Float64(z * c)); elseif (t_1 <= 1e+156) tmp = Float64(fma(-4.0, Float64(Float64(t * z) * a), b) / Float64(z * c)); else tmp = Float64(Float64(Float64(y * 9.0) / z) * Float64(x / c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+215], N[(N[(9.0 * N[(x / c), $MachinePrecision]), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -5e-17], N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(N[(-4.0 * N[(N[(t * z), $MachinePrecision] * a), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / 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}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\left(9 \cdot \frac{x}{c}\right) \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, \left(t \cdot z\right) \cdot a, b\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 9}{z} \cdot \frac{x}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999907e214Initial program 69.7%
Taylor expanded in x around inf
Applied rewrites92.3%
if -9.99999999999999907e214 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -4.9999999999999999e-17Initial program 83.9%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
Taylor expanded in z around 0
Applied rewrites69.3%
if -4.9999999999999999e-17 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 81.0%
Taylor expanded in x around 0
Applied rewrites74.8%
if 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 66.7%
Taylor expanded in x around inf
Applied rewrites78.8%
Applied rewrites78.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* (* 9.0 x) (/ y (* c z)))))
(if (<= t_1 -2e+18)
t_2
(if (<= t_1 2e-306)
(/ b (* z c))
(if (<= t_1 1e+156) (* -4.0 (/ (* a t) c)) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = (9.0 * x) * (y / (c * z));
double tmp;
if (t_1 <= -2e+18) {
tmp = t_2;
} else if (t_1 <= 2e-306) {
tmp = b / (z * c);
} else if (t_1 <= 1e+156) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = (9.0d0 * x) * (y / (c * z))
if (t_1 <= (-2d+18)) then
tmp = t_2
else if (t_1 <= 2d-306) then
tmp = b / (z * c)
else if (t_1 <= 1d+156) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = (9.0 * x) * (y / (c * z));
double tmp;
if (t_1 <= -2e+18) {
tmp = t_2;
} else if (t_1 <= 2e-306) {
tmp = b / (z * c);
} else if (t_1 <= 1e+156) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = (9.0 * x) * (y / (c * z)) tmp = 0 if t_1 <= -2e+18: tmp = t_2 elif t_1 <= 2e-306: tmp = b / (z * c) elif t_1 <= 1e+156: tmp = -4.0 * ((a * t) / c) else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(Float64(9.0 * x) * Float64(y / Float64(c * z))) tmp = 0.0 if (t_1 <= -2e+18) tmp = t_2; elseif (t_1 <= 2e-306) tmp = Float64(b / Float64(z * c)); elseif (t_1 <= 1e+156) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = (9.0 * x) * (y / (c * z));
tmp = 0.0;
if (t_1 <= -2e+18)
tmp = t_2;
elseif (t_1 <= 2e-306)
tmp = b / (z * c);
elseif (t_1 <= 1e+156)
tmp = -4.0 * ((a * t) / c);
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(9.0 * x), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+18], t$95$2, If[LessEqual[t$95$1, 2e-306], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := \left(9 \cdot x\right) \cdot \frac{y}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e18 or 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 73.5%
Taylor expanded in x around inf
Applied rewrites71.0%
Applied rewrites70.2%
if -2e18 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000006e-306Initial program 83.0%
Taylor expanded in b around inf
Applied rewrites60.5%
if 2.00000000000000006e-306 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 78.8%
Taylor expanded in z around inf
Applied rewrites47.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* x (/ (* y 9.0) (* c z)))))
(if (<= t_1 -2e+18)
t_2
(if (<= t_1 2e-306)
(/ b (* z c))
(if (<= t_1 1e+156) (* -4.0 (/ (* a t) c)) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y * 9.0) / (c * z));
double tmp;
if (t_1 <= -2e+18) {
tmp = t_2;
} else if (t_1 <= 2e-306) {
tmp = b / (z * c);
} else if (t_1 <= 1e+156) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = x * ((y * 9.0d0) / (c * z))
if (t_1 <= (-2d+18)) then
tmp = t_2
else if (t_1 <= 2d-306) then
tmp = b / (z * c)
else if (t_1 <= 1d+156) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = x * ((y * 9.0) / (c * z));
double tmp;
if (t_1 <= -2e+18) {
tmp = t_2;
} else if (t_1 <= 2e-306) {
tmp = b / (z * c);
} else if (t_1 <= 1e+156) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = x * ((y * 9.0) / (c * z)) tmp = 0 if t_1 <= -2e+18: tmp = t_2 elif t_1 <= 2e-306: tmp = b / (z * c) elif t_1 <= 1e+156: tmp = -4.0 * ((a * t) / c) else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(x * Float64(Float64(y * 9.0) / Float64(c * z))) tmp = 0.0 if (t_1 <= -2e+18) tmp = t_2; elseif (t_1 <= 2e-306) tmp = Float64(b / Float64(z * c)); elseif (t_1 <= 1e+156) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = x * ((y * 9.0) / (c * z));
tmp = 0.0;
if (t_1 <= -2e+18)
tmp = t_2;
elseif (t_1 <= 2e-306)
tmp = b / (z * c);
elseif (t_1 <= 1e+156)
tmp = -4.0 * ((a * t) / c);
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * 9.0), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+18], t$95$2, If[LessEqual[t$95$1, 2e-306], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+156], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := x \cdot \frac{y \cdot 9}{c \cdot z}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 10^{+156}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e18 or 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 73.5%
Taylor expanded in x around inf
Applied rewrites71.0%
Applied rewrites70.0%
if -2e18 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000006e-306Initial program 83.0%
Taylor expanded in b around inf
Applied rewrites60.5%
if 2.00000000000000006e-306 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 78.8%
Taylor expanded in z around inf
Applied rewrites47.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* x 9.0) y)) (t_2 (* 9.0 (/ (* x y) (* z c)))))
(if (<= t_1 -2e+18)
t_2
(if (<= t_1 2e-306)
(/ b (* z c))
(if (<= t_1 1.05e+38) (* -4.0 (/ (* a t) c)) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (z * c));
double tmp;
if (t_1 <= -2e+18) {
tmp = t_2;
} else if (t_1 <= 2e-306) {
tmp = b / (z * c);
} else if (t_1 <= 1.05e+38) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 9.0d0) * y
t_2 = 9.0d0 * ((x * y) / (z * c))
if (t_1 <= (-2d+18)) then
tmp = t_2
else if (t_1 <= 2d-306) then
tmp = b / (z * c)
else if (t_1 <= 1.05d+38) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double t_2 = 9.0 * ((x * y) / (z * c));
double tmp;
if (t_1 <= -2e+18) {
tmp = t_2;
} else if (t_1 <= 2e-306) {
tmp = b / (z * c);
} else if (t_1 <= 1.05e+38) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (x * 9.0) * y t_2 = 9.0 * ((x * y) / (z * c)) tmp = 0 if t_1 <= -2e+18: tmp = t_2 elif t_1 <= 2e-306: tmp = b / (z * c) elif t_1 <= 1.05e+38: tmp = -4.0 * ((a * t) / c) else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) t_2 = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))) tmp = 0.0 if (t_1 <= -2e+18) tmp = t_2; elseif (t_1 <= 2e-306) tmp = Float64(b / Float64(z * c)); elseif (t_1 <= 1.05e+38) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (x * 9.0) * y;
t_2 = 9.0 * ((x * y) / (z * c));
tmp = 0.0;
if (t_1 <= -2e+18)
tmp = t_2;
elseif (t_1 <= 2e-306)
tmp = b / (z * c);
elseif (t_1 <= 1.05e+38)
tmp = -4.0 * ((a * t) / c);
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+18], t$95$2, If[LessEqual[t$95$1, 2e-306], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.05e+38], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
t_2 := 9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t\_1 \leq 1.05 \cdot 10^{+38}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2e18 or 1.05e38 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 74.6%
Taylor expanded in x around inf
Applied rewrites61.6%
Applied rewrites56.0%
Applied rewrites56.0%
Applied rewrites56.0%
if -2e18 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000006e-306Initial program 83.0%
Taylor expanded in b around inf
Applied rewrites60.5%
if 2.00000000000000006e-306 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.05e38Initial program 78.8%
Taylor expanded in z around inf
Applied rewrites56.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 (or (<= z -1e+59) (not (<= z 4e+85))) (fma a (* t (/ -4.0 c)) (/ (/ (fma (* y x) 9.0 b) z) c)) (/ (+ (fma (* y x) 9.0 (* (* (* -4.0 z) a) t)) b) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1e+59) || !(z <= 4e+85)) {
tmp = fma(a, (t * (-4.0 / c)), ((fma((y * x), 9.0, b) / z) / c));
} else {
tmp = (fma((y * x), 9.0, (((-4.0 * z) * a) * t)) + b) / (z * c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1e+59) || !(z <= 4e+85)) tmp = fma(a, Float64(t * Float64(-4.0 / c)), Float64(Float64(fma(Float64(y * x), 9.0, b) / z) / c)); else tmp = Float64(Float64(fma(Float64(y * x), 9.0, Float64(Float64(Float64(-4.0 * z) * a) * t)) + b) / Float64(z * c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1e+59], N[Not[LessEqual[z, 4e+85]], $MachinePrecision]], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * 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 -1 \cdot 10^{+59} \lor \neg \left(z \leq 4 \cdot 10^{+85}\right):\\
\;\;\;\;\mathsf{fma}\left(a, t \cdot \frac{-4}{c}, \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, \left(\left(-4 \cdot z\right) \cdot a\right) \cdot t\right) + b}{z \cdot c}\\
\end{array}
\end{array}
if z < -9.99999999999999972e58 or 4.0000000000000001e85 < z Initial program 49.4%
Taylor expanded in x around 0
Applied rewrites84.4%
Applied rewrites86.8%
Applied rewrites86.7%
if -9.99999999999999972e58 < z < 4.0000000000000001e85Initial program 95.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
Applied rewrites95.8%
Final simplification92.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 (/ (/ (fma (* y x) 9.0 b) z) c)))
(if (<= z -1e+59)
(fma a (* t (/ -4.0 c)) t_1)
(if (<= z 4e+85)
(/ (+ (fma (* y x) 9.0 (* (* (* -4.0 z) a) t)) b) (* z c))
(fma a (/ (* -4.0 t) 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((y * x), 9.0, b) / z) / c;
double tmp;
if (z <= -1e+59) {
tmp = fma(a, (t * (-4.0 / c)), t_1);
} else if (z <= 4e+85) {
tmp = (fma((y * x), 9.0, (((-4.0 * z) * a) * t)) + b) / (z * c);
} else {
tmp = fma(a, ((-4.0 * t) / c), t_1);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(fma(Float64(y * x), 9.0, b) / z) / c) tmp = 0.0 if (z <= -1e+59) tmp = fma(a, Float64(t * Float64(-4.0 / c)), t_1); elseif (z <= 4e+85) tmp = Float64(Float64(fma(Float64(y * x), 9.0, Float64(Float64(Float64(-4.0 * z) * a) * t)) + b) / Float64(z * c)); else tmp = fma(a, Float64(Float64(-4.0 * t) / c), 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[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -1e+59], N[(a * N[(t * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 4e+85], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(-4.0 * t), $MachinePrecision] / c), $MachinePrecision] + t$95$1), $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 := \frac{\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}}{c}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+59}:\\
\;\;\;\;\mathsf{fma}\left(a, t \cdot \frac{-4}{c}, t\_1\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+85}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, \left(\left(-4 \cdot z\right) \cdot a\right) \cdot t\right) + b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{-4 \cdot t}{c}, t\_1\right)\\
\end{array}
\end{array}
if z < -9.99999999999999972e58Initial program 46.5%
Taylor expanded in x around 0
Applied rewrites84.9%
Applied rewrites84.2%
Applied rewrites84.1%
if -9.99999999999999972e58 < z < 4.0000000000000001e85Initial program 95.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
Applied rewrites95.8%
if 4.0000000000000001e85 < z Initial program 52.5%
Taylor expanded in x around 0
Applied rewrites83.8%
Applied rewrites89.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 (or (<= t_1 -1e+126) (not (<= t_1 1e+156)))
(* (/ (* y 9.0) z) (/ x c))
(/ (fma (* -4.0 t) a (/ b z)) c))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * 9.0) * y;
double tmp;
if ((t_1 <= -1e+126) || !(t_1 <= 1e+156)) {
tmp = ((y * 9.0) / z) * (x / c);
} else {
tmp = fma((-4.0 * t), a, (b / z)) / c;
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * 9.0) * y) tmp = 0.0 if ((t_1 <= -1e+126) || !(t_1 <= 1e+156)) tmp = Float64(Float64(Float64(y * 9.0) / z) * Float64(x / c)); else tmp = Float64(fma(Float64(-4.0 * t), a, Float64(b / z)) / c); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+126], N[Not[LessEqual[t$95$1, 1e+156]], $MachinePrecision]], N[(N[(N[(y * 9.0), $MachinePrecision] / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 9\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+126} \lor \neg \left(t\_1 \leq 10^{+156}\right):\\
\;\;\;\;\frac{y \cdot 9}{z} \cdot \frac{x}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{b}{z}\right)}{c}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -9.99999999999999925e125 or 9.9999999999999998e155 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 73.0%
Taylor expanded in x around inf
Applied rewrites80.4%
Applied rewrites80.5%
if -9.99999999999999925e125 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999998e155Initial program 80.6%
Taylor expanded in x around 0
Applied rewrites88.0%
Taylor expanded in x around 0
Applied rewrites78.4%
Final simplification79.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 (or (<= z -5.5e+58) (not (<= z 4.5e+78))) (/ (fma (* -4.0 t) a (/ (fma (* y x) 9.0 b) z)) c) (/ (+ (fma (* y x) 9.0 (* (* (* -4.0 z) a) t)) b) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -5.5e+58) || !(z <= 4.5e+78)) {
tmp = fma((-4.0 * t), a, (fma((y * x), 9.0, b) / z)) / c;
} else {
tmp = (fma((y * x), 9.0, (((-4.0 * z) * a) * t)) + b) / (z * c);
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -5.5e+58) || !(z <= 4.5e+78)) tmp = Float64(fma(Float64(-4.0 * t), a, Float64(fma(Float64(y * x), 9.0, b) / z)) / c); else tmp = Float64(Float64(fma(Float64(y * x), 9.0, Float64(Float64(Float64(-4.0 * z) * a) * t)) + b) / Float64(z * c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5.5e+58], N[Not[LessEqual[z, 4.5e+78]], $MachinePrecision]], N[(N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(y * x), $MachinePrecision] * 9.0 + N[(N[(N[(-4.0 * z), $MachinePrecision] * a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * 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.5 \cdot 10^{+58} \lor \neg \left(z \leq 4.5 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(-4 \cdot t, a, \frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, \left(\left(-4 \cdot z\right) \cdot a\right) \cdot t\right) + b}{z \cdot c}\\
\end{array}
\end{array}
if z < -5.4999999999999999e58 or 4.4999999999999999e78 < z Initial program 49.9%
Taylor expanded in x around 0
Applied rewrites84.5%
if -5.4999999999999999e58 < z < 4.4999999999999999e78Initial program 95.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
distribute-lft-neg-inN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
Applied rewrites95.7%
Final simplification91.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 (or (<= z -5e+58) (not (<= z 3.6e+125))) (* -4.0 (/ (* a t) c)) (/ (fma (* 9.0 x) y 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 ((z <= -5e+58) || !(z <= 3.6e+125)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = fma((9.0 * x), y, 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 ((z <= -5e+58) || !(z <= 3.6e+125)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(fma(Float64(9.0 * x), y, b) / Float64(z * c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5e+58], N[Not[LessEqual[z, 3.6e+125]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(9.0 * x), $MachinePrecision] * y + b), $MachinePrecision] / N[(z * 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 \cdot 10^{+58} \lor \neg \left(z \leq 3.6 \cdot 10^{+125}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.99999999999999986e58 or 3.6000000000000003e125 < z Initial program 48.2%
Taylor expanded in z around inf
Applied rewrites63.1%
if -4.99999999999999986e58 < z < 3.6000000000000003e125Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6493.0
Applied rewrites93.0%
Taylor expanded in z around 0
Applied rewrites79.8%
Final simplification73.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -5e+58) (not (<= z 3.6e+125))) (* -4.0 (/ (* a t) c)) (/ (fma (* y x) 9.0 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 ((z <= -5e+58) || !(z <= 3.6e+125)) {
tmp = -4.0 * ((a * t) / 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]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -5e+58) || !(z <= 3.6e+125)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(fma(Float64(y * x), 9.0, b) / Float64(z * c)); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -5e+58], N[Not[LessEqual[z, 3.6e+125]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] * 9.0 + b), $MachinePrecision] / N[(z * 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 \cdot 10^{+58} \lor \neg \left(z \leq 3.6 \cdot 10^{+125}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot x, 9, b\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.99999999999999986e58 or 3.6000000000000003e125 < z Initial program 48.2%
Taylor expanded in z around inf
Applied rewrites63.1%
if -4.99999999999999986e58 < z < 3.6000000000000003e125Initial program 94.8%
Taylor expanded in z around 0
Applied rewrites79.8%
Final simplification73.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -3.8e+26) (not (<= t 4e-92))) (* -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 ((t <= -3.8e+26) || !(t <= 4e-92)) {
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 ((t <= (-3.8d+26)) .or. (.not. (t <= 4d-92))) 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 ((t <= -3.8e+26) || !(t <= 4e-92)) {
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 (t <= -3.8e+26) or not (t <= 4e-92): 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 ((t <= -3.8e+26) || !(t <= 4e-92)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(b / Float64(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 ((t <= -3.8e+26) || ~((t <= 4e-92)))
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[Or[LessEqual[t, -3.8e+26], N[Not[LessEqual[t, 4e-92]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+26} \lor \neg \left(t \leq 4 \cdot 10^{-92}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if t < -3.8000000000000002e26 or 3.99999999999999995e-92 < t Initial program 70.9%
Taylor expanded in z around inf
Applied rewrites50.2%
if -3.8000000000000002e26 < t < 3.99999999999999995e-92Initial program 87.4%
Taylor expanded in b around inf
Applied rewrites49.8%
Final simplification50.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 78.4%
Taylor expanded in b around inf
Applied rewrites36.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025020
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -220031348160821/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 365902434742109/31250000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 28768236795461370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 138385150424563190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c)))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))