
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+187)))
(- (/ (* y 0.5) (/ a x)) (* t (* (/ z a) 4.5)))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+187)) {
tmp = ((y * 0.5) / (a / x)) - (t * ((z / a) * 4.5));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+187)) {
tmp = ((y * 0.5) / (a / x)) - (t * ((z / a) * 4.5));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+187): tmp = ((y * 0.5) / (a / x)) - (t * ((z / a) * 4.5)) else: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+187)) tmp = Float64(Float64(Float64(y * 0.5) / Float64(a / x)) - Float64(t * Float64(Float64(z / a) * 4.5))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 2e+187)))
tmp = ((y * 0.5) / (a / x)) - (t * ((z / a) * 4.5));
else
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+187]], $MachinePrecision]], N[(N[(N[(y * 0.5), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision] - N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+187}\right):\\
\;\;\;\;\frac{y \cdot 0.5}{\frac{a}{x}} - t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -inf.0 or 1.99999999999999981e187 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 72.0%
Taylor expanded in z around 0 71.9%
associate-*r*72.0%
*-commutative72.0%
Simplified72.0%
div-sub66.9%
times-frac81.9%
associate-*l*81.9%
*-commutative81.9%
associate-*r/92.3%
times-frac92.3%
metadata-eval92.3%
Applied egg-rr92.3%
div-inv92.3%
metadata-eval92.3%
*-commutative92.3%
*-commutative92.3%
clear-num92.3%
un-div-inv92.3%
*-commutative92.3%
Applied egg-rr92.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 1.99999999999999981e187Initial program 98.7%
Taylor expanded in z around 0 98.6%
associate-*r*98.6%
*-commutative98.6%
Simplified98.6%
Final simplification96.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+241)))
(- (* (/ x a) (/ y 2.0)) (* t (* (/ z a) 4.5)))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+241)) {
tmp = ((x / a) * (y / 2.0)) - (t * ((z / a) * 4.5));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+241)) {
tmp = ((x / a) * (y / 2.0)) - (t * ((z / a) * 4.5));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+241): tmp = ((x / a) * (y / 2.0)) - (t * ((z / a) * 4.5)) else: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+241)) tmp = Float64(Float64(Float64(x / a) * Float64(y / 2.0)) - Float64(t * Float64(Float64(z / a) * 4.5))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 2e+241)))
tmp = ((x / a) * (y / 2.0)) - (t * ((z / a) * 4.5));
else
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+241]], $MachinePrecision]], N[(N[(N[(x / a), $MachinePrecision] * N[(y / 2.0), $MachinePrecision]), $MachinePrecision] - N[(t * N[(N[(z / a), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+241}\right):\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2} - t \cdot \left(\frac{z}{a} \cdot 4.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -inf.0 or 2.0000000000000001e241 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 66.6%
Taylor expanded in z around 0 66.6%
associate-*r*66.6%
*-commutative66.6%
Simplified66.6%
div-sub60.6%
times-frac79.9%
associate-*l*79.9%
*-commutative79.9%
associate-*r/92.4%
times-frac92.4%
metadata-eval92.4%
Applied egg-rr92.4%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 2.0000000000000001e241Initial program 98.8%
Taylor expanded in z around 0 98.7%
associate-*r*98.7%
*-commutative98.7%
Simplified98.7%
Final simplification97.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= (* x y) -1e+259)
(* x (/ (* y 0.5) a))
(if (<= (* x y) 1e+287)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(* (* y 0.5) (/ x a)))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -1e+259) {
tmp = x * ((y * 0.5) / a);
} else if ((x * y) <= 1e+287) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = (y * 0.5) * (x / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x * y) <= (-1d+259)) then
tmp = x * ((y * 0.5d0) / a)
else if ((x * y) <= 1d+287) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = (y * 0.5d0) * (x / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -1e+259) {
tmp = x * ((y * 0.5) / a);
} else if ((x * y) <= 1e+287) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = (y * 0.5) * (x / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -1e+259: tmp = x * ((y * 0.5) / a) elif (x * y) <= 1e+287: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = (y * 0.5) * (x / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -1e+259) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); elseif (Float64(x * y) <= 1e+287) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(y * 0.5) * Float64(x / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -1e+259)
tmp = x * ((y * 0.5) / a);
elseif ((x * y) <= 1e+287)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = (y * 0.5) * (x / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+259], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+287], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+259}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+287}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.999999999999999e258Initial program 77.6%
Taylor expanded in z around 0 77.6%
associate-*r*77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in x around inf 77.6%
*-commutative77.6%
associate-/l*99.9%
associate-*r*99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
if -9.999999999999999e258 < (*.f64 x y) < 1.0000000000000001e287Initial program 94.6%
Taylor expanded in z around 0 94.5%
associate-*r*94.5%
*-commutative94.5%
Simplified94.5%
if 1.0000000000000001e287 < (*.f64 x y) Initial program 58.5%
Taylor expanded in x around inf 58.5%
associate-*r/58.5%
*-commutative58.5%
associate-*r*58.5%
*-commutative58.5%
Simplified58.5%
*-commutative58.5%
metadata-eval58.5%
div-inv58.5%
associate-*l/99.8%
div-inv99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Final simplification95.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.9e-26)
(/ (* y 0.5) (/ a x))
(if (<= x -2e-238)
(* t (* z (/ -4.5 a)))
(if (<= x 4e-94) (* z (* t (/ -4.5 a))) (* (* y 0.5) (/ x a))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.9e-26) {
tmp = (y * 0.5) / (a / x);
} else if (x <= -2e-238) {
tmp = t * (z * (-4.5 / a));
} else if (x <= 4e-94) {
tmp = z * (t * (-4.5 / a));
} else {
tmp = (y * 0.5) * (x / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (x <= (-2.9d-26)) then
tmp = (y * 0.5d0) / (a / x)
else if (x <= (-2d-238)) then
tmp = t * (z * ((-4.5d0) / a))
else if (x <= 4d-94) then
tmp = z * (t * ((-4.5d0) / a))
else
tmp = (y * 0.5d0) * (x / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.9e-26) {
tmp = (y * 0.5) / (a / x);
} else if (x <= -2e-238) {
tmp = t * (z * (-4.5 / a));
} else if (x <= 4e-94) {
tmp = z * (t * (-4.5 / a));
} else {
tmp = (y * 0.5) * (x / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -2.9e-26: tmp = (y * 0.5) / (a / x) elif x <= -2e-238: tmp = t * (z * (-4.5 / a)) elif x <= 4e-94: tmp = z * (t * (-4.5 / a)) else: tmp = (y * 0.5) * (x / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.9e-26) tmp = Float64(Float64(y * 0.5) / Float64(a / x)); elseif (x <= -2e-238) tmp = Float64(t * Float64(z * Float64(-4.5 / a))); elseif (x <= 4e-94) tmp = Float64(z * Float64(t * Float64(-4.5 / a))); else tmp = Float64(Float64(y * 0.5) * Float64(x / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -2.9e-26)
tmp = (y * 0.5) / (a / x);
elseif (x <= -2e-238)
tmp = t * (z * (-4.5 / a));
elseif (x <= 4e-94)
tmp = z * (t * (-4.5 / a));
else
tmp = (y * 0.5) * (x / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.9e-26], N[(N[(y * 0.5), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-238], N[(t * N[(z * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-94], N[(z * N[(t * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-26}:\\
\;\;\;\;\frac{y \cdot 0.5}{\frac{a}{x}}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-238}:\\
\;\;\;\;t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-94}:\\
\;\;\;\;z \cdot \left(t \cdot \frac{-4.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 0.5\right) \cdot \frac{x}{a}\\
\end{array}
\end{array}
if x < -2.8999999999999998e-26Initial program 90.4%
Taylor expanded in x around inf 74.1%
associate-*r/74.1%
*-commutative74.1%
associate-*r*74.1%
*-commutative74.1%
Simplified74.1%
*-commutative74.1%
metadata-eval74.1%
div-inv74.1%
associate-*l/72.7%
div-inv72.7%
metadata-eval72.7%
Applied egg-rr72.7%
*-commutative72.7%
clear-num72.7%
div-inv74.7%
Applied egg-rr74.7%
if -2.8999999999999998e-26 < x < -2e-238Initial program 95.9%
Taylor expanded in z around 0 95.6%
associate-*r*95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in x around 0 71.5%
*-commutative71.5%
associate-*l/71.7%
associate-*r/71.6%
associate-*l*70.9%
Simplified70.9%
if -2e-238 < x < 3.9999999999999998e-94Initial program 94.9%
Taylor expanded in x around 0 72.5%
associate-*r/72.4%
Simplified72.4%
pow172.4%
*-commutative72.4%
Applied egg-rr72.4%
unpow172.4%
associate-*l*72.5%
Simplified72.5%
associate-/l*71.0%
associate-*r/71.0%
*-commutative71.0%
associate-*r*72.6%
Applied egg-rr72.6%
if 3.9999999999999998e-94 < x Initial program 84.5%
Taylor expanded in x around inf 53.2%
associate-*r/53.2%
*-commutative53.2%
associate-*r*53.2%
*-commutative53.2%
Simplified53.2%
*-commutative53.2%
metadata-eval53.2%
div-inv53.2%
associate-*l/57.6%
div-inv57.6%
metadata-eval57.6%
Applied egg-rr57.6%
Final simplification67.9%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* y 0.5) (/ x a))))
(if (<= x -1.26e-14)
t_1
(if (<= x -1.85e-238)
(* -4.5 (* t (/ z a)))
(if (<= x 4.2e-94) (* z (* t (/ -4.5 a))) t_1)))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * 0.5) * (x / a);
double tmp;
if (x <= -1.26e-14) {
tmp = t_1;
} else if (x <= -1.85e-238) {
tmp = -4.5 * (t * (z / a));
} else if (x <= 4.2e-94) {
tmp = z * (t * (-4.5 / a));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (y * 0.5d0) * (x / a)
if (x <= (-1.26d-14)) then
tmp = t_1
else if (x <= (-1.85d-238)) then
tmp = (-4.5d0) * (t * (z / a))
else if (x <= 4.2d-94) then
tmp = z * (t * ((-4.5d0) / a))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * 0.5) * (x / a);
double tmp;
if (x <= -1.26e-14) {
tmp = t_1;
} else if (x <= -1.85e-238) {
tmp = -4.5 * (t * (z / a));
} else if (x <= 4.2e-94) {
tmp = z * (t * (-4.5 / a));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (y * 0.5) * (x / a) tmp = 0 if x <= -1.26e-14: tmp = t_1 elif x <= -1.85e-238: tmp = -4.5 * (t * (z / a)) elif x <= 4.2e-94: tmp = z * (t * (-4.5 / a)) else: tmp = t_1 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(y * 0.5) * Float64(x / a)) tmp = 0.0 if (x <= -1.26e-14) tmp = t_1; elseif (x <= -1.85e-238) tmp = Float64(-4.5 * Float64(t * Float64(z / a))); elseif (x <= 4.2e-94) tmp = Float64(z * Float64(t * Float64(-4.5 / a))); else tmp = t_1; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (y * 0.5) * (x / a);
tmp = 0.0;
if (x <= -1.26e-14)
tmp = t_1;
elseif (x <= -1.85e-238)
tmp = -4.5 * (t * (z / a));
elseif (x <= 4.2e-94)
tmp = z * (t * (-4.5 / a));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * 0.5), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.26e-14], t$95$1, If[LessEqual[x, -1.85e-238], N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-94], N[(z * N[(t * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 0.5\right) \cdot \frac{x}{a}\\
\mathbf{if}\;x \leq -1.26 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-238}:\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-94}:\\
\;\;\;\;z \cdot \left(t \cdot \frac{-4.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.25999999999999996e-14 or 4.2000000000000002e-94 < x Initial program 87.0%
Taylor expanded in x around inf 62.1%
associate-*r/62.1%
*-commutative62.1%
associate-*r*62.1%
*-commutative62.1%
Simplified62.1%
*-commutative62.1%
metadata-eval62.1%
div-inv62.1%
associate-*l/63.9%
div-inv63.9%
metadata-eval63.9%
Applied egg-rr63.9%
if -1.25999999999999996e-14 < x < -1.85000000000000012e-238Initial program 96.1%
Taylor expanded in z around 0 95.8%
associate-*r*95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 70.6%
associate-*r/69.9%
Simplified69.9%
if -1.85000000000000012e-238 < x < 4.2000000000000002e-94Initial program 94.9%
Taylor expanded in x around 0 72.5%
associate-*r/72.4%
Simplified72.4%
pow172.4%
*-commutative72.4%
Applied egg-rr72.4%
unpow172.4%
associate-*l*72.5%
Simplified72.5%
associate-/l*71.0%
associate-*r/71.0%
*-commutative71.0%
associate-*r*72.6%
Applied egg-rr72.6%
Final simplification66.9%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ (* y 0.5) a))))
(if (<= x -1e-23)
t_1
(if (<= x -1.85e-238)
(* t (* z (/ -4.5 a)))
(if (<= x 1.65e-93) (* z (* t (/ -4.5 a))) t_1)))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((y * 0.5) / a);
double tmp;
if (x <= -1e-23) {
tmp = t_1;
} else if (x <= -1.85e-238) {
tmp = t * (z * (-4.5 / a));
} else if (x <= 1.65e-93) {
tmp = z * (t * (-4.5 / a));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = x * ((y * 0.5d0) / a)
if (x <= (-1d-23)) then
tmp = t_1
else if (x <= (-1.85d-238)) then
tmp = t * (z * ((-4.5d0) / a))
else if (x <= 1.65d-93) then
tmp = z * (t * ((-4.5d0) / a))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((y * 0.5) / a);
double tmp;
if (x <= -1e-23) {
tmp = t_1;
} else if (x <= -1.85e-238) {
tmp = t * (z * (-4.5 / a));
} else if (x <= 1.65e-93) {
tmp = z * (t * (-4.5 / a));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = x * ((y * 0.5) / a) tmp = 0 if x <= -1e-23: tmp = t_1 elif x <= -1.85e-238: tmp = t * (z * (-4.5 / a)) elif x <= 1.65e-93: tmp = z * (t * (-4.5 / a)) else: tmp = t_1 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(Float64(y * 0.5) / a)) tmp = 0.0 if (x <= -1e-23) tmp = t_1; elseif (x <= -1.85e-238) tmp = Float64(t * Float64(z * Float64(-4.5 / a))); elseif (x <= 1.65e-93) tmp = Float64(z * Float64(t * Float64(-4.5 / a))); else tmp = t_1; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * ((y * 0.5) / a);
tmp = 0.0;
if (x <= -1e-23)
tmp = t_1;
elseif (x <= -1.85e-238)
tmp = t * (z * (-4.5 / a));
elseif (x <= 1.65e-93)
tmp = z * (t * (-4.5 / a));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e-23], t$95$1, If[LessEqual[x, -1.85e-238], N[(t * N[(z * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-93], N[(z * N[(t * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-238}:\\
\;\;\;\;t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-93}:\\
\;\;\;\;z \cdot \left(t \cdot \frac{-4.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.9999999999999996e-24 or 1.6500000000000001e-93 < x Initial program 87.2%
Taylor expanded in z around 0 87.2%
associate-*r*87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x around inf 62.6%
*-commutative62.6%
associate-/l*66.5%
associate-*r*66.4%
*-commutative66.4%
associate-*r/66.5%
Simplified66.5%
if -9.9999999999999996e-24 < x < -1.85000000000000012e-238Initial program 95.9%
Taylor expanded in z around 0 95.6%
associate-*r*95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in x around 0 71.5%
*-commutative71.5%
associate-*l/71.7%
associate-*r/71.6%
associate-*l*70.9%
Simplified70.9%
if -1.85000000000000012e-238 < x < 1.6500000000000001e-93Initial program 94.9%
Taylor expanded in x around 0 72.5%
associate-*r/72.4%
Simplified72.4%
pow172.4%
*-commutative72.4%
Applied egg-rr72.4%
unpow172.4%
associate-*l*72.5%
Simplified72.5%
associate-/l*71.0%
associate-*r/71.0%
*-commutative71.0%
associate-*r*72.6%
Applied egg-rr72.6%
Final simplification68.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -1.22e-26) (not (<= x 1.65e-93))) (* x (/ (* y 0.5) a)) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.22e-26) || !(x <= 1.65e-93)) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x <= (-1.22d-26)) .or. (.not. (x <= 1.65d-93))) then
tmp = x * ((y * 0.5d0) / a)
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.22e-26) || !(x <= 1.65e-93)) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -1.22e-26) or not (x <= 1.65e-93): tmp = x * ((y * 0.5) / a) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.22e-26) || !(x <= 1.65e-93)) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -1.22e-26) || ~((x <= 1.65e-93)))
tmp = x * ((y * 0.5) / a);
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.22e-26], N[Not[LessEqual[x, 1.65e-93]], $MachinePrecision]], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{-26} \lor \neg \left(x \leq 1.65 \cdot 10^{-93}\right):\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -1.22e-26 or 1.6500000000000001e-93 < x Initial program 87.2%
Taylor expanded in z around 0 87.2%
associate-*r*87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x around inf 62.6%
*-commutative62.6%
associate-/l*66.5%
associate-*r*66.4%
*-commutative66.4%
associate-*r/66.5%
Simplified66.5%
if -1.22e-26 < x < 1.6500000000000001e-93Initial program 95.3%
Taylor expanded in x around 0 72.1%
Final simplification68.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -5.6e-24) (not (<= x 4.5e-95))) (* x (* y (/ 0.5 a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5.6e-24) || !(x <= 4.5e-95)) {
tmp = x * (y * (0.5 / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x <= (-5.6d-24)) .or. (.not. (x <= 4.5d-95))) then
tmp = x * (y * (0.5d0 / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -5.6e-24) || !(x <= 4.5e-95)) {
tmp = x * (y * (0.5 / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -5.6e-24) or not (x <= 4.5e-95): tmp = x * (y * (0.5 / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -5.6e-24) || !(x <= 4.5e-95)) tmp = Float64(x * Float64(y * Float64(0.5 / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -5.6e-24) || ~((x <= 4.5e-95)))
tmp = x * (y * (0.5 / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -5.6e-24], N[Not[LessEqual[x, 4.5e-95]], $MachinePrecision]], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-24} \lor \neg \left(x \leq 4.5 \cdot 10^{-95}\right):\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -5.6000000000000003e-24 or 4.5e-95 < x Initial program 87.2%
Taylor expanded in x around inf 62.6%
associate-*r/62.6%
*-commutative62.6%
associate-*r*62.6%
associate-*r/66.5%
associate-/l*66.4%
Simplified66.4%
if -5.6000000000000003e-24 < x < 4.5e-95Initial program 95.3%
Taylor expanded in x around 0 72.1%
Final simplification68.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -8e+95) (* t (* z (/ -4.5 a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+95) {
tmp = t * (z * (-4.5 / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (z <= (-8d+95)) then
tmp = t * (z * ((-4.5d0) / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+95) {
tmp = t * (z * (-4.5 / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -8e+95: tmp = t * (z * (-4.5 / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+95) tmp = Float64(t * Float64(z * Float64(-4.5 / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -8e+95)
tmp = t * (z * (-4.5 / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+95], N[(t * N[(z * N[(-4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+95}:\\
\;\;\;\;t \cdot \left(z \cdot \frac{-4.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if z < -8.00000000000000016e95Initial program 86.6%
Taylor expanded in z around 0 86.6%
associate-*r*86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 59.7%
*-commutative59.7%
associate-*l/57.0%
associate-*r/59.7%
associate-*l*67.5%
Simplified67.5%
if -8.00000000000000016e95 < z Initial program 91.0%
Taylor expanded in x around 0 47.5%
Final simplification50.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.4e+103) (* -4.5 (* t (/ z a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+103) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (z <= (-2.4d+103)) then
tmp = (-4.5d0) * (t * (z / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e+103) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.4e+103: tmp = -4.5 * (t * (z / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e+103) tmp = Float64(-4.5 * Float64(t * Float64(z / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.4e+103)
tmp = -4.5 * (t * (z / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e+103], N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+103}:\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.3999999999999998e103Initial program 86.6%
Taylor expanded in z around 0 86.6%
associate-*r*86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 59.7%
associate-*r/67.5%
Simplified67.5%
if -2.3999999999999998e103 < z Initial program 91.0%
Taylor expanded in x around 0 47.5%
Final simplification50.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (* t (/ z a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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
code = (-4.5d0) * (t * (z / a))
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -4.5 * (t * (z / a))
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(t * Float64(z / a))) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (t * (z / a));
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Initial program 90.3%
Taylor expanded in z around 0 90.3%
associate-*r*90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in x around 0 49.2%
associate-*r/49.5%
Simplified49.5%
(FPCore (x y z t a)
:precision binary64
(if (< a -2.090464557976709e+86)
(- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
(if (< a 2.144030707833976e+99)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (a < (-2.090464557976709d+86)) then
tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
else if (a < 2.144030707833976d+99) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a < -2.090464557976709e+86: tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))) elif a < 2.144030707833976e+99: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a < -2.090464557976709e+86) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z)))); elseif (a < 2.144030707833976e+99) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a < -2.090464557976709e+86) tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))); elseif (a < 2.144030707833976e+99) tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0); else tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
herbie shell --seed 2024106
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:alt
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))