
(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 10 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 (* (/ 0.5 a) (- (* x y) (* 9.0 (* z t))))))
(if (<= (* x y) -4e+266)
(* (/ y a) (/ x 2.0))
(if (<= (* x y) -1e-170)
t_1
(if (<= (* x y) 1e-237)
(* (/ z a) (* t -4.5))
(if (<= (* x y) 2e+237) t_1 (* (/ x a) (/ y 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 = (0.5 / a) * ((x * y) - (9.0 * (z * t)));
double tmp;
if ((x * y) <= -4e+266) {
tmp = (y / a) * (x / 2.0);
} else if ((x * y) <= -1e-170) {
tmp = t_1;
} else if ((x * y) <= 1e-237) {
tmp = (z / a) * (t * -4.5);
} else if ((x * y) <= 2e+237) {
tmp = t_1;
} else {
tmp = (x / a) * (y / 2.0);
}
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 = (0.5d0 / a) * ((x * y) - (9.0d0 * (z * t)))
if ((x * y) <= (-4d+266)) then
tmp = (y / a) * (x / 2.0d0)
else if ((x * y) <= (-1d-170)) then
tmp = t_1
else if ((x * y) <= 1d-237) then
tmp = (z / a) * (t * (-4.5d0))
else if ((x * y) <= 2d+237) then
tmp = t_1
else
tmp = (x / a) * (y / 2.0d0)
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 = (0.5 / a) * ((x * y) - (9.0 * (z * t)));
double tmp;
if ((x * y) <= -4e+266) {
tmp = (y / a) * (x / 2.0);
} else if ((x * y) <= -1e-170) {
tmp = t_1;
} else if ((x * y) <= 1e-237) {
tmp = (z / a) * (t * -4.5);
} else if ((x * y) <= 2e+237) {
tmp = t_1;
} else {
tmp = (x / a) * (y / 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 = (0.5 / a) * ((x * y) - (9.0 * (z * t))) tmp = 0 if (x * y) <= -4e+266: tmp = (y / a) * (x / 2.0) elif (x * y) <= -1e-170: tmp = t_1 elif (x * y) <= 1e-237: tmp = (z / a) * (t * -4.5) elif (x * y) <= 2e+237: tmp = t_1 else: tmp = (x / a) * (y / 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(0.5 / a) * Float64(Float64(x * y) - Float64(9.0 * Float64(z * t)))) tmp = 0.0 if (Float64(x * y) <= -4e+266) tmp = Float64(Float64(y / a) * Float64(x / 2.0)); elseif (Float64(x * y) <= -1e-170) tmp = t_1; elseif (Float64(x * y) <= 1e-237) tmp = Float64(Float64(z / a) * Float64(t * -4.5)); elseif (Float64(x * y) <= 2e+237) tmp = t_1; else tmp = Float64(Float64(x / a) * Float64(y / 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 = (0.5 / a) * ((x * y) - (9.0 * (z * t)));
tmp = 0.0;
if ((x * y) <= -4e+266)
tmp = (y / a) * (x / 2.0);
elseif ((x * y) <= -1e-170)
tmp = t_1;
elseif ((x * y) <= 1e-237)
tmp = (z / a) * (t * -4.5);
elseif ((x * y) <= 2e+237)
tmp = t_1;
else
tmp = (x / a) * (y / 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[(0.5 / a), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e+266], N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-170], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-237], N[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+237], t$95$1, N[(N[(x / a), $MachinePrecision] * N[(y / 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 := \frac{0.5}{a} \cdot \left(x \cdot y - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+266}:\\
\;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-237}:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if (*.f64 x y) < -4.0000000000000001e266Initial program 54.4%
Taylor expanded in x around inf 59.7%
*-commutative59.7%
times-frac90.6%
Applied egg-rr90.6%
if -4.0000000000000001e266 < (*.f64 x y) < -9.99999999999999983e-171 or 9.9999999999999999e-238 < (*.f64 x y) < 1.99999999999999988e237Initial program 97.2%
div-inv97.1%
*-commutative97.1%
*-commutative97.1%
associate-/r*97.1%
metadata-eval97.1%
*-commutative97.1%
associate-*l*97.2%
Applied egg-rr97.2%
if -9.99999999999999983e-171 < (*.f64 x y) < 9.9999999999999999e-238Initial program 89.0%
Taylor expanded in x around 0 88.7%
associate-/l*96.3%
Simplified96.3%
associate-*r*96.4%
Applied egg-rr96.4%
if 1.99999999999999988e237 < (*.f64 x y) Initial program 78.2%
Taylor expanded in x around inf 78.2%
*-commutative78.2%
*-commutative78.2%
times-frac96.1%
Applied egg-rr96.1%
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
(let* ((t_1 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+224)))
(* (/ (+ (* x (/ y z)) (* t -9.0)) a) (/ z 2.0))
(/ (- (* 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)) / (a * 2.0);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+224)) {
tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 2.0);
} 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)) / (a * 2.0);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+224)) {
tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 2.0);
} 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)) / (a * 2.0) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+224): tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 2.0) 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(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+224)) tmp = Float64(Float64(Float64(Float64(x * Float64(y / z)) + Float64(t * -9.0)) / a) * Float64(z / 2.0)); 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)) / (a * 2.0);
tmp = 0.0;
if ((t_1 <= -Inf) || ~((t_1 <= 5e+224)))
tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 2.0);
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[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+224]], $MachinePrecision]], N[(N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(t * -9.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * N[(z / 2.0), $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 := \frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+224}\right):\\
\;\;\;\;\frac{x \cdot \frac{y}{z} + t \cdot -9}{a} \cdot \frac{z}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) < -inf.0 or 4.99999999999999964e224 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) Initial program 79.1%
Taylor expanded in z around inf 79.2%
*-commutative79.2%
times-frac86.7%
cancel-sign-sub-inv86.7%
associate-/l*92.6%
metadata-eval92.6%
Applied egg-rr92.6%
if -inf.0 < (/.f64 (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) (*.f64 a #s(literal 2 binary64))) < 4.99999999999999964e224Initial program 98.3%
associate-*l*98.3%
*-commutative98.3%
Applied egg-rr98.3%
Final simplification95.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* (* z 9.0) t))))
(if (<= t_1 -1.5e+253)
(- (* y (* 0.5 (/ x a))) (* (* t (/ z a)) 4.5))
(if (<= t_1 5e+281)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(* (/ (+ (* x (/ y z)) (* t -9.0)) a) (/ z 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 <= -1.5e+253) {
tmp = (y * (0.5 * (x / a))) - ((t * (z / a)) * 4.5);
} else if (t_1 <= 5e+281) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 2.0);
}
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 * 9.0d0) * t)
if (t_1 <= (-1.5d+253)) then
tmp = (y * (0.5d0 * (x / a))) - ((t * (z / a)) * 4.5d0)
else if (t_1 <= 5d+281) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = (((x * (y / z)) + (t * (-9.0d0))) / a) * (z / 2.0d0)
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 tmp;
if (t_1 <= -1.5e+253) {
tmp = (y * (0.5 * (x / a))) - ((t * (z / a)) * 4.5);
} else if (t_1 <= 5e+281) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 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 <= -1.5e+253: tmp = (y * (0.5 * (x / a))) - ((t * (z / a)) * 4.5) elif t_1 <= 5e+281: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 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 <= -1.5e+253) tmp = Float64(Float64(y * Float64(0.5 * Float64(x / a))) - Float64(Float64(t * Float64(z / a)) * 4.5)); elseif (t_1 <= 5e+281) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(Float64(x * Float64(y / z)) + Float64(t * -9.0)) / a) * Float64(z / 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 <= -1.5e+253)
tmp = (y * (0.5 * (x / a))) - ((t * (z / a)) * 4.5);
elseif (t_1 <= 5e+281)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = (((x * (y / z)) + (t * -9.0)) / a) * (z / 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[LessEqual[t$95$1, -1.5e+253], N[(N[(y * N[(0.5 * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] * 4.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+281], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(t * -9.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * N[(z / 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 -1.5 \cdot 10^{+253}:\\
\;\;\;\;y \cdot \left(0.5 \cdot \frac{x}{a}\right) - \left(t \cdot \frac{z}{a}\right) \cdot 4.5\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+281}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{y}{z} + t \cdot -9}{a} \cdot \frac{z}{2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < -1.4999999999999999e253Initial program 67.2%
associate-*l*67.2%
*-commutative67.2%
Applied egg-rr67.2%
div-sub62.2%
*-commutative62.2%
associate-*r/76.2%
*-un-lft-identity76.2%
*-commutative76.2%
times-frac76.2%
metadata-eval76.2%
associate-*l*76.3%
*-commutative76.3%
*-commutative76.3%
times-frac76.3%
*-commutative76.3%
associate-*r/94.8%
metadata-eval94.8%
Applied egg-rr94.8%
if -1.4999999999999999e253 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) < 5.00000000000000016e281Initial program 98.6%
associate-*l*98.6%
*-commutative98.6%
Applied egg-rr98.6%
if 5.00000000000000016e281 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z #s(literal 9 binary64)) t)) Initial program 73.6%
Taylor expanded in z around inf 76.4%
*-commutative76.4%
times-frac81.0%
cancel-sign-sub-inv81.0%
associate-/l*92.9%
metadata-eval92.9%
Applied egg-rr92.9%
Final simplification97.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* (* z 9.0) t) 4e+244) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (* (* t (/ z a)) -4.5)))
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 * 9.0) * t) <= 4e+244) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = (t * (z / a)) * -4.5;
}
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 * 9.0d0) * t) <= 4d+244) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = (t * (z / a)) * (-4.5d0)
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 * 9.0) * t) <= 4e+244) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = (t * (z / a)) * -4.5;
}
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 * 9.0) * t) <= 4e+244: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = (t * (z / a)) * -4.5 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(Float64(z * 9.0) * t) <= 4e+244) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(t * Float64(z / a)) * -4.5); 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 * 9.0) * t) <= 4e+244)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = (t * (z / a)) * -4.5;
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[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision], 4e+244], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] * -4.5), $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}\;\left(z \cdot 9\right) \cdot t \leq 4 \cdot 10^{+244}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \frac{z}{a}\right) \cdot -4.5\\
\end{array}
\end{array}
if (*.f64 (*.f64 z #s(literal 9 binary64)) t) < 4.0000000000000003e244Initial program 92.4%
associate-*l*92.4%
*-commutative92.4%
Applied egg-rr92.4%
if 4.0000000000000003e244 < (*.f64 (*.f64 z #s(literal 9 binary64)) t) Initial program 66.1%
Taylor expanded in x around 0 70.2%
associate-/l*99.8%
Simplified99.8%
Final simplification93.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= (* x y) -1e+74) (not (<= (* x y) 5e-69))) (* 0.5 (/ x (/ a y))) (* (/ z a) (* t -4.5))))
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) <= -1e+74) || !((x * y) <= 5e-69)) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = (z / a) * (t * -4.5);
}
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) <= (-1d+74)) .or. (.not. ((x * y) <= 5d-69))) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = (z / a) * (t * (-4.5d0))
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) <= -1e+74) || !((x * y) <= 5e-69)) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = (z / a) * (t * -4.5);
}
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) <= -1e+74) or not ((x * y) <= 5e-69): tmp = 0.5 * (x / (a / y)) else: tmp = (z / a) * (t * -4.5) 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) <= -1e+74) || !(Float64(x * y) <= 5e-69)) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(Float64(z / a) * Float64(t * -4.5)); 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) <= -1e+74) || ~(((x * y) <= 5e-69)))
tmp = 0.5 * (x / (a / y));
else
tmp = (z / a) * (t * -4.5);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+74], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-69]], $MachinePrecision]], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $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 -1 \cdot 10^{+74} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-69}\right):\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999952e73 or 5.00000000000000033e-69 < (*.f64 x y) Initial program 86.7%
Taylor expanded in x around inf 67.1%
*-commutative67.1%
*-commutative67.1%
times-frac72.1%
Applied egg-rr72.1%
Taylor expanded in y around 0 67.1%
*-commutative67.1%
associate-*r/72.1%
*-commutative72.1%
/-rgt-identity72.1%
associate-/r/72.0%
associate-/l/73.5%
associate-*l/73.6%
*-lft-identity73.6%
Simplified73.6%
if -9.99999999999999952e73 < (*.f64 x y) < 5.00000000000000033e-69Initial program 93.0%
Taylor expanded in x around 0 78.0%
associate-/l*80.8%
Simplified80.8%
associate-*r*80.9%
Applied egg-rr80.9%
Final simplification77.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 (<= (* x y) -1e+74) (* (/ y a) (/ x 2.0)) (if (<= (* x y) 0.2) (* (/ z a) (* t -4.5)) (/ (* y 0.5) (/ a x)))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -1e+74) {
tmp = (y / a) * (x / 2.0);
} else if ((x * y) <= 0.2) {
tmp = (z / a) * (t * -4.5);
} else {
tmp = (y * 0.5) / (a / x);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x * y) <= (-1d+74)) then
tmp = (y / a) * (x / 2.0d0)
else if ((x * y) <= 0.2d0) then
tmp = (z / a) * (t * (-4.5d0))
else
tmp = (y * 0.5d0) / (a / x)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -1e+74) {
tmp = (y / a) * (x / 2.0);
} else if ((x * y) <= 0.2) {
tmp = (z / a) * (t * -4.5);
} else {
tmp = (y * 0.5) / (a / x);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -1e+74: tmp = (y / a) * (x / 2.0) elif (x * y) <= 0.2: tmp = (z / a) * (t * -4.5) else: tmp = (y * 0.5) / (a / x) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -1e+74) tmp = Float64(Float64(y / a) * Float64(x / 2.0)); elseif (Float64(x * y) <= 0.2) tmp = Float64(Float64(z / a) * Float64(t * -4.5)); else tmp = Float64(Float64(y * 0.5) / Float64(a / x)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -1e+74)
tmp = (y / a) * (x / 2.0);
elseif ((x * y) <= 0.2)
tmp = (z / a) * (t * -4.5);
else
tmp = (y * 0.5) / (a / x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+74], N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.2], N[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $MachinePrecision]), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / N[(a / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\
\mathbf{elif}\;x \cdot y \leq 0.2:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{\frac{a}{x}}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999952e73Initial program 79.9%
Taylor expanded in x around inf 63.9%
*-commutative63.9%
times-frac77.4%
Applied egg-rr77.4%
if -9.99999999999999952e73 < (*.f64 x y) < 0.20000000000000001Initial program 93.2%
Taylor expanded in x around 0 74.2%
associate-/l*77.4%
Simplified77.4%
associate-*r*77.4%
Applied egg-rr77.4%
if 0.20000000000000001 < (*.f64 x y) Initial program 89.6%
Taylor expanded in x around inf 74.8%
*-commutative74.8%
*-commutative74.8%
times-frac77.7%
Applied egg-rr77.7%
clear-num77.7%
un-div-inv77.7%
div-inv77.7%
metadata-eval77.7%
Applied egg-rr77.7%
Final simplification77.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -1e+74) (* (/ y a) (/ x 2.0)) (if (<= (* x y) 0.2) (* (/ z a) (* t -4.5)) (* (/ x a) (/ y 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 tmp;
if ((x * y) <= -1e+74) {
tmp = (y / a) * (x / 2.0);
} else if ((x * y) <= 0.2) {
tmp = (z / a) * (t * -4.5);
} else {
tmp = (x / a) * (y / 2.0);
}
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) <= (-1d+74)) then
tmp = (y / a) * (x / 2.0d0)
else if ((x * y) <= 0.2d0) then
tmp = (z / a) * (t * (-4.5d0))
else
tmp = (x / a) * (y / 2.0d0)
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) <= -1e+74) {
tmp = (y / a) * (x / 2.0);
} else if ((x * y) <= 0.2) {
tmp = (z / a) * (t * -4.5);
} else {
tmp = (x / a) * (y / 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): tmp = 0 if (x * y) <= -1e+74: tmp = (y / a) * (x / 2.0) elif (x * y) <= 0.2: tmp = (z / a) * (t * -4.5) else: tmp = (x / a) * (y / 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) tmp = 0.0 if (Float64(x * y) <= -1e+74) tmp = Float64(Float64(y / a) * Float64(x / 2.0)); elseif (Float64(x * y) <= 0.2) tmp = Float64(Float64(z / a) * Float64(t * -4.5)); else tmp = Float64(Float64(x / a) * Float64(y / 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)
tmp = 0.0;
if ((x * y) <= -1e+74)
tmp = (y / a) * (x / 2.0);
elseif ((x * y) <= 0.2)
tmp = (z / a) * (t * -4.5);
else
tmp = (x / a) * (y / 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_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+74], N[(N[(y / a), $MachinePrecision] * N[(x / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.2], N[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 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}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;\frac{y}{a} \cdot \frac{x}{2}\\
\mathbf{elif}\;x \cdot y \leq 0.2:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999952e73Initial program 79.9%
Taylor expanded in x around inf 63.9%
*-commutative63.9%
times-frac77.4%
Applied egg-rr77.4%
if -9.99999999999999952e73 < (*.f64 x y) < 0.20000000000000001Initial program 93.2%
Taylor expanded in x around 0 74.2%
associate-/l*77.4%
Simplified77.4%
associate-*r*77.4%
Applied egg-rr77.4%
if 0.20000000000000001 < (*.f64 x y) Initial program 89.6%
Taylor expanded in x around inf 74.8%
*-commutative74.8%
*-commutative74.8%
times-frac77.7%
Applied egg-rr77.7%
Final simplification77.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -1e+74) (* 0.5 (/ x (/ a y))) (if (<= (* x y) 0.2) (* (/ z a) (* t -4.5)) (* (/ x a) (/ y 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 tmp;
if ((x * y) <= -1e+74) {
tmp = 0.5 * (x / (a / y));
} else if ((x * y) <= 0.2) {
tmp = (z / a) * (t * -4.5);
} else {
tmp = (x / a) * (y / 2.0);
}
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) <= (-1d+74)) then
tmp = 0.5d0 * (x / (a / y))
else if ((x * y) <= 0.2d0) then
tmp = (z / a) * (t * (-4.5d0))
else
tmp = (x / a) * (y / 2.0d0)
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) <= -1e+74) {
tmp = 0.5 * (x / (a / y));
} else if ((x * y) <= 0.2) {
tmp = (z / a) * (t * -4.5);
} else {
tmp = (x / a) * (y / 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): tmp = 0 if (x * y) <= -1e+74: tmp = 0.5 * (x / (a / y)) elif (x * y) <= 0.2: tmp = (z / a) * (t * -4.5) else: tmp = (x / a) * (y / 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) tmp = 0.0 if (Float64(x * y) <= -1e+74) tmp = Float64(0.5 * Float64(x / Float64(a / y))); elseif (Float64(x * y) <= 0.2) tmp = Float64(Float64(z / a) * Float64(t * -4.5)); else tmp = Float64(Float64(x / a) * Float64(y / 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)
tmp = 0.0;
if ((x * y) <= -1e+74)
tmp = 0.5 * (x / (a / y));
elseif ((x * y) <= 0.2)
tmp = (z / a) * (t * -4.5);
else
tmp = (x / a) * (y / 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_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+74], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.2], N[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] * N[(y / 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}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \cdot y \leq 0.2:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{y}{2}\\
\end{array}
\end{array}
if (*.f64 x y) < -9.99999999999999952e73Initial program 79.9%
Taylor expanded in x around inf 63.9%
*-commutative63.9%
*-commutative63.9%
times-frac75.4%
Applied egg-rr75.4%
Taylor expanded in y around 0 63.9%
*-commutative63.9%
associate-*r/75.4%
*-commutative75.4%
/-rgt-identity75.4%
associate-/r/75.4%
associate-/l/77.4%
associate-*l/77.5%
*-lft-identity77.5%
Simplified77.5%
if -9.99999999999999952e73 < (*.f64 x y) < 0.20000000000000001Initial program 93.2%
Taylor expanded in x around 0 74.2%
associate-/l*77.4%
Simplified77.4%
associate-*r*77.4%
Applied egg-rr77.4%
if 0.20000000000000001 < (*.f64 x y) Initial program 89.6%
Taylor expanded in x around inf 74.8%
*-commutative74.8%
*-commutative74.8%
times-frac77.7%
Applied egg-rr77.7%
Final simplification77.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -2.3e+103) (not (<= x 1.8e-150))) (* 0.5 (/ x (/ a y))) (* (* t (/ z a)) -4.5)))
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 <= -2.3e+103) || !(x <= 1.8e-150)) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = (t * (z / a)) * -4.5;
}
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 <= (-2.3d+103)) .or. (.not. (x <= 1.8d-150))) then
tmp = 0.5d0 * (x / (a / y))
else
tmp = (t * (z / a)) * (-4.5d0)
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 <= -2.3e+103) || !(x <= 1.8e-150)) {
tmp = 0.5 * (x / (a / y));
} else {
tmp = (t * (z / a)) * -4.5;
}
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 <= -2.3e+103) or not (x <= 1.8e-150): tmp = 0.5 * (x / (a / y)) else: tmp = (t * (z / a)) * -4.5 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 <= -2.3e+103) || !(x <= 1.8e-150)) tmp = Float64(0.5 * Float64(x / Float64(a / y))); else tmp = Float64(Float64(t * Float64(z / a)) * -4.5); 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 <= -2.3e+103) || ~((x <= 1.8e-150)))
tmp = 0.5 * (x / (a / y));
else
tmp = (t * (z / a)) * -4.5;
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[x, -2.3e+103], N[Not[LessEqual[x, 1.8e-150]], $MachinePrecision]], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] * -4.5), $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 -2.3 \cdot 10^{+103} \lor \neg \left(x \leq 1.8 \cdot 10^{-150}\right):\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \frac{z}{a}\right) \cdot -4.5\\
\end{array}
\end{array}
if x < -2.30000000000000008e103 or 1.8000000000000001e-150 < x Initial program 86.5%
Taylor expanded in x around inf 54.4%
*-commutative54.4%
*-commutative54.4%
times-frac61.3%
Applied egg-rr61.3%
Taylor expanded in y around 0 54.4%
*-commutative54.4%
associate-*r/61.3%
*-commutative61.3%
/-rgt-identity61.3%
associate-/r/61.3%
associate-/l/57.7%
associate-*l/57.7%
*-lft-identity57.7%
Simplified57.7%
if -2.30000000000000008e103 < x < 1.8000000000000001e-150Initial program 93.9%
Taylor expanded in x around 0 69.5%
associate-/l*71.8%
Simplified71.8%
Final simplification64.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 (* (* t (/ z a)) -4.5))
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)) * -4.5;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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)) * (-4.5d0)
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)) * -4.5;
}
[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)) * -4.5
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(t * Float64(z / a)) * -4.5) 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)) * -4.5;
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[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] * -4.5), $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])\\
\\
\left(t \cdot \frac{z}{a}\right) \cdot -4.5
\end{array}
Initial program 89.8%
Taylor expanded in x around 0 53.9%
associate-/l*56.4%
Simplified56.4%
Final simplification56.4%
(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 2024097
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:alt
(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)))