
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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 * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
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 * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + 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 (/ (* a b) 4.0)) (t_2 (+ (* x y) (/ (* z t) 16.0))))
(if (<= t_2 5e+251)
(+ c (- t_2 t_1))
(+ c (- (* x (+ y (* 0.0625 (* t (/ z x))))) 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 = (a * b) / 4.0;
double t_2 = (x * y) + ((z * t) / 16.0);
double tmp;
if (t_2 <= 5e+251) {
tmp = c + (t_2 - t_1);
} else {
tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 = (a * b) / 4.0d0
t_2 = (x * y) + ((z * t) / 16.0d0)
if (t_2 <= 5d+251) then
tmp = c + (t_2 - t_1)
else
tmp = c + ((x * (y + (0.0625d0 * (t * (z / x))))) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) / 4.0;
double t_2 = (x * y) + ((z * t) / 16.0);
double tmp;
if (t_2 <= 5e+251) {
tmp = c + (t_2 - t_1);
} else {
tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (a * b) / 4.0 t_2 = (x * y) + ((z * t) / 16.0) tmp = 0 if t_2 <= 5e+251: tmp = c + (t_2 - t_1) else: tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - 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(a * b) / 4.0) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (t_2 <= 5e+251) tmp = Float64(c + Float64(t_2 - t_1)); else tmp = Float64(c + Float64(Float64(x * Float64(y + Float64(0.0625 * Float64(t * Float64(z / x))))) - t_1)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * b) / 4.0;
t_2 = (x * y) + ((z * t) / 16.0);
tmp = 0.0;
if (t_2 <= 5e+251)
tmp = c + (t_2 - t_1);
else
tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+251], N[(c + N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * N[(y + N[(0.0625 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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{a \cdot b}{4}\\
t_2 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{+251}:\\
\;\;\;\;c + \left(t\_2 - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot \left(y + 0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\right) - t\_1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 5.0000000000000005e251Initial program 99.5%
if 5.0000000000000005e251 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) Initial program 85.2%
Taylor expanded in x around inf 91.1%
associate-/l*97.0%
Simplified97.0%
Final simplification99.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 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) 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 fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + 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(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + 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[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Initial program 97.6%
associate--l+97.6%
fma-define98.4%
associate-/l*98.4%
fma-neg98.4%
distribute-neg-frac298.4%
metadata-eval98.4%
Simplified98.4%
Final simplification98.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 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
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 c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
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(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0)))) 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[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
associate-+l-97.6%
fma-define98.4%
*-commutative98.4%
associate-/l*98.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.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 (* b (* a -0.25))))
(if (<= (* x y) -2.1e+182)
(* x y)
(if (<= (* x y) -9.5e+20)
c
(if (<= (* x y) 5e-316)
t_1
(if (<= (* x y) 6.6e-154)
c
(if (<= (* x y) 1.12e+169) t_1 (* x 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 = b * (a * -0.25);
double tmp;
if ((x * y) <= -2.1e+182) {
tmp = x * y;
} else if ((x * y) <= -9.5e+20) {
tmp = c;
} else if ((x * y) <= 5e-316) {
tmp = t_1;
} else if ((x * y) <= 6.6e-154) {
tmp = c;
} else if ((x * y) <= 1.12e+169) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * (-0.25d0))
if ((x * y) <= (-2.1d+182)) then
tmp = x * y
else if ((x * y) <= (-9.5d+20)) then
tmp = c
else if ((x * y) <= 5d-316) then
tmp = t_1
else if ((x * y) <= 6.6d-154) then
tmp = c
else if ((x * y) <= 1.12d+169) then
tmp = t_1
else
tmp = x * y
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 = b * (a * -0.25);
double tmp;
if ((x * y) <= -2.1e+182) {
tmp = x * y;
} else if ((x * y) <= -9.5e+20) {
tmp = c;
} else if ((x * y) <= 5e-316) {
tmp = t_1;
} else if ((x * y) <= 6.6e-154) {
tmp = c;
} else if ((x * y) <= 1.12e+169) {
tmp = t_1;
} else {
tmp = x * y;
}
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 = b * (a * -0.25) tmp = 0 if (x * y) <= -2.1e+182: tmp = x * y elif (x * y) <= -9.5e+20: tmp = c elif (x * y) <= 5e-316: tmp = t_1 elif (x * y) <= 6.6e-154: tmp = c elif (x * y) <= 1.12e+169: tmp = t_1 else: tmp = x * 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(b * Float64(a * -0.25)) tmp = 0.0 if (Float64(x * y) <= -2.1e+182) tmp = Float64(x * y); elseif (Float64(x * y) <= -9.5e+20) tmp = c; elseif (Float64(x * y) <= 5e-316) tmp = t_1; elseif (Float64(x * y) <= 6.6e-154) tmp = c; elseif (Float64(x * y) <= 1.12e+169) tmp = t_1; else tmp = Float64(x * y); 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 = b * (a * -0.25);
tmp = 0.0;
if ((x * y) <= -2.1e+182)
tmp = x * y;
elseif ((x * y) <= -9.5e+20)
tmp = c;
elseif ((x * y) <= 5e-316)
tmp = t_1;
elseif ((x * y) <= 6.6e-154)
tmp = c;
elseif ((x * y) <= 1.12e+169)
tmp = t_1;
else
tmp = x * y;
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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+182], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -9.5e+20], c, If[LessEqual[N[(x * y), $MachinePrecision], 5e-316], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.6e-154], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.12e+169], t$95$1, N[(x * 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 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{+20}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-316}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-154}:\\
\;\;\;\;c\\
\mathbf{elif}\;x \cdot y \leq 1.12 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0999999999999999e182 or 1.11999999999999996e169 < (*.f64 x y) Initial program 90.1%
Taylor expanded in z around 0 84.8%
Taylor expanded in x around inf 80.3%
if -2.0999999999999999e182 < (*.f64 x y) < -9.5e20 or 5.000000017e-316 < (*.f64 x y) < 6.60000000000000055e-154Initial program 100.0%
Taylor expanded in c around inf 43.3%
if -9.5e20 < (*.f64 x y) < 5.000000017e-316 or 6.60000000000000055e-154 < (*.f64 x y) < 1.11999999999999996e169Initial program 100.0%
Taylor expanded in z around 0 66.6%
Taylor expanded in a around inf 37.3%
associate-*r*37.3%
*-commutative37.3%
*-commutative37.3%
Simplified37.3%
Final simplification48.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 (+ c (* b (* a -0.25)))))
(if (<= (* x y) -2e+182)
(- (* x y) (* (* a b) 0.25))
(if (<= (* x y) 3e-272)
t_1
(if (<= (* x y) 5e-55)
(* z (+ (* t 0.0625) (/ c z)))
(if (<= (* x y) 1e+97) t_1 (* y (+ x (* 0.0625 (/ (* z t) 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 = c + (b * (a * -0.25));
double tmp;
if ((x * y) <= -2e+182) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= 3e-272) {
tmp = t_1;
} else if ((x * y) <= 5e-55) {
tmp = z * ((t * 0.0625) + (c / z));
} else if ((x * y) <= 1e+97) {
tmp = t_1;
} else {
tmp = y * (x + (0.0625 * ((z * t) / y)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 = c + (b * (a * (-0.25d0)))
if ((x * y) <= (-2d+182)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((x * y) <= 3d-272) then
tmp = t_1
else if ((x * y) <= 5d-55) then
tmp = z * ((t * 0.0625d0) + (c / z))
else if ((x * y) <= 1d+97) then
tmp = t_1
else
tmp = y * (x + (0.0625d0 * ((z * t) / y)))
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 = c + (b * (a * -0.25));
double tmp;
if ((x * y) <= -2e+182) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= 3e-272) {
tmp = t_1;
} else if ((x * y) <= 5e-55) {
tmp = z * ((t * 0.0625) + (c / z));
} else if ((x * y) <= 1e+97) {
tmp = t_1;
} else {
tmp = y * (x + (0.0625 * ((z * t) / y)));
}
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 = c + (b * (a * -0.25)) tmp = 0 if (x * y) <= -2e+182: tmp = (x * y) - ((a * b) * 0.25) elif (x * y) <= 3e-272: tmp = t_1 elif (x * y) <= 5e-55: tmp = z * ((t * 0.0625) + (c / z)) elif (x * y) <= 1e+97: tmp = t_1 else: tmp = y * (x + (0.0625 * ((z * t) / 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(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (Float64(x * y) <= -2e+182) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(x * y) <= 3e-272) tmp = t_1; elseif (Float64(x * y) <= 5e-55) tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(c / z))); elseif (Float64(x * y) <= 1e+97) tmp = t_1; else tmp = Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y)))); 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 = c + (b * (a * -0.25));
tmp = 0.0;
if ((x * y) <= -2e+182)
tmp = (x * y) - ((a * b) * 0.25);
elseif ((x * y) <= 3e-272)
tmp = t_1;
elseif ((x * y) <= 5e-55)
tmp = z * ((t * 0.0625) + (c / z));
elseif ((x * y) <= 1e+97)
tmp = t_1;
else
tmp = y * (x + (0.0625 * ((z * t) / y)));
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[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+182], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-55], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+97], t$95$1, N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $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 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-55}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0000000000000001e182Initial program 89.7%
Taylor expanded in z around 0 93.1%
Taylor expanded in c around 0 93.1%
if -2.0000000000000001e182 < (*.f64 x y) < 3.0000000000000003e-272 or 5.0000000000000002e-55 < (*.f64 x y) < 1.0000000000000001e97Initial program 100.0%
Taylor expanded in a around inf 67.3%
associate-*r*67.3%
*-commutative67.3%
*-commutative67.3%
Simplified67.3%
if 3.0000000000000003e-272 < (*.f64 x y) < 5.0000000000000002e-55Initial program 100.0%
Taylor expanded in t around inf 90.7%
Taylor expanded in t around inf 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*r*74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in z around inf 69.9%
if 1.0000000000000001e97 < (*.f64 x y) Initial program 94.1%
Taylor expanded in a around 0 84.9%
Taylor expanded in c around 0 75.7%
Taylor expanded in y around inf 75.9%
Final simplification72.3%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* b (* a -0.25)))))
(if (<= (* x y) -1.05e+57)
(+ c (* x y))
(if (<= (* x y) 2.9e-272)
t_1
(if (<= (* x y) 5.6e-51)
(* z (+ (* t 0.0625) (/ c z)))
(if (<= (* x y) 8.8e+101) t_1 (+ (* x y) (* 0.0625 (* z t)))))))))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 = c + (b * (a * -0.25));
double tmp;
if ((x * y) <= -1.05e+57) {
tmp = c + (x * y);
} else if ((x * y) <= 2.9e-272) {
tmp = t_1;
} else if ((x * y) <= 5.6e-51) {
tmp = z * ((t * 0.0625) + (c / z));
} else if ((x * y) <= 8.8e+101) {
tmp = t_1;
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 = c + (b * (a * (-0.25d0)))
if ((x * y) <= (-1.05d+57)) then
tmp = c + (x * y)
else if ((x * y) <= 2.9d-272) then
tmp = t_1
else if ((x * y) <= 5.6d-51) then
tmp = z * ((t * 0.0625d0) + (c / z))
else if ((x * y) <= 8.8d+101) then
tmp = t_1
else
tmp = (x * y) + (0.0625d0 * (z * t))
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 = c + (b * (a * -0.25));
double tmp;
if ((x * y) <= -1.05e+57) {
tmp = c + (x * y);
} else if ((x * y) <= 2.9e-272) {
tmp = t_1;
} else if ((x * y) <= 5.6e-51) {
tmp = z * ((t * 0.0625) + (c / z));
} else if ((x * y) <= 8.8e+101) {
tmp = t_1;
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
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 = c + (b * (a * -0.25)) tmp = 0 if (x * y) <= -1.05e+57: tmp = c + (x * y) elif (x * y) <= 2.9e-272: tmp = t_1 elif (x * y) <= 5.6e-51: tmp = z * ((t * 0.0625) + (c / z)) elif (x * y) <= 8.8e+101: tmp = t_1 else: tmp = (x * y) + (0.0625 * (z * t)) 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(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (Float64(x * y) <= -1.05e+57) tmp = Float64(c + Float64(x * y)); elseif (Float64(x * y) <= 2.9e-272) tmp = t_1; elseif (Float64(x * y) <= 5.6e-51) tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(c / z))); elseif (Float64(x * y) <= 8.8e+101) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); 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 = c + (b * (a * -0.25));
tmp = 0.0;
if ((x * y) <= -1.05e+57)
tmp = c + (x * y);
elseif ((x * y) <= 2.9e-272)
tmp = t_1;
elseif ((x * y) <= 5.6e-51)
tmp = z * ((t * 0.0625) + (c / z));
elseif ((x * y) <= 8.8e+101)
tmp = t_1;
else
tmp = (x * y) + (0.0625 * (z * t));
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[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+57], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.9e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.6e-51], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.8e+101], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $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 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+57}:\\
\;\;\;\;c + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-51}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\
\mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.04999999999999995e57Initial program 93.6%
Taylor expanded in t around inf 81.4%
Taylor expanded in x around inf 79.6%
if -1.04999999999999995e57 < (*.f64 x y) < 2.89999999999999995e-272 or 5.6e-51 < (*.f64 x y) < 8.8000000000000003e101Initial program 99.9%
Taylor expanded in a around inf 68.3%
associate-*r*68.3%
*-commutative68.3%
*-commutative68.3%
Simplified68.3%
if 2.89999999999999995e-272 < (*.f64 x y) < 5.6e-51Initial program 100.0%
Taylor expanded in t around inf 90.7%
Taylor expanded in t around inf 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*r*74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in z around inf 69.9%
if 8.8000000000000003e101 < (*.f64 x y) Initial program 94.1%
Taylor expanded in a around 0 84.9%
Taylor expanded in c around 0 75.7%
Final simplification72.1%
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 (+ c (* b (* a -0.25)))))
(if (<= (* x y) -1.8e+182)
(- (* x y) (* (* a b) 0.25))
(if (<= (* x y) 2.45e-272)
t_1
(if (<= (* x y) 4.8e-52)
(* z (+ (* t 0.0625) (/ c z)))
(if (<= (* x y) 8.5e+101) t_1 (+ (* x y) (* 0.0625 (* z t)))))))))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 = c + (b * (a * -0.25));
double tmp;
if ((x * y) <= -1.8e+182) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= 2.45e-272) {
tmp = t_1;
} else if ((x * y) <= 4.8e-52) {
tmp = z * ((t * 0.0625) + (c / z));
} else if ((x * y) <= 8.5e+101) {
tmp = t_1;
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 = c + (b * (a * (-0.25d0)))
if ((x * y) <= (-1.8d+182)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((x * y) <= 2.45d-272) then
tmp = t_1
else if ((x * y) <= 4.8d-52) then
tmp = z * ((t * 0.0625d0) + (c / z))
else if ((x * y) <= 8.5d+101) then
tmp = t_1
else
tmp = (x * y) + (0.0625d0 * (z * t))
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 = c + (b * (a * -0.25));
double tmp;
if ((x * y) <= -1.8e+182) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((x * y) <= 2.45e-272) {
tmp = t_1;
} else if ((x * y) <= 4.8e-52) {
tmp = z * ((t * 0.0625) + (c / z));
} else if ((x * y) <= 8.5e+101) {
tmp = t_1;
} else {
tmp = (x * y) + (0.0625 * (z * t));
}
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 = c + (b * (a * -0.25)) tmp = 0 if (x * y) <= -1.8e+182: tmp = (x * y) - ((a * b) * 0.25) elif (x * y) <= 2.45e-272: tmp = t_1 elif (x * y) <= 4.8e-52: tmp = z * ((t * 0.0625) + (c / z)) elif (x * y) <= 8.5e+101: tmp = t_1 else: tmp = (x * y) + (0.0625 * (z * t)) 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(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (Float64(x * y) <= -1.8e+182) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(x * y) <= 2.45e-272) tmp = t_1; elseif (Float64(x * y) <= 4.8e-52) tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(c / z))); elseif (Float64(x * y) <= 8.5e+101) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))); 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 = c + (b * (a * -0.25));
tmp = 0.0;
if ((x * y) <= -1.8e+182)
tmp = (x * y) - ((a * b) * 0.25);
elseif ((x * y) <= 2.45e-272)
tmp = t_1;
elseif ((x * y) <= 4.8e-52)
tmp = z * ((t * 0.0625) + (c / z));
elseif ((x * y) <= 8.5e+101)
tmp = t_1;
else
tmp = (x * y) + (0.0625 * (z * t));
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[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+182], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.45e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e-52], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.5e+101], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $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 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;x \cdot y \leq 2.45 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-52}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\
\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.8e182Initial program 89.7%
Taylor expanded in z around 0 93.1%
Taylor expanded in c around 0 93.1%
if -1.8e182 < (*.f64 x y) < 2.4499999999999999e-272 or 4.8000000000000003e-52 < (*.f64 x y) < 8.5000000000000001e101Initial program 100.0%
Taylor expanded in a around inf 67.3%
associate-*r*67.3%
*-commutative67.3%
*-commutative67.3%
Simplified67.3%
if 2.4499999999999999e-272 < (*.f64 x y) < 4.8000000000000003e-52Initial program 100.0%
Taylor expanded in t around inf 90.7%
Taylor expanded in t around inf 74.4%
*-commutative74.4%
*-commutative74.4%
associate-*r*74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in z around inf 69.9%
if 8.5000000000000001e101 < (*.f64 x y) Initial program 94.1%
Taylor expanded in a around 0 84.9%
Taylor expanded in c around 0 75.7%
Final simplification72.3%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
(if (<= t_1 INFINITY)
(+ c t_1)
(+ c (* y (+ x (* 0.0625 (/ (* z t) 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 * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = c + t_1;
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
return tmp;
}
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 * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = c + t_1;
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
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 * y) + ((z * t) / 16.0)) - ((a * b) / 4.0) tmp = 0 if t_1 <= math.inf: tmp = c + t_1 else: tmp = c + (y * (x + (0.0625 * ((z * t) / 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(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(c + t_1); else tmp = Float64(c + Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y))))); 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 * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
tmp = 0.0;
if (t_1 <= Inf)
tmp = c + t_1;
else
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
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[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\
\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0Initial program 100.0%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) Initial program 0.0%
Taylor expanded in a around 0 33.3%
Taylor expanded in y around inf 66.7%
Final simplification99.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ c (* x y)))
(t_2 (+ c (* z (* t 0.0625))))
(t_3 (+ c (* b (* a -0.25)))))
(if (<= z -4.7e+122)
t_2
(if (<= z -1.52e-74)
t_1
(if (<= z 5.5e-306)
t_3
(if (<= z 1.5e-238) t_1 (if (<= z 9.5e-70) t_3 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 = c + (x * y);
double t_2 = c + (z * (t * 0.0625));
double t_3 = c + (b * (a * -0.25));
double tmp;
if (z <= -4.7e+122) {
tmp = t_2;
} else if (z <= -1.52e-74) {
tmp = t_1;
} else if (z <= 5.5e-306) {
tmp = t_3;
} else if (z <= 1.5e-238) {
tmp = t_1;
} else if (z <= 9.5e-70) {
tmp = t_3;
} 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.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = c + (x * y)
t_2 = c + (z * (t * 0.0625d0))
t_3 = c + (b * (a * (-0.25d0)))
if (z <= (-4.7d+122)) then
tmp = t_2
else if (z <= (-1.52d-74)) then
tmp = t_1
else if (z <= 5.5d-306) then
tmp = t_3
else if (z <= 1.5d-238) then
tmp = t_1
else if (z <= 9.5d-70) then
tmp = t_3
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 = c + (x * y);
double t_2 = c + (z * (t * 0.0625));
double t_3 = c + (b * (a * -0.25));
double tmp;
if (z <= -4.7e+122) {
tmp = t_2;
} else if (z <= -1.52e-74) {
tmp = t_1;
} else if (z <= 5.5e-306) {
tmp = t_3;
} else if (z <= 1.5e-238) {
tmp = t_1;
} else if (z <= 9.5e-70) {
tmp = t_3;
} 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 = c + (x * y) t_2 = c + (z * (t * 0.0625)) t_3 = c + (b * (a * -0.25)) tmp = 0 if z <= -4.7e+122: tmp = t_2 elif z <= -1.52e-74: tmp = t_1 elif z <= 5.5e-306: tmp = t_3 elif z <= 1.5e-238: tmp = t_1 elif z <= 9.5e-70: tmp = t_3 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(c + Float64(x * y)) t_2 = Float64(c + Float64(z * Float64(t * 0.0625))) t_3 = Float64(c + Float64(b * Float64(a * -0.25))) tmp = 0.0 if (z <= -4.7e+122) tmp = t_2; elseif (z <= -1.52e-74) tmp = t_1; elseif (z <= 5.5e-306) tmp = t_3; elseif (z <= 1.5e-238) tmp = t_1; elseif (z <= 9.5e-70) tmp = t_3; 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 = c + (x * y);
t_2 = c + (z * (t * 0.0625));
t_3 = c + (b * (a * -0.25));
tmp = 0.0;
if (z <= -4.7e+122)
tmp = t_2;
elseif (z <= -1.52e-74)
tmp = t_1;
elseif (z <= 5.5e-306)
tmp = t_3;
elseif (z <= 1.5e-238)
tmp = t_1;
elseif (z <= 9.5e-70)
tmp = t_3;
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[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.7e+122], t$95$2, If[LessEqual[z, -1.52e-74], t$95$1, If[LessEqual[z, 5.5e-306], t$95$3, If[LessEqual[z, 1.5e-238], t$95$1, If[LessEqual[z, 9.5e-70], t$95$3, 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 := c + x \cdot y\\
t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_3 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-306}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-70}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.70000000000000023e122 or 9.4999999999999994e-70 < z Initial program 95.8%
Taylor expanded in t around inf 80.5%
Taylor expanded in t around inf 63.4%
*-commutative63.4%
*-commutative63.4%
associate-*r*63.4%
*-commutative63.4%
Simplified63.4%
if -4.70000000000000023e122 < z < -1.51999999999999997e-74 or 5.49999999999999992e-306 < z < 1.5e-238Initial program 98.0%
Taylor expanded in t around inf 98.1%
Taylor expanded in x around inf 67.4%
if -1.51999999999999997e-74 < z < 5.49999999999999992e-306 or 1.5e-238 < z < 9.4999999999999994e-70Initial program 100.0%
Taylor expanded in a around inf 65.2%
associate-*r*65.2%
*-commutative65.2%
*-commutative65.2%
Simplified65.2%
Final simplification64.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 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))) (t_3 (- t_2 t_1)))
(if (<= (* a b) -1e+154)
t_3
(if (<= (* a b) 2e+94)
(+ c (+ (* x y) t_2))
(if (<= (* a b) 4e+239) (- (+ c (* x y)) 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 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double t_3 = t_2 - t_1;
double tmp;
if ((a * b) <= -1e+154) {
tmp = t_3;
} else if ((a * b) <= 2e+94) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 4e+239) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) * 0.25d0
t_2 = 0.0625d0 * (z * t)
t_3 = t_2 - t_1
if ((a * b) <= (-1d+154)) then
tmp = t_3
else if ((a * b) <= 2d+94) then
tmp = c + ((x * y) + t_2)
else if ((a * b) <= 4d+239) then
tmp = (c + (x * y)) - t_1
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) * 0.25;
double t_2 = 0.0625 * (z * t);
double t_3 = t_2 - t_1;
double tmp;
if ((a * b) <= -1e+154) {
tmp = t_3;
} else if ((a * b) <= 2e+94) {
tmp = c + ((x * y) + t_2);
} else if ((a * b) <= 4e+239) {
tmp = (c + (x * y)) - t_1;
} else {
tmp = t_3;
}
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 * b) * 0.25 t_2 = 0.0625 * (z * t) t_3 = t_2 - t_1 tmp = 0 if (a * b) <= -1e+154: tmp = t_3 elif (a * b) <= 2e+94: tmp = c + ((x * y) + t_2) elif (a * b) <= 4e+239: tmp = (c + (x * y)) - 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 = Float64(Float64(a * b) * 0.25) t_2 = Float64(0.0625 * Float64(z * t)) t_3 = Float64(t_2 - t_1) tmp = 0.0 if (Float64(a * b) <= -1e+154) tmp = t_3; elseif (Float64(a * b) <= 2e+94) tmp = Float64(c + Float64(Float64(x * y) + t_2)); elseif (Float64(a * b) <= 4e+239) tmp = Float64(Float64(c + Float64(x * y)) - t_1); else tmp = t_3; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (a * b) * 0.25;
t_2 = 0.0625 * (z * t);
t_3 = t_2 - t_1;
tmp = 0.0;
if ((a * b) <= -1e+154)
tmp = t_3;
elseif ((a * b) <= 2e+94)
tmp = c + ((x * y) + t_2);
elseif ((a * b) <= 4e+239)
tmp = (c + (x * y)) - t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - t$95$1), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+154], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 2e+94], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e+239], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $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(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := t\_2 - t\_1\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+94}:\\
\;\;\;\;c + \left(x \cdot y + t\_2\right)\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+239}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e154 or 3.99999999999999996e239 < (*.f64 a b) Initial program 96.9%
Taylor expanded in x around 0 93.8%
Taylor expanded in c around 0 92.6%
if -1.00000000000000004e154 < (*.f64 a b) < 2e94Initial program 98.2%
Taylor expanded in a around 0 90.2%
if 2e94 < (*.f64 a b) < 3.99999999999999996e239Initial program 94.7%
Taylor expanded in z around 0 94.7%
Final simplification91.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* (* a b) 0.25)))
(if (<= (* x y) -2e+14)
(- (+ c (* x y)) t_1)
(if (<= (* x y) 2e+151)
(- (+ c (* 0.0625 (* z t))) t_1)
(+ c (* y (+ x (* 0.0625 (/ (* z t) 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 = (a * b) * 0.25;
double tmp;
if ((x * y) <= -2e+14) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 2e+151) {
tmp = (c + (0.0625 * (z * t))) - t_1;
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 * b) * 0.25d0
if ((x * y) <= (-2d+14)) then
tmp = (c + (x * y)) - t_1
else if ((x * y) <= 2d+151) then
tmp = (c + (0.0625d0 * (z * t))) - t_1
else
tmp = c + (y * (x + (0.0625d0 * ((z * t) / y))))
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 * b) * 0.25;
double tmp;
if ((x * y) <= -2e+14) {
tmp = (c + (x * y)) - t_1;
} else if ((x * y) <= 2e+151) {
tmp = (c + (0.0625 * (z * t))) - t_1;
} else {
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
}
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 * b) * 0.25 tmp = 0 if (x * y) <= -2e+14: tmp = (c + (x * y)) - t_1 elif (x * y) <= 2e+151: tmp = (c + (0.0625 * (z * t))) - t_1 else: tmp = c + (y * (x + (0.0625 * ((z * t) / 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(a * b) * 0.25) tmp = 0.0 if (Float64(x * y) <= -2e+14) tmp = Float64(Float64(c + Float64(x * y)) - t_1); elseif (Float64(x * y) <= 2e+151) tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - t_1); else tmp = Float64(c + Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y))))); 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 * b) * 0.25;
tmp = 0.0;
if ((x * y) <= -2e+14)
tmp = (c + (x * y)) - t_1;
elseif ((x * y) <= 2e+151)
tmp = (c + (0.0625 * (z * t))) - t_1;
else
tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
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[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+14], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+151], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2e14Initial program 94.8%
Taylor expanded in z around 0 90.8%
if -2e14 < (*.f64 x y) < 2.00000000000000003e151Initial program 100.0%
Taylor expanded in x around 0 96.0%
if 2.00000000000000003e151 < (*.f64 x y) Initial program 92.0%
Taylor expanded in a around 0 87.5%
Taylor expanded in y around inf 90.2%
Final simplification94.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 (* 0.0625 (* z t))))
(if (or (<= (* a b) -1e+154) (not (<= (* a b) 5e+114)))
(- t_1 (* (* a b) 0.25))
(+ c (+ (* x y) 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 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -1e+154) || !((a * b) <= 5e+114)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 = 0.0625d0 * (z * t)
if (((a * b) <= (-1d+154)) .or. (.not. ((a * b) <= 5d+114))) then
tmp = t_1 - ((a * b) * 0.25d0)
else
tmp = c + ((x * y) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.0625 * (z * t);
double tmp;
if (((a * b) <= -1e+154) || !((a * b) <= 5e+114)) {
tmp = t_1 - ((a * b) * 0.25);
} else {
tmp = c + ((x * y) + t_1);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 0.0625 * (z * t) tmp = 0 if ((a * b) <= -1e+154) or not ((a * b) <= 5e+114): tmp = t_1 - ((a * b) * 0.25) else: tmp = c + ((x * y) + 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(0.0625 * Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -1e+154) || !(Float64(a * b) <= 5e+114)) tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25)); else tmp = Float64(c + Float64(Float64(x * y) + t_1)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 0.0625 * (z * t);
tmp = 0.0;
if (((a * b) <= -1e+154) || ~(((a * b) <= 5e+114)))
tmp = t_1 - ((a * b) * 0.25);
else
tmp = c + ((x * y) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+154], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+114]], $MachinePrecision]], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $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 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+114}\right):\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000004e154 or 5.0000000000000001e114 < (*.f64 a b) Initial program 96.3%
Taylor expanded in x around 0 93.8%
Taylor expanded in c around 0 86.9%
if -1.00000000000000004e154 < (*.f64 a b) < 5.0000000000000001e114Initial program 98.2%
Taylor expanded in a around 0 89.8%
Final simplification88.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 (<= (* a b) -1e+151)
(- (* x y) (* (* a b) 0.25))
(if (<= (* a b) 5e+114)
(+ c (+ (* x y) (* 0.0625 (* z t))))
(+ c (* b (* a -0.25))))))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 ((a * b) <= -1e+151) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 5e+114) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 ((a * b) <= (-1d+151)) then
tmp = (x * y) - ((a * b) * 0.25d0)
else if ((a * b) <= 5d+114) then
tmp = c + ((x * y) + (0.0625d0 * (z * t)))
else
tmp = c + (b * (a * (-0.25d0)))
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 ((a * b) <= -1e+151) {
tmp = (x * y) - ((a * b) * 0.25);
} else if ((a * b) <= 5e+114) {
tmp = c + ((x * y) + (0.0625 * (z * t)));
} else {
tmp = c + (b * (a * -0.25));
}
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 (a * b) <= -1e+151: tmp = (x * y) - ((a * b) * 0.25) elif (a * b) <= 5e+114: tmp = c + ((x * y) + (0.0625 * (z * t))) else: tmp = c + (b * (a * -0.25)) 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(a * b) <= -1e+151) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25)); elseif (Float64(a * b) <= 5e+114) tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))); else tmp = Float64(c + Float64(b * Float64(a * -0.25))); 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 ((a * b) <= -1e+151)
tmp = (x * y) - ((a * b) * 0.25);
elseif ((a * b) <= 5e+114)
tmp = c + ((x * y) + (0.0625 * (z * t)));
else
tmp = c + (b * (a * -0.25));
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[(a * b), $MachinePrecision], -1e+151], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+114], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $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}\;a \cdot b \leq -1 \cdot 10^{+151}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+114}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e151Initial program 97.3%
Taylor expanded in z around 0 81.6%
Taylor expanded in c around 0 79.3%
if -1.00000000000000002e151 < (*.f64 a b) < 5.0000000000000001e114Initial program 98.2%
Taylor expanded in a around 0 90.2%
if 5.0000000000000001e114 < (*.f64 a b) Initial program 95.6%
Taylor expanded in a around inf 78.5%
associate-*r*78.5%
*-commutative78.5%
*-commutative78.5%
Simplified78.5%
Final simplification86.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 (if (or (<= (* x y) -1.4e+57) (not (<= (* x y) 4.6e+82))) (+ c (* x y)) (+ c (* b (* a -0.25)))))
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 * y) <= -1.4e+57) || !((x * y) <= 4.6e+82)) {
tmp = c + (x * y);
} else {
tmp = c + (b * (a * -0.25));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 * y) <= (-1.4d+57)) .or. (.not. ((x * y) <= 4.6d+82))) then
tmp = c + (x * y)
else
tmp = c + (b * (a * (-0.25d0)))
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 * y) <= -1.4e+57) || !((x * y) <= 4.6e+82)) {
tmp = c + (x * y);
} else {
tmp = c + (b * (a * -0.25));
}
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 * y) <= -1.4e+57) or not ((x * y) <= 4.6e+82): tmp = c + (x * y) else: tmp = c + (b * (a * -0.25)) 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(x * y) <= -1.4e+57) || !(Float64(x * y) <= 4.6e+82)) tmp = Float64(c + Float64(x * y)); else tmp = Float64(c + Float64(b * Float64(a * -0.25))); 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 * y) <= -1.4e+57) || ~(((x * y) <= 4.6e+82)))
tmp = c + (x * y);
else
tmp = c + (b * (a * -0.25));
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[N[(x * y), $MachinePrecision], -1.4e+57], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.6e+82]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $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}\;x \cdot y \leq -1.4 \cdot 10^{+57} \lor \neg \left(x \cdot y \leq 4.6 \cdot 10^{+82}\right):\\
\;\;\;\;c + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.4e57 or 4.59999999999999976e82 < (*.f64 x y) Initial program 94.2%
Taylor expanded in t around inf 86.9%
Taylor expanded in x around inf 71.9%
if -1.4e57 < (*.f64 x y) < 4.59999999999999976e82Initial program 100.0%
Taylor expanded in a around inf 63.0%
associate-*r*63.0%
*-commutative63.0%
*-commutative63.0%
Simplified63.0%
Final simplification66.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 (if (or (<= (* x y) -1.8e+182) (not (<= (* x y) 7.5e+96))) (* x y) 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 * y) <= -1.8e+182) || !((x * y) <= 7.5e+96)) {
tmp = x * y;
} else {
tmp = c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 * y) <= (-1.8d+182)) .or. (.not. ((x * y) <= 7.5d+96))) then
tmp = x * y
else
tmp = 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 * y) <= -1.8e+182) || !((x * y) <= 7.5e+96)) {
tmp = x * y;
} else {
tmp = 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 * y) <= -1.8e+182) or not ((x * y) <= 7.5e+96): tmp = x * y else: tmp = 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(x * y) <= -1.8e+182) || !(Float64(x * y) <= 7.5e+96)) tmp = Float64(x * y); else tmp = 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 * y) <= -1.8e+182) || ~(((x * y) <= 7.5e+96)))
tmp = x * y;
else
tmp = 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[N[(x * y), $MachinePrecision], -1.8e+182], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.5e+96]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+96}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c\\
\end{array}
\end{array}
if (*.f64 x y) < -1.8e182 or 7.4999999999999996e96 < (*.f64 x y) Initial program 92.5%
Taylor expanded in z around 0 79.9%
Taylor expanded in x around inf 66.9%
if -1.8e182 < (*.f64 x y) < 7.4999999999999996e96Initial program 100.0%
Taylor expanded in c around inf 30.7%
Final simplification42.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 (<= a -1.7e+127) (not (<= a 1.26e+44))) (* b (* a -0.25)) (+ c (* x 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 ((a <= -1.7e+127) || !(a <= 1.26e+44)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 ((a <= (-1.7d+127)) .or. (.not. (a <= 1.26d+44))) then
tmp = b * (a * (-0.25d0))
else
tmp = c + (x * y)
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 ((a <= -1.7e+127) || !(a <= 1.26e+44)) {
tmp = b * (a * -0.25);
} else {
tmp = c + (x * y);
}
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 (a <= -1.7e+127) or not (a <= 1.26e+44): tmp = b * (a * -0.25) else: tmp = c + (x * 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 ((a <= -1.7e+127) || !(a <= 1.26e+44)) tmp = Float64(b * Float64(a * -0.25)); else tmp = Float64(c + Float64(x * y)); 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 ((a <= -1.7e+127) || ~((a <= 1.26e+44)))
tmp = b * (a * -0.25);
else
tmp = c + (x * y);
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[a, -1.7e+127], N[Not[LessEqual[a, 1.26e+44]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $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}\;a \leq -1.7 \cdot 10^{+127} \lor \neg \left(a \leq 1.26 \cdot 10^{+44}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\
\mathbf{else}:\\
\;\;\;\;c + x \cdot y\\
\end{array}
\end{array}
if a < -1.69999999999999989e127 or 1.25999999999999996e44 < a Initial program 98.0%
Taylor expanded in z around 0 73.9%
Taylor expanded in a around inf 52.2%
associate-*r*52.2%
*-commutative52.2%
*-commutative52.2%
Simplified52.2%
if -1.69999999999999989e127 < a < 1.25999999999999996e44Initial program 97.4%
Taylor expanded in t around inf 93.2%
Taylor expanded in x around inf 60.8%
Final simplification57.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 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 c;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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 = 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 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 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 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 = 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_] := c
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
c
\end{array}
Initial program 97.6%
Taylor expanded in c around inf 23.6%
Final simplification23.6%
herbie shell --seed 2024075
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))