
(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 1e+266) (/ t_1 a) (* (/ t a) (- (* x (/ y t)) 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 <= 1e+266) {
tmp = t_1 / a;
} else {
tmp = (t / a) * ((x * (y / t)) - 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 <= 1e+266) {
tmp = t_1 / a;
} else {
tmp = (t / a) * ((x * (y / t)) - 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 <= 1e+266: tmp = t_1 / a else: tmp = (t / a) * ((x * (y / t)) - 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 <= 1e+266) tmp = Float64(t_1 / a); else tmp = Float64(Float64(t / a) * Float64(Float64(x * Float64(y / t)) - 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 <= 1e+266)
tmp = t_1 / a;
else
tmp = (t / a) * ((x * (y / t)) - 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, 1e+266], N[(t$95$1 / a), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $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 10^{+266}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a} \cdot \left(x \cdot \frac{y}{t} - z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 67.6%
Taylor expanded in x around inf 79.5%
+-commutative79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*83.1%
*-commutative83.1%
associate-/r*89.8%
Simplified89.8%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e266Initial program 99.2%
if 1e266 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 66.5%
Taylor expanded in t around inf 69.1%
associate-/l*71.7%
Simplified71.7%
Taylor expanded in t around inf 85.0%
mul-1-neg85.0%
distribute-frac-neg85.0%
+-commutative85.0%
distribute-frac-neg85.0%
sub-neg85.0%
associate-/l/87.6%
div-sub90.1%
associate-*r/95.1%
fma-neg95.1%
associate-*r/71.7%
associate-*l/94.9%
fma-undefine94.9%
sub-neg94.9%
Simplified94.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 y) -5e+29)
(/ y (/ a x))
(if (<= (* x y) 2e-126)
(* (/ z a) (- t))
(if (<= (* x y) 1e-97)
(* (* x y) (/ 1.0 a))
(if (<= (* x y) 5e-8) (* 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 tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = (z / a) * -t;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) * (1.0 / a);
} else if ((x * y) <= 5e-8) {
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) :: tmp
if ((x * y) <= (-5d+29)) then
tmp = y / (a / x)
else if ((x * y) <= 2d-126) then
tmp = (z / a) * -t
else if ((x * y) <= 1d-97) then
tmp = (x * y) * (1.0d0 / a)
else if ((x * y) <= 5d-8) 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 tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = (z / a) * -t;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) * (1.0 / a);
} else if ((x * y) <= 5e-8) {
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): tmp = 0 if (x * y) <= -5e+29: tmp = y / (a / x) elif (x * y) <= 2e-126: tmp = (z / a) * -t elif (x * y) <= 1e-97: tmp = (x * y) * (1.0 / a) elif (x * y) <= 5e-8: 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) tmp = 0.0 if (Float64(x * y) <= -5e+29) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e-126) tmp = Float64(Float64(z / a) * Float64(-t)); elseif (Float64(x * y) <= 1e-97) tmp = Float64(Float64(x * y) * Float64(1.0 / a)); elseif (Float64(x * y) <= 5e-8) tmp = Float64(z * Float64(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)
tmp = 0.0;
if ((x * y) <= -5e+29)
tmp = y / (a / x);
elseif ((x * y) <= 2e-126)
tmp = (z / a) * -t;
elseif ((x * y) <= 1e-97)
tmp = (x * y) * (1.0 / a);
elseif ((x * y) <= 5e-8)
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_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+29], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-126], N[(N[(z / a), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-97], N[(N[(x * y), $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-8], N[(z * N[((-t) / a), $MachinePrecision]), $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}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-126}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-t\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-97}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-8}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e29Initial program 88.6%
Taylor expanded in x around inf 75.8%
*-commutative75.8%
associate-/l*82.0%
Applied egg-rr82.0%
clear-num82.0%
un-div-inv82.8%
Applied egg-rr82.8%
if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126Initial program 92.4%
Taylor expanded in x around 0 82.2%
mul-1-neg82.2%
associate-/l*83.8%
distribute-rgt-neg-in83.8%
distribute-neg-frac283.8%
Simplified83.8%
if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97Initial program 99.0%
Taylor expanded in x around inf 99.0%
clear-num99.0%
associate-/r/99.2%
Applied egg-rr99.2%
if 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8Initial program 84.6%
Taylor expanded in x around 0 58.5%
*-commutative58.5%
associate-*r/68.3%
neg-mul-168.3%
distribute-rgt-neg-in68.3%
distribute-frac-neg68.3%
Simplified68.3%
if 4.9999999999999998e-8 < (*.f64 x y) Initial program 90.2%
Taylor expanded in x around inf 76.1%
associate-*r/74.3%
Simplified74.3%
clear-num74.2%
un-div-inv74.2%
Applied egg-rr74.2%
Final simplification80.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 (<= (* x y) -5e+29)
(/ y (/ a x))
(if (<= (* x y) 2e-126)
(* (/ z a) (- t))
(if (<= (* x y) 1e-97)
(/ (* x y) a)
(if (<= (* x y) 5e-8) (* 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 tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = (z / a) * -t;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-8) {
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) :: tmp
if ((x * y) <= (-5d+29)) then
tmp = y / (a / x)
else if ((x * y) <= 2d-126) then
tmp = (z / a) * -t
else if ((x * y) <= 1d-97) then
tmp = (x * y) / a
else if ((x * y) <= 5d-8) 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 tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = (z / a) * -t;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-8) {
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): tmp = 0 if (x * y) <= -5e+29: tmp = y / (a / x) elif (x * y) <= 2e-126: tmp = (z / a) * -t elif (x * y) <= 1e-97: tmp = (x * y) / a elif (x * y) <= 5e-8: 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) tmp = 0.0 if (Float64(x * y) <= -5e+29) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e-126) tmp = Float64(Float64(z / a) * Float64(-t)); elseif (Float64(x * y) <= 1e-97) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 5e-8) tmp = Float64(z * Float64(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)
tmp = 0.0;
if ((x * y) <= -5e+29)
tmp = y / (a / x);
elseif ((x * y) <= 2e-126)
tmp = (z / a) * -t;
elseif ((x * y) <= 1e-97)
tmp = (x * y) / a;
elseif ((x * y) <= 5e-8)
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_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+29], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-126], N[(N[(z / a), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-97], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-8], N[(z * N[((-t) / a), $MachinePrecision]), $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}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-126}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-t\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-97}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-8}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e29Initial program 88.6%
Taylor expanded in x around inf 75.8%
*-commutative75.8%
associate-/l*82.0%
Applied egg-rr82.0%
clear-num82.0%
un-div-inv82.8%
Applied egg-rr82.8%
if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126Initial program 92.4%
Taylor expanded in x around 0 82.2%
mul-1-neg82.2%
associate-/l*83.8%
distribute-rgt-neg-in83.8%
distribute-neg-frac283.8%
Simplified83.8%
if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97Initial program 99.0%
Taylor expanded in x around inf 99.0%
if 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8Initial program 84.6%
Taylor expanded in x around 0 58.5%
*-commutative58.5%
associate-*r/68.3%
neg-mul-168.3%
distribute-rgt-neg-in68.3%
distribute-frac-neg68.3%
Simplified68.3%
if 4.9999999999999998e-8 < (*.f64 x y) Initial program 90.2%
Taylor expanded in x around inf 76.1%
associate-*r/74.3%
Simplified74.3%
clear-num74.2%
un-div-inv74.2%
Applied egg-rr74.2%
Final simplification80.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 (<= (* x y) -5e+29)
(/ y (/ a x))
(if (<= (* x y) 2e-126)
(* (/ z a) (- t))
(if (<= (* x y) 1e-97)
(/ (* x y) a)
(if (<= (* x y) 5e-8) (/ z (/ a (- t))) (/ 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 tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = (z / a) * -t;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-8) {
tmp = z / (a / -t);
} 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) :: tmp
if ((x * y) <= (-5d+29)) then
tmp = y / (a / x)
else if ((x * y) <= 2d-126) then
tmp = (z / a) * -t
else if ((x * y) <= 1d-97) then
tmp = (x * y) / a
else if ((x * y) <= 5d-8) then
tmp = z / (a / -t)
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 tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = (z / a) * -t;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-8) {
tmp = z / (a / -t);
} 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): tmp = 0 if (x * y) <= -5e+29: tmp = y / (a / x) elif (x * y) <= 2e-126: tmp = (z / a) * -t elif (x * y) <= 1e-97: tmp = (x * y) / a elif (x * y) <= 5e-8: tmp = z / (a / -t) 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) tmp = 0.0 if (Float64(x * y) <= -5e+29) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e-126) tmp = Float64(Float64(z / a) * Float64(-t)); elseif (Float64(x * y) <= 1e-97) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 5e-8) tmp = Float64(z / Float64(a / Float64(-t))); 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)
tmp = 0.0;
if ((x * y) <= -5e+29)
tmp = y / (a / x);
elseif ((x * y) <= 2e-126)
tmp = (z / a) * -t;
elseif ((x * y) <= 1e-97)
tmp = (x * y) / a;
elseif ((x * y) <= 5e-8)
tmp = z / (a / -t);
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_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+29], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-126], N[(N[(z / a), $MachinePrecision] * (-t)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-97], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-8], N[(z / N[(a / (-t)), $MachinePrecision]), $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}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-126}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-t\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-97}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{z}{\frac{a}{-t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e29Initial program 88.6%
Taylor expanded in x around inf 75.8%
*-commutative75.8%
associate-/l*82.0%
Applied egg-rr82.0%
clear-num82.0%
un-div-inv82.8%
Applied egg-rr82.8%
if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126Initial program 92.4%
Taylor expanded in x around 0 82.2%
mul-1-neg82.2%
associate-/l*83.8%
distribute-rgt-neg-in83.8%
distribute-neg-frac283.8%
Simplified83.8%
if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97Initial program 99.0%
Taylor expanded in x around inf 99.0%
if 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8Initial program 84.6%
Taylor expanded in x around 0 58.5%
*-commutative58.5%
associate-*r/68.3%
neg-mul-168.3%
distribute-rgt-neg-in68.3%
distribute-frac-neg68.3%
Simplified68.3%
distribute-frac-neg68.3%
distribute-rgt-neg-out68.3%
add-sqr-sqrt45.3%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod1.2%
add-sqr-sqrt2.6%
clear-num2.6%
un-div-inv2.6%
add-sqr-sqrt1.2%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod45.1%
add-sqr-sqrt68.3%
Applied egg-rr68.3%
if 4.9999999999999998e-8 < (*.f64 x y) Initial program 90.2%
Taylor expanded in x around inf 76.1%
associate-*r/74.3%
Simplified74.3%
clear-num74.2%
un-div-inv74.2%
Applied egg-rr74.2%
Final simplification80.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 (/ z (/ a (- t)))))
(if (<= (* x y) -5e+29)
(/ y (/ a x))
(if (<= (* x y) 2e-126)
t_1
(if (<= (* x y) 1e-97)
(/ (* x y) a)
(if (<= (* x y) 5e-8) 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 / (a / -t);
double tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = t_1;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-8) {
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 / (a / -t)
if ((x * y) <= (-5d+29)) then
tmp = y / (a / x)
else if ((x * y) <= 2d-126) then
tmp = t_1
else if ((x * y) <= 1d-97) then
tmp = (x * y) / a
else if ((x * y) <= 5d-8) 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 / (a / -t);
double tmp;
if ((x * y) <= -5e+29) {
tmp = y / (a / x);
} else if ((x * y) <= 2e-126) {
tmp = t_1;
} else if ((x * y) <= 1e-97) {
tmp = (x * y) / a;
} else if ((x * y) <= 5e-8) {
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 / (a / -t) tmp = 0 if (x * y) <= -5e+29: tmp = y / (a / x) elif (x * y) <= 2e-126: tmp = t_1 elif (x * y) <= 1e-97: tmp = (x * y) / a elif (x * y) <= 5e-8: 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(a / Float64(-t))) tmp = 0.0 if (Float64(x * y) <= -5e+29) tmp = Float64(y / Float64(a / x)); elseif (Float64(x * y) <= 2e-126) tmp = t_1; elseif (Float64(x * y) <= 1e-97) tmp = Float64(Float64(x * y) / a); elseif (Float64(x * y) <= 5e-8) 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 / (a / -t);
tmp = 0.0;
if ((x * y) <= -5e+29)
tmp = y / (a / x);
elseif ((x * y) <= 2e-126)
tmp = t_1;
elseif ((x * y) <= 1e-97)
tmp = (x * y) / a;
elseif ((x * y) <= 5e-8)
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[(a / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+29], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-126], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-97], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-8], 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 := \frac{z}{\frac{a}{-t}}\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-97}:\\
\;\;\;\;\frac{x \cdot y}{a}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e29Initial program 88.6%
Taylor expanded in x around inf 75.8%
*-commutative75.8%
associate-/l*82.0%
Applied egg-rr82.0%
clear-num82.0%
un-div-inv82.8%
Applied egg-rr82.8%
if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126 or 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8Initial program 91.3%
Taylor expanded in x around 0 78.9%
*-commutative78.9%
associate-*r/82.8%
neg-mul-182.8%
distribute-rgt-neg-in82.8%
distribute-frac-neg82.8%
Simplified82.8%
distribute-frac-neg82.8%
distribute-rgt-neg-out82.8%
add-sqr-sqrt43.2%
sqrt-unprod36.0%
sqr-neg36.0%
sqrt-unprod4.3%
add-sqr-sqrt9.5%
clear-num9.5%
un-div-inv9.5%
add-sqr-sqrt4.3%
sqrt-unprod36.6%
sqr-neg36.6%
sqrt-unprod43.8%
add-sqr-sqrt83.6%
Applied egg-rr83.6%
if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97Initial program 99.0%
Taylor expanded in x around inf 99.0%
if 4.9999999999999998e-8 < (*.f64 x y) Initial program 90.2%
Taylor expanded in x around inf 76.1%
associate-*r/74.3%
Simplified74.3%
clear-num74.2%
un-div-inv74.2%
Applied egg-rr74.2%
Final simplification81.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))))
(if (<= t_1 (- INFINITY))
(* t (- (* (/ y t) (/ x a)) (/ z a)))
(if (<= t_1 1e+266) (/ t_1 a) (* (/ t a) (- (* x (/ y t)) 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 = t * (((y / t) * (x / a)) - (z / a));
} else if (t_1 <= 1e+266) {
tmp = t_1 / a;
} else {
tmp = (t / a) * ((x * (y / t)) - 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 = t * (((y / t) * (x / a)) - (z / a));
} else if (t_1 <= 1e+266) {
tmp = t_1 / a;
} else {
tmp = (t / a) * ((x * (y / t)) - 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 = t * (((y / t) * (x / a)) - (z / a)) elif t_1 <= 1e+266: tmp = t_1 / a else: tmp = (t / a) * ((x * (y / t)) - 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(t * Float64(Float64(Float64(y / t) * Float64(x / a)) - Float64(z / a))); elseif (t_1 <= 1e+266) tmp = Float64(t_1 / a); else tmp = Float64(Float64(t / a) * Float64(Float64(x * Float64(y / t)) - 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 = t * (((y / t) * (x / a)) - (z / a));
elseif (t_1 <= 1e+266)
tmp = t_1 / a;
else
tmp = (t / a) * ((x * (y / t)) - 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[(t * N[(N[(N[(y / t), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision] - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+266], N[(t$95$1 / a), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t \cdot \left(\frac{y}{t} \cdot \frac{x}{a} - \frac{z}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+266}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a} \cdot \left(x \cdot \frac{y}{t} - z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0Initial program 67.6%
Taylor expanded in t around inf 80.4%
+-commutative80.4%
mul-1-neg80.4%
unsub-neg80.4%
times-frac93.4%
Simplified93.4%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e266Initial program 99.2%
if 1e266 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 66.5%
Taylor expanded in t around inf 69.1%
associate-/l*71.7%
Simplified71.7%
Taylor expanded in t around inf 85.0%
mul-1-neg85.0%
distribute-frac-neg85.0%
+-commutative85.0%
distribute-frac-neg85.0%
sub-neg85.0%
associate-/l/87.6%
div-sub90.1%
associate-*r/95.1%
fma-neg95.1%
associate-*r/71.7%
associate-*l/94.9%
fma-undefine94.9%
sub-neg94.9%
Simplified94.9%
Final simplification97.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 (<= (* z t) (- INFINITY)) (* z (/ (- t) a)) (if (<= (* z t) 2e+218) (/ (- (* x y) (* z t)) a) (* (/ 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 ((z * t) <= -((double) INFINITY)) {
tmp = z * (-t / a);
} else if ((z * t) <= 2e+218) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (z / a) * -t;
}
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 ((z * t) <= -Double.POSITIVE_INFINITY) {
tmp = z * (-t / a);
} else if ((z * t) <= 2e+218) {
tmp = ((x * y) - (z * t)) / a;
} else {
tmp = (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 (z * t) <= -math.inf: tmp = z * (-t / a) elif (z * t) <= 2e+218: tmp = ((x * y) - (z * t)) / a else: tmp = (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 (Float64(z * t) <= Float64(-Inf)) tmp = Float64(z * Float64(Float64(-t) / a)); elseif (Float64(z * t) <= 2e+218) tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a); else tmp = Float64(Float64(z / a) * Float64(-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 ((z * t) <= -Inf)
tmp = z * (-t / a);
elseif ((z * t) <= 2e+218)
tmp = ((x * y) - (z * t)) / a;
else
tmp = (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[N[(z * t), $MachinePrecision], (-Infinity)], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+218], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * (-t)), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;z \cdot \frac{-t}{a}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+218}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 42.4%
Taylor expanded in x around 0 42.4%
*-commutative42.4%
associate-*r/93.6%
neg-mul-193.6%
distribute-rgt-neg-in93.6%
distribute-frac-neg93.6%
Simplified93.6%
if -inf.0 < (*.f64 z t) < 2.00000000000000017e218Initial program 96.3%
if 2.00000000000000017e218 < (*.f64 z t) Initial program 70.6%
Taylor expanded in x around 0 74.9%
mul-1-neg74.9%
associate-/l*95.7%
distribute-rgt-neg-in95.7%
distribute-neg-frac295.7%
Simplified95.7%
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 (let* ((t_1 (- (* x y) (* z t)))) (if (<= t_1 1e+266) (/ t_1 a) (* (/ t a) (- (* x (/ y t)) 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 <= 1e+266) {
tmp = t_1 / a;
} else {
tmp = (t / a) * ((x * (y / t)) - 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) :: t_1
real(8) :: tmp
t_1 = (x * y) - (z * t)
if (t_1 <= 1d+266) then
tmp = t_1 / a
else
tmp = (t / a) * ((x * (y / t)) - 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 t_1 = (x * y) - (z * t);
double tmp;
if (t_1 <= 1e+266) {
tmp = t_1 / a;
} else {
tmp = (t / a) * ((x * (y / t)) - 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 <= 1e+266: tmp = t_1 / a else: tmp = (t / a) * ((x * (y / t)) - 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 <= 1e+266) tmp = Float64(t_1 / a); else tmp = Float64(Float64(t / a) * Float64(Float64(x * Float64(y / t)) - 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 <= 1e+266)
tmp = t_1 / a;
else
tmp = (t / a) * ((x * (y / t)) - 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, 1e+266], N[(t$95$1 / a), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $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 10^{+266}:\\
\;\;\;\;\frac{t\_1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a} \cdot \left(x \cdot \frac{y}{t} - z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 z t)) < 1e266Initial program 95.0%
if 1e266 < (-.f64 (*.f64 x y) (*.f64 z t)) Initial program 66.5%
Taylor expanded in t around inf 69.1%
associate-/l*71.7%
Simplified71.7%
Taylor expanded in t around inf 85.0%
mul-1-neg85.0%
distribute-frac-neg85.0%
+-commutative85.0%
distribute-frac-neg85.0%
sub-neg85.0%
associate-/l/87.6%
div-sub90.1%
associate-*r/95.1%
fma-neg95.1%
associate-*r/71.7%
associate-*l/94.9%
fma-undefine94.9%
sub-neg94.9%
Simplified94.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 (/ 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) {
return x / (a / y);
}
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 / (a / y)
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 / (a / y);
}
[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 / (a / y)
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(a / y)) 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 / (a / y);
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[(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])\\
\\
\frac{x}{\frac{a}{y}}
\end{array}
Initial program 90.6%
Taylor expanded in x around inf 48.6%
associate-*r/47.9%
Simplified47.9%
clear-num47.6%
un-div-inv47.4%
Applied egg-rr47.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 90.6%
Taylor expanded in x around inf 48.6%
associate-*r/47.9%
Simplified47.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 (* t (/ z a)))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return t * (z / 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 = t * (z / 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 t * (z / 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 t * (z / 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(t * Float64(z / 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 = t * (z / 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[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
t \cdot \frac{z}{a}
\end{array}
Initial program 90.6%
div-inv90.5%
*-commutative90.5%
cancel-sign-sub-inv90.5%
*-commutative90.5%
add-sqr-sqrt47.6%
sqrt-unprod58.4%
sqr-neg58.4%
sqrt-unprod20.1%
add-sqr-sqrt44.6%
fma-define44.6%
Applied egg-rr44.6%
Taylor expanded in x around 0 8.0%
associate-/l*8.7%
Simplified8.7%
(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 2024108
(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))