
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -5.4e+43)
(/ (* x (- (/ (+ (/ b z) (* a (* t -4.0))) x) (* -9.0 (/ y z)))) c)
(if (<= z 1e-11)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (- (+ (/ b z) (* 9.0 (/ (* y x) z))) (* 4.0 (* a t))) c))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -5.4e+43) {
tmp = (x * ((((b / z) + (a * (t * -4.0))) / x) - (-9.0 * (y / z)))) / c;
} else if (z <= 1e-11) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-5.4d+43)) then
tmp = (x * ((((b / z) + (a * (t * (-4.0d0)))) / x) - ((-9.0d0) * (y / z)))) / c
else if (z <= 1d-11) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = (((b / z) + (9.0d0 * ((y * x) / z))) - (4.0d0 * (a * t))) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -5.4e+43) {
tmp = (x * ((((b / z) + (a * (t * -4.0))) / x) - (-9.0 * (y / z)))) / c;
} else if (z <= 1e-11) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -5.4e+43: tmp = (x * ((((b / z) + (a * (t * -4.0))) / x) - (-9.0 * (y / z)))) / c elif z <= 1e-11: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -5.4e+43) tmp = Float64(Float64(x * Float64(Float64(Float64(Float64(b / z) + Float64(a * Float64(t * -4.0))) / x) - Float64(-9.0 * Float64(y / z)))) / c); elseif (z <= 1e-11) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(y * x) / z))) - Float64(4.0 * Float64(a * t))) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -5.4e+43)
tmp = (x * ((((b / z) + (a * (t * -4.0))) / x) - (-9.0 * (y / z)))) / c;
elseif (z <= 1e-11)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -5.4e+43], N[(N[(x * N[(N[(N[(N[(b / z), $MachinePrecision] + N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - N[(-9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1e-11], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+43}:\\
\;\;\;\;\frac{x \cdot \left(\frac{\frac{b}{z} + a \cdot \left(t \cdot -4\right)}{x} - -9 \cdot \frac{y}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 10^{-11}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{b}{z} + 9 \cdot \frac{y \cdot x}{z}\right) - 4 \cdot \left(a \cdot t\right)}{c}\\
\end{array}
\end{array}
if z < -5.4000000000000004e43Initial program 70.2%
associate-+l-70.2%
*-commutative70.2%
associate-*r*63.0%
*-commutative63.0%
associate-+l-63.0%
associate-*l*63.0%
associate-*l*72.5%
*-commutative72.5%
Simplified72.5%
associate-+l-72.5%
div-sub70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*l*70.7%
*-commutative70.7%
associate-*l*70.7%
Applied egg-rr70.7%
Taylor expanded in c around 0 86.5%
Taylor expanded in x around -inf 89.9%
mul-1-neg89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
mul-1-neg89.9%
unsub-neg89.9%
cancel-sign-sub-inv89.9%
metadata-eval89.9%
*-commutative89.9%
associate-*l*90.0%
Simplified90.0%
if -5.4000000000000004e43 < z < 9.99999999999999939e-12Initial program 93.9%
if 9.99999999999999939e-12 < z Initial program 59.7%
associate-+l-59.7%
*-commutative59.7%
associate-*r*61.2%
*-commutative61.2%
associate-+l-61.2%
associate-*l*61.3%
associate-*l*62.8%
*-commutative62.8%
Simplified62.8%
associate-+l-62.8%
div-sub62.9%
associate-*r*62.8%
*-commutative62.8%
associate-*l*62.8%
*-commutative62.8%
associate-*l*62.8%
Applied egg-rr62.8%
Taylor expanded in c around 0 91.4%
Final simplification92.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (/ (* t -4.0) c))))
(if (<= x -3.1e+105)
(* 9.0 (* x (/ (/ y z) c)))
(if (<= x -3.2e+18)
t_1
(if (<= x -3.7e-183)
(* b (/ 1.0 (* z c)))
(if (<= x -4.9e-273)
t_1
(if (<= x 3.8e-221)
(/ b (* z c))
(if (<= x 3.7e-60) t_1 (* 9.0 (* x (/ (/ y c) z)))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * ((t * -4.0) / c);
double tmp;
if (x <= -3.1e+105) {
tmp = 9.0 * (x * ((y / z) / c));
} else if (x <= -3.2e+18) {
tmp = t_1;
} else if (x <= -3.7e-183) {
tmp = b * (1.0 / (z * c));
} else if (x <= -4.9e-273) {
tmp = t_1;
} else if (x <= 3.8e-221) {
tmp = b / (z * c);
} else if (x <= 3.7e-60) {
tmp = t_1;
} else {
tmp = 9.0 * (x * ((y / c) / z));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = a * ((t * (-4.0d0)) / c)
if (x <= (-3.1d+105)) then
tmp = 9.0d0 * (x * ((y / z) / c))
else if (x <= (-3.2d+18)) then
tmp = t_1
else if (x <= (-3.7d-183)) then
tmp = b * (1.0d0 / (z * c))
else if (x <= (-4.9d-273)) then
tmp = t_1
else if (x <= 3.8d-221) then
tmp = b / (z * c)
else if (x <= 3.7d-60) then
tmp = t_1
else
tmp = 9.0d0 * (x * ((y / c) / z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * ((t * -4.0) / c);
double tmp;
if (x <= -3.1e+105) {
tmp = 9.0 * (x * ((y / z) / c));
} else if (x <= -3.2e+18) {
tmp = t_1;
} else if (x <= -3.7e-183) {
tmp = b * (1.0 / (z * c));
} else if (x <= -4.9e-273) {
tmp = t_1;
} else if (x <= 3.8e-221) {
tmp = b / (z * c);
} else if (x <= 3.7e-60) {
tmp = t_1;
} else {
tmp = 9.0 * (x * ((y / c) / z));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = a * ((t * -4.0) / c) tmp = 0 if x <= -3.1e+105: tmp = 9.0 * (x * ((y / z) / c)) elif x <= -3.2e+18: tmp = t_1 elif x <= -3.7e-183: tmp = b * (1.0 / (z * c)) elif x <= -4.9e-273: tmp = t_1 elif x <= 3.8e-221: tmp = b / (z * c) elif x <= 3.7e-60: tmp = t_1 else: tmp = 9.0 * (x * ((y / c) / z)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(Float64(t * -4.0) / c)) tmp = 0.0 if (x <= -3.1e+105) tmp = Float64(9.0 * Float64(x * Float64(Float64(y / z) / c))); elseif (x <= -3.2e+18) tmp = t_1; elseif (x <= -3.7e-183) tmp = Float64(b * Float64(1.0 / Float64(z * c))); elseif (x <= -4.9e-273) tmp = t_1; elseif (x <= 3.8e-221) tmp = Float64(b / Float64(z * c)); elseif (x <= 3.7e-60) tmp = t_1; else tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c) / z))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = a * ((t * -4.0) / c);
tmp = 0.0;
if (x <= -3.1e+105)
tmp = 9.0 * (x * ((y / z) / c));
elseif (x <= -3.2e+18)
tmp = t_1;
elseif (x <= -3.7e-183)
tmp = b * (1.0 / (z * c));
elseif (x <= -4.9e-273)
tmp = t_1;
elseif (x <= 3.8e-221)
tmp = b / (z * c);
elseif (x <= 3.7e-60)
tmp = t_1;
else
tmp = 9.0 * (x * ((y / c) / z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e+105], N[(9.0 * N[(x * N[(N[(y / z), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e+18], t$95$1, If[LessEqual[x, -3.7e-183], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.9e-273], t$95$1, If[LessEqual[x, 3.8e-221], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e-60], t$95$1, N[(9.0 * N[(x * N[(N[(y / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := a \cdot \frac{t \cdot -4}{c}\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+105}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{z}}{c}\right)\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-183}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{-273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-221}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c}}{z}\right)\\
\end{array}
\end{array}
if x < -3.10000000000000004e105Initial program 79.2%
associate-+l-79.2%
*-commutative79.2%
associate-*r*76.7%
*-commutative76.7%
associate-+l-76.7%
associate-*l*76.8%
associate-*l*74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in t around inf 63.4%
Taylor expanded in x around inf 65.0%
associate-/l*63.4%
*-commutative63.4%
associate-/r*68.1%
Simplified68.1%
if -3.10000000000000004e105 < x < -3.2e18 or -3.6999999999999999e-183 < x < -4.89999999999999964e-273 or 3.8000000000000001e-221 < x < 3.70000000000000025e-60Initial program 77.4%
associate-+l-77.4%
*-commutative77.4%
associate-*r*74.8%
*-commutative74.8%
associate-+l-74.8%
associate-*l*74.9%
associate-*l*78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in z around inf 52.1%
*-commutative52.1%
associate-/l*52.4%
associate-*r*52.4%
associate-*l/52.4%
Simplified52.4%
if -3.2e18 < x < -3.6999999999999999e-183Initial program 83.6%
associate-+l-83.6%
*-commutative83.6%
associate-*r*78.1%
*-commutative78.1%
associate-+l-78.1%
associate-*l*78.1%
associate-*l*83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in b around inf 47.4%
*-commutative47.4%
Simplified47.4%
div-inv47.3%
Applied egg-rr47.3%
if -4.89999999999999964e-273 < x < 3.8000000000000001e-221Initial program 99.7%
associate-+l-99.7%
*-commutative99.7%
associate-*r*96.3%
*-commutative96.3%
associate-+l-96.3%
associate-*l*96.3%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in b around inf 72.1%
*-commutative72.1%
Simplified72.1%
if 3.70000000000000025e-60 < x Initial program 73.3%
associate-+l-73.3%
*-commutative73.3%
associate-*r*77.0%
*-commutative77.0%
associate-+l-77.0%
associate-*l*77.0%
associate-*l*74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in x around inf 40.7%
associate-/l*41.7%
*-commutative41.7%
Applied egg-rr41.7%
*-commutative41.7%
associate-/r*43.4%
Simplified43.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* a (/ (* t -4.0) c))) (t_2 (* 9.0 (* x (/ (/ y c) z)))))
(if (<= x -6e+103)
t_2
(if (<= x -8.2e+17)
t_1
(if (<= x -2.8e-182)
(* b (/ 1.0 (* z c)))
(if (<= x -1.7e-273)
t_1
(if (<= x 3.8e-218) (/ b (* z c)) (if (<= x 5.5e-62) t_1 t_2))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * ((t * -4.0) / c);
double t_2 = 9.0 * (x * ((y / c) / z));
double tmp;
if (x <= -6e+103) {
tmp = t_2;
} else if (x <= -8.2e+17) {
tmp = t_1;
} else if (x <= -2.8e-182) {
tmp = b * (1.0 / (z * c));
} else if (x <= -1.7e-273) {
tmp = t_1;
} else if (x <= 3.8e-218) {
tmp = b / (z * c);
} else if (x <= 5.5e-62) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * ((t * (-4.0d0)) / c)
t_2 = 9.0d0 * (x * ((y / c) / z))
if (x <= (-6d+103)) then
tmp = t_2
else if (x <= (-8.2d+17)) then
tmp = t_1
else if (x <= (-2.8d-182)) then
tmp = b * (1.0d0 / (z * c))
else if (x <= (-1.7d-273)) then
tmp = t_1
else if (x <= 3.8d-218) then
tmp = b / (z * c)
else if (x <= 5.5d-62) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = a * ((t * -4.0) / c);
double t_2 = 9.0 * (x * ((y / c) / z));
double tmp;
if (x <= -6e+103) {
tmp = t_2;
} else if (x <= -8.2e+17) {
tmp = t_1;
} else if (x <= -2.8e-182) {
tmp = b * (1.0 / (z * c));
} else if (x <= -1.7e-273) {
tmp = t_1;
} else if (x <= 3.8e-218) {
tmp = b / (z * c);
} else if (x <= 5.5e-62) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = a * ((t * -4.0) / c) t_2 = 9.0 * (x * ((y / c) / z)) tmp = 0 if x <= -6e+103: tmp = t_2 elif x <= -8.2e+17: tmp = t_1 elif x <= -2.8e-182: tmp = b * (1.0 / (z * c)) elif x <= -1.7e-273: tmp = t_1 elif x <= 3.8e-218: tmp = b / (z * c) elif x <= 5.5e-62: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(a * Float64(Float64(t * -4.0) / c)) t_2 = Float64(9.0 * Float64(x * Float64(Float64(y / c) / z))) tmp = 0.0 if (x <= -6e+103) tmp = t_2; elseif (x <= -8.2e+17) tmp = t_1; elseif (x <= -2.8e-182) tmp = Float64(b * Float64(1.0 / Float64(z * c))); elseif (x <= -1.7e-273) tmp = t_1; elseif (x <= 3.8e-218) tmp = Float64(b / Float64(z * c)); elseif (x <= 5.5e-62) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = a * ((t * -4.0) / c);
t_2 = 9.0 * (x * ((y / c) / z));
tmp = 0.0;
if (x <= -6e+103)
tmp = t_2;
elseif (x <= -8.2e+17)
tmp = t_1;
elseif (x <= -2.8e-182)
tmp = b * (1.0 / (z * c));
elseif (x <= -1.7e-273)
tmp = t_1;
elseif (x <= 3.8e-218)
tmp = b / (z * c);
elseif (x <= 5.5e-62)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(x * N[(N[(y / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+103], t$95$2, If[LessEqual[x, -8.2e+17], t$95$1, If[LessEqual[x, -2.8e-182], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-273], t$95$1, If[LessEqual[x, 3.8e-218], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-62], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := a \cdot \frac{t \cdot -4}{c}\\
t_2 := 9 \cdot \left(x \cdot \frac{\frac{y}{c}}{z}\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-182}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-273}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-218}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -6e103 or 5.50000000000000022e-62 < x Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
associate-*r*76.9%
*-commutative76.9%
associate-+l-76.9%
associate-*l*76.9%
associate-*l*74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in x around inf 49.2%
associate-/l*49.3%
*-commutative49.3%
Applied egg-rr49.3%
*-commutative49.3%
associate-/r*51.2%
Simplified51.2%
if -6e103 < x < -8.2e17 or -2.79999999999999993e-182 < x < -1.69999999999999996e-273 or 3.7999999999999999e-218 < x < 5.50000000000000022e-62Initial program 77.4%
associate-+l-77.4%
*-commutative77.4%
associate-*r*74.8%
*-commutative74.8%
associate-+l-74.8%
associate-*l*74.9%
associate-*l*78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in z around inf 52.1%
*-commutative52.1%
associate-/l*52.4%
associate-*r*52.4%
associate-*l/52.4%
Simplified52.4%
if -8.2e17 < x < -2.79999999999999993e-182Initial program 83.6%
associate-+l-83.6%
*-commutative83.6%
associate-*r*78.1%
*-commutative78.1%
associate-+l-78.1%
associate-*l*78.1%
associate-*l*83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in b around inf 47.4%
*-commutative47.4%
Simplified47.4%
div-inv47.3%
Applied egg-rr47.3%
if -1.69999999999999996e-273 < x < 3.7999999999999999e-218Initial program 99.7%
associate-+l-99.7%
*-commutative99.7%
associate-*r*96.3%
*-commutative96.3%
associate-+l-96.3%
associate-*l*96.3%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in b around inf 72.1%
*-commutative72.1%
Simplified72.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -8.2e-45) (not (<= z 1.8e-11))) (/ (- (+ (/ b z) (* 9.0 (/ (* y x) z))) (* 4.0 (* a t))) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -8.2e-45) || !(z <= 1.8e-11)) {
tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-8.2d-45)) .or. (.not. (z <= 1.8d-11))) then
tmp = (((b / z) + (9.0d0 * ((y * x) / z))) - (4.0d0 * (a * t))) / c
else
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -8.2e-45) || !(z <= 1.8e-11)) {
tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -8.2e-45) or not (z <= 1.8e-11): tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c else: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -8.2e-45) || !(z <= 1.8e-11)) tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(y * x) / z))) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -8.2e-45) || ~((z <= 1.8e-11)))
tmp = (((b / z) + (9.0 * ((y * x) / z))) - (4.0 * (a * t))) / c;
else
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -8.2e-45], N[Not[LessEqual[z, 1.8e-11]], $MachinePrecision]], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-45} \lor \neg \left(z \leq 1.8 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{\left(\frac{b}{z} + 9 \cdot \frac{y \cdot x}{z}\right) - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -8.1999999999999998e-45 or 1.79999999999999992e-11 < z Initial program 67.5%
associate-+l-67.5%
*-commutative67.5%
associate-*r*65.4%
*-commutative65.4%
associate-+l-65.4%
associate-*l*65.4%
associate-*l*70.0%
*-commutative70.0%
Simplified70.0%
associate-+l-70.0%
div-sub69.3%
associate-*r*69.3%
*-commutative69.3%
associate-*l*69.3%
*-commutative69.3%
associate-*l*69.3%
Applied egg-rr69.3%
Taylor expanded in c around 0 90.2%
if -8.1999999999999998e-45 < z < 1.79999999999999992e-11Initial program 93.4%
Final simplification91.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.86e+73)
(/ (- (* (/ y z) (* x 9.0)) (* a (* t 4.0))) c)
(if (<= z 7.5e+72)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (- (/ b z) (* 4.0 (* a t))) c))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.86e+73) {
tmp = (((y / z) * (x * 9.0)) - (a * (t * 4.0))) / c;
} else if (z <= 7.5e+72) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / z) - (4.0 * (a * t))) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-1.86d+73)) then
tmp = (((y / z) * (x * 9.0d0)) - (a * (t * 4.0d0))) / c
else if (z <= 7.5d+72) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = ((b / z) - (4.0d0 * (a * t))) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.86e+73) {
tmp = (((y / z) * (x * 9.0)) - (a * (t * 4.0))) / c;
} else if (z <= 7.5e+72) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / z) - (4.0 * (a * t))) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.86e+73: tmp = (((y / z) * (x * 9.0)) - (a * (t * 4.0))) / c elif z <= 7.5e+72: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = ((b / z) - (4.0 * (a * t))) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.86e+73) tmp = Float64(Float64(Float64(Float64(y / z) * Float64(x * 9.0)) - Float64(a * Float64(t * 4.0))) / c); elseif (z <= 7.5e+72) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.86e+73)
tmp = (((y / z) * (x * 9.0)) - (a * (t * 4.0))) / c;
elseif (z <= 7.5e+72)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = ((b / z) - (4.0 * (a * t))) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.86e+73], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 7.5e+72], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.86 \cdot 10^{+73}:\\
\;\;\;\;\frac{\frac{y}{z} \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot 4\right)}{c}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\end{array}
\end{array}
if z < -1.8599999999999999e73Initial program 69.1%
associate-+l-69.1%
*-commutative69.1%
associate-*r*61.6%
*-commutative61.6%
associate-+l-61.6%
associate-*l*61.6%
associate-*l*71.5%
*-commutative71.5%
Simplified71.5%
associate-+l-71.5%
div-sub69.6%
associate-*r*69.6%
*-commutative69.6%
associate-*l*69.6%
*-commutative69.6%
associate-*l*69.6%
Applied egg-rr69.6%
Taylor expanded in c around 0 86.0%
Taylor expanded in b around 0 74.9%
associate-*r/78.6%
associate-*r*78.5%
*-commutative78.5%
associate-*l*78.6%
Simplified78.6%
if -1.8599999999999999e73 < z < 7.50000000000000027e72Initial program 93.3%
if 7.50000000000000027e72 < z Initial program 50.4%
associate-+l-50.4%
*-commutative50.4%
associate-*r*50.4%
*-commutative50.4%
associate-+l-50.4%
associate-*l*50.5%
associate-*l*52.5%
*-commutative52.5%
Simplified52.5%
associate-+l-52.5%
div-sub52.5%
associate-*r*52.5%
*-commutative52.5%
associate-*l*52.5%
*-commutative52.5%
associate-*l*52.5%
Applied egg-rr52.5%
Taylor expanded in c around 0 88.6%
Taylor expanded in x around 0 81.0%
Final simplification87.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -6.2e+15)
(* a (/ (* t -4.0) c))
(if (<= t -8.4e-66)
(/ b (* z c))
(if (or (<= t -8.5e-107) (not (<= t 1e-140)))
(* -4.0 (/ (* a t) c))
(* b (/ 1.0 (* z c)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -6.2e+15) {
tmp = a * ((t * -4.0) / c);
} else if (t <= -8.4e-66) {
tmp = b / (z * c);
} else if ((t <= -8.5e-107) || !(t <= 1e-140)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b * (1.0 / (z * c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (t <= (-6.2d+15)) then
tmp = a * ((t * (-4.0d0)) / c)
else if (t <= (-8.4d-66)) then
tmp = b / (z * c)
else if ((t <= (-8.5d-107)) .or. (.not. (t <= 1d-140))) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = b * (1.0d0 / (z * c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -6.2e+15) {
tmp = a * ((t * -4.0) / c);
} else if (t <= -8.4e-66) {
tmp = b / (z * c);
} else if ((t <= -8.5e-107) || !(t <= 1e-140)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b * (1.0 / (z * c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -6.2e+15: tmp = a * ((t * -4.0) / c) elif t <= -8.4e-66: tmp = b / (z * c) elif (t <= -8.5e-107) or not (t <= 1e-140): tmp = -4.0 * ((a * t) / c) else: tmp = b * (1.0 / (z * c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -6.2e+15) tmp = Float64(a * Float64(Float64(t * -4.0) / c)); elseif (t <= -8.4e-66) tmp = Float64(b / Float64(z * c)); elseif ((t <= -8.5e-107) || !(t <= 1e-140)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(b * Float64(1.0 / Float64(z * c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -6.2e+15)
tmp = a * ((t * -4.0) / c);
elseif (t <= -8.4e-66)
tmp = b / (z * c);
elseif ((t <= -8.5e-107) || ~((t <= 1e-140)))
tmp = -4.0 * ((a * t) / c);
else
tmp = b * (1.0 / (z * c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -6.2e+15], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.4e-66], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -8.5e-107], N[Not[LessEqual[t, 1e-140]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+15}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\mathbf{elif}\;t \leq -8.4 \cdot 10^{-66}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-107} \lor \neg \left(t \leq 10^{-140}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\end{array}
\end{array}
if t < -6.2e15Initial program 71.8%
associate-+l-71.8%
*-commutative71.8%
associate-*r*70.1%
*-commutative70.1%
associate-+l-70.1%
associate-*l*70.1%
associate-*l*68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in z around inf 48.8%
*-commutative48.8%
associate-/l*55.3%
associate-*r*55.3%
associate-*l/55.3%
Simplified55.3%
if -6.2e15 < t < -8.4000000000000001e-66Initial program 78.0%
associate-+l-78.0%
*-commutative78.0%
associate-*r*78.0%
*-commutative78.0%
associate-+l-78.0%
associate-*l*78.2%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in b around inf 31.9%
*-commutative31.9%
Simplified31.9%
if -8.4000000000000001e-66 < t < -8.49999999999999956e-107 or 9.9999999999999998e-141 < t Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
associate-*l*78.2%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in z around inf 47.8%
if -8.49999999999999956e-107 < t < 9.9999999999999998e-141Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*85.5%
*-commutative85.5%
associate-+l-85.5%
associate-*l*85.6%
associate-*l*89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in b around inf 55.8%
*-commutative55.8%
Simplified55.8%
div-inv56.2%
Applied egg-rr56.2%
Final simplification51.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -2.8e+17)
(* a (/ (* t -4.0) c))
(if (or (<= t -3.8e-65) (and (not (<= t -2.2e-106)) (<= t 1.32e-139)))
(/ b (* z c))
(* -4.0 (/ (* a t) c)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -2.8e+17) {
tmp = a * ((t * -4.0) / c);
} else if ((t <= -3.8e-65) || (!(t <= -2.2e-106) && (t <= 1.32e-139))) {
tmp = b / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (t <= (-2.8d+17)) then
tmp = a * ((t * (-4.0d0)) / c)
else if ((t <= (-3.8d-65)) .or. (.not. (t <= (-2.2d-106))) .and. (t <= 1.32d-139)) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * ((a * t) / c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -2.8e+17) {
tmp = a * ((t * -4.0) / c);
} else if ((t <= -3.8e-65) || (!(t <= -2.2e-106) && (t <= 1.32e-139))) {
tmp = b / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -2.8e+17: tmp = a * ((t * -4.0) / c) elif (t <= -3.8e-65) or (not (t <= -2.2e-106) and (t <= 1.32e-139)): tmp = b / (z * c) else: tmp = -4.0 * ((a * t) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -2.8e+17) tmp = Float64(a * Float64(Float64(t * -4.0) / c)); elseif ((t <= -3.8e-65) || (!(t <= -2.2e-106) && (t <= 1.32e-139))) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -2.8e+17)
tmp = a * ((t * -4.0) / c);
elseif ((t <= -3.8e-65) || (~((t <= -2.2e-106)) && (t <= 1.32e-139)))
tmp = b / (z * c);
else
tmp = -4.0 * ((a * t) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -2.8e+17], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -3.8e-65], And[N[Not[LessEqual[t, -2.2e-106]], $MachinePrecision], LessEqual[t, 1.32e-139]]], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+17}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-65} \lor \neg \left(t \leq -2.2 \cdot 10^{-106}\right) \land t \leq 1.32 \cdot 10^{-139}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if t < -2.8e17Initial program 71.8%
associate-+l-71.8%
*-commutative71.8%
associate-*r*70.1%
*-commutative70.1%
associate-+l-70.1%
associate-*l*70.1%
associate-*l*68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in z around inf 48.8%
*-commutative48.8%
associate-/l*55.3%
associate-*r*55.3%
associate-*l/55.3%
Simplified55.3%
if -2.8e17 < t < -3.8000000000000002e-65 or -2.19999999999999994e-106 < t < 1.31999999999999995e-139Initial program 89.9%
associate-+l-89.9%
*-commutative89.9%
associate-*r*84.5%
*-commutative84.5%
associate-+l-84.5%
associate-*l*84.5%
associate-*l*88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in b around inf 52.4%
*-commutative52.4%
Simplified52.4%
if -3.8000000000000002e-65 < t < -2.19999999999999994e-106 or 1.31999999999999995e-139 < t Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
associate-*l*78.2%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in z around inf 47.8%
Final simplification51.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= z 7.5e+69) (/ (+ b (- (* x (* y 9.0)) (* (* z 4.0) (* a t)))) (* z c)) (/ (- (/ b z) (* 4.0 (* a t))) c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 7.5e+69) {
tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = ((b / z) - (4.0 * (a * t))) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= 7.5d+69) then
tmp = (b + ((x * (y * 9.0d0)) - ((z * 4.0d0) * (a * t)))) / (z * c)
else
tmp = ((b / z) - (4.0d0 * (a * t))) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 7.5e+69) {
tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = ((b / z) - (4.0 * (a * t))) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= 7.5e+69: tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (z * c) else: tmp = ((b / z) - (4.0 * (a * t))) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= 7.5e+69) tmp = Float64(Float64(b + Float64(Float64(x * Float64(y * 9.0)) - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= 7.5e+69)
tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (z * c);
else
tmp = ((b / z) - (4.0 * (a * t))) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, 7.5e+69], N[(N[(b + N[(N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(y \cdot 9\right) - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\end{array}
\end{array}
if z < 7.49999999999999939e69Initial program 87.1%
associate-+l-87.1%
*-commutative87.1%
associate-*r*85.6%
*-commutative85.6%
associate-+l-85.6%
associate-*l*85.6%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
if 7.49999999999999939e69 < z Initial program 50.4%
associate-+l-50.4%
*-commutative50.4%
associate-*r*50.4%
*-commutative50.4%
associate-+l-50.4%
associate-*l*50.5%
associate-*l*52.5%
*-commutative52.5%
Simplified52.5%
associate-+l-52.5%
div-sub52.5%
associate-*r*52.5%
*-commutative52.5%
associate-*l*52.5%
*-commutative52.5%
associate-*l*52.5%
Applied egg-rr52.5%
Taylor expanded in c around 0 88.6%
Taylor expanded in x around 0 81.0%
Final simplification85.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1.1e-53) (not (<= z 6.3e+58))) (/ (- (/ b z) (* 4.0 (* a t))) c) (/ (+ b (* x (* y 9.0))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.1e-53) || !(z <= 6.3e+58)) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + (x * (y * 9.0))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-1.1d-53)) .or. (.not. (z <= 6.3d+58))) then
tmp = ((b / z) - (4.0d0 * (a * t))) / c
else
tmp = (b + (x * (y * 9.0d0))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1.1e-53) || !(z <= 6.3e+58)) {
tmp = ((b / z) - (4.0 * (a * t))) / c;
} else {
tmp = (b + (x * (y * 9.0))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1.1e-53) or not (z <= 6.3e+58): tmp = ((b / z) - (4.0 * (a * t))) / c else: tmp = (b + (x * (y * 9.0))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1.1e-53) || !(z <= 6.3e+58)) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c); else tmp = Float64(Float64(b + Float64(x * Float64(y * 9.0))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1.1e-53) || ~((z <= 6.3e+58)))
tmp = ((b / z) - (4.0 * (a * t))) / c;
else
tmp = (b + (x * (y * 9.0))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1.1e-53], N[Not[LessEqual[z, 6.3e+58]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-53} \lor \neg \left(z \leq 6.3 \cdot 10^{+58}\right):\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.10000000000000009e-53 or 6.2999999999999995e58 < z Initial program 66.0%
associate-+l-66.0%
*-commutative66.0%
associate-*r*62.9%
*-commutative62.9%
associate-+l-62.9%
associate-*l*62.9%
associate-*l*68.0%
*-commutative68.0%
Simplified68.0%
associate-+l-68.0%
div-sub66.4%
associate-*r*66.3%
*-commutative66.3%
associate-*l*66.3%
*-commutative66.3%
associate-*l*66.3%
Applied egg-rr66.3%
Taylor expanded in c around 0 89.2%
Taylor expanded in x around 0 78.9%
if -1.10000000000000009e-53 < z < 6.2999999999999995e58Initial program 92.4%
associate-+l-92.4%
*-commutative92.4%
associate-*r*93.1%
*-commutative93.1%
associate-+l-93.1%
associate-*l*93.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in x around inf 83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*r*83.1%
Simplified83.1%
Final simplification81.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -3.5e+73) (not (<= z 3.1e+59))) (* a (/ (* t -4.0) c)) (/ (+ b (* x (* y 9.0))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.5e+73) || !(z <= 3.1e+59)) {
tmp = a * ((t * -4.0) / c);
} else {
tmp = (b + (x * (y * 9.0))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-3.5d+73)) .or. (.not. (z <= 3.1d+59))) then
tmp = a * ((t * (-4.0d0)) / c)
else
tmp = (b + (x * (y * 9.0d0))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.5e+73) || !(z <= 3.1e+59)) {
tmp = a * ((t * -4.0) / c);
} else {
tmp = (b + (x * (y * 9.0))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.5e+73) or not (z <= 3.1e+59): tmp = a * ((t * -4.0) / c) else: tmp = (b + (x * (y * 9.0))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.5e+73) || !(z <= 3.1e+59)) tmp = Float64(a * Float64(Float64(t * -4.0) / c)); else tmp = Float64(Float64(b + Float64(x * Float64(y * 9.0))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -3.5e+73) || ~((z <= 3.1e+59)))
tmp = a * ((t * -4.0) / c);
else
tmp = (b + (x * (y * 9.0))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -3.5e+73], N[Not[LessEqual[z, 3.1e+59]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+73} \lor \neg \left(z \leq 3.1 \cdot 10^{+59}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -3.50000000000000002e73 or 3.10000000000000015e59 < z Initial program 61.0%
associate-+l-61.0%
*-commutative61.0%
associate-*r*57.4%
*-commutative57.4%
associate-+l-57.4%
associate-*l*57.4%
associate-*l*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in z around inf 60.6%
*-commutative60.6%
associate-/l*62.2%
associate-*r*62.2%
associate-*l/62.2%
Simplified62.2%
if -3.50000000000000002e73 < z < 3.10000000000000015e59Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
associate-*r*93.8%
*-commutative93.8%
associate-+l-93.8%
associate-*l*93.9%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in x around inf 80.9%
associate-*r*80.9%
*-commutative80.9%
associate-*r*81.0%
Simplified81.0%
Final simplification73.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -2.9e-56) (not (<= z 6.3e+58))) (* -4.0 (* t (/ a c))) (/ b (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.9e-56) || !(z <= 6.3e+58)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-2.9d-56)) .or. (.not. (z <= 6.3d+58))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = b / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.9e-56) || !(z <= 6.3e+58)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2.9e-56) or not (z <= 6.3e+58): tmp = -4.0 * (t * (a / c)) else: tmp = b / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.9e-56) || !(z <= 6.3e+58)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(b / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -2.9e-56) || ~((z <= 6.3e+58)))
tmp = -4.0 * (t * (a / c));
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2.9e-56], N[Not[LessEqual[z, 6.3e+58]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-56} \lor \neg \left(z \leq 6.3 \cdot 10^{+58}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.89999999999999991e-56 or 6.2999999999999995e58 < z Initial program 66.0%
associate-+l-66.0%
*-commutative66.0%
associate-*r*62.9%
*-commutative62.9%
associate-+l-62.9%
associate-*l*62.9%
associate-*l*68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in z around 0 58.3%
associate-/l*58.9%
Applied egg-rr58.9%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in a around inf 58.7%
associate-*r/58.7%
associate-*r*58.7%
associate-*l/58.3%
associate-*r/58.3%
associate-*l*58.3%
Simplified58.3%
if -2.89999999999999991e-56 < z < 6.2999999999999995e58Initial program 92.4%
associate-+l-92.4%
*-commutative92.4%
associate-*r*93.1%
*-commutative93.1%
associate-+l-93.1%
associate-*l*93.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in b around inf 47.6%
*-commutative47.6%
Simplified47.6%
Final simplification52.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = b / (z * c)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 79.7%
associate-+l-79.7%
*-commutative79.7%
associate-*r*78.6%
*-commutative78.6%
associate-+l-78.6%
associate-*l*78.6%
associate-*l*79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in b around inf 38.2%
*-commutative38.2%
Simplified38.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024092
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))