
(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 11 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))
(* x (- (/ y a) (* t (/ (/ z x) a))))
(if (<= t_1 2e+232) (/ t_1 a) (- (* x (/ y a)) (/ t (/ a 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 / a) - (t * ((z / x) / a)));
} else if (t_1 <= 2e+232) {
tmp = t_1 / a;
} else {
tmp = (x * (y / a)) - (t / (a / 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 / a) - (t * ((z / x) / a)));
} else if (t_1 <= 2e+232) {
tmp = t_1 / a;
} else {
tmp = (x * (y / a)) - (t / (a / 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 / a) - (t * ((z / x) / a))) elif t_1 <= 2e+232: tmp = t_1 / a else: tmp = (x * (y / a)) - (t / (a / 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 / a) - Float64(t * Float64(Float64(z / x) / a)))); elseif (t_1 <= 2e+232) tmp = Float64(t_1 / a); else tmp = Float64(Float64(x * Float64(y / a)) - Float64(t / Float64(a / 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 / a) - (t * ((z / x) / a)));
elseif (t_1 <= 2e+232)
tmp = t_1 / a;
else
tmp = (x * (y / a)) - (t / (a / 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 / a), $MachinePrecision] - N[(t * N[(N[(z / x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+232], N[(t$95$1 / a), $MachinePrecision], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $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 \left(\frac{y}{a} - t \cdot \frac{\frac{z}{x}}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+232}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 68.4%
Taylor expanded in x around inf 73.6%
+-commutative73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*80.2%
*-commutative80.2%
associate-/r*87.5%
Simplified87.5%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000011e232Initial program 99.2%
if 2.00000000000000011e232 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 68.8%
div-sub68.8%
associate-/l*90.0%
associate-/l*99.9%
Applied egg-rr99.9%
associate-*r/90.0%
add-sqr-sqrt33.7%
sqrt-unprod71.8%
sqr-neg71.8%
sqrt-unprod43.5%
add-sqr-sqrt58.9%
associate-*l/58.9%
*-commutative58.9%
clear-num58.9%
un-div-inv58.9%
add-sqr-sqrt43.5%
sqrt-unprod74.3%
sqr-neg74.3%
sqrt-unprod38.3%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
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 (* t (/ (- z) a))) (t_2 (* y (/ x a))))
(if (<= (* x y) -5e-59)
t_2
(if (<= (* x y) 2e-88)
t_1
(if (<= (* x y) 1e-15)
(/ (* x y) a)
(if (<= (* x y) 1e+47) t_1 t_2))))))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 = t * (-z / a);
double t_2 = y * (x / a);
double tmp;
if ((x * y) <= -5e-59) {
tmp = t_2;
} else if ((x * y) <= 2e-88) {
tmp = t_1;
} else if ((x * y) <= 1e-15) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (-z / a)
t_2 = y * (x / a)
if ((x * y) <= (-5d-59)) then
tmp = t_2
else if ((x * y) <= 2d-88) then
tmp = t_1
else if ((x * y) <= 1d-15) then
tmp = (x * y) / a
else if ((x * y) <= 1d+47) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (-z / a);
double t_2 = y * (x / a);
double tmp;
if ((x * y) <= -5e-59) {
tmp = t_2;
} else if ((x * y) <= 2e-88) {
tmp = t_1;
} else if ((x * y) <= 1e-15) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+47) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = t * (-z / a) t_2 = y * (x / a) tmp = 0 if (x * y) <= -5e-59: tmp = t_2 elif (x * y) <= 2e-88: tmp = t_1 elif (x * y) <= 1e-15: tmp = (x * y) / a elif (x * y) <= 1e+47: tmp = t_1 else: tmp = t_2 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(t * Float64(Float64(-z) / a)) t_2 = Float64(y * Float64(x / a)) tmp = 0.0 if (Float64(x * y) <= -5e-59) tmp = t_2; elseif (Float64(x * y) <= 2e-88) tmp = t_1; elseif (Float64(x * y) <= 1e-15) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 1e+47) tmp = t_1; else tmp = t_2; 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 = t * (-z / a);
t_2 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -5e-59)
tmp = t_2;
elseif ((x * y) <= 2e-88)
tmp = t_1;
elseif ((x * y) <= 1e-15)
tmp = (x * y) / a;
elseif ((x * y) <= 1e+47)
tmp = t_1;
else
tmp = t_2;
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[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e-59], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-88], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+47], t$95$1, t$95$2]]]]]]
\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 := t \cdot \frac{-z}{a}\\
t_2 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-15}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e-59 or 1e47 < (*.f64 x y) Initial program 85.9%
Taylor expanded in x around inf 72.2%
clear-num72.1%
associate-/r*79.5%
associate-/r/79.5%
clear-num79.6%
Applied egg-rr79.6%
if -5.0000000000000001e-59 < (*.f64 x y) < 1.99999999999999987e-88 or 1.0000000000000001e-15 < (*.f64 x y) < 1e47Initial program 97.2%
Taylor expanded in x around 0 89.3%
mul-1-neg89.3%
associate-/l*83.9%
distribute-rgt-neg-in83.9%
distribute-neg-frac283.9%
Simplified83.9%
if 1.99999999999999987e-88 < (*.f64 x y) < 1.0000000000000001e-15Initial program 91.4%
Taylor expanded in x around inf 73.0%
Final simplification81.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
(let* ((t_1 (* z (/ (- t) a))) (t_2 (* y (/ x a))))
(if (<= (* x y) -5e-59)
t_2
(if (<= (* x y) 2e-88)
t_1
(if (<= (* x y) 1e-15)
(/ (* x y) a)
(if (<= (* x y) 1e+47) t_1 t_2))))))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 = z * (-t / a);
double t_2 = y * (x / a);
double tmp;
if ((x * y) <= -5e-59) {
tmp = t_2;
} else if ((x * y) <= 2e-88) {
tmp = t_1;
} else if ((x * y) <= 1e-15) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+47) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (-t / a)
t_2 = y * (x / a)
if ((x * y) <= (-5d-59)) then
tmp = t_2
else if ((x * y) <= 2d-88) then
tmp = t_1
else if ((x * y) <= 1d-15) then
tmp = (x * y) / a
else if ((x * y) <= 1d+47) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-t / a);
double t_2 = y * (x / a);
double tmp;
if ((x * y) <= -5e-59) {
tmp = t_2;
} else if ((x * y) <= 2e-88) {
tmp = t_1;
} else if ((x * y) <= 1e-15) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+47) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = z * (-t / a) t_2 = y * (x / a) tmp = 0 if (x * y) <= -5e-59: tmp = t_2 elif (x * y) <= 2e-88: tmp = t_1 elif (x * y) <= 1e-15: tmp = (x * y) / a elif (x * y) <= 1e+47: tmp = t_1 else: tmp = t_2 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(z * Float64(Float64(-t) / a)) t_2 = Float64(y * Float64(x / a)) tmp = 0.0 if (Float64(x * y) <= -5e-59) tmp = t_2; elseif (Float64(x * y) <= 2e-88) tmp = t_1; elseif (Float64(x * y) <= 1e-15) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 1e+47) tmp = t_1; else tmp = t_2; 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 = z * (-t / a);
t_2 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -5e-59)
tmp = t_2;
elseif ((x * y) <= 2e-88)
tmp = t_1;
elseif ((x * y) <= 1e-15)
tmp = (x * y) / a;
elseif ((x * y) <= 1e+47)
tmp = t_1;
else
tmp = t_2;
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[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e-59], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-88], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+47], t$95$1, t$95$2]]]]]]
\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 := z \cdot \frac{-t}{a}\\
t_2 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-15}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e-59 or 1e47 < (*.f64 x y) Initial program 85.9%
Taylor expanded in x around inf 72.2%
clear-num72.1%
associate-/r*79.5%
associate-/r/79.5%
clear-num79.6%
Applied egg-rr79.6%
if -5.0000000000000001e-59 < (*.f64 x y) < 1.99999999999999987e-88 or 1.0000000000000001e-15 < (*.f64 x y) < 1e47Initial program 97.2%
Taylor expanded in x around 0 89.3%
*-commutative89.3%
associate-*r/83.0%
neg-mul-183.0%
distribute-rgt-neg-in83.0%
distribute-frac-neg83.0%
Simplified83.0%
if 1.99999999999999987e-88 < (*.f64 x y) < 1.0000000000000001e-15Initial program 91.4%
Taylor expanded in x around inf 73.0%
Final simplification80.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 (* y (/ x a))))
(if (<= (* x y) -5e-59)
t_1
(if (<= (* x y) 2e-88)
(/ (* z (- t)) a)
(if (<= (* x y) 1e-15)
(/ (* x y) a)
(if (<= (* x y) 1e+47) (* z (/ (- t) a)) t_1))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / a);
double tmp;
if ((x * y) <= -5e-59) {
tmp = t_1;
} else if ((x * y) <= 2e-88) {
tmp = (z * -t) / a;
} else if ((x * y) <= 1e-15) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+47) {
tmp = z * (-t / a);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * (x / a)
if ((x * y) <= (-5d-59)) then
tmp = t_1
else if ((x * y) <= 2d-88) then
tmp = (z * -t) / a
else if ((x * y) <= 1d-15) then
tmp = (x * y) / a
else if ((x * y) <= 1d+47) then
tmp = z * (-t / a)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x / a);
double tmp;
if ((x * y) <= -5e-59) {
tmp = t_1;
} else if ((x * y) <= 2e-88) {
tmp = (z * -t) / a;
} else if ((x * y) <= 1e-15) {
tmp = (x * y) / a;
} else if ((x * y) <= 1e+47) {
tmp = z * (-t / a);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = y * (x / a) tmp = 0 if (x * y) <= -5e-59: tmp = t_1 elif (x * y) <= 2e-88: tmp = (z * -t) / a elif (x * y) <= 1e-15: tmp = (x * y) / a elif (x * y) <= 1e+47: tmp = z * (-t / 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(y * Float64(x / a)) tmp = 0.0 if (Float64(x * y) <= -5e-59) tmp = t_1; elseif (Float64(x * y) <= 2e-88) tmp = Float64(Float64(z * Float64(-t)) / a); elseif (Float64(x * y) <= 1e-15) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 1e+47) tmp = Float64(z * Float64(Float64(-t) / a)); else tmp = t_1; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x / a);
tmp = 0.0;
if ((x * y) <= -5e-59)
tmp = t_1;
elseif ((x * y) <= 2e-88)
tmp = (z * -t) / a;
elseif ((x * y) <= 1e-15)
tmp = (x * y) / a;
elseif ((x * y) <= 1e+47)
tmp = z * (-t / 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[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e-59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-88], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+47], N[(z * N[((-t) / 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 := y \cdot \frac{x}{a}\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-88}:\\
\;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{-15}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+47}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e-59 or 1e47 < (*.f64 x y) Initial program 85.9%
Taylor expanded in x around inf 72.2%
clear-num72.1%
associate-/r*79.5%
associate-/r/79.5%
clear-num79.6%
Applied egg-rr79.6%
if -5.0000000000000001e-59 < (*.f64 x y) < 1.99999999999999987e-88Initial program 97.9%
Taylor expanded in x around 0 91.9%
associate-*r*91.9%
mul-1-neg91.9%
Simplified91.9%
if 1.99999999999999987e-88 < (*.f64 x y) < 1.0000000000000001e-15Initial program 91.4%
Taylor expanded in x around inf 73.0%
if 1.0000000000000001e-15 < (*.f64 x y) < 1e47Initial program 91.9%
Taylor expanded in x around 0 68.0%
*-commutative68.0%
associate-*r/76.2%
neg-mul-176.2%
distribute-rgt-neg-in76.2%
distribute-frac-neg76.2%
Simplified76.2%
Final simplification83.9%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+232)))
(- (* x (/ y a)) (/ t (/ a z)))
(/ t_1 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)) || !(t_1 <= 2e+232)) {
tmp = (x * (y / a)) - (t / (a / z));
} else {
tmp = t_1 / 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) || !(t_1 <= 2e+232)) {
tmp = (x * (y / a)) - (t / (a / z));
} else {
tmp = t_1 / 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) or not (t_1 <= 2e+232): tmp = (x * (y / a)) - (t / (a / z)) else: tmp = t_1 / 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)) || !(t_1 <= 2e+232)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(t / Float64(a / z))); else tmp = Float64(t_1 / 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) || ~((t_1 <= 2e+232)))
tmp = (x * (y / a)) - (t / (a / z));
else
tmp = t_1 / 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+232]], $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, 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 \lor \neg \left(t\_1 \leq 2 \cdot 10^{+232}\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 2.00000000000000011e232 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 68.6%
div-sub62.8%
associate-/l*78.9%
associate-/l*92.6%
Applied egg-rr92.6%
associate-*r/78.9%
add-sqr-sqrt33.6%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod31.8%
add-sqr-sqrt50.7%
associate-*l/50.7%
*-commutative50.7%
clear-num50.7%
un-div-inv50.7%
add-sqr-sqrt31.8%
sqrt-unprod62.4%
sqr-neg62.4%
sqrt-unprod39.0%
add-sqr-sqrt89.7%
Applied egg-rr89.7%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000011e232Initial program 99.2%
Final simplification96.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- (* x y) (* z t)) a))) (if (<= t_1 5e+294) t_1 (* (- y (/ (* z t) x)) (/ 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)) / a;
double tmp;
if (t_1 <= 5e+294) {
tmp = t_1;
} else {
tmp = (y - ((z * t) / x)) * (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) :: t_1
real(8) :: tmp
t_1 = ((x * y) - (z * t)) / a
if (t_1 <= 5d+294) then
tmp = t_1
else
tmp = (y - ((z * t) / x)) * (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 t_1 = ((x * y) - (z * t)) / a;
double tmp;
if (t_1 <= 5e+294) {
tmp = t_1;
} else {
tmp = (y - ((z * t) / x)) * (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)) / a tmp = 0 if t_1 <= 5e+294: tmp = t_1 else: tmp = (y - ((z * t) / x)) * (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(Float64(x * y) - Float64(z * t)) / a) tmp = 0.0 if (t_1 <= 5e+294) tmp = t_1; else tmp = Float64(Float64(y - Float64(Float64(z * t) / x)) * 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)
t_1 = ((x * y) - (z * t)) / a;
tmp = 0.0;
if (t_1 <= 5e+294)
tmp = t_1;
else
tmp = (y - ((z * t) / x)) * (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[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+294], t$95$1, N[(N[(y - N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y - z \cdot t}{a}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+294}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y - \frac{z \cdot t}{x}\right) \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) < 4.9999999999999999e294Initial program 94.0%
if 4.9999999999999999e294 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a) Initial program 75.8%
div-sub71.1%
associate-/l*75.6%
associate-/l*88.8%
Applied egg-rr88.8%
Taylor expanded in x around inf 75.0%
*-commutative75.0%
+-commutative75.0%
mul-1-neg75.0%
sub-neg75.0%
*-commutative75.0%
associate-/l/77.9%
div-sub80.2%
associate-*l/73.8%
associate-/l*77.9%
*-commutative77.9%
Simplified77.9%
Final simplification91.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (/ x (/ a y)) (if (<= (* x y) 2e+220) (/ (- (* x y) (* z t)) 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 ((x * y) <= -((double) INFINITY)) {
tmp = x / (a / y);
} else if ((x * y) <= 2e+220) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = y * (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 tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = x / (a / y);
} else if ((x * y) <= 2e+220) {
tmp = ((x * y) - (z * t)) / 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 (x * y) <= -math.inf: tmp = x / (a / y) elif (x * y) <= 2e+220: tmp = ((x * y) - (z * t)) / 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(x * y) <= Float64(-Inf)) tmp = Float64(x / Float64(a / y)); elseif (Float64(x * y) <= 2e+220) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / 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 ((x * y) <= -Inf)
tmp = x / (a / y);
elseif ((x * y) <= 2e+220)
tmp = ((x * y) - (z * t)) / 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[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+220], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $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}\;x \cdot y \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+220}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 63.0%
Taylor expanded in x around inf 70.7%
associate-*r/99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
if -inf.0 < (*.f64 x y) < 2e220Initial program 95.4%
if 2e220 < (*.f64 x y) Initial program 65.3%
Taylor expanded in x around inf 65.3%
clear-num65.3%
associate-/r*99.9%
associate-/r/99.9%
clear-num99.9%
Applied egg-rr99.9%
Final simplification96.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 (<= a 3.2e+105) (/ (- (* x y) (* z t)) a) (- (* 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 tmp;
if (a <= 3.2e+105) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (x * (y / a)) - (z * (t / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= 3.2d+105) then
tmp = ((x * y) - (z * t)) / a
else
tmp = (x * (y / a)) - (z * (t / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.2e+105) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (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): tmp = 0 if a <= 3.2e+105: tmp = ((x * y) - (z * t)) / a else: tmp = (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) tmp = 0.0 if (a <= 3.2e+105) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(x * Float64(y / a)) - Float64(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)
tmp = 0.0;
if (a <= 3.2e+105)
tmp = ((x * y) - (z * t)) / a;
else
tmp = (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_] := If[LessEqual[a, 3.2e+105], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(z * 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}
\mathbf{if}\;a \leq 3.2 \cdot 10^{+105}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a} - z \cdot \frac{t}{a}\\
\end{array}
\end{array}
if a < 3.2e105Initial program 92.4%
if 3.2e105 < a Initial program 83.5%
div-sub83.5%
associate-/l*85.7%
associate-/l*87.7%
Applied egg-rr87.7%
Final simplification91.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* 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 91.0%
Taylor expanded in x around inf 50.7%
associate-*r/53.0%
Simplified53.0%
Final simplification53.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 (* 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) {
return y * (x / 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 = y * (x / 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 y * (x / 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 y * (x / 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(y * Float64(x / 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 = y * (x / 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[(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])\\
\\
y \cdot \frac{x}{a}
\end{array}
Initial program 91.0%
Taylor expanded in x around inf 50.7%
clear-num50.6%
associate-/r*54.2%
associate-/r/54.5%
clear-num54.6%
Applied egg-rr54.6%
Final simplification54.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ y (/ a x)))
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 y / (a / x);
}
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 = y / (a / x)
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 y / (a / x);
}
[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 y / (a / x)
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(y / Float64(a / x)) 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 = y / (a / x);
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[(y / N[(a / x), $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])\\
\\
\frac{y}{\frac{a}{x}}
\end{array}
Initial program 91.0%
Taylor expanded in x around inf 50.7%
clear-num50.6%
associate-/r*54.2%
associate-/r/54.5%
clear-num54.6%
Applied egg-rr54.6%
*-commutative54.6%
clear-num54.5%
div-inv54.2%
Applied egg-rr54.2%
Final simplification54.2%
(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 2024055
(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))