
(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 10 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 -2e+279)
(- (* x (/ y a)) (* z (/ t a)))
(if (<= t_1 5e+289) (/ t_1 a) (* x (- (/ y a) (* t (/ (/ z x) a))))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= -2e+279) {
tmp = (x * (y / a)) - (z * (t / a));
} else if (t_1 <= 5e+289) {
tmp = t_1 / a;
} else {
tmp = x * ((y / a) - (t * ((z / 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)
if (t_1 <= (-2d+279)) then
tmp = (x * (y / a)) - (z * (t / a))
else if (t_1 <= 5d+289) then
tmp = t_1 / a
else
tmp = x * ((y / a) - (t * ((z / 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);
double tmp;
if (t_1 <= -2e+279) {
tmp = (x * (y / a)) - (z * (t / a));
} else if (t_1 <= 5e+289) {
tmp = t_1 / a;
} else {
tmp = x * ((y / a) - (t * ((z / x) / a)));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - (z * t) tmp = 0 if t_1 <= -2e+279: tmp = (x * (y / a)) - (z * (t / a)) elif t_1 <= 5e+289: tmp = t_1 / a else: tmp = x * ((y / a) - (t * ((z / x) / a))) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(z * t)) tmp = 0.0 if (t_1 <= -2e+279) tmp = Float64(Float64(x * Float64(y / a)) - Float64(z * Float64(t / a))); elseif (t_1 <= 5e+289) tmp = Float64(t_1 / a); else tmp = Float64(x * Float64(Float64(y / a) - Float64(t * Float64(Float64(z / x) / a)))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - (z * t);
tmp = 0.0;
if (t_1 <= -2e+279)
tmp = (x * (y / a)) - (z * (t / a));
elseif (t_1 <= 5e+289)
tmp = t_1 / a;
else
tmp = x * ((y / a) - (t * ((z / x) / a)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+279], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+289], N[(t$95$1 / a), $MachinePrecision], N[(x * N[(N[(y / a), $MachinePrecision] - N[(t * N[(N[(z / x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+279}:\\
\;\;\;\;x \cdot \frac{y}{a} - z \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{a} - t \cdot \frac{\frac{z}{x}}{a}\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -2.00000000000000012e279Initial program 74.0%
div-sub70.5%
associate-/l*87.0%
associate-/l*89.5%
Applied egg-rr89.5%
if -2.00000000000000012e279 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000031e289Initial program 98.3%
if 5.00000000000000031e289 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 70.8%
Taylor expanded in x around inf 76.9%
+-commutative76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-/l*86.1%
*-commutative86.1%
associate-/r*81.5%
Simplified81.5%
Final simplification94.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) a)) (t_2 (* z (/ (- t) a))))
(if (<= (* x y) -1e+175)
(* y (/ x a))
(if (<= (* x y) -1e-24)
t_1
(if (<= (* x y) 1e-100)
t_2
(if (<= (* x y) 4e-31)
t_1
(if (<= (* x y) 1e+24) t_2 (/ 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) {
double t_1 = (x * y) / a;
double t_2 = z * (-t / a);
double tmp;
if ((x * y) <= -1e+175) {
tmp = y * (x / a);
} else if ((x * y) <= -1e-24) {
tmp = t_1;
} else if ((x * y) <= 1e-100) {
tmp = t_2;
} else if ((x * y) <= 4e-31) {
tmp = t_1;
} else if ((x * y) <= 1e+24) {
tmp = t_2;
} else {
tmp = y / (a / x);
}
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 = (x * y) / a
t_2 = z * (-t / a)
if ((x * y) <= (-1d+175)) then
tmp = y * (x / a)
else if ((x * y) <= (-1d-24)) then
tmp = t_1
else if ((x * y) <= 1d-100) then
tmp = t_2
else if ((x * y) <= 4d-31) then
tmp = t_1
else if ((x * y) <= 1d+24) then
tmp = t_2
else
tmp = y / (a / x)
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) / a;
double t_2 = z * (-t / a);
double tmp;
if ((x * y) <= -1e+175) {
tmp = y * (x / a);
} else if ((x * y) <= -1e-24) {
tmp = t_1;
} else if ((x * y) <= 1e-100) {
tmp = t_2;
} else if ((x * y) <= 4e-31) {
tmp = t_1;
} else if ((x * y) <= 1e+24) {
tmp = t_2;
} else {
tmp = y / (a / x);
}
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) / a t_2 = z * (-t / a) tmp = 0 if (x * y) <= -1e+175: tmp = y * (x / a) elif (x * y) <= -1e-24: tmp = t_1 elif (x * y) <= 1e-100: tmp = t_2 elif (x * y) <= 4e-31: tmp = t_1 elif (x * y) <= 1e+24: tmp = t_2 else: tmp = y / (a / x) 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) / a) t_2 = Float64(z * Float64(Float64(-t) / a)) tmp = 0.0 if (Float64(x * y) <= -1e+175) tmp = Float64(y * Float64(x / a)); elseif (Float64(x * y) <= -1e-24) tmp = t_1; elseif (Float64(x * y) <= 1e-100) tmp = t_2; elseif (Float64(x * y) <= 4e-31) tmp = t_1; elseif (Float64(x * y) <= 1e+24) tmp = t_2; else tmp = Float64(y / Float64(a / x)); 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) / a;
t_2 = z * (-t / a);
tmp = 0.0;
if ((x * y) <= -1e+175)
tmp = y * (x / a);
elseif ((x * y) <= -1e-24)
tmp = t_1;
elseif ((x * y) <= 1e-100)
tmp = t_2;
elseif ((x * y) <= 4e-31)
tmp = t_1;
elseif ((x * y) <= 1e+24)
tmp = t_2;
else
tmp = y / (a / x);
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] / a), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+175], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-24], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-100], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e-31], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+24], t$95$2, 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])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a}\\
t_2 := z \cdot \frac{-t}{a}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+175}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-100}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+24}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e174Initial program 75.1%
Taylor expanded in x around inf 75.1%
associate-*r/90.5%
Simplified90.5%
clear-num90.4%
un-div-inv90.5%
Applied egg-rr90.5%
associate-/r/90.5%
Applied egg-rr90.5%
if -9.9999999999999994e174 < (*.f64 x y) < -9.99999999999999924e-25 or 1e-100 < (*.f64 x y) < 4e-31Initial program 99.7%
Taylor expanded in x around inf 68.1%
if -9.99999999999999924e-25 < (*.f64 x y) < 1e-100 or 4e-31 < (*.f64 x y) < 9.9999999999999998e23Initial program 92.5%
Taylor expanded in x around 0 78.8%
*-commutative78.8%
associate-*r/80.2%
neg-mul-180.2%
distribute-rgt-neg-in80.2%
distribute-frac-neg80.2%
Simplified80.2%
if 9.9999999999999998e23 < (*.f64 x y) Initial program 90.3%
Taylor expanded in x around inf 79.8%
associate-*r/84.1%
Simplified84.1%
clear-num83.5%
un-div-inv82.2%
Applied egg-rr82.2%
associate-/r/79.5%
Applied egg-rr79.5%
*-commutative79.5%
clear-num79.3%
un-div-inv79.5%
Applied egg-rr79.5%
Final simplification79.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 (/ (* x y) a)))
(if (<= (* x y) -1e+175)
(* y (/ x a))
(if (<= (* x y) -1e-24)
t_1
(if (<= (* x y) 1e-100)
(/ z (/ a (- t)))
(if (<= (* x y) 4e-31)
t_1
(if (<= (* x y) 1e+24) (* z (/ (- t) a)) (/ 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) {
double t_1 = (x * y) / a;
double tmp;
if ((x * y) <= -1e+175) {
tmp = y * (x / a);
} else if ((x * y) <= -1e-24) {
tmp = t_1;
} else if ((x * y) <= 1e-100) {
tmp = z / (a / -t);
} else if ((x * y) <= 4e-31) {
tmp = t_1;
} else if ((x * y) <= 1e+24) {
tmp = z * (-t / a);
} else {
tmp = y / (a / x);
}
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) / a
if ((x * y) <= (-1d+175)) then
tmp = y * (x / a)
else if ((x * y) <= (-1d-24)) then
tmp = t_1
else if ((x * y) <= 1d-100) then
tmp = z / (a / -t)
else if ((x * y) <= 4d-31) then
tmp = t_1
else if ((x * y) <= 1d+24) then
tmp = z * (-t / a)
else
tmp = y / (a / x)
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) / a;
double tmp;
if ((x * y) <= -1e+175) {
tmp = y * (x / a);
} else if ((x * y) <= -1e-24) {
tmp = t_1;
} else if ((x * y) <= 1e-100) {
tmp = z / (a / -t);
} else if ((x * y) <= 4e-31) {
tmp = t_1;
} else if ((x * y) <= 1e+24) {
tmp = z * (-t / a);
} else {
tmp = y / (a / x);
}
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) / a tmp = 0 if (x * y) <= -1e+175: tmp = y * (x / a) elif (x * y) <= -1e-24: tmp = t_1 elif (x * y) <= 1e-100: tmp = z / (a / -t) elif (x * y) <= 4e-31: tmp = t_1 elif (x * y) <= 1e+24: tmp = z * (-t / a) else: tmp = y / (a / x) 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) / a) tmp = 0.0 if (Float64(x * y) <= -1e+175) tmp = Float64(y * Float64(x / a)); elseif (Float64(x * y) <= -1e-24) tmp = t_1; elseif (Float64(x * y) <= 1e-100) tmp = Float64(z / Float64(a / Float64(-t))); elseif (Float64(x * y) <= 4e-31) tmp = t_1; elseif (Float64(x * y) <= 1e+24) tmp = Float64(z * Float64(Float64(-t) / a)); else tmp = Float64(y / Float64(a / x)); 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) / a;
tmp = 0.0;
if ((x * y) <= -1e+175)
tmp = y * (x / a);
elseif ((x * y) <= -1e-24)
tmp = t_1;
elseif ((x * y) <= 1e-100)
tmp = z / (a / -t);
elseif ((x * y) <= 4e-31)
tmp = t_1;
elseif ((x * y) <= 1e+24)
tmp = z * (-t / a);
else
tmp = y / (a / x);
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] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+175], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-24], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-100], N[(z / N[(a / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e-31], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+24], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+175}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-100}:\\
\;\;\;\;\frac{z}{\frac{a}{-t}}\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{+24}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.9999999999999994e174Initial program 75.1%
Taylor expanded in x around inf 75.1%
associate-*r/90.5%
Simplified90.5%
clear-num90.4%
un-div-inv90.5%
Applied egg-rr90.5%
associate-/r/90.5%
Applied egg-rr90.5%
if -9.9999999999999994e174 < (*.f64 x y) < -9.99999999999999924e-25 or 1e-100 < (*.f64 x y) < 4e-31Initial program 99.7%
Taylor expanded in x around inf 68.1%
if -9.99999999999999924e-25 < (*.f64 x y) < 1e-100Initial program 92.1%
Taylor expanded in x around 0 79.4%
mul-1-neg79.4%
associate-/l*79.2%
distribute-rgt-neg-in79.2%
distribute-neg-frac279.2%
Simplified79.2%
*-commutative79.2%
distribute-frac-neg279.2%
distribute-lft-neg-in79.2%
associate-/r/80.9%
distribute-neg-frac80.9%
Applied egg-rr80.9%
if 4e-31 < (*.f64 x y) < 9.9999999999999998e23Initial program 99.5%
Taylor expanded in x around 0 67.1%
*-commutative67.1%
associate-*r/67.3%
neg-mul-167.3%
distribute-rgt-neg-in67.3%
distribute-frac-neg67.3%
Simplified67.3%
if 9.9999999999999998e23 < (*.f64 x y) Initial program 90.3%
Taylor expanded in x around inf 79.8%
associate-*r/84.1%
Simplified84.1%
clear-num83.5%
un-div-inv82.2%
Applied egg-rr82.2%
associate-/r/79.5%
Applied egg-rr79.5%
*-commutative79.5%
clear-num79.3%
un-div-inv79.5%
Applied egg-rr79.5%
Final simplification79.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 (- (* x y) (* z t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+284)))
(* (- y (* t (/ z x))) (/ x a))
(/ 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 <= 1e+284)) {
tmp = (y - (t * (z / x))) * (x / a);
} 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 <= 1e+284)) {
tmp = (y - (t * (z / x))) * (x / a);
} 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 <= 1e+284): tmp = (y - (t * (z / x))) * (x / a) 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 <= 1e+284)) tmp = Float64(Float64(y - Float64(t * Float64(z / x))) * Float64(x / a)); 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 <= 1e+284)))
tmp = (y - (t * (z / x))) * (x / a);
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, 1e+284]], $MachinePrecision]], N[(N[(y - N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / a), $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 10^{+284}\right):\\
\;\;\;\;\left(y - t \cdot \frac{z}{x}\right) \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 1.00000000000000008e284 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 69.1%
div-sub64.4%
associate-/l*77.4%
associate-/l*87.4%
Applied egg-rr87.4%
Taylor expanded in x around inf 78.9%
*-commutative78.9%
+-commutative78.9%
mul-1-neg78.9%
sub-neg78.9%
times-frac81.6%
associate-*l/80.4%
div-sub86.6%
associate-*l/69.2%
associate-/l*86.3%
Simplified86.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.00000000000000008e284Initial program 98.3%
Final simplification95.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* z t))))
(if (or (<= t_1 -2e+279) (not (<= t_1 5e+279)))
(- (* x (/ y a)) (* z (/ t a)))
(/ 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 <= -2e+279) || !(t_1 <= 5e+279)) {
tmp = (x * (y / a)) - (z * (t / a));
} else {
tmp = t_1 / 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)
if ((t_1 <= (-2d+279)) .or. (.not. (t_1 <= 5d+279))) then
tmp = (x * (y / a)) - (z * (t / a))
else
tmp = t_1 / 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);
double tmp;
if ((t_1 <= -2e+279) || !(t_1 <= 5e+279)) {
tmp = (x * (y / a)) - (z * (t / a));
} 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 <= -2e+279) or not (t_1 <= 5e+279): tmp = (x * (y / a)) - (z * (t / a)) 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 <= -2e+279) || !(t_1 <= 5e+279)) tmp = Float64(Float64(x * Float64(y / a)) - Float64(z * Float64(t / a))); 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 <= -2e+279) || ~((t_1 <= 5e+279)))
tmp = (x * (y / a)) - (z * (t / a));
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, -2e+279], N[Not[LessEqual[t$95$1, 5e+279]], $MachinePrecision]], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t / a), $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 -2 \cdot 10^{+279} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+279}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - z \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -2.00000000000000012e279 or 5.0000000000000002e279 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 73.2%
div-sub69.2%
associate-/l*80.4%
associate-/l*89.1%
Applied egg-rr89.1%
if -2.00000000000000012e279 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.0000000000000002e279Initial program 98.3%
Final simplification95.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= (* x y) (- INFINITY)) (not (<= (* x y) 2e+271))) (* x (/ y a)) (/ (- (* x y) (* z t)) a)))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) <= -((double) INFINITY)) || !((x * y) <= 2e+271)) {
tmp = x * (y / a);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((x * y) <= -Double.POSITIVE_INFINITY) || !((x * y) <= 2e+271)) {
tmp = x * (y / a);
} else {
tmp = ((x * y) - (z * t)) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if ((x * y) <= -math.inf) or not ((x * y) <= 2e+271): tmp = x * (y / a) else: tmp = ((x * y) - (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 ((Float64(x * y) <= Float64(-Inf)) || !(Float64(x * y) <= 2e+271)) tmp = Float64(x * Float64(y / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (((x * y) <= -Inf) || ~(((x * y) <= 2e+271)))
tmp = x * (y / a);
else
tmp = ((x * y) - (z * t)) / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+271]], $MachinePrecision]], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / 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}
\mathbf{if}\;x \cdot y \leq -\infty \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+271}\right):\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0 or 1.99999999999999991e271 < (*.f64 x y) Initial program 65.7%
Taylor expanded in x around inf 68.7%
associate-*r/96.9%
Simplified96.9%
if -inf.0 < (*.f64 x y) < 1.99999999999999991e271Initial program 94.8%
Final simplification95.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -5e+86) (/ x (/ a y)) (if (<= (* x y) 1e+24) (* t (/ (- z) a)) (/ 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) {
double tmp;
if ((x * y) <= -5e+86) {
tmp = x / (a / y);
} else if ((x * y) <= 1e+24) {
tmp = t * (-z / a);
} else {
tmp = y / (a / x);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x * y) <= (-5d+86)) then
tmp = x / (a / y)
else if ((x * y) <= 1d+24) then
tmp = t * (-z / a)
else
tmp = y / (a / x)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -5e+86) {
tmp = x / (a / y);
} else if ((x * y) <= 1e+24) {
tmp = t * (-z / a);
} else {
tmp = y / (a / x);
}
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) <= -5e+86: tmp = x / (a / y) elif (x * y) <= 1e+24: tmp = t * (-z / a) else: tmp = y / (a / x) 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) <= -5e+86) tmp = Float64(x / Float64(a / y)); elseif (Float64(x * y) <= 1e+24) tmp = Float64(t * Float64(Float64(-z) / a)); else tmp = Float64(y / Float64(a / x)); 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) <= -5e+86)
tmp = x / (a / y);
elseif ((x * y) <= 1e+24)
tmp = t * (-z / a);
else
tmp = y / (a / x);
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], -5e+86], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+24], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+86}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 10^{+24}:\\
\;\;\;\;t \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999998e86Initial program 83.1%
Taylor expanded in x around inf 76.7%
associate-*r/83.1%
Simplified83.1%
clear-num83.0%
un-div-inv83.2%
Applied egg-rr83.2%
if -4.9999999999999998e86 < (*.f64 x y) < 9.9999999999999998e23Initial program 93.9%
Taylor expanded in x around 0 71.8%
mul-1-neg71.8%
associate-/l*71.6%
distribute-rgt-neg-in71.6%
distribute-neg-frac271.6%
Simplified71.6%
if 9.9999999999999998e23 < (*.f64 x y) Initial program 90.3%
Taylor expanded in x around inf 79.8%
associate-*r/84.1%
Simplified84.1%
clear-num83.5%
un-div-inv82.2%
Applied egg-rr82.2%
associate-/r/79.5%
Applied egg-rr79.5%
*-commutative79.5%
clear-num79.3%
un-div-inv79.5%
Applied egg-rr79.5%
Final simplification75.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 (if (<= a 3.6e-60) (* x (/ y 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 (a <= 3.6e-60) {
tmp = x * (y / a);
} else {
tmp = y * (x / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= 3.6d-60) then
tmp = x * (y / a)
else
tmp = y * (x / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.6e-60) {
tmp = x * (y / 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 a <= 3.6e-60: tmp = x * (y / 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 (a <= 3.6e-60) tmp = Float64(x * Float64(y / 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 (a <= 3.6e-60)
tmp = x * (y / 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[a, 3.6e-60], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.6 \cdot 10^{-60}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if a < 3.6e-60Initial program 91.0%
Taylor expanded in x around inf 53.7%
associate-*r/54.6%
Simplified54.6%
if 3.6e-60 < a Initial program 91.2%
Taylor expanded in x around inf 52.7%
associate-*r/54.3%
Simplified54.3%
clear-num53.8%
un-div-inv53.9%
Applied egg-rr53.9%
associate-/r/56.4%
Applied egg-rr56.4%
Final simplification55.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= a 5.5e-63) (/ (* x y) 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 (a <= 5.5e-63) {
tmp = (x * y) / a;
} else {
tmp = y * (x / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= 5.5d-63) then
tmp = (x * y) / a
else
tmp = y * (x / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 5.5e-63) {
tmp = (x * y) / 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 a <= 5.5e-63: tmp = (x * y) / 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 (a <= 5.5e-63) tmp = Float64(Float64(x * y) / 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 (a <= 5.5e-63)
tmp = (x * y) / 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[a, 5.5e-63], N[(N[(x * y), $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}\;a \leq 5.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if a < 5.50000000000000043e-63Initial program 90.9%
Taylor expanded in x around inf 54.0%
if 5.50000000000000043e-63 < a Initial program 91.3%
Taylor expanded in x around inf 52.1%
associate-*r/54.8%
Simplified54.8%
clear-num54.4%
un-div-inv53.3%
Applied egg-rr53.3%
associate-/r/55.7%
Applied egg-rr55.7%
Final simplification54.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 (* 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 53.4%
associate-*r/54.5%
Simplified54.5%
Final simplification54.5%
(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 2024073
(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))