
(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.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* x y) (* t (* z 9.0)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+301)))
(+ (* y (/ x (* a 2.0))) (* -4.5 (* z (/ t a))))
(/ t_1 (* a 2.0)))))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 <= -((double) INFINITY)) || !(t_1 <= 4e+301)) {
tmp = (y * (x / (a * 2.0))) + (-4.5 * (z * (t / a)));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+301)) {
tmp = (y * (x / (a * 2.0))) + (-4.5 * (z * (t / a)));
} else {
tmp = t_1 / (a * 2.0);
}
return tmp;
}
[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 <= -math.inf) or not (t_1 <= 4e+301): tmp = (y * (x / (a * 2.0))) + (-4.5 * (z * (t / a))) else: tmp = t_1 / (a * 2.0) return tmp
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 <= Float64(-Inf)) || !(t_1 <= 4e+301)) tmp = Float64(Float64(y * Float64(x / Float64(a * 2.0))) + Float64(-4.5 * Float64(z * Float64(t / a)))); else tmp = Float64(t_1 / Float64(a * 2.0)); end return tmp end
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 <= -Inf) || ~((t_1 <= 4e+301)))
tmp = (y * (x / (a * 2.0))) + (-4.5 * (z * (t / a)));
else
tmp = t_1 / (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.
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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+301]], $MachinePrecision]], N[(N[(y * N[(x / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[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 -\infty \lor \neg \left(t\_1 \leq 4 \cdot 10^{+301}\right):\\
\;\;\;\;y \cdot \frac{x}{a \cdot 2} + -4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a \cdot 2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < -inf.0 or 4.00000000000000021e301 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) Initial program 67.7%
div-sub66.1%
*-commutative66.1%
div-sub67.7%
*-commutative67.7%
cancel-sign-sub-inv67.7%
fma-def69.3%
distribute-lft-neg-in69.3%
associate-*l*69.3%
distribute-rgt-neg-in69.3%
*-commutative69.3%
distribute-rgt-neg-in69.3%
metadata-eval69.3%
Simplified69.3%
*-commutative69.3%
metadata-eval69.3%
distribute-lft-neg-in69.3%
distribute-rgt-neg-in69.3%
fma-neg67.7%
associate-*r*67.7%
*-commutative67.7%
associate-*l*67.7%
Applied egg-rr67.7%
div-sub66.1%
sub-neg66.1%
associate-/l*76.6%
frac-2neg76.6%
distribute-frac-neg76.6%
*-commutative76.6%
distribute-rgt-neg-in76.6%
*-commutative76.6%
metadata-eval76.6%
associate-*r*76.6%
frac-2neg76.6%
associate-*r*76.6%
*-commutative76.6%
times-frac76.6%
metadata-eval76.6%
associate-*r/93.3%
associate-*l*93.3%
Applied egg-rr93.3%
associate-/r/91.6%
associate-*r*91.6%
*-commutative91.6%
Simplified91.6%
if -inf.0 < (-.f64 (*.f64 x y) (*.f64 (*.f64 z 9) t)) < 4.00000000000000021e301Initial program 98.5%
Final simplification96.9%
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 (<= (* a 2.0) 2e-64) (/ (fma x y (* z (* t -9.0))) (* a 2.0)) (fma -4.5 (/ t (/ a z)) (* 0.5 (/ x (/ a y))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 2.0) <= 2e-64) {
tmp = fma(x, y, (z * (t * -9.0))) / (a * 2.0);
} else {
tmp = fma(-4.5, (t / (a / z)), (0.5 * (x / (a / y))));
}
return tmp;
}
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 2.0) <= 2e-64) tmp = Float64(fma(x, y, Float64(z * Float64(t * -9.0))) / Float64(a * 2.0)); else tmp = fma(-4.5, Float64(t / Float64(a / z)), Float64(0.5 * Float64(x / Float64(a / y)))); end return tmp end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 2.0), $MachinePrecision], 2e-64], N[(N[(x * y + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 2 \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t \cdot -9\right)\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4.5, \frac{t}{\frac{a}{z}}, 0.5 \cdot \frac{x}{\frac{a}{y}}\right)\\
\end{array}
\end{array}
if (*.f64 a 2) < 1.99999999999999993e-64Initial program 92.6%
div-sub89.9%
*-commutative89.9%
div-sub92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
fma-def93.2%
distribute-lft-neg-in93.2%
associate-*l*93.2%
distribute-rgt-neg-in93.2%
*-commutative93.2%
distribute-rgt-neg-in93.2%
metadata-eval93.2%
Simplified93.2%
if 1.99999999999999993e-64 < (*.f64 a 2) Initial program 87.2%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around 0 87.0%
fma-def87.0%
associate-/l*93.0%
associate-/l*94.3%
Simplified94.3%
Final simplification93.5%
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 (/ x (/ a y)))))
(if (<= (* x y) -2e+17)
t_1
(if (<= (* x y) 5e-113)
(/ (* t (* z -4.5)) a)
(if (<= (* x y) 2e+15)
(/ (* x (* y 0.5)) a)
(if (<= (* x y) 7e+99) (* t (* -4.5 (/ z a))) t_1))))))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 * (x / (a / y));
double tmp;
if ((x * y) <= -2e+17) {
tmp = t_1;
} else if ((x * y) <= 5e-113) {
tmp = (t * (z * -4.5)) / a;
} else if ((x * y) <= 2e+15) {
tmp = (x * (y * 0.5)) / a;
} else if ((x * y) <= 7e+99) {
tmp = t * (-4.5 * (z / a));
} else {
tmp = t_1;
}
return tmp;
}
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 * (x / (a / y))
if ((x * y) <= (-2d+17)) then
tmp = t_1
else if ((x * y) <= 5d-113) then
tmp = (t * (z * (-4.5d0))) / a
else if ((x * y) <= 2d+15) then
tmp = (x * (y * 0.5d0)) / a
else if ((x * y) <= 7d+99) then
tmp = t * ((-4.5d0) * (z / a))
else
tmp = t_1
end if
code = tmp
end function
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 * (x / (a / y));
double tmp;
if ((x * y) <= -2e+17) {
tmp = t_1;
} else if ((x * y) <= 5e-113) {
tmp = (t * (z * -4.5)) / a;
} else if ((x * y) <= 2e+15) {
tmp = (x * (y * 0.5)) / a;
} else if ((x * y) <= 7e+99) {
tmp = t * (-4.5 * (z / a));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = 0.5 * (x / (a / y)) tmp = 0 if (x * y) <= -2e+17: tmp = t_1 elif (x * y) <= 5e-113: tmp = (t * (z * -4.5)) / a elif (x * y) <= 2e+15: tmp = (x * (y * 0.5)) / a elif (x * y) <= 7e+99: tmp = t * (-4.5 * (z / a)) else: tmp = t_1 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(x / Float64(a / y))) tmp = 0.0 if (Float64(x * y) <= -2e+17) tmp = t_1; elseif (Float64(x * y) <= 5e-113) tmp = Float64(Float64(t * Float64(z * -4.5)) / a); elseif (Float64(x * y) <= 2e+15) tmp = Float64(Float64(x * Float64(y * 0.5)) / a); elseif (Float64(x * y) <= 7e+99) tmp = Float64(t * Float64(-4.5 * Float64(z / a))); else tmp = t_1; end return tmp end
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 * (x / (a / y));
tmp = 0.0;
if ((x * y) <= -2e+17)
tmp = t_1;
elseif ((x * y) <= 5e-113)
tmp = (t * (z * -4.5)) / a;
elseif ((x * y) <= 2e+15)
tmp = (x * (y * 0.5)) / a;
elseif ((x * y) <= 7e+99)
tmp = t * (-4.5 * (z / a));
else
tmp = t_1;
end
tmp_2 = tmp;
end
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[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+17], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-113], N[(N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+99], N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-113}:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -4.5\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot 0.5\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+99}:\\
\;\;\;\;t \cdot \left(-4.5 \cdot \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2e17 or 6.9999999999999995e99 < (*.f64 x y) Initial program 86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in x around inf 74.0%
associate-/l*75.7%
Simplified75.7%
if -2e17 < (*.f64 x y) < 4.9999999999999997e-113Initial program 95.1%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around 0 77.2%
associate-/l*73.4%
Simplified73.4%
*-commutative73.4%
associate-/r/75.7%
associate-*r*75.6%
associate-*l/77.2%
Applied egg-rr77.2%
if 4.9999999999999997e-113 < (*.f64 x y) < 2e15Initial program 99.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in x around inf 70.9%
associate-*r/70.9%
*-commutative70.9%
associate-*r*70.9%
Simplified70.9%
if 2e15 < (*.f64 x y) < 6.9999999999999995e99Initial program 93.1%
associate-*l*93.2%
Simplified93.2%
div-sub86.1%
sub-neg86.1%
*-commutative86.1%
times-frac86.2%
div-inv86.1%
associate-*r*85.9%
*-commutative85.9%
associate-*l*86.2%
*-commutative86.2%
associate-/r*86.2%
metadata-eval86.2%
Applied egg-rr86.2%
sub-neg86.2%
*-commutative86.2%
associate-*l/86.2%
associate-*l/86.1%
*-commutative86.1%
*-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
metadata-eval86.1%
Simplified86.1%
Taylor expanded in x around 0 66.4%
associate-*r/72.8%
*-commutative72.8%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Final simplification75.9%
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 (/ x (/ a y)))))
(if (<= (* x y) -2e+17)
t_1
(if (<= (* x y) 5e-113)
(/ (* t (* z -9.0)) (* a 2.0))
(if (<= (* x y) 2e+15)
(/ (* x (* y 0.5)) a)
(if (<= (* x y) 7e+99) (* t (* -4.5 (/ z a))) t_1))))))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 * (x / (a / y));
double tmp;
if ((x * y) <= -2e+17) {
tmp = t_1;
} else if ((x * y) <= 5e-113) {
tmp = (t * (z * -9.0)) / (a * 2.0);
} else if ((x * y) <= 2e+15) {
tmp = (x * (y * 0.5)) / a;
} else if ((x * y) <= 7e+99) {
tmp = t * (-4.5 * (z / a));
} else {
tmp = t_1;
}
return tmp;
}
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 * (x / (a / y))
if ((x * y) <= (-2d+17)) then
tmp = t_1
else if ((x * y) <= 5d-113) then
tmp = (t * (z * (-9.0d0))) / (a * 2.0d0)
else if ((x * y) <= 2d+15) then
tmp = (x * (y * 0.5d0)) / a
else if ((x * y) <= 7d+99) then
tmp = t * ((-4.5d0) * (z / a))
else
tmp = t_1
end if
code = tmp
end function
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 * (x / (a / y));
double tmp;
if ((x * y) <= -2e+17) {
tmp = t_1;
} else if ((x * y) <= 5e-113) {
tmp = (t * (z * -9.0)) / (a * 2.0);
} else if ((x * y) <= 2e+15) {
tmp = (x * (y * 0.5)) / a;
} else if ((x * y) <= 7e+99) {
tmp = t * (-4.5 * (z / a));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = 0.5 * (x / (a / y)) tmp = 0 if (x * y) <= -2e+17: tmp = t_1 elif (x * y) <= 5e-113: tmp = (t * (z * -9.0)) / (a * 2.0) elif (x * y) <= 2e+15: tmp = (x * (y * 0.5)) / a elif (x * y) <= 7e+99: tmp = t * (-4.5 * (z / a)) else: tmp = t_1 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(x / Float64(a / y))) tmp = 0.0 if (Float64(x * y) <= -2e+17) tmp = t_1; elseif (Float64(x * y) <= 5e-113) tmp = Float64(Float64(t * Float64(z * -9.0)) / Float64(a * 2.0)); elseif (Float64(x * y) <= 2e+15) tmp = Float64(Float64(x * Float64(y * 0.5)) / a); elseif (Float64(x * y) <= 7e+99) tmp = Float64(t * Float64(-4.5 * Float64(z / a))); else tmp = t_1; end return tmp end
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 * (x / (a / y));
tmp = 0.0;
if ((x * y) <= -2e+17)
tmp = t_1;
elseif ((x * y) <= 5e-113)
tmp = (t * (z * -9.0)) / (a * 2.0);
elseif ((x * y) <= 2e+15)
tmp = (x * (y * 0.5)) / a;
elseif ((x * y) <= 7e+99)
tmp = t * (-4.5 * (z / a));
else
tmp = t_1;
end
tmp_2 = tmp;
end
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[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+17], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-113], N[(N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(N[(x * N[(y * 0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+99], N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-113}:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -9\right)}{a \cdot 2}\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot 0.5\right)}{a}\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+99}:\\
\;\;\;\;t \cdot \left(-4.5 \cdot \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2e17 or 6.9999999999999995e99 < (*.f64 x y) Initial program 86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in x around inf 74.0%
associate-/l*75.7%
Simplified75.7%
if -2e17 < (*.f64 x y) < 4.9999999999999997e-113Initial program 95.1%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around 0 77.2%
*-commutative77.2%
associate-*r*77.2%
*-commutative77.2%
*-commutative77.2%
Simplified77.2%
if 4.9999999999999997e-113 < (*.f64 x y) < 2e15Initial program 99.5%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in x around inf 70.9%
associate-*r/70.9%
*-commutative70.9%
associate-*r*70.9%
Simplified70.9%
if 2e15 < (*.f64 x y) < 6.9999999999999995e99Initial program 93.1%
associate-*l*93.2%
Simplified93.2%
div-sub86.1%
sub-neg86.1%
*-commutative86.1%
times-frac86.2%
div-inv86.1%
associate-*r*85.9%
*-commutative85.9%
associate-*l*86.2%
*-commutative86.2%
associate-/r*86.2%
metadata-eval86.2%
Applied egg-rr86.2%
sub-neg86.2%
*-commutative86.2%
associate-*l/86.2%
associate-*l/86.1%
*-commutative86.1%
*-commutative86.1%
associate-*l*86.1%
*-commutative86.1%
metadata-eval86.1%
Simplified86.1%
Taylor expanded in x around 0 66.4%
associate-*r/72.8%
*-commutative72.8%
associate-*r*73.0%
*-commutative73.0%
Simplified73.0%
Final simplification75.9%
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 (* t (* z 9.0))))
(if (<= t_1 (- INFINITY))
(* t (* -4.5 (/ z a)))
(if (<= t_1 5e+240)
(/ (- (* x y) t_1) (* a 2.0))
(* -4.5 (/ t (/ a z)))))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (z * 9.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t * (-4.5 * (z / a));
} else if (t_1 <= 5e+240) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
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 = t * (z * 9.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t * (-4.5 * (z / a));
} else if (t_1 <= 5e+240) {
tmp = ((x * y) - t_1) / (a * 2.0);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = t * (z * 9.0) tmp = 0 if t_1 <= -math.inf: tmp = t * (-4.5 * (z / a)) elif t_1 <= 5e+240: tmp = ((x * y) - t_1) / (a * 2.0) else: tmp = -4.5 * (t / (a / z)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(t * Float64(z * 9.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t * Float64(-4.5 * Float64(z / a))); elseif (t_1 <= 5e+240) tmp = Float64(Float64(Float64(x * y) - t_1) / Float64(a * 2.0)); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = t * (z * 9.0);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = t * (-4.5 * (z / a));
elseif (t_1 <= 5e+240)
tmp = ((x * y) - t_1) / (a * 2.0);
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
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[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t * N[(-4.5 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+240], N[(N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t \cdot \left(-4.5 \cdot \frac{z}{a}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+240}:\\
\;\;\;\;\frac{x \cdot y - t\_1}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 z 9) t) < -inf.0Initial program 53.2%
associate-*l*53.2%
Simplified53.2%
div-sub53.2%
sub-neg53.2%
*-commutative53.2%
times-frac46.1%
div-inv46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*l*46.1%
*-commutative46.1%
associate-/r*46.1%
metadata-eval46.1%
Applied egg-rr46.1%
sub-neg46.1%
*-commutative46.1%
associate-*l/46.1%
associate-*l/46.1%
*-commutative46.1%
*-commutative46.1%
associate-*l*46.1%
*-commutative46.1%
metadata-eval46.1%
Simplified46.1%
Taylor expanded in x around 0 53.2%
associate-*r/92.3%
*-commutative92.3%
associate-*r*92.6%
*-commutative92.6%
Simplified92.6%
if -inf.0 < (*.f64 (*.f64 z 9) t) < 5.0000000000000003e240Initial program 95.2%
if 5.0000000000000003e240 < (*.f64 (*.f64 z 9) t) Initial program 78.2%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in x around 0 81.9%
associate-/l*96.5%
Simplified96.5%
Final simplification95.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* 0.5 (/ y (/ a x))) (/ (- (* x y) (* 9.0 (* z t))) (* a 2.0))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y / (a / x)) else: tmp = ((x * y) - (9.0 * (z * t))) / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y / Float64(a / x))); else tmp = Float64(Float64(Float64(x * y) - Float64(9.0 * Float64(z * t))) / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y / (a / x));
else
tmp = ((x * y) - (9.0 * (z * 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. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - 9 \cdot \left(z \cdot t\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 62.6%
associate-*l*62.6%
Simplified62.6%
Taylor expanded in x around inf 69.2%
associate-*r/97.1%
Simplified97.1%
associate-*r/69.2%
*-commutative69.2%
associate-/l*97.2%
Applied egg-rr97.2%
if -inf.0 < (*.f64 x y) Initial program 92.9%
div-sub90.9%
*-commutative90.9%
div-sub92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
fma-def93.4%
distribute-lft-neg-in93.4%
associate-*l*93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
distribute-rgt-neg-in93.4%
metadata-eval93.4%
Simplified93.4%
*-commutative93.4%
metadata-eval93.4%
distribute-lft-neg-in93.4%
distribute-rgt-neg-in93.4%
fma-neg93.0%
associate-*r*92.9%
*-commutative92.9%
associate-*l*93.0%
Applied egg-rr93.0%
Final simplification93.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* 0.5 (/ y (/ a x))) (/ (- (* x y) (* z (* t 9.0))) (* a 2.0))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = 0.5 * (y / (a / x));
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = 0.5 * (y / (a / x)) else: tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(0.5 * Float64(y / Float64(a / x))); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -Inf)
tmp = 0.5 * (y / (a / x));
else
tmp = ((x * y) - (z * (t * 9.0))) / (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. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 62.6%
associate-*l*62.6%
Simplified62.6%
Taylor expanded in x around inf 69.2%
associate-*r/97.1%
Simplified97.1%
associate-*r/69.2%
*-commutative69.2%
associate-/l*97.2%
Applied egg-rr97.2%
if -inf.0 < (*.f64 x y) Initial program 92.9%
associate-*l*93.0%
Simplified93.0%
Final simplification93.2%
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 -3.5e-65) (not (<= x 1.04e-29))) (* 0.5 (* x (/ y a))) (* -4.5 (/ (* z 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 <= -3.5e-65) || !(x <= 1.04e-29)) {
tmp = 0.5 * (x * (y / 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.
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 <= (-3.5d-65)) .or. (.not. (x <= 1.04d-29))) then
tmp = 0.5d0 * (x * (y / a))
else
tmp = (-4.5d0) * ((z * t) / a)
end if
code = tmp
end function
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 <= -3.5e-65) || !(x <= 1.04e-29)) {
tmp = 0.5 * (x * (y / a));
} else {
tmp = -4.5 * ((z * t) / a);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (x <= -3.5e-65) or not (x <= 1.04e-29): tmp = 0.5 * (x * (y / a)) else: tmp = -4.5 * ((z * t) / a) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((x <= -3.5e-65) || !(x <= 1.04e-29)) tmp = Float64(0.5 * Float64(x * Float64(y / 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])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x <= -3.5e-65) || ~((x <= 1.04e-29)))
tmp = 0.5 * (x * (y / 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. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -3.5e-65], N[Not[LessEqual[x, 1.04e-29]], $MachinePrecision]], N[(0.5 * N[(x * N[(y / 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-65} \lor \neg \left(x \leq 1.04 \cdot 10^{-29}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -3.50000000000000005e-65 or 1.03999999999999995e-29 < x Initial program 88.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in x around inf 62.8%
associate-*r/63.6%
Simplified63.6%
if -3.50000000000000005e-65 < x < 1.03999999999999995e-29Initial program 95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 70.3%
Final simplification66.2%
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 -2.95e-80) (* 0.5 (* x (/ y a))) (if (<= x 2.85e-29) (* -4.5 (/ (* z t) a)) (* 0.5 (* y (/ x a))))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.95e-80) {
tmp = 0.5 * (x * (y / a));
} else if (x <= 2.85e-29) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.95d-80)) then
tmp = 0.5d0 * (x * (y / a))
else if (x <= 2.85d-29) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = 0.5d0 * (y * (x / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.95e-80) {
tmp = 0.5 * (x * (y / a));
} else if (x <= 2.85e-29) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -2.95e-80: tmp = 0.5 * (x * (y / a)) elif x <= 2.85e-29: tmp = -4.5 * ((z * t) / a) else: tmp = 0.5 * (y * (x / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.95e-80) tmp = Float64(0.5 * Float64(x * Float64(y / a))); elseif (x <= 2.85e-29) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(0.5 * Float64(y * Float64(x / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -2.95e-80)
tmp = 0.5 * (x * (y / a));
elseif (x <= 2.85e-29)
tmp = -4.5 * ((z * t) / a);
else
tmp = 0.5 * (y * (x / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.95e-80], N[(0.5 * N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.85e-29], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.95 \cdot 10^{-80}:\\
\;\;\;\;0.5 \cdot \left(x \cdot \frac{y}{a}\right)\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{-29}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if x < -2.95e-80Initial program 87.4%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in x around inf 65.2%
associate-*r/64.6%
Simplified64.6%
if -2.95e-80 < x < 2.85e-29Initial program 96.6%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in x around 0 71.0%
if 2.85e-29 < x Initial program 88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in x around inf 59.2%
associate-/l*61.7%
Simplified61.7%
associate-/r/63.0%
Applied egg-rr63.0%
Final simplification66.6%
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 -9.2e-65) (* 0.5 (/ x (/ a y))) (if (<= x 1.72e-19) (* -4.5 (/ (* z t) a)) (* 0.5 (* y (/ x 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 <= -9.2e-65) {
tmp = 0.5 * (x / (a / y));
} else if (x <= 1.72e-19) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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 <= (-9.2d-65)) then
tmp = 0.5d0 * (x / (a / y))
else if (x <= 1.72d-19) then
tmp = (-4.5d0) * ((z * t) / a)
else
tmp = 0.5d0 * (y * (x / a))
end if
code = tmp
end function
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 <= -9.2e-65) {
tmp = 0.5 * (x / (a / y));
} else if (x <= 1.72e-19) {
tmp = -4.5 * ((z * t) / a);
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -9.2e-65: tmp = 0.5 * (x / (a / y)) elif x <= 1.72e-19: tmp = -4.5 * ((z * t) / a) else: tmp = 0.5 * (y * (x / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -9.2e-65) tmp = Float64(0.5 * Float64(x / Float64(a / y))); elseif (x <= 1.72e-19) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); else tmp = Float64(0.5 * Float64(y * Float64(x / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -9.2e-65)
tmp = 0.5 * (x / (a / y));
elseif (x <= 1.72e-19)
tmp = -4.5 * ((z * t) / a);
else
tmp = 0.5 * (y * (x / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -9.2e-65], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.72e-19], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{-65}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \leq 1.72 \cdot 10^{-19}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if x < -9.1999999999999999e-65Initial program 88.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in x around inf 66.0%
associate-/l*66.1%
Simplified66.1%
if -9.1999999999999999e-65 < x < 1.72000000000000004e-19Initial program 95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around 0 69.8%
if 1.72000000000000004e-19 < x Initial program 88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in x around inf 58.6%
associate-/l*61.2%
Simplified61.2%
associate-/r/62.4%
Applied egg-rr62.4%
Final simplification66.5%
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 -6.5e-65) (* 0.5 (/ x (/ a y))) (if (<= x 1.28e-17) (/ (* t (* z -4.5)) a) (* 0.5 (* y (/ x 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 <= -6.5e-65) {
tmp = 0.5 * (x / (a / y));
} else if (x <= 1.28e-17) {
tmp = (t * (z * -4.5)) / a;
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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 <= (-6.5d-65)) then
tmp = 0.5d0 * (x / (a / y))
else if (x <= 1.28d-17) then
tmp = (t * (z * (-4.5d0))) / a
else
tmp = 0.5d0 * (y * (x / a))
end if
code = tmp
end function
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 <= -6.5e-65) {
tmp = 0.5 * (x / (a / y));
} else if (x <= 1.28e-17) {
tmp = (t * (z * -4.5)) / a;
} else {
tmp = 0.5 * (y * (x / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -6.5e-65: tmp = 0.5 * (x / (a / y)) elif x <= 1.28e-17: tmp = (t * (z * -4.5)) / a else: tmp = 0.5 * (y * (x / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -6.5e-65) tmp = Float64(0.5 * Float64(x / Float64(a / y))); elseif (x <= 1.28e-17) tmp = Float64(Float64(t * Float64(z * -4.5)) / a); else tmp = Float64(0.5 * Float64(y * Float64(x / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -6.5e-65)
tmp = 0.5 * (x / (a / y));
elseif (x <= 1.28e-17)
tmp = (t * (z * -4.5)) / a;
else
tmp = 0.5 * (y * (x / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6.5e-65], N[(0.5 * N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.28e-17], N[(N[(t * N[(z * -4.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(0.5 * N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-65}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{a}{y}}\\
\mathbf{elif}\;x \leq 1.28 \cdot 10^{-17}:\\
\;\;\;\;\frac{t \cdot \left(z \cdot -4.5\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(y \cdot \frac{x}{a}\right)\\
\end{array}
\end{array}
if x < -6.5e-65Initial program 88.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in x around inf 66.0%
associate-/l*66.1%
Simplified66.1%
if -6.5e-65 < x < 1.28e-17Initial program 95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around 0 69.8%
associate-/l*68.1%
Simplified68.1%
*-commutative68.1%
associate-/r/71.0%
associate-*r*71.0%
associate-*l/69.8%
Applied egg-rr69.8%
if 1.28e-17 < x Initial program 88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in x around inf 58.6%
associate-/l*61.2%
Simplified61.2%
associate-/r/62.4%
Applied egg-rr62.4%
Final simplification66.5%
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-290) (* -4.5 (/ t (/ a z))) (* -4.5 (* z (/ 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-290) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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-290)) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (-4.5d0) * (z * (t / a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -5.8e-290) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = -4.5 * (z * (t / a));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if x <= -5.8e-290: tmp = -4.5 * (t / (a / z)) else: tmp = -4.5 * (z * (t / a)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -5.8e-290) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(-4.5 * Float64(z * Float64(t / a))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -5.8e-290)
tmp = -4.5 * (t / (a / z));
else
tmp = -4.5 * (z * (t / a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -5.8e-290], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-290}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\end{array}
\end{array}
if x < -5.79999999999999989e-290Initial program 88.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in x around 0 39.8%
associate-/l*42.5%
Simplified42.5%
if -5.79999999999999989e-290 < x Initial program 93.3%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around 0 55.9%
associate-/l*54.5%
associate-/r/54.5%
Simplified54.5%
Final simplification48.7%
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 -2.4e-76) (* -4.5 (* z (/ t a))) (* -4.5 (/ (* z t) a))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.4e-76) {
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.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-2.4d-76)) 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;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.4e-76) {
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]) def code(x, y, z, t, a): tmp = 0 if x <= -2.4e-76: 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]) function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.4e-76) tmp = Float64(-4.5 * Float64(z * Float64(t / 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])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (x <= -2.4e-76)
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. code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.4e-76], N[(-4.5 * N[(z * N[(t / 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-76}:\\
\;\;\;\;-4.5 \cdot \left(z \cdot \frac{t}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\end{array}
\end{array}
if x < -2.40000000000000013e-76Initial program 88.3%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in x around 0 32.3%
associate-/l*36.0%
associate-/r/36.8%
Simplified36.8%
if -2.40000000000000013e-76 < x Initial program 92.5%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around 0 55.6%
Final simplification49.5%
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);
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.
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;
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]) def code(x, y, z, t, a): return -4.5 * (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])){:}
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. 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])\\
\\
-4.5 \cdot \left(z \cdot \frac{t}{a}\right)
\end{array}
Initial program 91.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in x around 0 48.1%
associate-/l*48.7%
associate-/r/50.0%
Simplified50.0%
Final simplification50.0%
(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 2024027
(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)))