
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
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 * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
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 * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\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 9.0) t))) (t_2 (* z (* t (/ 4.5 a)))))
(if (<= t_1 -4e+268)
(- (/ (/ x a) (/ 2.0 y)) t_2)
(if (<= t_1 6e+290)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ x 2.0) (/ y a)) t_2)))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = z * (t * (4.5 / a));
double tmp;
if (t_1 <= -4e+268) {
tmp = ((x / a) / (2.0 / y)) - t_2;
} else if (t_1 <= 6e+290) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((x / 2.0) * (y / a)) - t_2;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) - ((z * 9.0d0) * t)
t_2 = z * (t * (4.5d0 / a))
if (t_1 <= (-4d+268)) then
tmp = ((x / a) / (2.0d0 / y)) - t_2
else if (t_1 <= 6d+290) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((x / 2.0d0) * (y / a)) - t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) - ((z * 9.0) * t);
double t_2 = z * (t * (4.5 / a));
double tmp;
if (t_1 <= -4e+268) {
tmp = ((x / a) / (2.0 / y)) - t_2;
} else if (t_1 <= 6e+290) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((x / 2.0) * (y / a)) - t_2;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (x * y) - ((z * 9.0) * t) t_2 = z * (t * (4.5 / a)) tmp = 0 if t_1 <= -4e+268: tmp = ((x / a) / (2.0 / y)) - t_2 elif t_1 <= 6e+290: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((x / 2.0) * (y / a)) - t_2 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) t_2 = Float64(z * Float64(t * Float64(4.5 / a))) tmp = 0.0 if (t_1 <= -4e+268) tmp = Float64(Float64(Float64(x / a) / Float64(2.0 / y)) - t_2); elseif (t_1 <= 6e+290) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(x / 2.0) * Float64(y / a)) - t_2); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) - ((z * 9.0) * t);
t_2 = z * (t * (4.5 / a));
tmp = 0.0;
if (t_1 <= -4e+268)
tmp = ((x / a) / (2.0 / y)) - t_2;
elseif (t_1 <= 6e+290)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = ((x / 2.0) * (y / a)) - t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * N[(4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+268], N[(N[(N[(x / a), $MachinePrecision] / N[(2.0 / y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 6e+290], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / 2.0), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision] - t$95$2), $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 - \left(z \cdot 9\right) \cdot t\\
t_2 := z \cdot \left(t \cdot \frac{4.5}{a}\right)\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+268}:\\
\;\;\;\;\frac{\frac{x}{a}}{\frac{2}{y}} - t_2\\
\mathbf{elif}\;t_1 \leq 6 \cdot 10^{+290}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{2} \cdot \frac{y}{a} - t_2\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -3.9999999999999999e268Initial program 70.6%
associate-*l*70.6%
Simplified70.6%
div-sub63.7%
*-commutative63.7%
times-frac73.5%
div-inv73.5%
associate-*r*73.5%
*-commutative73.5%
associate-*l*73.5%
*-commutative73.5%
associate-/r*73.5%
metadata-eval73.5%
Applied egg-rr73.5%
associate-*l/73.5%
associate-*r/63.7%
associate-*l/73.5%
associate-/l*73.4%
Applied egg-rr73.4%
Taylor expanded in z around 0 73.4%
associate-*r/73.4%
*-commutative73.4%
*-commutative73.4%
associate-*r/73.4%
metadata-eval73.4%
associate-*r/73.4%
associate-*l*89.4%
associate-*r/89.4%
metadata-eval89.4%
Simplified89.4%
if -3.9999999999999999e268 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 6e290Initial program 99.6%
associate-*l*99.6%
Simplified99.6%
if 6e290 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 52.5%
associate-*l*52.5%
Simplified52.5%
div-sub52.5%
*-commutative52.5%
times-frac72.9%
div-inv72.8%
associate-*r*72.8%
*-commutative72.8%
associate-*l*72.8%
*-commutative72.8%
associate-/r*72.8%
metadata-eval72.8%
Applied egg-rr72.8%
Taylor expanded in z around 0 72.9%
associate-*r/72.9%
*-commutative72.9%
*-commutative72.9%
associate-*r/72.8%
metadata-eval72.8%
associate-*r/72.8%
associate-*l*96.0%
associate-*r/96.3%
metadata-eval96.3%
Simplified96.3%
Final simplification98.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 9.0) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 6e+290)))
(- (* (/ x 2.0) (/ y a)) (* z (* t (/ 4.5 a))))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))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 * 9.0) * t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 6e+290)) {
tmp = ((x / 2.0) * (y / a)) - (z * (t * (4.5 / a)));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
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 * 9.0) * t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 6e+290)) {
tmp = ((x / 2.0) * (y / a)) - (z * (t * (4.5 / a)));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
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 * 9.0) * t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 6e+290): tmp = ((x / 2.0) * (y / a)) - (z * (t * (4.5 / a))) else: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) 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(Float64(z * 9.0) * t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 6e+290)) tmp = Float64(Float64(Float64(x / 2.0) * Float64(y / a)) - Float64(z * Float64(t * Float64(4.5 / a)))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); 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 * 9.0) * t);
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 6e+290)))
tmp = ((x / 2.0) * (y / a)) - (z * (t * (4.5 / a)));
else
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
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[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 6e+290]], $MachinePrecision]], N[(N[(N[(x / 2.0), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t * N[(4.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $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 - \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 6 \cdot 10^{+290}\right):\\
\;\;\;\;\frac{x}{2} \cdot \frac{y}{a} - z \cdot \left(t \cdot \frac{4.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -inf.0 or 6e290 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 58.9%
associate-*l*58.9%
Simplified58.9%
div-sub55.1%
*-commutative55.1%
times-frac71.2%
div-inv71.2%
associate-*r*71.2%
*-commutative71.2%
associate-*l*71.2%
*-commutative71.2%
associate-/r*71.2%
metadata-eval71.2%
Applied egg-rr71.2%
Taylor expanded in z around 0 71.2%
associate-*r/71.2%
*-commutative71.2%
*-commutative71.2%
associate-*r/71.1%
metadata-eval71.1%
associate-*r/71.1%
associate-*l*92.2%
associate-*r/92.2%
metadata-eval92.2%
Simplified92.3%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 6e290Initial program 99.6%
associate-*l*99.6%
Simplified99.6%
Final simplification98.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 (* (* z 9.0) t)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+288)))
(* -4.5 (* t (/ z a)))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))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 * 9.0) * t;
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+288)) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
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 = (z * 9.0) * t;
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+288)) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
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 * 9.0) * t tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+288): tmp = -4.5 * (t * (z / a)) else: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) 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(z * 9.0) * t) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+288)) tmp = Float64(-4.5 * Float64(t * Float64(z / a))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); 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 * 9.0) * t;
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 1e+288)))
tmp = -4.5 * (t * (z / a));
else
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
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[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+288]], $MachinePrecision]], N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $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 := \left(z \cdot 9\right) \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+288}\right):\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < -inf.0 or 1e288 < (*.f64 (*.f64 z 9) t) Initial program 42.4%
associate-*l*42.4%
Simplified42.4%
Taylor expanded in x around 0 42.6%
associate-/l*99.2%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in t around 0 42.6%
associate-*r/99.4%
Simplified99.4%
if -inf.0 < (*.f64 (*.f64 z 9) t) < 1e288Initial program 96.0%
associate-*l*96.0%
Simplified96.0%
Final simplification96.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 (or (<= z -1.25e+92)
(not
(or (<= z -2.3e+59) (and (not (<= z -5.3e+32)) (<= z 1.25e-148)))))
(* -4.5 (* t (/ z a)))
(* 0.5 (* 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 <= -1.25e+92) || !((z <= -2.3e+59) || (!(z <= -5.3e+32) && (z <= 1.25e-148)))) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = 0.5 * (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 <= (-1.25d+92)) .or. (.not. (z <= (-2.3d+59)) .or. (.not. (z <= (-5.3d+32))) .and. (z <= 1.25d-148))) then
tmp = (-4.5d0) * (t * (z / a))
else
tmp = 0.5d0 * (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 <= -1.25e+92) || !((z <= -2.3e+59) || (!(z <= -5.3e+32) && (z <= 1.25e-148)))) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = 0.5 * (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 <= -1.25e+92) or not ((z <= -2.3e+59) or (not (z <= -5.3e+32) and (z <= 1.25e-148))): tmp = -4.5 * (t * (z / a)) else: tmp = 0.5 * (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 <= -1.25e+92) || !((z <= -2.3e+59) || (!(z <= -5.3e+32) && (z <= 1.25e-148)))) tmp = Float64(-4.5 * Float64(t * Float64(z / a))); else tmp = Float64(0.5 * 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 ((z <= -1.25e+92) || ~(((z <= -2.3e+59) || (~((z <= -5.3e+32)) && (z <= 1.25e-148)))))
tmp = -4.5 * (t * (z / a));
else
tmp = 0.5 * (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[Or[LessEqual[z, -1.25e+92], N[Not[Or[LessEqual[z, -2.3e+59], And[N[Not[LessEqual[z, -5.3e+32]], $MachinePrecision], LessEqual[z, 1.25e-148]]]], $MachinePrecision]], N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / 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}\;z \leq -1.25 \cdot 10^{+92} \lor \neg \left(z \leq -2.3 \cdot 10^{+59} \lor \neg \left(z \leq -5.3 \cdot 10^{+32}\right) \land z \leq 1.25 \cdot 10^{-148}\right):\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if z < -1.25000000000000005e92 or -2.30000000000000008e59 < z < -5.2999999999999999e32 or 1.25e-148 < z Initial program 89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in x around 0 61.3%
associate-/l*65.6%
associate-/r/65.2%
Simplified65.2%
Taylor expanded in t around 0 61.3%
associate-*r/66.1%
Simplified66.1%
if -1.25000000000000005e92 < z < -2.30000000000000008e59 or -5.2999999999999999e32 < z < 1.25e-148Initial program 93.0%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in x around inf 72.4%
associate-*r/73.3%
Simplified73.3%
Final simplification69.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 (* -4.5 (* t (/ z a)))))
(if (<= z -2.2e+90)
t_1
(if (<= z -4.6e+54)
(* 0.5 (* x (/ y a)))
(if (or (<= z -2.3e+31) (not (<= z 1.25e-148)))
t_1
(* 0.5 (* 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 t_1 = -4.5 * (t * (z / a));
double tmp;
if (z <= -2.2e+90) {
tmp = t_1;
} else if (z <= -4.6e+54) {
tmp = 0.5 * (x * (y / a));
} else if ((z <= -2.3e+31) || !(z <= 1.25e-148)) {
tmp = t_1;
} else {
tmp = 0.5 * (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) :: t_1
real(8) :: tmp
t_1 = (-4.5d0) * (t * (z / a))
if (z <= (-2.2d+90)) then
tmp = t_1
else if (z <= (-4.6d+54)) then
tmp = 0.5d0 * (x * (y / a))
else if ((z <= (-2.3d+31)) .or. (.not. (z <= 1.25d-148))) then
tmp = t_1
else
tmp = 0.5d0 * (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 t_1 = -4.5 * (t * (z / a));
double tmp;
if (z <= -2.2e+90) {
tmp = t_1;
} else if (z <= -4.6e+54) {
tmp = 0.5 * (x * (y / a));
} else if ((z <= -2.3e+31) || !(z <= 1.25e-148)) {
tmp = t_1;
} else {
tmp = 0.5 * (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): t_1 = -4.5 * (t * (z / a)) tmp = 0 if z <= -2.2e+90: tmp = t_1 elif z <= -4.6e+54: tmp = 0.5 * (x * (y / a)) elif (z <= -2.3e+31) or not (z <= 1.25e-148): tmp = t_1 else: tmp = 0.5 * (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) t_1 = Float64(-4.5 * Float64(t * Float64(z / a))) tmp = 0.0 if (z <= -2.2e+90) tmp = t_1; elseif (z <= -4.6e+54) tmp = Float64(0.5 * Float64(x * Float64(y / a))); elseif ((z <= -2.3e+31) || !(z <= 1.25e-148)) tmp = t_1; else tmp = Float64(0.5 * 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)
t_1 = -4.5 * (t * (z / a));
tmp = 0.0;
if (z <= -2.2e+90)
tmp = t_1;
elseif (z <= -4.6e+54)
tmp = 0.5 * (x * (y / a));
elseif ((z <= -2.3e+31) || ~((z <= 1.25e-148)))
tmp = t_1;
else
tmp = 0.5 * (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_] := Block[{t$95$1 = N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+90], t$95$1, If[LessEqual[z, -4.6e+54], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.3e+31], N[Not[LessEqual[z, 1.25e-148]], $MachinePrecision]], t$95$1, N[(0.5 * N[(y * N[(x / 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}
t_1 := -4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{+54}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+31} \lor \neg \left(z \leq 1.25 \cdot 10^{-148}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if z < -2.1999999999999999e90 or -4.59999999999999988e54 < z < -2.3e31 or 1.25e-148 < z Initial program 89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in x around 0 61.3%
associate-/l*65.6%
associate-/r/65.2%
Simplified65.2%
Taylor expanded in t around 0 61.3%
associate-*r/66.1%
Simplified66.1%
if -2.1999999999999999e90 < z < -4.59999999999999988e54Initial program 90.1%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in x around inf 60.5%
associate-*r/60.5%
Simplified60.5%
if -2.3e31 < z < 1.25e-148Initial program 93.3%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 73.6%
associate-/l*74.9%
Simplified74.9%
associate-/r/76.3%
Applied egg-rr76.3%
Final simplification70.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* -4.5 (* t (/ z a)))))
(if (<= z -2.1e+90)
t_1
(if (<= z -4.4e+57)
(* 0.5 (/ x (/ a y)))
(if (or (<= z -7.5e+32) (not (<= z 1.25e-148)))
t_1
(* 0.5 (* 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 t_1 = -4.5 * (t * (z / a));
double tmp;
if (z <= -2.1e+90) {
tmp = t_1;
} else if (z <= -4.4e+57) {
tmp = 0.5 * (x / (a / y));
} else if ((z <= -7.5e+32) || !(z <= 1.25e-148)) {
tmp = t_1;
} else {
tmp = 0.5 * (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) :: t_1
real(8) :: tmp
t_1 = (-4.5d0) * (t * (z / a))
if (z <= (-2.1d+90)) then
tmp = t_1
else if (z <= (-4.4d+57)) then
tmp = 0.5d0 * (x / (a / y))
else if ((z <= (-7.5d+32)) .or. (.not. (z <= 1.25d-148))) then
tmp = t_1
else
tmp = 0.5d0 * (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 t_1 = -4.5 * (t * (z / a));
double tmp;
if (z <= -2.1e+90) {
tmp = t_1;
} else if (z <= -4.4e+57) {
tmp = 0.5 * (x / (a / y));
} else if ((z <= -7.5e+32) || !(z <= 1.25e-148)) {
tmp = t_1;
} else {
tmp = 0.5 * (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): t_1 = -4.5 * (t * (z / a)) tmp = 0 if z <= -2.1e+90: tmp = t_1 elif z <= -4.4e+57: tmp = 0.5 * (x / (a / y)) elif (z <= -7.5e+32) or not (z <= 1.25e-148): tmp = t_1 else: tmp = 0.5 * (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) t_1 = Float64(-4.5 * Float64(t * Float64(z / a))) tmp = 0.0 if (z <= -2.1e+90) tmp = t_1; elseif (z <= -4.4e+57) tmp = Float64(0.5 * Float64(x / Float64(a / y))); elseif ((z <= -7.5e+32) || !(z <= 1.25e-148)) tmp = t_1; else tmp = Float64(0.5 * 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)
t_1 = -4.5 * (t * (z / a));
tmp = 0.0;
if (z <= -2.1e+90)
tmp = t_1;
elseif (z <= -4.4e+57)
tmp = 0.5 * (x / (a / y));
elseif ((z <= -7.5e+32) || ~((z <= 1.25e-148)))
tmp = t_1;
else
tmp = 0.5 * (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_] := Block[{t$95$1 = N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+90], t$95$1, If[LessEqual[z, -4.4e+57], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.5e+32], N[Not[LessEqual[z, 1.25e-148]], $MachinePrecision]], t$95$1, N[(0.5 * N[(y * N[(x / 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}
t_1 := -4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{+57}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+32} \lor \neg \left(z \leq 1.25 \cdot 10^{-148}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if z < -2.09999999999999981e90 or -4.4000000000000001e57 < z < -7.49999999999999959e32 or 1.25e-148 < z Initial program 89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in x around 0 61.3%
associate-/l*65.6%
associate-/r/65.2%
Simplified65.2%
Taylor expanded in t around 0 61.3%
associate-*r/66.1%
Simplified66.1%
if -2.09999999999999981e90 < z < -4.4000000000000001e57Initial program 90.1%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in x around inf 60.5%
associate-/l*60.9%
Simplified60.9%
if -7.49999999999999959e32 < z < 1.25e-148Initial program 93.3%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 73.6%
associate-/l*74.9%
Simplified74.9%
associate-/r/76.3%
Applied egg-rr76.3%
Final simplification70.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t 1.8e+85) (* -4.5 (* t (/ z a))) (* -4.5 (* 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 (t <= 1.8e+85) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = -4.5 * (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 (t <= 1.8d+85) then
tmp = (-4.5d0) * (t * (z / a))
else
tmp = (-4.5d0) * (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 (t <= 1.8e+85) {
tmp = -4.5 * (t * (z / a));
} else {
tmp = -4.5 * (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 t <= 1.8e+85: tmp = -4.5 * (t * (z / a)) else: tmp = -4.5 * (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 (t <= 1.8e+85) tmp = Float64(-4.5 * Float64(t * Float64(z / a))); else tmp = Float64(-4.5 * 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 (t <= 1.8e+85)
tmp = -4.5 * (t * (z / a));
else
tmp = -4.5 * (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[t, 1.8e+85], N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * 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}\;t \leq 1.8 \cdot 10^{+85}:\\
\;\;\;\;-4.5 \cdot \left(t \cdot \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if t < 1.7999999999999999e85Initial program 93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 45.7%
associate-/l*44.2%
associate-/r/45.3%
Simplified45.3%
Taylor expanded in t around 0 45.7%
associate-*r/44.5%
Simplified44.5%
if 1.7999999999999999e85 < t Initial program 82.1%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in x around 0 58.0%
associate-/l*65.5%
associate-/r/77.1%
Simplified77.1%
Final simplification50.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 (<= t 2.5e+85) (* -4.5 (/ t (/ a z))) (* -4.5 (* 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 (t <= 2.5e+85) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * (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 (t <= 2.5d+85) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (-4.5d0) * (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 (t <= 2.5e+85) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * (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 t <= 2.5e+85: tmp = -4.5 * (t / (a / z)) else: tmp = -4.5 * (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 (t <= 2.5e+85) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(-4.5 * 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 (t <= 2.5e+85)
tmp = -4.5 * (t / (a / z));
else
tmp = -4.5 * (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[t, 2.5e+85], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * 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}\;t \leq 2.5 \cdot 10^{+85}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if t < 2.5e85Initial program 93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in x around 0 45.7%
associate-/l*44.2%
Simplified44.2%
if 2.5e85 < t Initial program 82.1%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in x around 0 58.0%
associate-/l*65.5%
associate-/r/77.1%
Simplified77.1%
Final simplification50.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 (* -4.5 (* 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 -4.5 * (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 = (-4.5d0) * (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 -4.5 * (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 -4.5 * (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(-4.5 * 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 = -4.5 * (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[(-4.5 * N[(t * N[(z / 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])\\
\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Initial program 91.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in x around 0 48.0%
associate-/l*48.2%
associate-/r/51.3%
Simplified51.3%
Taylor expanded in t around 0 48.0%
associate-*r/48.5%
Simplified48.5%
Final simplification48.5%
(FPCore (x y z t a)
:precision binary64
(if (< a -2.090464557976709e+86)
(- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
(if (< a 2.144030707833976e+99)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
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) :: tmp
if (a < (-2.090464557976709d+86)) then
tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
else if (a < 2.144030707833976d+99) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a < -2.090464557976709e+86: tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))) elif a < 2.144030707833976e+99: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a < -2.090464557976709e+86) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z)))); elseif (a < 2.144030707833976e+99) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a < -2.090464557976709e+86) tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))); elseif (a < 2.144030707833976e+99) tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0); else tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
herbie shell --seed 2024019
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))