
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* t (* z 9.0)))))
(if (<= t_1 1e+228)
(/ t_1 (* a 2.0))
(- (* y (/ (/ x 2.0) a)) (* (* 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) - (t * (z * 9.0));
double tmp;
if (t_1 <= 1e+228) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (y * ((x / 2.0) / a)) - ((z * 9.0) * (t / (a * 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) - (t * (z * 9.0d0))
if (t_1 <= 1d+228) then
tmp = t_1 / (a * 2.0d0)
else
tmp = (y * ((x / 2.0d0) / a)) - ((z * 9.0d0) * (t / (a * 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) - (t * (z * 9.0));
double tmp;
if (t_1 <= 1e+228) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (y * ((x / 2.0) / a)) - ((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) - (t * (z * 9.0)) tmp = 0 if t_1 <= 1e+228: tmp = t_1 / (a * 2.0) else: tmp = (y * ((x / 2.0) / a)) - ((z * 9.0) * (t / (a * 2.0))) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) tmp = 0.0 if (t_1 <= 1e+228) tmp = Float64(t_1 / Float64(a * 2.0)); else tmp = Float64(Float64(y * Float64(Float64(x / 2.0) / a)) - Float64(Float64(z * 9.0) * Float64(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) - (t * (z * 9.0));
tmp = 0.0;
if (t_1 <= 1e+228)
tmp = t_1 / (a * 2.0);
else
tmp = (y * ((x / 2.0) / a)) - ((z * 9.0) * (t / (a * 2.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+228], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[(x / 2.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * N[(t / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - t \cdot \left(z \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq 10^{+228}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{\frac{x}{2}}{a} - \left(z \cdot 9\right) \cdot \frac{t}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 9.9999999999999992e227Initial program 96.9%
if 9.9999999999999992e227 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 78.7%
div-sub73.8%
associate-/l*78.4%
associate-/l*90.2%
Applied egg-rr90.2%
clear-num90.2%
un-div-inv90.2%
*-commutative90.2%
*-un-lft-identity90.2%
times-frac90.2%
metadata-eval90.2%
Applied egg-rr90.2%
associate-/r*90.2%
associate-/r/90.2%
Simplified90.2%
Final simplification95.9%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (/ (fma x y (* z (* t -9.0))) (* 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) {
return fma(x, y, (z * (t * -9.0))) / (a * 2.0);
}
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(fma(x, y, Float64(z * Float64(t * -9.0))) / Float64(a * 2.0)) 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[(x * y + N[(z * N[(t * -9.0), $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])\\
\\
\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}
\end{array}
Initial program 94.0%
div-sub91.7%
*-commutative91.7%
div-sub94.0%
cancel-sign-sub-inv94.0%
*-commutative94.0%
fma-define94.4%
distribute-rgt-neg-in94.4%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
metadata-eval94.4%
Simplified94.4%
Final simplification94.4%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* (fma t (* z -9.0) (* x y)) (/ 0.5 a)))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return fma(t, (z * -9.0), (x * y)) * (0.5 / a);
}
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(fma(t, Float64(z * -9.0), Float64(x * y)) * Float64(0.5 / a)) end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(t * N[(z * -9.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\mathsf{fma}\left(t, z \cdot -9, x \cdot y\right) \cdot \frac{0.5}{a}
\end{array}
Initial program 94.0%
Taylor expanded in a around 0 94.1%
associate-*r/94.1%
cancel-sign-sub-inv94.1%
metadata-eval94.1%
*-commutative94.1%
associate-*r*94.0%
fma-define94.4%
associate-*l/94.3%
*-commutative94.3%
fma-define93.9%
+-commutative93.9%
fma-define94.4%
Simplified94.4%
Final simplification94.4%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ 0.5 (/ a (* x y)))))
(if (<= (* x y) -2e+87)
t_1
(if (<= (* x y) -4e+55)
(* -4.5 (/ z (/ a t)))
(if (<= (* x y) -2e+35)
t_1
(if (<= (* x y) 5e-27)
(* -4.5 (/ (* z t) a))
(if (<= (* x y) 1e+59)
t_1
(if (<= (* x y) 2e+70)
(* -4.5 (* z (/ t a)))
(* x (* 0.5 (/ y a)))))))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = t_1;
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = -4.5 * ((z * t) / a);
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (a / (x * y))
if ((x * y) <= (-2d+87)) then
tmp = t_1
else if ((x * y) <= (-4d+55)) then
tmp = (-4.5d0) * (z / (a / t))
else if ((x * y) <= (-2d+35)) then
tmp = t_1
else if ((x * y) <= 5d-27) then
tmp = (-4.5d0) * ((z * t) / a)
else if ((x * y) <= 1d+59) then
tmp = t_1
else if ((x * y) <= 2d+70) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = x * (0.5d0 * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = t_1;
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = -4.5 * ((z * t) / a);
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = 0.5 / (a / (x * y)) tmp = 0 if (x * y) <= -2e+87: tmp = t_1 elif (x * y) <= -4e+55: tmp = -4.5 * (z / (a / t)) elif (x * y) <= -2e+35: tmp = t_1 elif (x * y) <= 5e-27: tmp = -4.5 * ((z * t) / a) elif (x * y) <= 1e+59: tmp = t_1 elif (x * y) <= 2e+70: tmp = -4.5 * (z * (t / a)) else: tmp = x * (0.5 * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(0.5 / Float64(a / Float64(x * y))) tmp = 0.0 if (Float64(x * y) <= -2e+87) tmp = t_1; elseif (Float64(x * y) <= -4e+55) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (Float64(x * y) <= -2e+35) tmp = t_1; elseif (Float64(x * y) <= 5e-27) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (Float64(x * y) <= 1e+59) tmp = t_1; elseif (Float64(x * y) <= 2e+70) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(x * Float64(0.5 * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 / (a / (x * y));
tmp = 0.0;
if ((x * y) <= -2e+87)
tmp = t_1;
elseif ((x * y) <= -4e+55)
tmp = -4.5 * (z / (a / t));
elseif ((x * y) <= -2e+35)
tmp = t_1;
elseif ((x * y) <= 5e-27)
tmp = -4.5 * ((z * t) / a);
elseif ((x * y) <= 1e+59)
tmp = t_1;
elseif ((x * y) <= 2e+70)
tmp = -4.5 * (z * (t / a));
else
tmp = x * (0.5 * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+87], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4e+55], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+70], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e87 or -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58Initial program 92.3%
clear-num92.2%
inv-pow92.2%
*-commutative92.2%
associate-/l*92.2%
fma-neg93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
Applied egg-rr93.5%
unpow-193.5%
associate-/r*93.5%
metadata-eval93.5%
fma-define92.2%
+-commutative92.2%
fma-define93.5%
Simplified93.5%
Taylor expanded in t around 0 80.2%
if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55Initial program 99.6%
Taylor expanded in x around 0 75.5%
*-commutative75.5%
associate-/l*75.5%
Applied egg-rr75.5%
clear-num75.5%
un-div-inv75.5%
Applied egg-rr75.5%
if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.7%
Taylor expanded in x around 0 79.2%
if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70Initial program 100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
associate-/l*100.0%
Applied egg-rr100.0%
if 2.00000000000000015e70 < (*.f64 x y) Initial program 91.1%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
associate-/l*76.0%
associate-*l*76.0%
Simplified76.0%
Final simplification79.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ 0.5 (/ a (* x y)))))
(if (<= (* x y) -2e+87)
(/ (* x y) (* a 2.0))
(if (<= (* x y) -4e+55)
(* -4.5 (/ z (/ a t)))
(if (<= (* x y) -2e+35)
t_1
(if (<= (* x y) 5e-27)
(* -4.5 (/ (* z t) a))
(if (<= (* x y) 1e+59)
t_1
(if (<= (* x y) 2e+70)
(* -4.5 (* z (/ t a)))
(* x (* 0.5 (/ y a)))))))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = (x * y) / (a * 2.0);
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = -4.5 * ((z * t) / a);
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (a / (x * y))
if ((x * y) <= (-2d+87)) then
tmp = (x * y) / (a * 2.0d0)
else if ((x * y) <= (-4d+55)) then
tmp = (-4.5d0) * (z / (a / t))
else if ((x * y) <= (-2d+35)) then
tmp = t_1
else if ((x * y) <= 5d-27) then
tmp = (-4.5d0) * ((z * t) / a)
else if ((x * y) <= 1d+59) then
tmp = t_1
else if ((x * y) <= 2d+70) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = x * (0.5d0 * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = (x * y) / (a * 2.0);
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = -4.5 * ((z * t) / a);
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = 0.5 / (a / (x * y)) tmp = 0 if (x * y) <= -2e+87: tmp = (x * y) / (a * 2.0) elif (x * y) <= -4e+55: tmp = -4.5 * (z / (a / t)) elif (x * y) <= -2e+35: tmp = t_1 elif (x * y) <= 5e-27: tmp = -4.5 * ((z * t) / a) elif (x * y) <= 1e+59: tmp = t_1 elif (x * y) <= 2e+70: tmp = -4.5 * (z * (t / a)) else: tmp = x * (0.5 * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(0.5 / Float64(a / Float64(x * y))) tmp = 0.0 if (Float64(x * y) <= -2e+87) tmp = Float64(Float64(x * y) / Float64(a * 2.0)); elseif (Float64(x * y) <= -4e+55) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (Float64(x * y) <= -2e+35) tmp = t_1; elseif (Float64(x * y) <= 5e-27) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (Float64(x * y) <= 1e+59) tmp = t_1; elseif (Float64(x * y) <= 2e+70) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(x * Float64(0.5 * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 / (a / (x * y));
tmp = 0.0;
if ((x * y) <= -2e+87)
tmp = (x * y) / (a * 2.0);
elseif ((x * y) <= -4e+55)
tmp = -4.5 * (z / (a / t));
elseif ((x * y) <= -2e+35)
tmp = t_1;
elseif ((x * y) <= 5e-27)
tmp = -4.5 * ((z * t) / a);
elseif ((x * y) <= 1e+59)
tmp = t_1;
elseif ((x * y) <= 2e+70)
tmp = -4.5 * (z * (t / a));
else
tmp = x * (0.5 * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+87], N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e+55], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+70], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\
\;\;\;\;\frac{x \cdot y}{a \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e87Initial program 91.1%
Taylor expanded in x around inf 84.0%
if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55Initial program 99.6%
Taylor expanded in x around 0 75.5%
*-commutative75.5%
associate-/l*75.5%
Applied egg-rr75.5%
clear-num75.5%
un-div-inv75.5%
Applied egg-rr75.5%
if -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58Initial program 95.4%
clear-num95.5%
inv-pow95.5%
*-commutative95.5%
associate-/l*95.5%
fma-neg95.5%
*-commutative95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
Applied egg-rr95.5%
unpow-195.5%
associate-/r*95.5%
metadata-eval95.5%
fma-define95.5%
+-commutative95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around 0 71.0%
if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.7%
Taylor expanded in x around 0 79.2%
if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70Initial program 100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
associate-/l*100.0%
Applied egg-rr100.0%
if 2.00000000000000015e70 < (*.f64 x y) Initial program 91.1%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
associate-/l*76.0%
associate-*l*76.0%
Simplified76.0%
Final simplification79.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ 0.5 (/ a (* x y)))))
(if (<= (* x y) -2e+87)
(/ (* x y) (* a 2.0))
(if (<= (* x y) -4e+55)
(* -4.5 (/ z (/ a t)))
(if (<= (* x y) -2e+35)
t_1
(if (<= (* x y) 5e-27)
(/ (* -4.5 (* z t)) a)
(if (<= (* x y) 1e+59)
t_1
(if (<= (* x y) 2e+70)
(* -4.5 (* z (/ t a)))
(* x (* 0.5 (/ y a)))))))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = (x * y) / (a * 2.0);
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (-4.5 * (z * t)) / a;
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (a / (x * y))
if ((x * y) <= (-2d+87)) then
tmp = (x * y) / (a * 2.0d0)
else if ((x * y) <= (-4d+55)) then
tmp = (-4.5d0) * (z / (a / t))
else if ((x * y) <= (-2d+35)) then
tmp = t_1
else if ((x * y) <= 5d-27) then
tmp = ((-4.5d0) * (z * t)) / a
else if ((x * y) <= 1d+59) then
tmp = t_1
else if ((x * y) <= 2d+70) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = x * (0.5d0 * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = (x * y) / (a * 2.0);
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (-4.5 * (z * t)) / a;
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = 0.5 / (a / (x * y)) tmp = 0 if (x * y) <= -2e+87: tmp = (x * y) / (a * 2.0) elif (x * y) <= -4e+55: tmp = -4.5 * (z / (a / t)) elif (x * y) <= -2e+35: tmp = t_1 elif (x * y) <= 5e-27: tmp = (-4.5 * (z * t)) / a elif (x * y) <= 1e+59: tmp = t_1 elif (x * y) <= 2e+70: tmp = -4.5 * (z * (t / a)) else: tmp = x * (0.5 * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(0.5 / Float64(a / Float64(x * y))) tmp = 0.0 if (Float64(x * y) <= -2e+87) tmp = Float64(Float64(x * y) / Float64(a * 2.0)); elseif (Float64(x * y) <= -4e+55) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (Float64(x * y) <= -2e+35) tmp = t_1; elseif (Float64(x * y) <= 5e-27) tmp = Float64(Float64(-4.5 * Float64(z * t)) / a); elseif (Float64(x * y) <= 1e+59) tmp = t_1; elseif (Float64(x * y) <= 2e+70) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(x * Float64(0.5 * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 / (a / (x * y));
tmp = 0.0;
if ((x * y) <= -2e+87)
tmp = (x * y) / (a * 2.0);
elseif ((x * y) <= -4e+55)
tmp = -4.5 * (z / (a / t));
elseif ((x * y) <= -2e+35)
tmp = t_1;
elseif ((x * y) <= 5e-27)
tmp = (-4.5 * (z * t)) / a;
elseif ((x * y) <= 1e+59)
tmp = t_1;
elseif ((x * y) <= 2e+70)
tmp = -4.5 * (z * (t / a));
else
tmp = x * (0.5 * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+87], N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e+55], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(N[(-4.5 * N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+70], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\
\;\;\;\;\frac{x \cdot y}{a \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\frac{-4.5 \cdot \left(z \cdot t\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e87Initial program 91.1%
Taylor expanded in x around inf 84.0%
if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55Initial program 99.6%
Taylor expanded in x around 0 75.5%
*-commutative75.5%
associate-/l*75.5%
Applied egg-rr75.5%
clear-num75.5%
un-div-inv75.5%
Applied egg-rr75.5%
if -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58Initial program 95.4%
clear-num95.5%
inv-pow95.5%
*-commutative95.5%
associate-/l*95.5%
fma-neg95.5%
*-commutative95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
Applied egg-rr95.5%
unpow-195.5%
associate-/r*95.5%
metadata-eval95.5%
fma-define95.5%
+-commutative95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around 0 71.0%
if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.7%
Taylor expanded in x around 0 79.2%
*-commutative79.2%
associate-*l/79.2%
Applied egg-rr79.2%
if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70Initial program 100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
associate-/l*100.0%
Applied egg-rr100.0%
if 2.00000000000000015e70 < (*.f64 x y) Initial program 91.1%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
associate-/l*76.0%
associate-*l*76.0%
Simplified76.0%
Final simplification79.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ 0.5 (/ a (* x y)))))
(if (<= (* x y) -2e+87)
(/ (* x y) (* a 2.0))
(if (<= (* x y) -4e+55)
(* -4.5 (/ z (/ a t)))
(if (<= (* x y) -2e+35)
t_1
(if (<= (* x y) 5e-27)
(/ (* -9.0 (* z t)) (* a 2.0))
(if (<= (* x y) 1e+59)
t_1
(if (<= (* x y) 2e+70)
(* -4.5 (* z (/ t a)))
(* x (* 0.5 (/ y a)))))))))))assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = (x * y) / (a * 2.0);
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (-9.0 * (z * t)) / (a * 2.0);
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (a / (x * y))
if ((x * y) <= (-2d+87)) then
tmp = (x * y) / (a * 2.0d0)
else if ((x * y) <= (-4d+55)) then
tmp = (-4.5d0) * (z / (a / t))
else if ((x * y) <= (-2d+35)) then
tmp = t_1
else if ((x * y) <= 5d-27) then
tmp = ((-9.0d0) * (z * t)) / (a * 2.0d0)
else if ((x * y) <= 1d+59) then
tmp = t_1
else if ((x * y) <= 2d+70) then
tmp = (-4.5d0) * (z * (t / a))
else
tmp = x * (0.5d0 * (y / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 / (a / (x * y));
double tmp;
if ((x * y) <= -2e+87) {
tmp = (x * y) / (a * 2.0);
} else if ((x * y) <= -4e+55) {
tmp = -4.5 * (z / (a / t));
} else if ((x * y) <= -2e+35) {
tmp = t_1;
} else if ((x * y) <= 5e-27) {
tmp = (-9.0 * (z * t)) / (a * 2.0);
} else if ((x * y) <= 1e+59) {
tmp = t_1;
} else if ((x * y) <= 2e+70) {
tmp = -4.5 * (z * (t / a));
} else {
tmp = x * (0.5 * (y / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = 0.5 / (a / (x * y)) tmp = 0 if (x * y) <= -2e+87: tmp = (x * y) / (a * 2.0) elif (x * y) <= -4e+55: tmp = -4.5 * (z / (a / t)) elif (x * y) <= -2e+35: tmp = t_1 elif (x * y) <= 5e-27: tmp = (-9.0 * (z * t)) / (a * 2.0) elif (x * y) <= 1e+59: tmp = t_1 elif (x * y) <= 2e+70: tmp = -4.5 * (z * (t / a)) else: tmp = x * (0.5 * (y / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(0.5 / Float64(a / Float64(x * y))) tmp = 0.0 if (Float64(x * y) <= -2e+87) tmp = Float64(Float64(x * y) / Float64(a * 2.0)); elseif (Float64(x * y) <= -4e+55) tmp = Float64(-4.5 * Float64(z / Float64(a / t))); elseif (Float64(x * y) <= -2e+35) tmp = t_1; elseif (Float64(x * y) <= 5e-27) tmp = Float64(Float64(-9.0 * Float64(z * t)) / Float64(a * 2.0)); elseif (Float64(x * y) <= 1e+59) tmp = t_1; elseif (Float64(x * y) <= 2e+70) tmp = Float64(-4.5 * Float64(z * Float64(t / a))); else tmp = Float64(x * Float64(0.5 * Float64(y / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 0.5 / (a / (x * y));
tmp = 0.0;
if ((x * y) <= -2e+87)
tmp = (x * y) / (a * 2.0);
elseif ((x * y) <= -4e+55)
tmp = -4.5 * (z / (a / t));
elseif ((x * y) <= -2e+35)
tmp = t_1;
elseif ((x * y) <= 5e-27)
tmp = (-9.0 * (z * t)) / (a * 2.0);
elseif ((x * y) <= 1e+59)
tmp = t_1;
elseif ((x * y) <= 2e+70)
tmp = -4.5 * (z * (t / a));
else
tmp = x * (0.5 * (y / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 / N[(a / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+87], N[(N[(x * y), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e+55], N[(-4.5 * N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e+35], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-27], N[(N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+70], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{\frac{a}{x \cdot y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87}:\\
\;\;\;\;\frac{x \cdot y}{a \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{+55}:\\
\;\;\;\;-4.5 \cdot \frac{z}{\frac{a}{t}}\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\frac{-9 \cdot \left(z \cdot t\right)}{a \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+70}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e87Initial program 91.1%
Taylor expanded in x around inf 84.0%
if -1.9999999999999999e87 < (*.f64 x y) < -4.00000000000000004e55Initial program 99.6%
Taylor expanded in x around 0 75.5%
*-commutative75.5%
associate-/l*75.5%
Applied egg-rr75.5%
clear-num75.5%
un-div-inv75.5%
Applied egg-rr75.5%
if -4.00000000000000004e55 < (*.f64 x y) < -1.9999999999999999e35 or 5.0000000000000002e-27 < (*.f64 x y) < 9.99999999999999972e58Initial program 95.4%
clear-num95.5%
inv-pow95.5%
*-commutative95.5%
associate-/l*95.5%
fma-neg95.5%
*-commutative95.5%
distribute-rgt-neg-in95.5%
distribute-rgt-neg-in95.5%
metadata-eval95.5%
Applied egg-rr95.5%
unpow-195.5%
associate-/r*95.5%
metadata-eval95.5%
fma-define95.5%
+-commutative95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around 0 71.0%
if -1.9999999999999999e35 < (*.f64 x y) < 5.0000000000000002e-27Initial program 95.7%
Taylor expanded in x around 0 79.2%
if 9.99999999999999972e58 < (*.f64 x y) < 2.00000000000000015e70Initial program 100.0%
Taylor expanded in x around 0 100.0%
*-commutative100.0%
associate-/l*100.0%
Applied egg-rr100.0%
if 2.00000000000000015e70 < (*.f64 x y) Initial program 91.1%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
associate-/l*76.0%
associate-*l*76.0%
Simplified76.0%
Final simplification79.1%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* t (* z 9.0)))))
(if (<= t_1 1e+228)
(/ t_1 (* a 2.0))
(- (* x (/ y (* a 2.0))) (* (/ t a) (* z 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 t_1 = (x * y) - (t * (z * 9.0));
double tmp;
if (t_1 <= 1e+228) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (x * (y / (a * 2.0))) - ((t / a) * (z * 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) :: t_1
real(8) :: tmp
t_1 = (x * y) - (t * (z * 9.0d0))
if (t_1 <= 1d+228) then
tmp = t_1 / (a * 2.0d0)
else
tmp = (x * (y / (a * 2.0d0))) - ((t / a) * (z * 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 t_1 = (x * y) - (t * (z * 9.0));
double tmp;
if (t_1 <= 1e+228) {
tmp = t_1 / (a * 2.0);
} else {
tmp = (x * (y / (a * 2.0))) - ((t / a) * (z * 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): t_1 = (x * y) - (t * (z * 9.0)) tmp = 0 if t_1 <= 1e+228: tmp = t_1 / (a * 2.0) else: tmp = (x * (y / (a * 2.0))) - ((t / a) * (z * 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) t_1 = Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) tmp = 0.0 if (t_1 <= 1e+228) tmp = Float64(t_1 / Float64(a * 2.0)); else tmp = Float64(Float64(x * Float64(y / Float64(a * 2.0))) - Float64(Float64(t / a) * Float64(z * 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)
t_1 = (x * y) - (t * (z * 9.0));
tmp = 0.0;
if (t_1 <= 1e+228)
tmp = t_1 / (a * 2.0);
else
tmp = (x * (y / (a * 2.0))) - ((t / a) * (z * 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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+228], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot y - t \cdot \left(z \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq 10^{+228}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{a \cdot 2} - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 9.9999999999999992e227Initial program 96.9%
if 9.9999999999999992e227 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 78.7%
div-sub73.8%
associate-/l*78.4%
associate-/l*90.2%
Applied egg-rr90.2%
Taylor expanded in z around 0 78.5%
*-commutative78.5%
associate-*l/90.2%
associate-*l*90.2%
Simplified90.2%
Final simplification95.9%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= x -1.4e-39) (not (<= x 3.8e+15))) (* x (* y (/ 0.5 a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.4e-39) || !(x <= 3.8e+15)) {
tmp = x * (y * (0.5 / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((x <= (-1.4d-39)) .or. (.not. (x <= 3.8d+15))) then
tmp = x * (y * (0.5d0 / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.4e-39) || !(x <= 3.8e+15)) {
tmp = x * (y * (0.5 / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -1.4e-39) or not (x <= 3.8e+15): tmp = x * (y * (0.5 / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.4e-39) || !(x <= 3.8e+15)) tmp = Float64(x * Float64(y * Float64(0.5 / a))); else tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -1.4e-39) || ~((x <= 3.8e+15)))
tmp = x * (y * (0.5 / a));
else
tmp = -4.5 * ((z * t) / a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.4e-39], N[Not[LessEqual[x, 3.8e+15]], $MachinePrecision]], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-39} \lor \neg \left(x \leq 3.8 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -1.4000000000000001e-39 or 3.8e15 < x Initial program 92.2%
Taylor expanded in a around 0 92.2%
associate-*r/92.2%
cancel-sign-sub-inv92.2%
metadata-eval92.2%
*-commutative92.2%
associate-*r*92.2%
fma-define92.9%
associate-*l/92.9%
*-commutative92.9%
fma-define92.2%
+-commutative92.2%
fma-define93.0%
Simplified93.0%
Taylor expanded in t around 0 65.4%
associate-*r/65.4%
associate-*l/65.3%
*-commutative65.3%
associate-*l*63.7%
Simplified63.7%
if -1.4000000000000001e-39 < x < 3.8e15Initial program 96.2%
Taylor expanded in x around 0 71.8%
Final simplification67.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= x -5.8e-39) (* x (* 0.5 (/ y a))) (if (<= x 1.65e+15) (* -4.5 (/ (* z t) a)) (* x (* y (/ 0.5 a))))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.8e-39) {
tmp = x * (0.5 * (y / a));
} else if (x <= 1.65e+15) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-5.8d-39)) then
tmp = x * (0.5d0 * (y / a))
else if (x <= 1.65d+15) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = x * (y * (0.5d0 / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.8e-39) {
tmp = x * (0.5 * (y / a));
} else if (x <= 1.65e+15) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -5.8e-39: tmp = x * (0.5 * (y / a)) elif x <= 1.65e+15: tmp = -4.5 * ((z * t) / a) else: tmp = x * (y * (0.5 / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.8e-39) tmp = Float64(x * Float64(0.5 * Float64(y / a))); elseif (x <= 1.65e+15) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(x * Float64(y * Float64(0.5 / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -5.8e-39)
tmp = x * (0.5 * (y / a));
elseif (x <= 1.65e+15)
tmp = -4.5 * ((z * t) / a);
else
tmp = x * (y * (0.5 / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.8e-39], N[(x * N[(0.5 * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e+15], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-39}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \frac{y}{a}\right)\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+15}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\end{array}
\end{array}
if x < -5.79999999999999975e-39Initial program 93.3%
Taylor expanded in x around inf 66.4%
*-commutative66.4%
associate-/l*65.1%
associate-*l*65.1%
Simplified65.1%
if -5.79999999999999975e-39 < x < 1.65e15Initial program 96.2%
Taylor expanded in x around 0 71.8%
if 1.65e15 < x Initial program 91.0%
Taylor expanded in a around 0 91.0%
associate-*r/91.0%
cancel-sign-sub-inv91.0%
metadata-eval91.0%
*-commutative91.0%
associate-*r*91.0%
fma-define91.0%
associate-*l/90.9%
*-commutative90.9%
fma-define90.9%
+-commutative90.9%
fma-define92.4%
Simplified92.4%
Taylor expanded in t around 0 64.1%
associate-*r/64.1%
associate-*l/64.0%
*-commutative64.0%
associate-*l*62.1%
Simplified62.1%
Final simplification67.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= x -1.15e-38) (* (/ x 2.0) (/ y a)) (if (<= x 5e+17) (* -4.5 (/ (* z t) a)) (* x (* y (/ 0.5 a))))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.15e-38) {
tmp = (x / 2.0) * (y / a);
} else if (x <= 5e+17) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-1.15d-38)) then
tmp = (x / 2.0d0) * (y / a)
else if (x <= 5d+17) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = x * (y * (0.5d0 / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.15e-38) {
tmp = (x / 2.0) * (y / a);
} else if (x <= 5e+17) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = x * (y * (0.5 / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -1.15e-38: tmp = (x / 2.0) * (y / a) elif x <= 5e+17: tmp = -4.5 * ((z * t) / a) else: tmp = x * (y * (0.5 / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.15e-38) tmp = Float64(Float64(x / 2.0) * Float64(y / a)); elseif (x <= 5e+17) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(x * Float64(y * Float64(0.5 / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -1.15e-38)
tmp = (x / 2.0) * (y / a);
elseif (x <= 5e+17)
tmp = -4.5 * ((z * t) / a);
else
tmp = x * (y * (0.5 / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.15e-38], N[(N[(x / 2.0), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+17], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-38}:\\
\;\;\;\;\frac{x}{2} \cdot \frac{y}{a}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+17}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{0.5}{a}\right)\\
\end{array}
\end{array}
if x < -1.15000000000000001e-38Initial program 93.3%
clear-num93.2%
inv-pow93.2%
*-commutative93.2%
associate-/l*93.2%
fma-neg94.5%
*-commutative94.5%
distribute-rgt-neg-in94.5%
distribute-rgt-neg-in94.5%
metadata-eval94.5%
Applied egg-rr94.5%
unpow-194.5%
associate-/r*94.5%
metadata-eval94.5%
fma-define93.2%
+-commutative93.2%
fma-define93.3%
Simplified93.3%
Taylor expanded in t around 0 66.3%
div-inv66.3%
clear-num66.4%
metadata-eval66.4%
times-frac66.4%
*-un-lft-identity66.4%
*-commutative66.4%
*-commutative66.4%
times-frac65.1%
Applied egg-rr65.1%
if -1.15000000000000001e-38 < x < 5e17Initial program 96.2%
Taylor expanded in x around 0 71.8%
if 5e17 < x Initial program 91.0%
Taylor expanded in a around 0 91.0%
associate-*r/91.0%
cancel-sign-sub-inv91.0%
metadata-eval91.0%
*-commutative91.0%
associate-*r*91.0%
fma-define91.0%
associate-*l/90.9%
*-commutative90.9%
fma-define90.9%
+-commutative90.9%
fma-define92.4%
Simplified92.4%
Taylor expanded in t around 0 64.1%
associate-*r/64.1%
associate-*l/64.0%
*-commutative64.0%
associate-*l*62.1%
Simplified62.1%
Final simplification67.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 (/ (- (* x y) (* t (* z 9.0))) (* 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) {
return ((x * y) - (t * (z * 9.0))) / (a * 2.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.
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) - (t * (z * 9.0d0))) / (a * 2.0d0)
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - (t * (z * 9.0))) / (a * 2.0);
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return ((x * y) - (t * (z * 9.0))) / (a * 2.0)
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(t * Float64(z * 9.0))) / Float64(a * 2.0)) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = ((x * y) - (t * (z * 9.0))) / (a * 2.0);
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(t * N[(z * 9.0), $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])\\
\\
\frac{x \cdot y - t \cdot \left(z \cdot 9\right)}{a \cdot 2}
\end{array}
Initial program 94.0%
Final simplification94.0%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= y 4.3e+79) (* -4.5 (/ (* z t) a)) (* -4.5 (* z (/ t a)))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.3e+79) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 4.3d+79) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.3e+79) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if y <= 4.3e+79: tmp = -4.5 * ((z * t) / a) else: tmp = -4.5 * (z * (t / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (y <= 4.3e+79) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (y <= 4.3e+79)
tmp = -4.5 * ((z * t) / a);
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.3e+79], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{+79}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if y < 4.3000000000000003e79Initial program 93.5%
Taylor expanded in x around 0 55.2%
if 4.3000000000000003e79 < y Initial program 96.0%
Taylor expanded in x around 0 30.7%
*-commutative30.7%
associate-/l*29.3%
Applied egg-rr29.3%
Final simplification50.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 (* -4.5 (* z (/ t a))))
assert(x < y && y < z && z < t && t < a);
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (-4.5d0) * (z * (t / a))
end function
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (z * (t / a));
}
[x, y, z, t, a] = sort([x, y, z, t, a]) [x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -4.5 * (z * (t / a))
x, y, z, t, a = sort([x, y, z, t, a]) x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(z * Float64(t / a))) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (z * (t / a));
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 94.0%
Taylor expanded in x around 0 50.3%
*-commutative50.3%
associate-/l*48.4%
Applied egg-rr48.4%
Final simplification48.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 2024040
(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)))