
(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 18 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 and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 1e+261)))
(fma -4.5 (* z (/ t a)) (* 0.5 (/ y (/ a x))))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))assert(x < y);
assert(z < t);
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 <= 1e+261)) {
tmp = fma(-4.5, (z * (t / a)), (0.5 * (y / (a / x))));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) 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 <= 1e+261)) tmp = fma(-4.5, Float64(z * Float64(t / a)), Float64(0.5 * Float64(y / Float64(a / x)))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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, 1e+261]], $MachinePrecision]], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(y / N[(a / x), $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] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\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 10^{+261}\right):\\
\;\;\;\;\mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, 0.5 \cdot \frac{y}{\frac{a}{x}}\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 9.9999999999999993e260 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 66.8%
associate-*l*68.2%
Simplified68.2%
Taylor expanded in x around 0 65.6%
fma-def65.6%
associate-/l*76.3%
associate-/r/76.3%
associate-/l*92.1%
associate-/r/90.7%
Simplified90.7%
*-commutative90.7%
clear-num90.7%
un-div-inv90.7%
Applied egg-rr90.7%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 9.9999999999999993e260Initial program 97.8%
associate-*l*97.8%
Simplified97.8%
Final simplification95.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 1e+261)))
(fma -4.5 (* z (/ t a)) (* 0.5 (* y (/ x a))))
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)))))assert(x < y);
assert(z < t);
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 <= 1e+261)) {
tmp = fma(-4.5, (z * (t / a)), (0.5 * (y * (x / a))));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) 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 <= 1e+261)) tmp = fma(-4.5, Float64(z * Float64(t / a)), Float64(0.5 * Float64(y * Float64(x / a)))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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, 1e+261]], $MachinePrecision]], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(y * N[(x / 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] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\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 10^{+261}\right):\\
\;\;\;\;\mathsf{fma}\left(-4.5, z \cdot \frac{t}{a}, 0.5 \cdot \left(y \cdot \frac{x}{a}\right)\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 9.9999999999999993e260 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 66.8%
associate-*l*68.2%
Simplified68.2%
Taylor expanded in x around 0 65.6%
fma-def65.6%
associate-/l*76.3%
associate-/r/76.3%
associate-/l*92.1%
associate-/r/90.7%
Simplified90.7%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 9.9999999999999993e260Initial program 97.8%
associate-*l*97.8%
Simplified97.8%
Final simplification95.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y 1.5e+263) (* (fma x y (* z (* t -9.0))) (/ 0.5 a)) (* 0.5 (/ x (/ a y)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 1.5e+263) {
tmp = fma(x, y, (z * (t * -9.0))) * (0.5 / a);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= 1.5e+263) tmp = Float64(fma(x, y, Float64(z * Float64(t * -9.0))) * Float64(0.5 / a)); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, 1.5e+263], N[(N[(x * y + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{+263}:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < 1.49999999999999995e263Initial program 89.4%
associate-*l*89.8%
Simplified89.8%
div-inv89.8%
fma-neg90.6%
distribute-rgt-neg-in90.6%
*-commutative90.6%
distribute-rgt-neg-in90.6%
metadata-eval90.6%
*-commutative90.6%
associate-/r*90.6%
metadata-eval90.6%
Applied egg-rr90.6%
if 1.49999999999999995e263 < y Initial program 68.7%
associate-*l*68.7%
Simplified68.7%
Taylor expanded in x around inf 60.8%
associate-/l*84.0%
Simplified84.0%
Final simplification90.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y 3.9e+264) (/ (fma x y (* -9.0 (* z t))) (* a 2.0)) (* 0.5 (/ x (/ a y)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.9e+264) {
tmp = fma(x, y, (-9.0 * (z * t))) / (a * 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.9e+264) tmp = Float64(fma(x, y, Float64(-9.0 * Float64(z * t))) / Float64(a * 2.0)); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.9e+264], N[(N[(x * y + N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{+264}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, -9 \cdot \left(z \cdot t\right)\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < 3.89999999999999994e264Initial program 89.4%
fma-neg90.3%
*-commutative90.3%
associate-*l*90.7%
distribute-lft-neg-in90.7%
metadata-eval90.7%
Simplified90.7%
if 3.89999999999999994e264 < y Initial program 68.7%
associate-*l*68.7%
Simplified68.7%
Taylor expanded in x around inf 60.8%
associate-/l*84.0%
Simplified84.0%
Final simplification90.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) (- INFINITY))
(* 0.5 (/ y (/ a x)))
(if (<= (* x y) -2e-66)
t_1
(if (<= (* x y) 5e-61)
(/ (* t (* z -4.5)) a)
(if (<= (* x y) 2.0)
t_1
(if (<= (* x y) 4e+74)
(* (/ (* t -9.0) a) (/ z 2.0))
(* 0.5 (/ x (/ a y))))))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (t * (z * -4.5)) / a;
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = ((t * -9.0) / a) * (z / 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (t * (z * -4.5)) / a;
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = ((t * -9.0) / a) * (z / 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y / (a / x)) elif (x * y) <= -2e-66: tmp = t_1 elif (x * y) <= 5e-61: tmp = (t * (z * -4.5)) / a elif (x * y) <= 2.0: tmp = t_1 elif (x * y) <= 4e+74: tmp = ((t * -9.0) / a) * (z / 2.0) else: tmp = 0.5 * (x / (a / y)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (Float64(x * y) <= -2e-66) tmp = t_1; elseif (Float64(x * y) <= 5e-61) tmp = Float64(Float64(t * Float64(z * -4.5)) / a); elseif (Float64(x * y) <= 2.0) tmp = t_1; elseif (Float64(x * y) <= 4e+74) tmp = Float64(Float64(Float64(t * -9.0) / a) * Float64(z / 2.0)); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y / (a / x));
elseif ((x * y) <= -2e-66)
tmp = t_1;
elseif ((x * y) <= 5e-61)
tmp = (t * (z * -4.5)) / a;
elseif ((x * y) <= 2.0)
tmp = t_1;
elseif ((x * y) <= 4e+74)
tmp = ((t * -9.0) / a) * (z / 2.0);
else
tmp = 0.5 * (x / (a / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-66], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-61], N[(N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+74], N[(N[(N[(t * -9.0), $MachinePrecision] / a), $MachinePrecision] * N[(z / 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-61}:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -4.5\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 2:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+74}:\\
\;\;\;\;\frac{t \cdot -9}{a} \cdot \frac{z}{2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.1%
associate-*l*64.1%
Simplified64.1%
Taylor expanded in x around inf 64.1%
associate-/l*93.8%
associate-/r/93.6%
Simplified93.6%
*-commutative81.1%
clear-num81.1%
un-div-inv81.0%
Applied egg-rr93.5%
if -inf.0 < (*.f64 x y) < -2e-66 or 4.9999999999999999e-61 < (*.f64 x y) < 2Initial program 95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 73.1%
if -2e-66 < (*.f64 x y) < 4.9999999999999999e-61Initial program 92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 86.5%
associate-*r/86.5%
*-commutative86.5%
associate-*r*86.6%
Simplified86.6%
if 2 < (*.f64 x y) < 3.99999999999999981e74Initial program 90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around 0 70.9%
associate-*r*70.9%
*-commutative70.9%
times-frac75.6%
Applied egg-rr75.6%
if 3.99999999999999981e74 < (*.f64 x y) Initial program 79.4%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in x around inf 75.7%
associate-/l*89.2%
Simplified89.2%
Final simplification83.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) (- INFINITY))
(* 0.5 (/ y (/ a x)))
(if (<= (* x y) -2e-66)
t_1
(if (<= (* x y) 5e-61)
(/ (* z (* t -9.0)) (* a 2.0))
(if (<= (* x y) 2.0)
t_1
(if (<= (* x y) 4e+74)
(* (/ (* t -9.0) a) (/ z 2.0))
(* 0.5 (/ x (/ a y))))))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (z * (t * -9.0)) / (a * 2.0);
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = ((t * -9.0) / a) * (z / 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (z * (t * -9.0)) / (a * 2.0);
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = ((t * -9.0) / a) * (z / 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y / (a / x)) elif (x * y) <= -2e-66: tmp = t_1 elif (x * y) <= 5e-61: tmp = (z * (t * -9.0)) / (a * 2.0) elif (x * y) <= 2.0: tmp = t_1 elif (x * y) <= 4e+74: tmp = ((t * -9.0) / a) * (z / 2.0) else: tmp = 0.5 * (x / (a / y)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (Float64(x * y) <= -2e-66) tmp = t_1; elseif (Float64(x * y) <= 5e-61) tmp = Float64(Float64(z * Float64(t * -9.0)) / Float64(a * 2.0)); elseif (Float64(x * y) <= 2.0) tmp = t_1; elseif (Float64(x * y) <= 4e+74) tmp = Float64(Float64(Float64(t * -9.0) / a) * Float64(z / 2.0)); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y / (a / x));
elseif ((x * y) <= -2e-66)
tmp = t_1;
elseif ((x * y) <= 5e-61)
tmp = (z * (t * -9.0)) / (a * 2.0);
elseif ((x * y) <= 2.0)
tmp = t_1;
elseif ((x * y) <= 4e+74)
tmp = ((t * -9.0) / a) * (z / 2.0);
else
tmp = 0.5 * (x / (a / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-66], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-61], N[(N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+74], N[(N[(N[(t * -9.0), $MachinePrecision] / a), $MachinePrecision] * N[(z / 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-61}:\\
\;\;\;\;\frac{z \cdot \left(t \cdot -9\right)}{a \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq 2:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+74}:\\
\;\;\;\;\frac{t \cdot -9}{a} \cdot \frac{z}{2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.1%
associate-*l*64.1%
Simplified64.1%
Taylor expanded in x around inf 64.1%
associate-/l*93.8%
associate-/r/93.6%
Simplified93.6%
*-commutative81.1%
clear-num81.1%
un-div-inv81.0%
Applied egg-rr93.5%
if -inf.0 < (*.f64 x y) < -2e-66 or 4.9999999999999999e-61 < (*.f64 x y) < 2Initial program 95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 73.1%
if -2e-66 < (*.f64 x y) < 4.9999999999999999e-61Initial program 92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 86.5%
*-commutative86.5%
*-commutative86.5%
associate-*r*86.6%
Simplified86.6%
if 2 < (*.f64 x y) < 3.99999999999999981e74Initial program 90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around 0 70.9%
associate-*r*70.9%
*-commutative70.9%
times-frac75.6%
Applied egg-rr75.6%
if 3.99999999999999981e74 < (*.f64 x y) Initial program 79.4%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in x around inf 75.7%
associate-/l*89.2%
Simplified89.2%
Final simplification83.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) (- INFINITY))
(* 0.5 (/ y (/ a x)))
(if (<= (* x y) -2e-66)
t_1
(if (<= (* x y) 5e-61)
(* (/ -4.5 a) (* z t))
(if (<= (* x y) 2.0)
t_1
(if (<= (* x y) 4e+74)
(* -4.5 (* z (/ t a)))
(* 0.5 (/ x (/ a y))))))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (-4.5 / a) * (z * t);
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (-4.5 / a) * (z * t);
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y / (a / x)) elif (x * y) <= -2e-66: tmp = t_1 elif (x * y) <= 5e-61: tmp = (-4.5 / a) * (z * t) elif (x * y) <= 2.0: tmp = t_1 elif (x * y) <= 4e+74: tmp = -4.5 * (z * (t / a)) else: tmp = 0.5 * (x / (a / y)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (Float64(x * y) <= -2e-66) tmp = t_1; elseif (Float64(x * y) <= 5e-61) tmp = Float64(Float64(-4.5 / a) * Float64(z * t)); elseif (Float64(x * y) <= 2.0) tmp = t_1; elseif (Float64(x * y) <= 4e+74) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y / (a / x));
elseif ((x * y) <= -2e-66)
tmp = t_1;
elseif ((x * y) <= 5e-61)
tmp = (-4.5 / a) * (z * t);
elseif ((x * y) <= 2.0)
tmp = t_1;
elseif ((x * y) <= 4e+74)
tmp = -4.5 * (z * (t / a));
else
tmp = 0.5 * (x / (a / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-66], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-61], N[(N[(-4.5 / a), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+74], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-61}:\\
\;\;\;\;\frac{-4.5}{a} \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 2:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+74}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.1%
associate-*l*64.1%
Simplified64.1%
Taylor expanded in x around inf 64.1%
associate-/l*93.8%
associate-/r/93.6%
Simplified93.6%
*-commutative81.1%
clear-num81.1%
un-div-inv81.0%
Applied egg-rr93.5%
if -inf.0 < (*.f64 x y) < -2e-66 or 4.9999999999999999e-61 < (*.f64 x y) < 2Initial program 95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 73.1%
if -2e-66 < (*.f64 x y) < 4.9999999999999999e-61Initial program 92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 86.5%
associate-/l*80.0%
Simplified80.0%
clear-num78.9%
un-div-inv79.0%
Applied egg-rr79.0%
associate-/l/85.8%
associate-/r/86.5%
Applied egg-rr86.5%
if 2 < (*.f64 x y) < 3.99999999999999981e74Initial program 90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around 0 70.9%
*-commutative70.9%
times-frac70.8%
associate-*l/75.6%
metadata-eval75.6%
*-commutative75.6%
Applied egg-rr75.6%
if 3.99999999999999981e74 < (*.f64 x y) Initial program 79.4%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in x around inf 75.7%
associate-/l*89.2%
Simplified89.2%
Final simplification83.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* x y) (* a 2.0))))
(if (<= (* x y) (- INFINITY))
(* 0.5 (/ y (/ a x)))
(if (<= (* x y) -2e-66)
t_1
(if (<= (* x y) 5e-61)
(/ (* t (* z -4.5)) a)
(if (<= (* x y) 2.0)
t_1
(if (<= (* x y) 4e+74)
(* -4.5 (* z (/ t a)))
(* 0.5 (/ x (/ a y))))))))))assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (t * (z * -4.5)) / a;
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) / (a * 2.0);
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y / (a / x));
} else if ((x * y) <= -2e-66) {
tmp = t_1;
} else if ((x * y) <= 5e-61) {
tmp = (t * (z * -4.5)) / a;
} else if ((x * y) <= 2.0) {
tmp = t_1;
} else if ((x * y) <= 4e+74) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): t_1 = (x * y) / (a * 2.0) tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y / (a / x)) elif (x * y) <= -2e-66: tmp = t_1 elif (x * y) <= 5e-61: tmp = (t * (z * -4.5)) / a elif (x * y) <= 2.0: tmp = t_1 elif (x * y) <= 4e+74: tmp = -4.5 * (z * (t / a)) else: tmp = 0.5 * (x / (a / y)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) / Float64(a * 2.0)) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (Float64(x * y) <= -2e-66) tmp = t_1; elseif (Float64(x * y) <= 5e-61) tmp = Float64(Float64(t * Float64(z * -4.5)) / a); elseif (Float64(x * y) <= 2.0) tmp = t_1; elseif (Float64(x * y) <= 4e+74) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) / (a * 2.0);
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y / (a / x));
elseif ((x * y) <= -2e-66)
tmp = t_1;
elseif ((x * y) <= 5e-61)
tmp = (t * (z * -4.5)) / a;
elseif ((x * y) <= 2.0)
tmp = t_1;
elseif ((x * y) <= 4e+74)
tmp = -4.5 * (z * (t / a));
else
tmp = 0.5 * (x / (a / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-66], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-61], N[(N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e+74], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{a \cdot 2}\\
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-61}:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -4.5\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 2:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+74}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.1%
associate-*l*64.1%
Simplified64.1%
Taylor expanded in x around inf 64.1%
associate-/l*93.8%
associate-/r/93.6%
Simplified93.6%
*-commutative81.1%
clear-num81.1%
un-div-inv81.0%
Applied egg-rr93.5%
if -inf.0 < (*.f64 x y) < -2e-66 or 4.9999999999999999e-61 < (*.f64 x y) < 2Initial program 95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 73.1%
if -2e-66 < (*.f64 x y) < 4.9999999999999999e-61Initial program 92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 86.5%
associate-*r/86.5%
*-commutative86.5%
associate-*r*86.6%
Simplified86.6%
if 2 < (*.f64 x y) < 3.99999999999999981e74Initial program 90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around 0 70.9%
*-commutative70.9%
times-frac70.8%
associate-*l/75.6%
metadata-eval75.6%
*-commutative75.6%
Applied egg-rr75.6%
if 3.99999999999999981e74 < (*.f64 x y) Initial program 79.4%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in x around inf 75.7%
associate-/l*89.2%
Simplified89.2%
Final simplification83.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* a 2.0) -1e-149) (- (* (* x y) (/ 0.5 a)) (* (/ z a) (/ (* 9.0 t) 2.0))) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 2.0) <= -1e-149) {
tmp = ((x * y) * (0.5 / a)) - ((z / a) * ((9.0 * t) / 2.0));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a * 2.0d0) <= (-1d-149)) then
tmp = ((x * y) * (0.5d0 / a)) - ((z / a) * ((9.0d0 * t) / 2.0d0))
else
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 2.0) <= -1e-149) {
tmp = ((x * y) * (0.5 / a)) - ((z / a) * ((9.0 * t) / 2.0));
} else {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (a * 2.0) <= -1e-149: tmp = ((x * y) * (0.5 / a)) - ((z / a) * ((9.0 * t) / 2.0)) else: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 2.0) <= -1e-149) tmp = Float64(Float64(Float64(x * y) * Float64(0.5 / a)) - Float64(Float64(z / a) * Float64(Float64(9.0 * t) / 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 = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((a * 2.0) <= -1e-149)
tmp = ((x * y) * (0.5 / a)) - ((z / a) * ((9.0 * t) / 2.0));
else
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 2.0), $MachinePrecision], -1e-149], N[(N[(N[(x * y), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision] - N[(N[(z / a), $MachinePrecision] * N[(N[(9.0 * t), $MachinePrecision] / 2.0), $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] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{0.5}{a} - \frac{z}{a} \cdot \frac{9 \cdot t}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 a 2) < -9.99999999999999979e-150Initial program 83.4%
associate-*l*83.4%
Simplified83.4%
div-sub83.4%
div-inv83.4%
*-commutative83.4%
associate-/r*83.4%
metadata-eval83.4%
times-frac87.5%
Applied egg-rr87.5%
if -9.99999999999999979e-150 < (*.f64 a 2) Initial program 91.4%
associate-*l*92.0%
Simplified92.0%
Final simplification90.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y 6e+264) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (* 0.5 (/ x (/ a y)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 6e+264) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 (y <= 6d+264) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = 0.5d0 * (x / (a / y))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 6e+264) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = 0.5 * (x / (a / y));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if y <= 6e+264: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = 0.5 * (x / (a / y)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (y <= 6e+264) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(0.5 * Float64(x / Float64(a / y))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= 6e+264)
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
else
tmp = 0.5 * (x / (a / y));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, 6e+264], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{+264}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < 6e264Initial program 89.4%
associate-*l*89.8%
Simplified89.8%
if 6e264 < y Initial program 68.7%
associate-*l*68.7%
Simplified68.7%
Taylor expanded in x around inf 60.8%
associate-/l*84.0%
Simplified84.0%
Final simplification89.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e-128) (not (<= t 1.3e+39))) (* -4.5 (/ t (/ a z))) (* 0.5 (* x (/ y a)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e-128) || !(t <= 1.3e+39)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-3.5d-128)) .or. (.not. (t <= 1.3d+39))) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = 0.5d0 * (x * (y / a))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e-128) || !(t <= 1.3e+39)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (x * (y / a));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e-128) or not (t <= 1.3e+39): tmp = -4.5 * (t / (a / z)) else: tmp = 0.5 * (x * (y / a)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e-128) || !(t <= 1.3e+39)) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(0.5 * Float64(x * Float64(y / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((t <= -3.5e-128) || ~((t <= 1.3e+39)))
tmp = -4.5 * (t / (a / z));
else
tmp = 0.5 * (x * (y / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e-128], N[Not[LessEqual[t, 1.3e+39]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-128} \lor \neg \left(t \leq 1.3 \cdot 10^{+39}\right):\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if t < -3.5e-128 or 1.3e39 < t Initial program 85.9%
associate-*l*85.9%
Simplified85.9%
Taylor expanded in x around 0 58.0%
associate-/l*60.6%
Simplified60.6%
if -3.5e-128 < t < 1.3e39Initial program 91.3%
associate-*l*92.2%
Simplified92.2%
div-inv92.1%
fma-neg92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
distribute-rgt-neg-in92.1%
metadata-eval92.1%
*-commutative92.1%
associate-/r*92.1%
metadata-eval92.1%
Applied egg-rr92.1%
Taylor expanded in x around inf 68.0%
associate-*r/70.4%
Simplified70.4%
Final simplification65.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= t -1e-128) (not (<= t 5e+55))) (* -4.5 (/ t (/ a z))) (* 0.5 (* y (/ x a)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e-128) || !(t <= 5e+55)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-1d-128)) .or. (.not. (t <= 5d+55))) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = 0.5d0 * (y * (x / a))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e-128) || !(t <= 5e+55)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (t <= -1e-128) or not (t <= 5e+55): tmp = -4.5 * (t / (a / z)) else: tmp = 0.5 * (y * (x / a)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e-128) || !(t <= 5e+55)) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(0.5 * Float64(y * Float64(x / a))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((t <= -1e-128) || ~((t <= 5e+55)))
tmp = -4.5 * (t / (a / z));
else
tmp = 0.5 * (y * (x / a));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e-128], N[Not[LessEqual[t, 5e+55]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-128} \lor \neg \left(t \leq 5 \cdot 10^{+55}\right):\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if t < -1.00000000000000005e-128 or 5.00000000000000046e55 < t Initial program 85.6%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in x around 0 57.8%
associate-/l*60.5%
Simplified60.5%
if -1.00000000000000005e-128 < t < 5.00000000000000046e55Initial program 91.5%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 67.2%
associate-/l*69.6%
associate-/r/66.7%
Simplified66.7%
Final simplification63.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= t -3.5e-128) (not (<= t 1.6e+56))) (* -4.5 (/ t (/ a z))) (* 0.5 (/ y (/ a x)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e-128) || !(t <= 1.6e+56)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (y / (a / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-3.5d-128)) .or. (.not. (t <= 1.6d+56))) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = 0.5d0 * (y / (a / x))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.5e-128) || !(t <= 1.6e+56)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (y / (a / x));
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if (t <= -3.5e-128) or not (t <= 1.6e+56): tmp = -4.5 * (t / (a / z)) else: tmp = 0.5 * (y / (a / x)) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.5e-128) || !(t <= 1.6e+56)) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(0.5 * Float64(y / Float64(a / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((t <= -3.5e-128) || ~((t <= 1.6e+56)))
tmp = -4.5 * (t / (a / z));
else
tmp = 0.5 * (y / (a / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.5e-128], N[Not[LessEqual[t, 1.6e+56]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-128} \lor \neg \left(t \leq 1.6 \cdot 10^{+56}\right):\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if t < -3.5e-128 or 1.60000000000000002e56 < t Initial program 85.6%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in x around 0 57.8%
associate-/l*60.5%
Simplified60.5%
if -3.5e-128 < t < 1.60000000000000002e56Initial program 91.5%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 67.2%
associate-/l*69.6%
associate-/r/66.7%
Simplified66.7%
*-commutative87.6%
clear-num87.0%
un-div-inv88.4%
Applied egg-rr66.7%
Final simplification63.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -2.5e-128) (* -4.5 (/ t (/ a z))) (if (<= t 1.65e+55) (* 0.5 (/ y (/ a x))) (* (/ z a) (* t -4.5)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e-128) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 1.65e+55) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = (z / a) * (t * -4.5);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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-128)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 1.65d+55) then
tmp = 0.5d0 * (y / (a / x))
else
tmp = (z / a) * (t * (-4.5d0))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e-128) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 1.65e+55) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = (z / a) * (t * -4.5);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -2.5e-128: tmp = -4.5 * (t / (a / z)) elif t <= 1.65e+55: tmp = 0.5 * (y / (a / x)) else: tmp = (z / a) * (t * -4.5) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e-128) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 1.65e+55) tmp = Float64(0.5 * Float64(y / Float64(a / x))); else tmp = Float64(Float64(z / a) * Float64(t * -4.5)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -2.5e-128)
tmp = -4.5 * (t / (a / z));
elseif (t <= 1.65e+55)
tmp = 0.5 * (y / (a / x));
else
tmp = (z / a) * (t * -4.5);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e-128], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e+55], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(t * -4.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-128}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+55}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{a} \cdot \left(t \cdot -4.5\right)\\
\end{array}
\end{array}
if t < -2.5000000000000001e-128Initial program 86.1%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around 0 49.8%
associate-/l*55.9%
Simplified55.9%
if -2.5000000000000001e-128 < t < 1.65e55Initial program 91.5%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 67.2%
associate-/l*69.6%
associate-/r/66.7%
Simplified66.7%
*-commutative87.6%
clear-num87.0%
un-div-inv88.4%
Applied egg-rr66.7%
if 1.65e55 < t Initial program 85.0%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
times-frac68.1%
metadata-eval68.1%
associate-*l/76.1%
associate-/r/66.3%
associate-*r/66.3%
div-inv66.4%
clear-num66.5%
Applied egg-rr66.5%
Final simplification63.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -1e-128) (* -4.5 (/ t (/ a z))) (if (<= t 5.6e+55) (* 0.5 (/ y (/ a x))) (* (/ t a) (* z -4.5)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e-128) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 5.6e+55) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = (t / a) * (z * -4.5);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-1d-128)) then
tmp = (-4.5d0) * (t / (a / z))
else if (t <= 5.6d+55) then
tmp = 0.5d0 * (y / (a / x))
else
tmp = (t / a) * (z * (-4.5d0))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e-128) {
tmp = -4.5 * (t / (a / z));
} else if (t <= 5.6e+55) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = (t / a) * (z * -4.5);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -1e-128: tmp = -4.5 * (t / (a / z)) elif t <= 5.6e+55: tmp = 0.5 * (y / (a / x)) else: tmp = (t / a) * (z * -4.5) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -1e-128) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); elseif (t <= 5.6e+55) tmp = Float64(0.5 * Float64(y / Float64(a / x))); else tmp = Float64(Float64(t / a) * Float64(z * -4.5)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -1e-128)
tmp = -4.5 * (t / (a / z));
elseif (t <= 5.6e+55)
tmp = 0.5 * (y / (a / x));
else
tmp = (t / a) * (z * -4.5);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1e-128], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+55], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(z * -4.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-128}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+55}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a} \cdot \left(z \cdot -4.5\right)\\
\end{array}
\end{array}
if t < -1.00000000000000005e-128Initial program 86.1%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around 0 49.8%
associate-/l*55.9%
Simplified55.9%
if -1.00000000000000005e-128 < t < 5.6000000000000002e55Initial program 91.5%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 67.2%
associate-/l*69.6%
associate-/r/66.7%
Simplified66.7%
*-commutative87.6%
clear-num87.0%
un-div-inv88.4%
Applied egg-rr66.7%
if 5.6000000000000002e55 < t Initial program 85.0%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
times-frac68.1%
metadata-eval68.1%
associate-*l/76.1%
*-commutative76.1%
associate-*r*76.1%
Applied egg-rr76.1%
Final simplification65.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -2.9e-129) (/ -4.5 (/ (/ a z) t)) (if (<= t 6.6e+56) (* 0.5 (/ y (/ a x))) (* (/ t a) (* z -4.5)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.9e-129) {
tmp = -4.5 / ((a / z) / t);
} else if (t <= 6.6e+56) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = (t / a) * (z * -4.5);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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.9d-129)) then
tmp = (-4.5d0) / ((a / z) / t)
else if (t <= 6.6d+56) then
tmp = 0.5d0 * (y / (a / x))
else
tmp = (t / a) * (z * (-4.5d0))
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.9e-129) {
tmp = -4.5 / ((a / z) / t);
} else if (t <= 6.6e+56) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = (t / a) * (z * -4.5);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if t <= -2.9e-129: tmp = -4.5 / ((a / z) / t) elif t <= 6.6e+56: tmp = 0.5 * (y / (a / x)) else: tmp = (t / a) * (z * -4.5) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.9e-129) tmp = Float64(-4.5 / Float64(Float64(a / z) / t)); elseif (t <= 6.6e+56) tmp = Float64(0.5 * Float64(y / Float64(a / x))); else tmp = Float64(Float64(t / a) * Float64(z * -4.5)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -2.9e-129)
tmp = -4.5 / ((a / z) / t);
elseif (t <= 6.6e+56)
tmp = 0.5 * (y / (a / x));
else
tmp = (t / a) * (z * -4.5);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.9e-129], N[(-4.5 / N[(N[(a / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+56], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(z * -4.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-129}:\\
\;\;\;\;\frac{-4.5}{\frac{\frac{a}{z}}{t}}\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+56}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a} \cdot \left(z \cdot -4.5\right)\\
\end{array}
\end{array}
if t < -2.90000000000000017e-129Initial program 86.1%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around 0 49.8%
associate-/l*55.9%
Simplified55.9%
clear-num55.9%
un-div-inv55.9%
Applied egg-rr55.9%
if -2.90000000000000017e-129 < t < 6.60000000000000004e56Initial program 91.5%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in x around inf 67.2%
associate-/l*69.6%
associate-/r/66.7%
Simplified66.7%
*-commutative87.6%
clear-num87.0%
un-div-inv88.4%
Applied egg-rr66.7%
if 6.60000000000000004e56 < t Initial program 85.0%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
times-frac68.1%
metadata-eval68.1%
associate-*l/76.1%
*-commutative76.1%
associate-*r*76.1%
Applied egg-rr76.1%
Final simplification65.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1e-176) (* -4.5 (/ t (/ a z))) (* -4.5 (/ (* z t) a))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-176) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 <= (-1d-176)) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-176) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): tmp = 0 if z <= -1e-176: tmp = -4.5 * (t / (a / z)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e-176) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1e-176)
tmp = -4.5 * (t / (a / z));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-176], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-176}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if z < -1e-176Initial program 91.6%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around 0 57.9%
associate-/l*59.5%
Simplified59.5%
if -1e-176 < z Initial program 86.3%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in x around 0 43.9%
Final simplification50.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (/ t (/ a z))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t / (a / z));
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t 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 / (a / z))
end function
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t / (a / z));
}
[x, y] = sort([x, y]) [z, t] = sort([z, t]) def code(x, y, z, t, a): return -4.5 * (t / (a / z))
x, y = sort([x, y]) z, t = sort([z, t]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(t / Float64(a / z))) end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (t / (a / z));
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
-4.5 \cdot \frac{t}{\frac{a}{z}}
\end{array}
Initial program 88.5%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in x around 0 49.6%
associate-/l*49.2%
Simplified49.2%
Final simplification49.2%
(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 2023275
(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)))