
(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 14 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 and y should be sorted in increasing order before calling this function.
NOTE: z and t 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))
(- (pow (/ (cbrt (* x y)) (cbrt a)) 3.0) (/ t (/ a z)))
(if (<= t_1 5e+276) (/ t_1 a) (fma y (/ x a) (/ (- z) (/ a t)))))))assert(x < y);
assert(z < t);
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 = pow((cbrt((x * y)) / cbrt(a)), 3.0) - (t / (a / z));
} else if (t_1 <= 5e+276) {
tmp = t_1 / a;
} else {
tmp = fma(y, (x / a), (-z / (a / t)));
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) 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((Float64(cbrt(Float64(x * y)) / cbrt(a)) ^ 3.0) - Float64(t / Float64(a / z))); elseif (t_1 <= 5e+276) tmp = Float64(t_1 / a); else tmp = fma(y, Float64(x / a), Float64(Float64(-z) / Float64(a / t))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(N[Power[N[(N[Power[N[(x * y), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+276], N[(t$95$1 / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision] + N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;{\left(\frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}\right)}^{3} - \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 79.0%
div-sub79.0%
add-cube-cbrt79.0%
add-cube-cbrt79.0%
times-frac79.0%
fma-neg79.0%
pow279.0%
pow279.0%
associate-/l*92.8%
Applied egg-rr92.8%
fma-neg92.8%
associate-/r/96.5%
*-commutative96.5%
unpow296.5%
unpow296.5%
times-frac96.5%
cube-unmult96.5%
associate-*l/79.0%
*-commutative79.0%
associate-/l*96.5%
Simplified96.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000001e276Initial program 99.7%
if 5.00000000000000001e276 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 78.6%
div-sub78.6%
*-commutative78.6%
*-un-lft-identity78.6%
times-frac86.5%
fma-neg86.5%
associate-/l*97.2%
Applied egg-rr97.2%
Final simplification99.0%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 a)) (/ t (/ a z)))
(if (<= t_1 5e+276) (/ t_1 a) (fma y (/ x a) (/ (- z) (/ a t)))))))assert(x < y);
assert(z < t);
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 / a)) - (t / (a / z));
} else if (t_1 <= 5e+276) {
tmp = t_1 / a;
} else {
tmp = fma(y, (x / a), (-z / (a / t)));
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) 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(Float64(x * Float64(y / a)) - Float64(t / Float64(a / z))); elseif (t_1 <= 5e+276) tmp = Float64(t_1 / a); else tmp = fma(y, Float64(x / a), Float64(Float64(-z) / Float64(a / t))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+276], N[(t$95$1 / a), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision] + N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 79.0%
div-sub79.0%
add-cube-cbrt79.0%
add-cube-cbrt79.0%
times-frac79.0%
fma-neg79.0%
pow279.0%
pow279.0%
associate-/l*92.8%
Applied egg-rr92.8%
fma-neg92.8%
associate-/r/96.5%
*-commutative96.5%
unpow296.5%
unpow296.5%
times-frac96.5%
cube-unmult96.5%
associate-*l/79.0%
*-commutative79.0%
associate-/l*96.5%
Simplified96.5%
unpow396.5%
frac-times96.5%
times-frac96.5%
add-cube-cbrt96.5%
add-cube-cbrt96.5%
associate-*r/96.2%
*-commutative96.2%
Applied egg-rr96.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000001e276Initial program 99.7%
if 5.00000000000000001e276 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 78.6%
div-sub78.6%
*-commutative78.6%
*-un-lft-identity78.6%
times-frac86.5%
fma-neg86.5%
associate-/l*97.2%
Applied egg-rr97.2%
Final simplification99.0%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+299)))
(- (* x (/ y a)) (/ t (/ a z)))
(/ t_1 a))))assert(x < y);
assert(z < t);
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)) || !(t_1 <= 1e+299)) {
tmp = (x * (y / a)) - (t / (a / z));
} else {
tmp = t_1 / a;
}
return tmp;
}
assert x < y;
assert z < t;
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) || !(t_1 <= 1e+299)) {
tmp = (x * (y / a)) - (t / (a / z));
} else {
tmp = t_1 / a;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+299): tmp = (x * (y / a)) - (t / (a / z)) else: tmp = t_1 / a return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+299)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(t / Float64(a / z))); else tmp = Float64(t_1 / a); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 1e+299)))
tmp = (x * (y / a)) - (t / (a / z));
else
tmp = t_1 / a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+299]], $MachinePrecision]], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+299}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 1.0000000000000001e299 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 76.6%
div-sub76.6%
add-cube-cbrt76.5%
add-cube-cbrt76.5%
times-frac76.5%
fma-neg76.5%
pow276.5%
pow276.5%
associate-/l*88.2%
Applied egg-rr88.2%
fma-neg88.2%
associate-/r/89.8%
*-commutative89.8%
unpow289.8%
unpow289.8%
times-frac89.8%
cube-unmult89.8%
associate-*l/76.5%
*-commutative76.5%
associate-/l*89.9%
Simplified89.9%
unpow389.9%
frac-times89.9%
times-frac89.9%
add-cube-cbrt89.9%
add-cube-cbrt89.9%
associate-*r/98.1%
*-commutative98.1%
Applied egg-rr98.1%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e299Initial program 99.7%
Final simplification99.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (/ a z))) (t_2 (- (* x y) (* z t))))
(if (<= t_2 (- INFINITY))
(- (* x (/ y a)) t_1)
(if (<= t_2 1e+299) (/ t_2 a) (- (/ x (/ a y)) t_1)))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / z);
double t_2 = (x * y) - (z * t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (x * (y / a)) - t_1;
} else if (t_2 <= 1e+299) {
tmp = t_2 / a;
} else {
tmp = (x / (a / y)) - t_1;
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / z);
double t_2 = (x * y) - (z * t);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (x * (y / a)) - t_1;
} else if (t_2 <= 1e+299) {
tmp = t_2 / a;
} else {
tmp = (x / (a / y)) - t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = t / (a / z) t_2 = (x * y) - (z * t) tmp = 0 if t_2 <= -math.inf: tmp = (x * (y / a)) - t_1 elif t_2 <= 1e+299: tmp = t_2 / a else: tmp = (x / (a / y)) - t_1 return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(t / Float64(a / z)) t_2 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(x * Float64(y / a)) - t_1); elseif (t_2 <= 1e+299) tmp = Float64(t_2 / a); else tmp = Float64(Float64(x / Float64(a / y)) - t_1); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = t / (a / z);
t_2 = (x * y) - (z * t);
tmp = 0.0;
if (t_2 <= -Inf)
tmp = (x * (y / a)) - t_1;
elseif (t_2 <= 1e+299)
tmp = t_2 / a;
else
tmp = (x / (a / y)) - t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+299], N[(t$95$2 / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{a}{z}}\\
t_2 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - t_1\\
\mathbf{elif}\;t_2 \leq 10^{+299}:\\
\;\;\;\;\frac{t_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - t_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 79.0%
div-sub79.0%
add-cube-cbrt79.0%
add-cube-cbrt79.0%
times-frac79.0%
fma-neg79.0%
pow279.0%
pow279.0%
associate-/l*92.8%
Applied egg-rr92.8%
fma-neg92.8%
associate-/r/96.5%
*-commutative96.5%
unpow296.5%
unpow296.5%
times-frac96.5%
cube-unmult96.5%
associate-*l/79.0%
*-commutative79.0%
associate-/l*96.5%
Simplified96.5%
unpow396.5%
frac-times96.5%
times-frac96.5%
add-cube-cbrt96.5%
add-cube-cbrt96.5%
associate-*r/96.2%
*-commutative96.2%
Applied egg-rr96.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e299Initial program 99.7%
if 1.0000000000000001e299 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 74.4%
div-sub74.4%
associate-/l*87.1%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 87.1%
associate-/l*99.9%
Simplified99.9%
Final simplification99.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 a)) (/ t (/ a z)))
(if (<= t_1 1e+299) (/ t_1 a) (- (/ x (/ a y)) (/ z (/ a t)))))))assert(x < y);
assert(z < t);
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 / a)) - (t / (a / z));
} else if (t_1 <= 1e+299) {
tmp = t_1 / a;
} else {
tmp = (x / (a / y)) - (z / (a / t));
}
return tmp;
}
assert x < y;
assert z < t;
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 / a)) - (t / (a / z));
} else if (t_1 <= 1e+299) {
tmp = t_1 / a;
} else {
tmp = (x / (a / y)) - (z / (a / t));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = (x * (y / a)) - (t / (a / z)) elif t_1 <= 1e+299: tmp = t_1 / a else: tmp = (x / (a / y)) - (z / (a / t)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) 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(Float64(x * Float64(y / a)) - Float64(t / Float64(a / z))); elseif (t_1 <= 1e+299) tmp = Float64(t_1 / a); else tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
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 / a)) - (t / (a / z));
elseif (t_1 <= 1e+299)
tmp = t_1 / a;
else
tmp = (x / (a / y)) - (z / (a / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+299], N[(t$95$1 / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t_1 \leq 10^{+299}:\\
\;\;\;\;\frac{t_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 79.0%
div-sub79.0%
add-cube-cbrt79.0%
add-cube-cbrt79.0%
times-frac79.0%
fma-neg79.0%
pow279.0%
pow279.0%
associate-/l*92.8%
Applied egg-rr92.8%
fma-neg92.8%
associate-/r/96.5%
*-commutative96.5%
unpow296.5%
unpow296.5%
times-frac96.5%
cube-unmult96.5%
associate-*l/79.0%
*-commutative79.0%
associate-/l*96.5%
Simplified96.5%
unpow396.5%
frac-times96.5%
times-frac96.5%
add-cube-cbrt96.5%
add-cube-cbrt96.5%
associate-*r/96.2%
*-commutative96.2%
Applied egg-rr96.2%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e299Initial program 99.7%
if 1.0000000000000001e299 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 74.4%
div-sub74.4%
associate-/l*87.1%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification99.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- t) (/ z a))))
(if (<= (* x y) -2e-40)
(/ (* x y) a)
(if (<= (* x y) -2e-261)
t_1
(if (<= (* x y) 5e-285)
(* z (/ (- t) a))
(if (<= (* x y) 2e+47) t_1 (/ y (/ a x))))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = -t * (z / a);
double tmp;
if ((x * y) <= -2e-40) {
tmp = (x * y) / a;
} else if ((x * y) <= -2e-261) {
tmp = t_1;
} else if ((x * y) <= 5e-285) {
tmp = z * (-t / a);
} else if ((x * y) <= 2e+47) {
tmp = t_1;
} else {
tmp = y / (a / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 = -t * (z / a)
if ((x * y) <= (-2d-40)) then
tmp = (x * y) / a
else if ((x * y) <= (-2d-261)) then
tmp = t_1
else if ((x * y) <= 5d-285) then
tmp = z * (-t / a)
else if ((x * y) <= 2d+47) then
tmp = t_1
else
tmp = y / (a / x)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -t * (z / a);
double tmp;
if ((x * y) <= -2e-40) {
tmp = (x * y) / a;
} else if ((x * y) <= -2e-261) {
tmp = t_1;
} else if ((x * y) <= 5e-285) {
tmp = z * (-t / a);
} else if ((x * y) <= 2e+47) {
tmp = t_1;
} else {
tmp = y / (a / x);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = -t * (z / a) tmp = 0 if (x * y) <= -2e-40: tmp = (x * y) / a elif (x * y) <= -2e-261: tmp = t_1 elif (x * y) <= 5e-285: tmp = z * (-t / a) elif (x * y) <= 2e+47: tmp = t_1 else: tmp = y / (a / x) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(-t) * Float64(z / a)) tmp = 0.0 if (Float64(x * y) <= -2e-40) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= -2e-261) tmp = t_1; elseif (Float64(x * y) <= 5e-285) tmp = Float64(z * Float64(Float64(-t) / a)); elseif (Float64(x * y) <= 2e+47) tmp = t_1; else tmp = Float64(y / Float64(a / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = -t * (z / a);
tmp = 0.0;
if ((x * y) <= -2e-40)
tmp = (x * y) / a;
elseif ((x * y) <= -2e-261)
tmp = t_1;
elseif ((x * y) <= 5e-285)
tmp = z * (-t / a);
elseif ((x * y) <= 2e+47)
tmp = t_1;
else
tmp = y / (a / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e-40], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-261], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-285], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+47], t$95$1, N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \frac{z}{a}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-261}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-285}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e-40Initial program 93.5%
Taylor expanded in x around inf 77.8%
if -1.9999999999999999e-40 < (*.f64 x y) < -1.99999999999999997e-261 or 5.00000000000000018e-285 < (*.f64 x y) < 2.0000000000000001e47Initial program 97.6%
Taylor expanded in x around 0 73.4%
mul-1-neg73.4%
*-commutative73.4%
associate-*l/66.9%
*-commutative66.9%
distribute-rgt-neg-in66.9%
distribute-frac-neg66.9%
Simplified66.9%
if -1.99999999999999997e-261 < (*.f64 x y) < 5.00000000000000018e-285Initial program 93.7%
Taylor expanded in x around 0 90.5%
mul-1-neg90.5%
*-commutative90.5%
associate-*l/90.4%
*-commutative90.4%
distribute-rgt-neg-in90.4%
distribute-frac-neg90.4%
Simplified90.4%
distribute-frac-neg90.4%
distribute-rgt-neg-out90.4%
clear-num90.4%
div-inv91.9%
associate-/r/81.8%
Applied egg-rr81.8%
if 2.0000000000000001e47 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf 75.1%
associate-*l/79.4%
Simplified79.4%
clear-num79.4%
associate-*l/79.4%
*-un-lft-identity79.4%
Applied egg-rr79.4%
Final simplification74.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= (* x y) -2e-40)
(/ (* x y) a)
(if (<= (* x y) -2e-261)
(* (- t) (/ z a))
(if (<= (* x y) 5e-285)
(* z (/ (- t) a))
(if (<= (* x y) 2e+47) (/ (- t) (/ a z)) (/ y (/ a x)))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e-40) {
tmp = (x * y) / a;
} else if ((x * y) <= -2e-261) {
tmp = -t * (z / a);
} else if ((x * y) <= 5e-285) {
tmp = z * (-t / a);
} else if ((x * y) <= 2e+47) {
tmp = -t / (a / z);
} else {
tmp = y / (a / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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) <= (-2d-40)) then
tmp = (x * y) / a
else if ((x * y) <= (-2d-261)) then
tmp = -t * (z / a)
else if ((x * y) <= 5d-285) then
tmp = z * (-t / a)
else if ((x * y) <= 2d+47) then
tmp = -t / (a / z)
else
tmp = y / (a / x)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e-40) {
tmp = (x * y) / a;
} else if ((x * y) <= -2e-261) {
tmp = -t * (z / a);
} else if ((x * y) <= 5e-285) {
tmp = z * (-t / a);
} else if ((x * y) <= 2e+47) {
tmp = -t / (a / z);
} else {
tmp = y / (a / x);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e-40: tmp = (x * y) / a elif (x * y) <= -2e-261: tmp = -t * (z / a) elif (x * y) <= 5e-285: tmp = z * (-t / a) elif (x * y) <= 2e+47: tmp = -t / (a / z) else: tmp = y / (a / x) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e-40) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= -2e-261) tmp = Float64(Float64(-t) * Float64(z / a)); elseif (Float64(x * y) <= 5e-285) tmp = Float64(z * Float64(Float64(-t) / a)); elseif (Float64(x * y) <= 2e+47) tmp = Float64(Float64(-t) / Float64(a / z)); else tmp = Float64(y / Float64(a / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e-40)
tmp = (x * y) / a;
elseif ((x * y) <= -2e-261)
tmp = -t * (z / a);
elseif ((x * y) <= 5e-285)
tmp = z * (-t / a);
elseif ((x * y) <= 2e+47)
tmp = -t / (a / z);
else
tmp = y / (a / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e-40], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-261], N[((-t) * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-285], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+47], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-261}:\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-285}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+47}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e-40Initial program 93.5%
Taylor expanded in x around inf 77.8%
if -1.9999999999999999e-40 < (*.f64 x y) < -1.99999999999999997e-261Initial program 99.6%
Taylor expanded in x around 0 83.8%
mul-1-neg83.8%
*-commutative83.8%
associate-*l/73.5%
*-commutative73.5%
distribute-rgt-neg-in73.5%
distribute-frac-neg73.5%
Simplified73.5%
if -1.99999999999999997e-261 < (*.f64 x y) < 5.00000000000000018e-285Initial program 93.7%
Taylor expanded in x around 0 90.5%
mul-1-neg90.5%
*-commutative90.5%
associate-*l/90.4%
*-commutative90.4%
distribute-rgt-neg-in90.4%
distribute-frac-neg90.4%
Simplified90.4%
distribute-frac-neg90.4%
distribute-rgt-neg-out90.4%
clear-num90.4%
div-inv91.9%
associate-/r/81.8%
Applied egg-rr81.8%
if 5.00000000000000018e-285 < (*.f64 x y) < 2.0000000000000001e47Initial program 96.2%
Taylor expanded in x around 0 65.9%
mul-1-neg65.9%
*-commutative65.9%
associate-*l/62.1%
*-commutative62.1%
distribute-rgt-neg-in62.1%
distribute-frac-neg62.1%
Simplified62.1%
add-sqr-sqrt30.7%
sqrt-unprod24.5%
swap-sqr18.7%
distribute-frac-neg18.7%
distribute-frac-neg18.7%
sqr-neg18.7%
swap-sqr24.5%
clear-num24.5%
div-inv24.6%
clear-num24.6%
div-inv24.6%
sqrt-unprod8.8%
add-sqr-sqrt9.2%
frac-2neg9.2%
distribute-neg-frac9.2%
add-sqr-sqrt4.3%
sqrt-unprod20.9%
sqr-neg20.9%
sqrt-unprod24.3%
add-sqr-sqrt62.3%
frac-2neg62.3%
Applied egg-rr62.3%
if 2.0000000000000001e47 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf 75.1%
associate-*l/79.4%
Simplified79.4%
clear-num79.4%
associate-*l/79.4%
*-un-lft-identity79.4%
Applied egg-rr79.4%
Final simplification74.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= (* z t) -1e-38)
(/ (- t) (/ a z))
(if (<= (* z t) 5e-22)
(/ (* x y) a)
(if (<= (* z t) 4e+141) (- (/ (* z t) a)) (* z (/ (- t) a))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= -1e-38) {
tmp = -t / (a / z);
} else if ((z * t) <= 5e-22) {
tmp = (x * y) / a;
} else if ((z * t) <= 4e+141) {
tmp = -((z * t) / a);
} else {
tmp = z * (-t / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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) <= (-1d-38)) then
tmp = -t / (a / z)
else if ((z * t) <= 5d-22) then
tmp = (x * y) / a
else if ((z * t) <= 4d+141) then
tmp = -((z * t) / a)
else
tmp = z * (-t / a)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z * t) <= -1e-38) {
tmp = -t / (a / z);
} else if ((z * t) <= 5e-22) {
tmp = (x * y) / a;
} else if ((z * t) <= 4e+141) {
tmp = -((z * t) / a);
} else {
tmp = z * (-t / a);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (z * t) <= -1e-38: tmp = -t / (a / z) elif (z * t) <= 5e-22: tmp = (x * y) / a elif (z * t) <= 4e+141: tmp = -((z * t) / a) else: tmp = z * (-t / a) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(z * t) <= -1e-38) tmp = Float64(Float64(-t) / Float64(a / z)); elseif (Float64(z * t) <= 5e-22) tmp = Float64(Float64(x * y) / a); elseif (Float64(z * t) <= 4e+141) tmp = Float64(-Float64(Float64(z * t) / a)); else tmp = Float64(z * Float64(Float64(-t) / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((z * t) <= -1e-38)
tmp = -t / (a / z);
elseif ((z * t) <= 5e-22)
tmp = (x * y) / a;
elseif ((z * t) <= 4e+141)
tmp = -((z * t) / a);
else
tmp = z * (-t / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e-38], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e-22], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 4e+141], (-N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-38}:\\
\;\;\;\;\frac{-t}{\frac{a}{z}}\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+141}:\\
\;\;\;\;-\frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\end{array}
\end{array}
if (*.f64 z t) < -9.9999999999999996e-39Initial program 92.6%
Taylor expanded in x around 0 76.2%
mul-1-neg76.2%
*-commutative76.2%
associate-*l/73.0%
*-commutative73.0%
distribute-rgt-neg-in73.0%
distribute-frac-neg73.0%
Simplified73.0%
add-sqr-sqrt41.2%
sqrt-unprod36.3%
swap-sqr24.0%
distribute-frac-neg24.0%
distribute-frac-neg24.0%
sqr-neg24.0%
swap-sqr36.3%
clear-num36.2%
div-inv36.2%
clear-num36.2%
div-inv36.2%
sqrt-unprod0.9%
add-sqr-sqrt1.3%
frac-2neg1.3%
distribute-neg-frac1.3%
add-sqr-sqrt0.9%
sqrt-unprod24.5%
sqr-neg24.5%
sqrt-unprod35.6%
add-sqr-sqrt73.1%
frac-2neg73.1%
Applied egg-rr73.1%
if -9.9999999999999996e-39 < (*.f64 z t) < 4.99999999999999954e-22Initial program 97.5%
Taylor expanded in x around inf 83.8%
if 4.99999999999999954e-22 < (*.f64 z t) < 4.00000000000000007e141Initial program 99.6%
Taylor expanded in x around 0 65.5%
associate-*r/65.5%
mul-1-neg65.5%
distribute-rgt-neg-in65.5%
Simplified65.5%
if 4.00000000000000007e141 < (*.f64 z t) Initial program 83.5%
Taylor expanded in x around 0 73.0%
mul-1-neg73.0%
*-commutative73.0%
associate-*l/86.3%
*-commutative86.3%
distribute-rgt-neg-in86.3%
distribute-frac-neg86.3%
Simplified86.3%
distribute-frac-neg86.3%
distribute-rgt-neg-out86.3%
clear-num86.4%
div-inv86.4%
associate-/r/83.7%
Applied egg-rr83.7%
Final simplification78.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e-40) (/ (* x y) a) (if (<= (* x y) 2e+47) (* z (/ (- t) a)) (/ y (/ a x)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e-40) {
tmp = (x * y) / a;
} else if ((x * y) <= 2e+47) {
tmp = z * (-t / a);
} else {
tmp = y / (a / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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) <= (-2d-40)) then
tmp = (x * y) / a
else if ((x * y) <= 2d+47) then
tmp = z * (-t / a)
else
tmp = y / (a / x)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e-40) {
tmp = (x * y) / a;
} else if ((x * y) <= 2e+47) {
tmp = z * (-t / a);
} else {
tmp = y / (a / x);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e-40: tmp = (x * y) / a elif (x * y) <= 2e+47: tmp = z * (-t / a) else: tmp = y / (a / x) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e-40) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 2e+47) tmp = Float64(z * Float64(Float64(-t) / a)); else tmp = Float64(y / Float64(a / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e-40)
tmp = (x * y) / a;
elseif ((x * y) <= 2e+47)
tmp = z * (-t / a);
else
tmp = y / (a / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e-40], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+47], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+47}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e-40Initial program 93.5%
Taylor expanded in x around inf 77.8%
if -1.9999999999999999e-40 < (*.f64 x y) < 2.0000000000000001e47Initial program 96.6%
Taylor expanded in x around 0 77.7%
mul-1-neg77.7%
*-commutative77.7%
associate-*l/72.9%
*-commutative72.9%
distribute-rgt-neg-in72.9%
distribute-frac-neg72.9%
Simplified72.9%
distribute-frac-neg72.9%
distribute-rgt-neg-out72.9%
clear-num72.2%
div-inv72.7%
associate-/r/70.3%
Applied egg-rr70.3%
if 2.0000000000000001e47 < (*.f64 x y) Initial program 91.5%
Taylor expanded in x around inf 75.1%
associate-*l/79.4%
Simplified79.4%
clear-num79.4%
associate-*l/79.4%
*-un-lft-identity79.4%
Applied egg-rr79.4%
Final simplification74.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) 5e+276) (/ (- (* x y) (* z t)) a) (/ y (/ a x))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 5e+276) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y / (a / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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) <= 5d+276) then
tmp = ((x * y) - (z * t)) / a
else
tmp = y / (a / x)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 5e+276) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y / (a / x);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= 5e+276: tmp = ((x * y) - (z * t)) / a else: tmp = y / (a / x) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= 5e+276) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(y / Float64(a / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= 5e+276)
tmp = ((x * y) - (z * t)) / a;
else
tmp = y / (a / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], 5e+276], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < 5.00000000000000001e276Initial program 96.1%
if 5.00000000000000001e276 < (*.f64 x y) Initial program 74.6%
Taylor expanded in x around inf 74.8%
associate-*l/99.9%
Simplified99.9%
clear-num99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Final simplification96.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) 5e+276) (/ (* x y) a) (/ y (/ a x))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 5e+276) {
tmp = (x * y) / a;
} else {
tmp = y / (a / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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) <= 5d+276) then
tmp = (x * y) / a
else
tmp = y / (a / x)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= 5e+276) {
tmp = (x * y) / a;
} else {
tmp = y / (a / x);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= 5e+276: tmp = (x * y) / a else: tmp = y / (a / x) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= 5e+276) tmp = Float64(Float64(x * y) / a); else tmp = Float64(y / Float64(a / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= 5e+276)
tmp = (x * y) / a;
else
tmp = y / (a / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], 5e+276], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < 5.00000000000000001e276Initial program 96.1%
Taylor expanded in x around inf 52.0%
if 5.00000000000000001e276 < (*.f64 x y) Initial program 74.6%
Taylor expanded in x around inf 74.8%
associate-*l/99.9%
Simplified99.9%
clear-num99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
Applied egg-rr99.8%
Final simplification55.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x (/ y a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return x * (y / a);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return x * (y / a)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(x * Float64(y / a)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = x * (y / a);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t 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] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
x \cdot \frac{y}{a}
\end{array}
Initial program 94.5%
Taylor expanded in x around inf 53.7%
associate-*r/50.7%
Simplified50.7%
Final simplification50.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y (/ x a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 = y * (x / a)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return y * (x / a);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return y * (x / a)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(y * Float64(x / a)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = y * (x / a);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
y \cdot \frac{x}{a}
\end{array}
Initial program 94.5%
Taylor expanded in x around inf 53.7%
associate-*l/52.3%
Simplified52.3%
Final simplification52.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ y (/ a x)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return y / (a / x);
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 = y / (a / x)
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return y / (a / x);
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return y / (a / x)
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(y / Float64(a / x)) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = y / (a / x);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\frac{y}{\frac{a}{x}}
\end{array}
Initial program 94.5%
Taylor expanded in x around inf 53.7%
associate-*l/52.3%
Simplified52.3%
clear-num52.3%
associate-*l/52.4%
*-un-lft-identity52.4%
Applied egg-rr52.4%
Final simplification52.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 2023293
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:herbie-target
(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))