
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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 * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
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 * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\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 t))))
(if (<= t_1 (- INFINITY))
(* t (fma -1.0 (/ z a) (* x (/ y (* t a)))))
(if (<= t_1 1e+303)
(/ (fma x y (* z (- t))) a)
(* z (- (* x (/ (/ y a) 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 t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t * fma(-1.0, (z / a), (x * (y / (t * a))));
} else if (t_1 <= 1e+303) {
tmp = fma(x, y, (z * -t)) / a;
} else {
tmp = z * ((x * ((y / a) / 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) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t * fma(-1.0, Float64(z / a), Float64(x * Float64(y / Float64(t * a))))); elseif (t_1 <= 1e+303) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a); else tmp = Float64(z * Float64(Float64(x * Float64(Float64(y / a) / z)) - Float64(t / a))); end return 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t * N[(-1.0 * N[(z / a), $MachinePrecision] + N[(x * N[(y / N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(z * N[(N[(x * N[(N[(y / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(t / 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])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t \cdot \mathsf{fma}\left(-1, \frac{z}{a}, x \cdot \frac{y}{t \cdot a}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \frac{\frac{y}{a}}{z} - \frac{t}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
Taylor expanded in t around inf 79.5%
fma-define79.5%
associate-/l*91.9%
*-commutative91.9%
Simplified91.9%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e303Initial program 98.7%
div-sub97.2%
*-commutative97.2%
div-sub98.7%
*-commutative98.7%
fma-neg98.7%
distribute-rgt-neg-out98.7%
Simplified98.7%
if 1e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 65.6%
div-sub65.6%
*-un-lft-identity65.6%
add-sqr-sqrt30.9%
times-frac30.9%
fma-neg30.9%
associate-/l*36.4%
Applied egg-rr36.4%
fma-undefine36.4%
distribute-lft-neg-in36.4%
cancel-sign-sub-inv36.4%
associate-/l*39.3%
associate-*r/33.8%
*-commutative33.8%
associate-/l*39.4%
Simplified39.4%
Taylor expanded in z around inf 79.1%
associate-/l*90.9%
associate-/r*93.9%
Simplified93.9%
Final simplification97.5%
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 t))))
(if (<= t_1 (- INFINITY))
(* x (/ (- y (* t (/ z x))) a))
(if (<= t_1 1e+303)
(/ (fma x y (* z (- t))) a)
(* z (- (* x (/ (/ y a) 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 t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+303) {
tmp = fma(x, y, (z * -t)) / a;
} else {
tmp = z * ((x * ((y / a) / 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) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y - Float64(t * Float64(z / x))) / a)); elseif (t_1 <= 1e+303) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a); else tmp = Float64(z * Float64(Float64(x * Float64(Float64(y / a) / z)) - Float64(t / a))); end return 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x * N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(z * N[(N[(x * N[(N[(y / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(t / 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])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y - t \cdot \frac{z}{x}}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \frac{\frac{y}{a}}{z} - \frac{t}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
Taylor expanded in x around inf 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
associate-/l*75.6%
*-commutative75.6%
associate-/r*83.9%
Simplified83.9%
Taylor expanded in y around 0 75.3%
times-frac83.9%
associate-*l/83.9%
associate-*r/75.9%
div-sub80.3%
associate-*r/88.2%
Simplified88.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e303Initial program 98.7%
div-sub97.2%
*-commutative97.2%
div-sub98.7%
*-commutative98.7%
fma-neg98.7%
distribute-rgt-neg-out98.7%
Simplified98.7%
if 1e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 65.6%
div-sub65.6%
*-un-lft-identity65.6%
add-sqr-sqrt30.9%
times-frac30.9%
fma-neg30.9%
associate-/l*36.4%
Applied egg-rr36.4%
fma-undefine36.4%
distribute-lft-neg-in36.4%
cancel-sign-sub-inv36.4%
associate-/l*39.3%
associate-*r/33.8%
*-commutative33.8%
associate-/l*39.4%
Simplified39.4%
Taylor expanded in z around inf 79.1%
associate-/l*90.9%
associate-/r*93.9%
Simplified93.9%
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
(let* ((t_1 (- (* x y) (* z t))))
(if (<= t_1 (- INFINITY))
(* z (fma y (/ x (* z a)) (/ t (- a))))
(if (<= t_1 1e+303)
(/ (fma x y (* z (- t))) a)
(* z (- (* x (/ (/ y a) 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 t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * fma(y, (x / (z * a)), (t / -a));
} else if (t_1 <= 1e+303) {
tmp = fma(x, y, (z * -t)) / a;
} else {
tmp = z * ((x * ((y / a) / 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) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * fma(y, Float64(x / Float64(z * a)), Float64(t / Float64(-a)))); elseif (t_1 <= 1e+303) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a); else tmp = Float64(z * Float64(Float64(x * Float64(Float64(y / a) / z)) - Float64(t / a))); end return 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * N[(y * N[(x / N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(t / (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(z * N[(N[(x * N[(N[(y / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(t / 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])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \mathsf{fma}\left(y, \frac{x}{z \cdot a}, \frac{t}{-a}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \frac{\frac{y}{a}}{z} - \frac{t}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
mul-1-neg79.5%
unsub-neg79.5%
*-commutative79.5%
associate-/l*91.8%
fma-neg91.8%
*-commutative91.8%
distribute-frac-neg91.8%
Simplified91.8%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e303Initial program 98.7%
div-sub97.2%
*-commutative97.2%
div-sub98.7%
*-commutative98.7%
fma-neg98.7%
distribute-rgt-neg-out98.7%
Simplified98.7%
if 1e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 65.6%
div-sub65.6%
*-un-lft-identity65.6%
add-sqr-sqrt30.9%
times-frac30.9%
fma-neg30.9%
associate-/l*36.4%
Applied egg-rr36.4%
fma-undefine36.4%
distribute-lft-neg-in36.4%
cancel-sign-sub-inv36.4%
associate-/l*39.3%
associate-*r/33.8%
*-commutative33.8%
associate-/l*39.4%
Simplified39.4%
Taylor expanded in z around inf 79.1%
associate-/l*90.9%
associate-/r*93.9%
Simplified93.9%
Final simplification97.5%
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 t)) a)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+294)))
(* x (/ (- y (* t (/ z x))) 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) - (z * t)) / a;
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+294)) {
tmp = x * ((y - (t * (z / x))) / a);
} else {
tmp = t_1;
}
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 * t)) / a;
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+294)) {
tmp = x * ((y - (t * (z / x))) / 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) - (z * t)) / a tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+294): tmp = x * ((y - (t * (z / x))) / 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(Float64(x * y) - Float64(z * t)) / a) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+294)) tmp = Float64(x * Float64(Float64(y - Float64(t * Float64(z / x))) / 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) - (z * t)) / a;
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 2e+294)))
tmp = x * ((y - (t * (z / x))) / 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[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+294]], $MachinePrecision]], N[(x * N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $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 := \frac{x \cdot y - z \cdot t}{a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+294}\right):\\
\;\;\;\;x \cdot \frac{y - t \cdot \frac{z}{x}}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < -inf.0 or 2.00000000000000013e294 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) Initial program 76.1%
Taylor expanded in x around inf 78.5%
+-commutative78.5%
mul-1-neg78.5%
unsub-neg78.5%
associate-/l*80.9%
*-commutative80.9%
associate-/r*87.7%
Simplified87.7%
Taylor expanded in y around 0 78.5%
times-frac83.0%
associate-*l/83.3%
associate-*r/80.1%
div-sub85.9%
associate-*r/89.1%
Simplified89.1%
if -inf.0 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 2.00000000000000013e294Initial program 98.5%
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
(let* ((t_1 (- (* x y) (* z t))))
(if (<= t_1 (- INFINITY))
(* x (/ (- y (* t (/ z x))) a))
(if (<= t_1 1e+295) (/ t_1 a) (* x (- (/ y a) (* t (/ (/ z 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 t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+295) {
tmp = t_1 / a;
} else {
tmp = x * ((y / a) - (t * ((z / x) / a)));
}
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 * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+295) {
tmp = t_1 / a;
} else {
tmp = x * ((y / a) - (t * ((z / 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): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = x * ((y - (t * (z / x))) / a) elif t_1 <= 1e+295: tmp = t_1 / a else: tmp = x * ((y / a) - (t * ((z / 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) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y - Float64(t * Float64(z / x))) / a)); elseif (t_1 <= 1e+295) tmp = Float64(t_1 / a); else tmp = Float64(x * Float64(Float64(y / a) - Float64(t * Float64(Float64(z / 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)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = x * ((y - (t * (z / x))) / a);
elseif (t_1 <= 1e+295)
tmp = t_1 / a;
else
tmp = x * ((y / a) - (t * ((z / 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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x * N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+295], N[(t$95$1 / a), $MachinePrecision], N[(x * N[(N[(y / a), $MachinePrecision] - N[(t * N[(N[(z / x), $MachinePrecision] / a), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y - t \cdot \frac{z}{x}}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+295}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{a} - t \cdot \frac{\frac{z}{x}}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
Taylor expanded in x around inf 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
associate-/l*75.6%
*-commutative75.6%
associate-/r*83.9%
Simplified83.9%
Taylor expanded in y around 0 75.3%
times-frac83.9%
associate-*l/83.9%
associate-*r/75.9%
div-sub80.3%
associate-*r/88.2%
Simplified88.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 9.9999999999999998e294Initial program 98.7%
if 9.9999999999999998e294 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 67.5%
Taylor expanded in x around inf 77.8%
+-commutative77.8%
mul-1-neg77.8%
unsub-neg77.8%
associate-/l*83.4%
*-commutative83.4%
associate-/r*91.7%
Simplified91.7%
Final simplification96.8%
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 t))))
(if (<= t_1 (- INFINITY))
(* x (/ (- y (* t (/ z x))) a))
(if (<= t_1 1e+303) (/ t_1 a) (* x (- (/ y a) (/ (/ t a) (/ x z))))))))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 * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+303) {
tmp = t_1 / a;
} else {
tmp = x * ((y / a) - ((t / a) / (x / z)));
}
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 * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+303) {
tmp = t_1 / a;
} else {
tmp = x * ((y / a) - ((t / a) / (x / z)));
}
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 * t) tmp = 0 if t_1 <= -math.inf: tmp = x * ((y - (t * (z / x))) / a) elif t_1 <= 1e+303: tmp = t_1 / a else: tmp = x * ((y / a) - ((t / a) / (x / z))) 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(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y - Float64(t * Float64(z / x))) / a)); elseif (t_1 <= 1e+303) tmp = Float64(t_1 / a); else tmp = Float64(x * Float64(Float64(y / a) - Float64(Float64(t / a) / Float64(x / z)))); 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 * t);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = x * ((y - (t * (z / x))) / a);
elseif (t_1 <= 1e+303)
tmp = t_1 / a;
else
tmp = x * ((y / a) - ((t / a) / (x / z)));
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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x * N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(t$95$1 / a), $MachinePrecision], N[(x * N[(N[(y / a), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] / N[(x / z), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y - t \cdot \frac{z}{x}}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{a} - \frac{\frac{t}{a}}{\frac{x}{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
Taylor expanded in x around inf 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
associate-/l*75.6%
*-commutative75.6%
associate-/r*83.9%
Simplified83.9%
Taylor expanded in y around 0 75.3%
times-frac83.9%
associate-*l/83.9%
associate-*r/75.9%
div-sub80.3%
associate-*r/88.2%
Simplified88.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e303Initial program 98.7%
if 1e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 65.6%
Taylor expanded in x around inf 76.4%
+-commutative76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*82.4%
*-commutative82.4%
associate-/r*91.2%
Simplified91.2%
clear-num91.2%
un-div-inv91.2%
div-inv91.1%
clear-num91.2%
Applied egg-rr91.2%
associate-/r*91.1%
Simplified91.1%
Final simplification96.8%
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 t))))
(if (<= t_1 (- INFINITY))
(* x (/ (- y (* t (/ z x))) a))
(if (<= t_1 1e+303) (/ t_1 a) (* z (- (* x (/ (/ y a) 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 t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+303) {
tmp = t_1 / a;
} else {
tmp = z * ((x * ((y / a) / z)) - (t / a));
}
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 * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y - (t * (z / x))) / a);
} else if (t_1 <= 1e+303) {
tmp = t_1 / a;
} else {
tmp = z * ((x * ((y / a) / 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): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = x * ((y - (t * (z / x))) / a) elif t_1 <= 1e+303: tmp = t_1 / a else: tmp = z * ((x * ((y / a) / 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) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y - Float64(t * Float64(z / x))) / a)); elseif (t_1 <= 1e+303) tmp = Float64(t_1 / a); else tmp = Float64(z * Float64(Float64(x * Float64(Float64(y / a) / z)) - Float64(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)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = x * ((y - (t * (z / x))) / a);
elseif (t_1 <= 1e+303)
tmp = t_1 / a;
else
tmp = z * ((x * ((y / a) / 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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x * N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(t$95$1 / a), $MachinePrecision], N[(z * N[(N[(x * N[(N[(y / a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(t / 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])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y - t \cdot \frac{z}{x}}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \frac{\frac{y}{a}}{z} - \frac{t}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 60.0%
Taylor expanded in x around inf 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
associate-/l*75.6%
*-commutative75.6%
associate-/r*83.9%
Simplified83.9%
Taylor expanded in y around 0 75.3%
times-frac83.9%
associate-*l/83.9%
associate-*r/75.9%
div-sub80.3%
associate-*r/88.2%
Simplified88.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e303Initial program 98.7%
if 1e303 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 65.6%
div-sub65.6%
*-un-lft-identity65.6%
add-sqr-sqrt30.9%
times-frac30.9%
fma-neg30.9%
associate-/l*36.4%
Applied egg-rr36.4%
fma-undefine36.4%
distribute-lft-neg-in36.4%
cancel-sign-sub-inv36.4%
associate-/l*39.3%
associate-*r/33.8%
*-commutative33.8%
associate-/l*39.4%
Simplified39.4%
Taylor expanded in z around inf 79.1%
associate-/l*90.9%
associate-/r*93.9%
Simplified93.9%
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 (<= (* z t) -5e+274) (* z (/ t (- a))) (if (<= (* z t) 2e+291) (/ (- (* x y) (* z t)) a) (* 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) {
double tmp;
if ((z * t) <= -5e+274) {
tmp = z * (t / -a);
} else if ((z * t) <= 2e+291) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t * (-z / 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 * t) <= (-5d+274)) then
tmp = z * (t / -a)
else if ((z * t) <= 2d+291) then
tmp = ((x * y) - (z * t)) / a
else
tmp = t * (-z / 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 * t) <= -5e+274) {
tmp = z * (t / -a);
} else if ((z * t) <= 2e+291) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t * (-z / 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 * t) <= -5e+274: tmp = z * (t / -a) elif (z * t) <= 2e+291: tmp = ((x * y) - (z * t)) / a else: tmp = t * (-z / 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(z * t) <= -5e+274) tmp = Float64(z * Float64(t / Float64(-a))); elseif (Float64(z * t) <= 2e+291) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(t * Float64(Float64(-z) / 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 * t) <= -5e+274)
tmp = z * (t / -a);
elseif ((z * t) <= 2e+291)
tmp = ((x * y) - (z * t)) / a;
else
tmp = t * (-z / 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[(z * t), $MachinePrecision], -5e+274], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+291], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(t * N[((-z) / 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 \cdot t \leq -5 \cdot 10^{+274}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < -4.9999999999999998e274Initial program 65.0%
Taylor expanded in x around 0 65.4%
*-commutative65.4%
associate-*r/99.3%
neg-mul-199.3%
distribute-rgt-neg-in99.3%
distribute-frac-neg99.3%
Simplified99.3%
if -4.9999999999999998e274 < (*.f64 z t) < 1.9999999999999999e291Initial program 95.0%
if 1.9999999999999999e291 < (*.f64 z t) Initial program 69.4%
Taylor expanded in x around 0 69.4%
mul-1-neg69.4%
associate-/l*94.4%
distribute-rgt-neg-in94.4%
distribute-neg-frac294.4%
Simplified94.4%
Final simplification95.2%
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 (<= (* z t) -5e-47) (not (<= (* z t) 600000000.0))) (* t (/ (- z) a)) (* y (/ 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 (((z * t) <= -5e-47) || !((z * t) <= 600000000.0)) {
tmp = t * (-z / a);
} else {
tmp = y * (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 (((z * t) <= (-5d-47)) .or. (.not. ((z * t) <= 600000000.0d0))) then
tmp = t * (-z / a)
else
tmp = y * (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 (((z * t) <= -5e-47) || !((z * t) <= 600000000.0)) {
tmp = t * (-z / a);
} else {
tmp = y * (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 ((z * t) <= -5e-47) or not ((z * t) <= 600000000.0): tmp = t * (-z / a) else: tmp = y * (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(z * t) <= -5e-47) || !(Float64(z * t) <= 600000000.0)) tmp = Float64(t * Float64(Float64(-z) / a)); else tmp = Float64(y * 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 (((z * t) <= -5e-47) || ~(((z * t) <= 600000000.0)))
tmp = t * (-z / a);
else
tmp = y * (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[Or[LessEqual[N[(z * t), $MachinePrecision], -5e-47], N[Not[LessEqual[N[(z * t), $MachinePrecision], 600000000.0]], $MachinePrecision]], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(y * 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}\;z \cdot t \leq -5 \cdot 10^{-47} \lor \neg \left(z \cdot t \leq 600000000\right):\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000011e-47 or 6e8 < (*.f64 z t) Initial program 88.3%
Taylor expanded in x around 0 72.4%
mul-1-neg72.4%
associate-/l*76.0%
distribute-rgt-neg-in76.0%
distribute-neg-frac276.0%
Simplified76.0%
if -5.00000000000000011e-47 < (*.f64 z t) < 6e8Initial program 93.4%
Taylor expanded in y around inf 93.3%
+-commutative93.3%
mul-1-neg93.3%
unsub-neg93.3%
*-commutative93.3%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in x around inf 81.9%
Final simplification79.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 (<= (* z t) -5e-47) (* z (/ t (- a))) (if (<= (* z t) 600000000.0) (* y (/ x a)) (* 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) {
double tmp;
if ((z * t) <= -5e-47) {
tmp = z * (t / -a);
} else if ((z * t) <= 600000000.0) {
tmp = y * (x / a);
} else {
tmp = t * (-z / 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 * t) <= (-5d-47)) then
tmp = z * (t / -a)
else if ((z * t) <= 600000000.0d0) then
tmp = y * (x / a)
else
tmp = t * (-z / 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 * t) <= -5e-47) {
tmp = z * (t / -a);
} else if ((z * t) <= 600000000.0) {
tmp = y * (x / a);
} else {
tmp = t * (-z / 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 * t) <= -5e-47: tmp = z * (t / -a) elif (z * t) <= 600000000.0: tmp = y * (x / a) else: tmp = t * (-z / 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(z * t) <= -5e-47) tmp = Float64(z * Float64(t / Float64(-a))); elseif (Float64(z * t) <= 600000000.0) tmp = Float64(y * Float64(x / a)); else tmp = Float64(t * Float64(Float64(-z) / 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 * t) <= -5e-47)
tmp = z * (t / -a);
elseif ((z * t) <= 600000000.0)
tmp = y * (x / a);
else
tmp = t * (-z / 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[(z * t), $MachinePrecision], -5e-47], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 600000000.0], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(t * N[((-z) / 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 \cdot t \leq -5 \cdot 10^{-47}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\
\mathbf{elif}\;z \cdot t \leq 600000000:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < -5.00000000000000011e-47Initial program 85.9%
Taylor expanded in x around 0 65.6%
*-commutative65.6%
associate-*r/75.5%
neg-mul-175.5%
distribute-rgt-neg-in75.5%
distribute-frac-neg75.5%
Simplified75.5%
if -5.00000000000000011e-47 < (*.f64 z t) < 6e8Initial program 93.4%
Taylor expanded in y around inf 93.3%
+-commutative93.3%
mul-1-neg93.3%
unsub-neg93.3%
*-commutative93.3%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in x around inf 81.9%
if 6e8 < (*.f64 z t) Initial program 90.8%
Taylor expanded in x around 0 79.4%
mul-1-neg79.4%
associate-/l*82.1%
distribute-rgt-neg-in82.1%
distribute-neg-frac282.1%
Simplified82.1%
Final simplification80.4%
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 -1.28e-208) (* y (/ x a)) (* x (/ y 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.28e-208) {
tmp = y * (x / a);
} else {
tmp = x * (y / 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.28d-208)) then
tmp = y * (x / a)
else
tmp = x * (y / 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.28e-208) {
tmp = y * (x / a);
} else {
tmp = x * (y / 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.28e-208: tmp = y * (x / a) else: tmp = x * (y / 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.28e-208) tmp = Float64(y * Float64(x / a)); else tmp = Float64(x * Float64(y / 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.28e-208)
tmp = y * (x / a);
else
tmp = x * (y / 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, -1.28e-208], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / 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.28 \cdot 10^{-208}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if x < -1.2800000000000001e-208Initial program 89.5%
Taylor expanded in y around inf 84.2%
+-commutative84.2%
mul-1-neg84.2%
unsub-neg84.2%
*-commutative84.2%
associate-/l*81.7%
Simplified81.7%
Taylor expanded in x around inf 54.0%
if -1.2800000000000001e-208 < x Initial program 92.1%
Taylor expanded in x around inf 49.7%
associate-*r/55.8%
Simplified55.8%
Final simplification55.0%
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 (* x (/ y 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 x * (y / 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 = x * (y / 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 x * (y / 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 x * (y / 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(x * Float64(y / 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 = x * (y / 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[(x * N[(y / 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])\\
\\
x \cdot \frac{y}{a}
\end{array}
Initial program 90.9%
Taylor expanded in x around inf 51.6%
associate-*r/53.4%
Simplified53.4%
Final simplification53.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (/ y a) x) (* (/ t a) z))))
(if (< z -2.468684968699548e+170)
t_1
(if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = ((y / a) * x) - ((t / a) * z)
if (z < (-2.468684968699548d+170)) then
tmp = t_1
else if (z < 6.309831121978371d-71) then
tmp = ((x * y) - (z * t)) / a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y / a) * x) - ((t / a) * z);
double tmp;
if (z < -2.468684968699548e+170) {
tmp = t_1;
} else if (z < 6.309831121978371e-71) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y / a) * x) - ((t / a) * z) tmp = 0 if z < -2.468684968699548e+170: tmp = t_1 elif z < 6.309831121978371e-71: tmp = ((x * y) - (z * t)) / a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y / a) * x) - Float64(Float64(t / a) * z)) tmp = 0.0 if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y / a) * x) - ((t / a) * z); tmp = 0.0; if (z < -2.468684968699548e+170) tmp = t_1; elseif (z < 6.309831121978371e-71) tmp = ((x * y) - (z * t)) / a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.468684968699548e+170], t$95$1, If[Less[z, 6.309831121978371e-71], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\
\mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024053
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:alt
(if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))
(/ (- (* x y) (* z t)) a))