
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - (z * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - (z * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a): return ((x * y) - (z * t)) / a
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(z * t)) / a) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - (z * t)) / a; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= x -1.4e-231) (/ (fma x y (* z (- t))) 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 tmp;
if (x <= -1.4e-231) {
tmp = fma(x, y, (z * -t)) / 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) tmp = 0.0 if (x <= -1.4e-231) tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a); else tmp = Float64(Float64(Float64(x * y) / a) - Float64(t / Float64(a / z))); end return tmp end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.4e-231], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] / a), $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}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-231}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if x < -1.3999999999999999e-231Initial program 93.8%
fma-neg94.7%
distribute-rgt-neg-out94.7%
Simplified94.7%
if -1.3999999999999999e-231 < x Initial program 93.1%
Taylor expanded in x around 0 92.4%
clear-num92.0%
associate-/r/92.4%
Applied egg-rr92.4%
associate-*l/92.4%
*-un-lft-identity92.4%
*-commutative92.4%
associate-*l/94.3%
clear-num94.3%
associate-*l/94.6%
*-un-lft-identity94.6%
Applied egg-rr94.6%
Final simplification94.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 (* t (/ (- z) a))) (t_2 (/ (* x y) a)))
(if (<= (* x y) -1e+109)
(/ y (/ a x))
(if (<= (* x y) -5e+38)
t_1
(if (<= (* x y) -4e-84)
t_2
(if (<= (* x y) 5e-53)
t_1
(if (<= (* x y) 1e-22)
t_2
(if (<= (* x y) 2e+31) t_1 (/ x (/ a y))))))))))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 = (x * y) / a;
double tmp;
if ((x * y) <= -1e+109) {
tmp = y / (a / x);
} else if ((x * y) <= -5e+38) {
tmp = t_1;
} else if ((x * y) <= -4e-84) {
tmp = t_2;
} else if ((x * y) <= 5e-53) {
tmp = t_1;
} else if ((x * y) <= 1e-22) {
tmp = t_2;
} else if ((x * y) <= 2e+31) {
tmp = t_1;
} else {
tmp = x / (a / y);
}
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 = (x * y) / a
if ((x * y) <= (-1d+109)) then
tmp = y / (a / x)
else if ((x * y) <= (-5d+38)) then
tmp = t_1
else if ((x * y) <= (-4d-84)) then
tmp = t_2
else if ((x * y) <= 5d-53) then
tmp = t_1
else if ((x * y) <= 1d-22) then
tmp = t_2
else if ((x * y) <= 2d+31) then
tmp = t_1
else
tmp = x / (a / y)
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 = (x * y) / a;
double tmp;
if ((x * y) <= -1e+109) {
tmp = y / (a / x);
} else if ((x * y) <= -5e+38) {
tmp = t_1;
} else if ((x * y) <= -4e-84) {
tmp = t_2;
} else if ((x * y) <= 5e-53) {
tmp = t_1;
} else if ((x * y) <= 1e-22) {
tmp = t_2;
} else if ((x * y) <= 2e+31) {
tmp = t_1;
} else {
tmp = x / (a / y);
}
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 = (x * y) / a tmp = 0 if (x * y) <= -1e+109: tmp = y / (a / x) elif (x * y) <= -5e+38: tmp = t_1 elif (x * y) <= -4e-84: tmp = t_2 elif (x * y) <= 5e-53: tmp = t_1 elif (x * y) <= 1e-22: tmp = t_2 elif (x * y) <= 2e+31: tmp = t_1 else: tmp = x / (a / y) 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(Float64(x * y) / a) tmp = 0.0 if (Float64(x * y) <= -1e+109) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= -5e+38) tmp = t_1; elseif (Float64(x * y) <= -4e-84) tmp = t_2; elseif (Float64(x * y) <= 5e-53) tmp = t_1; elseif (Float64(x * y) <= 1e-22) tmp = t_2; elseif (Float64(x * y) <= 2e+31) tmp = t_1; else tmp = Float64(x / Float64(a / y)); 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 = (x * y) / a;
tmp = 0.0;
if ((x * y) <= -1e+109)
tmp = y / (a / x);
elseif ((x * y) <= -5e+38)
tmp = t_1;
elseif ((x * y) <= -4e-84)
tmp = t_2;
elseif ((x * y) <= 5e-53)
tmp = t_1;
elseif ((x * y) <= 1e-22)
tmp = t_2;
elseif ((x * y) <= 2e+31)
tmp = t_1;
else
tmp = x / (a / y);
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[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+109], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e+38], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4e-84], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-53], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-22], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e+31], t$95$1, N[(x / N[(a / y), $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 := t \cdot \frac{-z}{a}\\
t_2 := \frac{x \cdot y}{a}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+109}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999982e108Initial program 92.1%
Taylor expanded in x around inf 85.3%
associate-*r/89.2%
Simplified89.2%
associate-*r/85.3%
*-commutative85.3%
associate-/l*87.5%
Applied egg-rr87.5%
if -9.99999999999999982e108 < (*.f64 x y) < -4.9999999999999997e38 or -4.0000000000000001e-84 < (*.f64 x y) < 5e-53 or 1e-22 < (*.f64 x y) < 1.9999999999999999e31Initial program 93.8%
Taylor expanded in x around 0 79.0%
mul-1-neg79.0%
*-commutative79.0%
associate-*l/78.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
if -4.9999999999999997e38 < (*.f64 x y) < -4.0000000000000001e-84 or 5e-53 < (*.f64 x y) < 1e-22Initial program 96.3%
Taylor expanded in x around inf 72.4%
if 1.9999999999999999e31 < (*.f64 x y) Initial program 91.8%
Taylor expanded in x around inf 81.1%
associate-*r/83.0%
Simplified83.0%
associate-*r/81.1%
associate-/l*83.1%
Applied egg-rr83.1%
Final simplification80.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 (* t (/ (- z) a))) (t_2 (/ (* x y) a)))
(if (<= (* x y) -1e+109)
(/ y (/ a x))
(if (<= (* x y) -5e+38)
t_1
(if (<= (* x y) -4e-84)
t_2
(if (<= (* x y) 5e-53)
t_1
(if (<= (* x y) 1e-22)
t_2
(if (<= (* x y) 2e+31) (/ (* z (- t)) a) (/ x (/ a y))))))))))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 = (x * y) / a;
double tmp;
if ((x * y) <= -1e+109) {
tmp = y / (a / x);
} else if ((x * y) <= -5e+38) {
tmp = t_1;
} else if ((x * y) <= -4e-84) {
tmp = t_2;
} else if ((x * y) <= 5e-53) {
tmp = t_1;
} else if ((x * y) <= 1e-22) {
tmp = t_2;
} else if ((x * y) <= 2e+31) {
tmp = (z * -t) / a;
} else {
tmp = x / (a / y);
}
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 = (x * y) / a
if ((x * y) <= (-1d+109)) then
tmp = y / (a / x)
else if ((x * y) <= (-5d+38)) then
tmp = t_1
else if ((x * y) <= (-4d-84)) then
tmp = t_2
else if ((x * y) <= 5d-53) then
tmp = t_1
else if ((x * y) <= 1d-22) then
tmp = t_2
else if ((x * y) <= 2d+31) then
tmp = (z * -t) / a
else
tmp = x / (a / y)
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 = (x * y) / a;
double tmp;
if ((x * y) <= -1e+109) {
tmp = y / (a / x);
} else if ((x * y) <= -5e+38) {
tmp = t_1;
} else if ((x * y) <= -4e-84) {
tmp = t_2;
} else if ((x * y) <= 5e-53) {
tmp = t_1;
} else if ((x * y) <= 1e-22) {
tmp = t_2;
} else if ((x * y) <= 2e+31) {
tmp = (z * -t) / a;
} else {
tmp = x / (a / y);
}
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 = (x * y) / a tmp = 0 if (x * y) <= -1e+109: tmp = y / (a / x) elif (x * y) <= -5e+38: tmp = t_1 elif (x * y) <= -4e-84: tmp = t_2 elif (x * y) <= 5e-53: tmp = t_1 elif (x * y) <= 1e-22: tmp = t_2 elif (x * y) <= 2e+31: tmp = (z * -t) / a else: tmp = x / (a / y) 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(Float64(x * y) / a) tmp = 0.0 if (Float64(x * y) <= -1e+109) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= -5e+38) tmp = t_1; elseif (Float64(x * y) <= -4e-84) tmp = t_2; elseif (Float64(x * y) <= 5e-53) tmp = t_1; elseif (Float64(x * y) <= 1e-22) tmp = t_2; elseif (Float64(x * y) <= 2e+31) tmp = Float64(Float64(z * Float64(-t)) / a); else tmp = Float64(x / Float64(a / y)); 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 = (x * y) / a;
tmp = 0.0;
if ((x * y) <= -1e+109)
tmp = y / (a / x);
elseif ((x * y) <= -5e+38)
tmp = t_1;
elseif ((x * y) <= -4e-84)
tmp = t_2;
elseif ((x * y) <= 5e-53)
tmp = t_1;
elseif ((x * y) <= 1e-22)
tmp = t_2;
elseif ((x * y) <= 2e+31)
tmp = (z * -t) / a;
else
tmp = x / (a / y);
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[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+109], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e+38], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4e-84], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-53], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-22], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e+31], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], N[(x / N[(a / y), $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 := t \cdot \frac{-z}{a}\\
t_2 := \frac{x \cdot y}{a}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+109}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-22}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+31}:\\
\;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999982e108Initial program 92.1%
Taylor expanded in x around inf 85.3%
associate-*r/89.2%
Simplified89.2%
associate-*r/85.3%
*-commutative85.3%
associate-/l*87.5%
Applied egg-rr87.5%
if -9.99999999999999982e108 < (*.f64 x y) < -4.9999999999999997e38 or -4.0000000000000001e-84 < (*.f64 x y) < 5e-53Initial program 93.3%
Taylor expanded in x around 0 78.7%
mul-1-neg78.7%
*-commutative78.7%
associate-*l/78.7%
distribute-rgt-neg-in78.7%
Simplified78.7%
if -4.9999999999999997e38 < (*.f64 x y) < -4.0000000000000001e-84 or 5e-53 < (*.f64 x y) < 1e-22Initial program 96.3%
Taylor expanded in x around inf 72.4%
if 1e-22 < (*.f64 x y) < 1.9999999999999999e31Initial program 99.9%
Taylor expanded in x around 0 82.5%
mul-1-neg82.5%
distribute-rgt-neg-in82.5%
Simplified82.5%
if 1.9999999999999999e31 < (*.f64 x y) Initial program 91.8%
Taylor expanded in x around inf 81.1%
associate-*r/83.0%
Simplified83.0%
associate-*r/81.1%
associate-/l*83.1%
Applied egg-rr83.1%
Final simplification80.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (- (/ t a)))))
(if (<= (* x y) -1e-118)
(/ (* x y) a)
(if (<= (* x y) 5e-53)
t_1
(if (<= (* x y) 2.0)
(/ y (/ a x))
(if (<= (* x y) 2e+31) t_1 (/ x (/ a y))))))))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 tmp;
if ((x * y) <= -1e-118) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-53) {
tmp = t_1;
} else if ((x * y) <= 2.0) {
tmp = y / (a / x);
} else if ((x * y) <= 2e+31) {
tmp = t_1;
} else {
tmp = x / (a / y);
}
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 = z * -(t / a)
if ((x * y) <= (-1d-118)) then
tmp = (x * y) / a
else if ((x * y) <= 5d-53) then
tmp = t_1
else if ((x * y) <= 2.0d0) then
tmp = y / (a / x)
else if ((x * y) <= 2d+31) then
tmp = t_1
else
tmp = x / (a / y)
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 tmp;
if ((x * y) <= -1e-118) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-53) {
tmp = t_1;
} else if ((x * y) <= 2.0) {
tmp = y / (a / x);
} else if ((x * y) <= 2e+31) {
tmp = t_1;
} else {
tmp = x / (a / y);
}
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) tmp = 0 if (x * y) <= -1e-118: tmp = (x * y) / a elif (x * y) <= 5e-53: tmp = t_1 elif (x * y) <= 2.0: tmp = y / (a / x) elif (x * y) <= 2e+31: tmp = t_1 else: tmp = x / (a / y) 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))) tmp = 0.0 if (Float64(x * y) <= -1e-118) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 5e-53) tmp = t_1; elseif (Float64(x * y) <= 2.0) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e+31) tmp = t_1; else tmp = Float64(x / Float64(a / y)); 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);
tmp = 0.0;
if ((x * y) <= -1e-118)
tmp = (x * y) / a;
elseif ((x * y) <= 5e-53)
tmp = t_1;
elseif ((x * y) <= 2.0)
tmp = y / (a / x);
elseif ((x * y) <= 2e+31)
tmp = t_1;
else
tmp = x / (a / y);
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]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e-118], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-53], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.0], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+31], t$95$1, N[(x / N[(a / y), $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 := z \cdot \left(-\frac{t}{a}\right)\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-118}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999985e-119Initial program 93.4%
Taylor expanded in x around inf 72.4%
if -9.99999999999999985e-119 < (*.f64 x y) < 5e-53 or 2 < (*.f64 x y) < 1.9999999999999999e31Initial program 93.5%
Taylor expanded in x around 0 92.6%
Taylor expanded in t around inf 82.8%
mul-1-neg82.8%
associate-*l/83.2%
distribute-rgt-neg-in83.2%
Simplified83.2%
if 5e-53 < (*.f64 x y) < 2Initial program 99.4%
Taylor expanded in x around inf 63.9%
associate-*r/38.6%
Simplified38.6%
associate-*r/63.9%
*-commutative63.9%
associate-/l*66.0%
Applied egg-rr66.0%
if 1.9999999999999999e31 < (*.f64 x y) Initial program 91.8%
Taylor expanded in x around inf 81.1%
associate-*r/83.0%
Simplified83.0%
associate-*r/81.1%
associate-/l*83.1%
Applied egg-rr83.1%
Final simplification78.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 (<= a 4e+173) (/ (- (* 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 <= 4e+173) {
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 <= 4d+173) 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 <= 4e+173) {
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 <= 4e+173: 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 <= 4e+173) 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 <= 4e+173)
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, 4e+173], 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 4 \cdot 10^{+173}:\\
\;\;\;\;\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 < 4.0000000000000001e173Initial program 95.5%
if 4.0000000000000001e173 < a Initial program 76.9%
Taylor expanded in x around 0 76.9%
+-commutative76.9%
mul-1-neg76.9%
unsub-neg76.9%
associate-*r/76.8%
associate-/l*86.5%
associate-/r/84.5%
Applied egg-rr84.5%
Final simplification94.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 (<= a 2.2e+172) (/ (- (* x y) (* z t)) a) (- (/ x (/ a y)) (/ z (/ a t)))))
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 <= 2.2e+172) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (x / (a / y)) - (z / (a / t));
}
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 <= 2.2d+172) then
tmp = ((x * y) - (z * t)) / a
else
tmp = (x / (a / y)) - (z / (a / t))
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 <= 2.2e+172) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (x / (a / y)) - (z / (a / t));
}
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 <= 2.2e+172: tmp = ((x * y) - (z * t)) / a else: tmp = (x / (a / y)) - (z / (a / t)) 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 <= 2.2e+172) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t))); 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 <= 2.2e+172)
tmp = ((x * y) - (z * t)) / a;
else
tmp = (x / (a / y)) - (z / (a / t));
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, 2.2e+172], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $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 2.2 \cdot 10^{+172}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\end{array}
\end{array}
if a < 2.2000000000000001e172Initial program 95.5%
if 2.2000000000000001e172 < a Initial program 76.9%
div-sub76.9%
associate-/l*76.9%
associate-/l*84.8%
Applied egg-rr84.8%
Final simplification94.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 -6.2e-232) (/ (- (* x y) (* z t)) 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 tmp;
if (x <= -6.2e-232) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = ((x * y) / a) - (t / (a / z));
}
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 <= (-6.2d-232)) then
tmp = ((x * y) - (z * t)) / a
else
tmp = ((x * y) / a) - (t / (a / z))
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 <= -6.2e-232) {
tmp = ((x * y) - (z * t)) / 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): tmp = 0 if x <= -6.2e-232: tmp = ((x * y) - (z * t)) / 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) tmp = 0.0 if (x <= -6.2e-232) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(Float64(x * 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)
tmp = 0.0;
if (x <= -6.2e-232)
tmp = ((x * y) - (z * t)) / 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_] := If[LessEqual[x, -6.2e-232], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] / a), $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}
\mathbf{if}\;x \leq -6.2 \cdot 10^{-232}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a} - \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if x < -6.1999999999999998e-232Initial program 93.8%
if -6.1999999999999998e-232 < x Initial program 93.1%
Taylor expanded in x around 0 92.4%
clear-num92.0%
associate-/r/92.4%
Applied egg-rr92.4%
associate-*l/92.4%
*-un-lft-identity92.4%
*-commutative92.4%
associate-*l/94.3%
clear-num94.3%
associate-*l/94.6%
*-un-lft-identity94.6%
Applied egg-rr94.6%
Final simplification94.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 (<= z -4.6e-203) (* 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 (z <= -4.6e-203) {
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 (z <= (-4.6d-203)) 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 (z <= -4.6e-203) {
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 z <= -4.6e-203: 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 (z <= -4.6e-203) 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 (z <= -4.6e-203)
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[z, -4.6e-203], 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}\;z \leq -4.6 \cdot 10^{-203}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{a}\\
\end{array}
\end{array}
if z < -4.59999999999999983e-203Initial program 91.3%
Taylor expanded in x around inf 43.8%
associate-*r/46.9%
Simplified46.9%
if -4.59999999999999983e-203 < z Initial program 94.5%
Taylor expanded in x around inf 58.0%
associate-*l/54.6%
Simplified54.6%
Final simplification51.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 (if (<= x -6e-56) (/ y (/ a x)) (* x (/ y a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6e-56) {
tmp = y / (a / x);
} else {
tmp = x * (y / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-6d-56)) then
tmp = y / (a / x)
else
tmp = x * (y / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6e-56) {
tmp = y / (a / x);
} else {
tmp = x * (y / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -6e-56: tmp = y / (a / x) else: tmp = x * (y / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -6e-56) tmp = Float64(y / Float64(a / x)); else tmp = Float64(x * Float64(y / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -6e-56)
tmp = y / (a / x);
else
tmp = x * (y / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6e-56], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-56}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\end{array}
\end{array}
if x < -5.99999999999999979e-56Initial program 93.5%
Taylor expanded in x around inf 65.5%
associate-*r/63.1%
Simplified63.1%
associate-*r/65.5%
*-commutative65.5%
associate-/l*66.4%
Applied egg-rr66.4%
if -5.99999999999999979e-56 < x Initial program 93.3%
Taylor expanded in x around inf 47.6%
associate-*r/47.6%
Simplified47.6%
Final simplification53.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.2e-94) (* x (/ y a)) (/ (* x y) a)))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-94) {
tmp = x * (y / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.2d-94)) then
tmp = x * (y / a)
else
tmp = (x * y) / a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-94) {
tmp = x * (y / a);
} else {
tmp = (x * y) / a;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.2e-94: tmp = x * (y / a) else: tmp = (x * y) / a return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e-94) tmp = Float64(x * Float64(y / a)); else tmp = Float64(Float64(x * y) / a); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.2e-94)
tmp = x * (y / a);
else
tmp = (x * y) / a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e-94], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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}\;z \leq -4.2 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\end{array}
\end{array}
if z < -4.2000000000000002e-94Initial program 91.6%
Taylor expanded in x around inf 35.9%
associate-*r/38.7%
Simplified38.7%
if -4.2000000000000002e-94 < z Initial program 94.1%
Taylor expanded in x around inf 59.4%
Final simplification53.7%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ (- (* 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) {
return ((x * y) - (z * t)) / 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) - (z * t)) / 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) - (z * t)) / 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) - (z * t)) / 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(Float64(Float64(x * y) - Float64(z * t)) / 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) - (z * t)) / 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[(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])\\
\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}
Initial program 93.4%
Final simplification93.4%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* 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 93.4%
Taylor expanded in x around inf 53.0%
associate-*r/52.3%
Simplified52.3%
Final simplification52.3%
(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 2024034
(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))