
(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 14 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 -2e+41)
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c)
(if (<= z 6.2e+54)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(fma -4.0 (/ a (/ c t)) (fma 9.0 (* (/ x c) (/ y z)) (/ 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 <= -2e+41) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
} else if (z <= 6.2e+54) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = fma(-4.0, (a / (c / t)), fma(9.0, ((x / c) * (y / z)), (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 <= -2e+41) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c); elseif (z <= 6.2e+54) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = fma(-4.0, Float64(a / Float64(c / t)), fma(9.0, Float64(Float64(x / c) * Float64(y / z)), Float64(b / Float64(z * c)))); end return 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, -2e+41], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 6.2e+54], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $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}\;z \leq -2 \cdot 10^{+41}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a}{\frac{c}{t}}, \mathsf{fma}\left(9, \frac{x}{c} \cdot \frac{y}{z}, \frac{b}{z \cdot c}\right)\right)\\
\end{array}
\end{array}
if z < -2.00000000000000001e41Initial program 69.0%
associate-+l-69.0%
*-commutative69.0%
associate-*r*68.9%
*-commutative68.9%
associate-+l-68.9%
*-commutative68.9%
associate-*r*69.0%
*-commutative69.0%
associate-*l*68.9%
associate-*l*72.8%
Simplified72.8%
clear-num72.8%
associate-/r/72.8%
associate-/r*72.8%
reciprocal-define72.8%
associate-*r*68.9%
cancel-sign-sub-inv68.9%
fma-def68.9%
distribute-lft-neg-in68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
distribute-rgt-neg-in68.9%
metadata-eval68.9%
Applied egg-rr68.9%
associate-*l/76.2%
Applied egg-rr76.2%
Taylor expanded in z around 0 89.1%
if -2.00000000000000001e41 < z < 6.1999999999999999e54Initial program 95.0%
if 6.1999999999999999e54 < z Initial program 54.9%
associate-+l-54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
associate-+l-54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
associate-*l*54.9%
associate-*l*62.7%
Simplified62.7%
Taylor expanded in x around 0 80.6%
cancel-sign-sub-inv80.6%
metadata-eval80.6%
+-commutative80.6%
fma-def80.6%
associate-/l*86.0%
fma-def86.0%
times-frac91.7%
*-commutative91.7%
Simplified91.7%
Final simplification93.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
(let* ((t_1 (* (/ x z) (/ (* 9.0 y) c))) (t_2 (* -4.0 (* t (/ a c)))))
(if (<= t -2.7e+106)
t_2
(if (<= t -7.3e+90)
t_1
(if (<= t -4000000.0)
t_2
(if (<= t -9.2e-203)
(/ b (* z c))
(if (<= t 6.8e-158) t_1 (* -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 t_1 = (x / z) * ((9.0 * y) / c);
double t_2 = -4.0 * (t * (a / c));
double tmp;
if (t <= -2.7e+106) {
tmp = t_2;
} else if (t <= -7.3e+90) {
tmp = t_1;
} else if (t <= -4000000.0) {
tmp = t_2;
} else if (t <= -9.2e-203) {
tmp = b / (z * c);
} else if (t <= 6.8e-158) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x / z) * ((9.0d0 * y) / c)
t_2 = (-4.0d0) * (t * (a / c))
if (t <= (-2.7d+106)) then
tmp = t_2
else if (t <= (-7.3d+90)) then
tmp = t_1
else if (t <= (-4000000.0d0)) then
tmp = t_2
else if (t <= (-9.2d-203)) then
tmp = b / (z * c)
else if (t <= 6.8d-158) then
tmp = t_1
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 t_1 = (x / z) * ((9.0 * y) / c);
double t_2 = -4.0 * (t * (a / c));
double tmp;
if (t <= -2.7e+106) {
tmp = t_2;
} else if (t <= -7.3e+90) {
tmp = t_1;
} else if (t <= -4000000.0) {
tmp = t_2;
} else if (t <= -9.2e-203) {
tmp = b / (z * c);
} else if (t <= 6.8e-158) {
tmp = t_1;
} 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): t_1 = (x / z) * ((9.0 * y) / c) t_2 = -4.0 * (t * (a / c)) tmp = 0 if t <= -2.7e+106: tmp = t_2 elif t <= -7.3e+90: tmp = t_1 elif t <= -4000000.0: tmp = t_2 elif t <= -9.2e-203: tmp = b / (z * c) elif t <= 6.8e-158: tmp = t_1 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) t_1 = Float64(Float64(x / z) * Float64(Float64(9.0 * y) / c)) t_2 = Float64(-4.0 * Float64(t * Float64(a / c))) tmp = 0.0 if (t <= -2.7e+106) tmp = t_2; elseif (t <= -7.3e+90) tmp = t_1; elseif (t <= -4000000.0) tmp = t_2; elseif (t <= -9.2e-203) tmp = Float64(b / Float64(z * c)); elseif (t <= 6.8e-158) tmp = t_1; 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)
t_1 = (x / z) * ((9.0 * y) / c);
t_2 = -4.0 * (t * (a / c));
tmp = 0.0;
if (t <= -2.7e+106)
tmp = t_2;
elseif (t <= -7.3e+90)
tmp = t_1;
elseif (t <= -4000000.0)
tmp = t_2;
elseif (t <= -9.2e-203)
tmp = b / (z * c);
elseif (t <= 6.8e-158)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(N[(9.0 * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+106], t$95$2, If[LessEqual[t, -7.3e+90], t$95$1, If[LessEqual[t, -4000000.0], t$95$2, If[LessEqual[t, -9.2e-203], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-158], t$95$1, 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}
t_1 := \frac{x}{z} \cdot \frac{9 \cdot y}{c}\\
t_2 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -7.3 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-203}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if t < -2.70000000000000006e106 or -7.29999999999999995e90 < t < -4e6Initial program 79.2%
associate-+l-79.2%
*-commutative79.2%
associate-*r*82.6%
*-commutative82.6%
associate-+l-82.6%
*-commutative82.6%
associate-*r*79.2%
*-commutative79.2%
associate-*l*79.2%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in z around inf 52.9%
*-commutative52.9%
associate-/l*60.0%
associate-/r/67.6%
Simplified67.6%
if -2.70000000000000006e106 < t < -7.29999999999999995e90 or -9.19999999999999966e-203 < t < 6.7999999999999999e-158Initial program 88.4%
associate-+l-88.4%
*-commutative88.4%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*88.4%
*-commutative88.4%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in x around inf 50.9%
associate-*r/51.1%
associate-*r*51.1%
*-commutative51.1%
associate-*r*51.0%
*-commutative51.0%
times-frac61.8%
Simplified61.8%
if -4e6 < t < -9.19999999999999966e-203Initial program 92.2%
associate-+l-92.2%
*-commutative92.2%
associate-*r*88.5%
*-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.2%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in b around inf 58.2%
*-commutative58.2%
Simplified58.2%
if 6.7999999999999999e-158 < t Initial program 73.4%
associate-+l-73.4%
*-commutative73.4%
associate-*r*80.4%
*-commutative80.4%
associate-+l-80.4%
*-commutative80.4%
associate-*r*73.4%
*-commutative73.4%
associate-*l*73.4%
associate-*l*78.4%
Simplified78.4%
Taylor expanded in z around inf 49.1%
Final simplification57.5%
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 (* -4.0 (* t (/ a c)))))
(if (<= t -2.7e+106)
t_1
(if (<= t -7.6e+90)
(* (/ x z) (/ (* 9.0 y) c))
(if (<= t -13500.0)
t_1
(if (<= t -4.6e-193)
(/ b (* z c))
(if (<= t 1.02e-158)
(/ 9.0 (* (/ z x) (/ c y)))
(* -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 t_1 = -4.0 * (t * (a / c));
double tmp;
if (t <= -2.7e+106) {
tmp = t_1;
} else if (t <= -7.6e+90) {
tmp = (x / z) * ((9.0 * y) / c);
} else if (t <= -13500.0) {
tmp = t_1;
} else if (t <= -4.6e-193) {
tmp = b / (z * c);
} else if (t <= 1.02e-158) {
tmp = 9.0 / ((z / x) * (c / y));
} 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) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c))
if (t <= (-2.7d+106)) then
tmp = t_1
else if (t <= (-7.6d+90)) then
tmp = (x / z) * ((9.0d0 * y) / c)
else if (t <= (-13500.0d0)) then
tmp = t_1
else if (t <= (-4.6d-193)) then
tmp = b / (z * c)
else if (t <= 1.02d-158) then
tmp = 9.0d0 / ((z / x) * (c / y))
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 t_1 = -4.0 * (t * (a / c));
double tmp;
if (t <= -2.7e+106) {
tmp = t_1;
} else if (t <= -7.6e+90) {
tmp = (x / z) * ((9.0 * y) / c);
} else if (t <= -13500.0) {
tmp = t_1;
} else if (t <= -4.6e-193) {
tmp = b / (z * c);
} else if (t <= 1.02e-158) {
tmp = 9.0 / ((z / x) * (c / y));
} 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): t_1 = -4.0 * (t * (a / c)) tmp = 0 if t <= -2.7e+106: tmp = t_1 elif t <= -7.6e+90: tmp = (x / z) * ((9.0 * y) / c) elif t <= -13500.0: tmp = t_1 elif t <= -4.6e-193: tmp = b / (z * c) elif t <= 1.02e-158: tmp = 9.0 / ((z / x) * (c / y)) 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) t_1 = Float64(-4.0 * Float64(t * Float64(a / c))) tmp = 0.0 if (t <= -2.7e+106) tmp = t_1; elseif (t <= -7.6e+90) tmp = Float64(Float64(x / z) * Float64(Float64(9.0 * y) / c)); elseif (t <= -13500.0) tmp = t_1; elseif (t <= -4.6e-193) tmp = Float64(b / Float64(z * c)); elseif (t <= 1.02e-158) tmp = Float64(9.0 / Float64(Float64(z / x) * Float64(c / y))); 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)
t_1 = -4.0 * (t * (a / c));
tmp = 0.0;
if (t <= -2.7e+106)
tmp = t_1;
elseif (t <= -7.6e+90)
tmp = (x / z) * ((9.0 * y) / c);
elseif (t <= -13500.0)
tmp = t_1;
elseif (t <= -4.6e-193)
tmp = b / (z * c);
elseif (t <= 1.02e-158)
tmp = 9.0 / ((z / x) * (c / y));
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_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+106], t$95$1, If[LessEqual[t, -7.6e+90], N[(N[(x / z), $MachinePrecision] * N[(N[(9.0 * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -13500.0], t$95$1, If[LessEqual[t, -4.6e-193], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e-158], N[(9.0 / N[(N[(z / x), $MachinePrecision] * N[(c / y), $MachinePrecision]), $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}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.6 \cdot 10^{+90}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{9 \cdot y}{c}\\
\mathbf{elif}\;t \leq -13500:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-193}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-158}:\\
\;\;\;\;\frac{9}{\frac{z}{x} \cdot \frac{c}{y}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if t < -2.70000000000000006e106 or -7.6000000000000002e90 < t < -13500Initial program 79.2%
associate-+l-79.2%
*-commutative79.2%
associate-*r*82.6%
*-commutative82.6%
associate-+l-82.6%
*-commutative82.6%
associate-*r*79.2%
*-commutative79.2%
associate-*l*79.2%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in z around inf 52.9%
*-commutative52.9%
associate-/l*60.0%
associate-/r/67.6%
Simplified67.6%
if -2.70000000000000006e106 < t < -7.6000000000000002e90Initial program 99.7%
associate-+l-99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
associate-+l-99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 61.6%
associate-*r/61.9%
associate-*r*61.9%
*-commutative61.9%
associate-*r*61.9%
*-commutative61.9%
times-frac80.4%
Simplified80.4%
if -13500 < t < -4.60000000000000017e-193Initial program 91.8%
associate-+l-91.8%
*-commutative91.8%
associate-*r*89.7%
*-commutative89.7%
associate-+l-89.7%
*-commutative89.7%
associate-*r*91.8%
*-commutative91.8%
associate-*l*91.8%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in b around inf 57.7%
*-commutative57.7%
Simplified57.7%
if -4.60000000000000017e-193 < t < 1.0199999999999999e-158Initial program 88.0%
associate-+l-88.0%
*-commutative88.0%
associate-*r*77.5%
*-commutative77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*88.0%
*-commutative88.0%
associate-*l*87.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in x around inf 47.3%
associate-*r/47.5%
associate-*r*47.4%
*-commutative47.4%
associate-*r*47.4%
*-commutative47.4%
times-frac56.9%
Simplified56.9%
clear-num56.9%
associate-/l*56.8%
frac-times56.9%
metadata-eval56.9%
Applied egg-rr56.9%
if 1.0199999999999999e-158 < t Initial program 73.4%
associate-+l-73.4%
*-commutative73.4%
associate-*r*80.4%
*-commutative80.4%
associate-+l-80.4%
*-commutative80.4%
associate-*r*73.4%
*-commutative73.4%
associate-*l*73.4%
associate-*l*78.4%
Simplified78.4%
Taylor expanded in z around inf 49.1%
Final simplification56.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
(let* ((t_1 (/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c)))
(if (<= z -8e-137)
t_1
(if (<= z 1.1e-239)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= z 2.05e-122) (/ (- b (* 4.0 (* a (* z t)))) (* z c)) t_1)))))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 = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
double tmp;
if (z <= -8e-137) {
tmp = t_1;
} else if (z <= 1.1e-239) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (z <= 2.05e-122) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = t_1;
}
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 = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c
if (z <= (-8d-137)) then
tmp = t_1
else if (z <= 1.1d-239) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else if (z <= 2.05d-122) then
tmp = (b - (4.0d0 * (a * (z * t)))) / (z * c)
else
tmp = t_1
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 = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
double tmp;
if (z <= -8e-137) {
tmp = t_1;
} else if (z <= 1.1e-239) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (z <= 2.05e-122) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = t_1;
}
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 = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c tmp = 0 if z <= -8e-137: tmp = t_1 elif z <= 1.1e-239: tmp = (b + (9.0 * (x * y))) / (z * c) elif z <= 2.05e-122: tmp = (b - (4.0 * (a * (z * t)))) / (z * c) else: tmp = t_1 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(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c) tmp = 0.0 if (z <= -8e-137) tmp = t_1; elseif (z <= 1.1e-239) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (z <= 2.05e-122) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); else tmp = t_1; 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 = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
tmp = 0.0;
if (z <= -8e-137)
tmp = t_1;
elseif (z <= 1.1e-239)
tmp = (b + (9.0 * (x * y))) / (z * c);
elseif (z <= 2.05e-122)
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
else
tmp = t_1;
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[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -8e-137], t$95$1, If[LessEqual[z, 1.1e-239], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e-122], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c}\\
\mathbf{if}\;z \leq -8 \cdot 10^{-137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-239}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-122}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.99999999999999982e-137 or 2.05e-122 < z Initial program 76.4%
associate-+l-76.4%
*-commutative76.4%
associate-*r*76.4%
*-commutative76.4%
associate-+l-76.4%
*-commutative76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*l*76.4%
associate-*l*79.5%
Simplified79.5%
clear-num79.3%
associate-/r/79.5%
associate-/r*79.5%
reciprocal-define79.5%
associate-*r*76.3%
cancel-sign-sub-inv76.3%
fma-def76.3%
distribute-lft-neg-in76.3%
*-commutative76.3%
distribute-rgt-neg-in76.3%
*-commutative76.3%
distribute-rgt-neg-in76.3%
distribute-rgt-neg-in76.3%
metadata-eval76.3%
Applied egg-rr76.3%
associate-*l/78.2%
Applied egg-rr78.2%
Taylor expanded in z around 0 88.0%
if -7.99999999999999982e-137 < z < 1.09999999999999991e-239Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
associate-*r*99.7%
*-commutative99.7%
associate-+l-99.7%
*-commutative99.7%
associate-*r*95.7%
*-commutative95.7%
associate-*l*95.7%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in z around 0 87.0%
*-commutative87.0%
Simplified87.0%
if 1.09999999999999991e-239 < z < 2.05e-122Initial program 96.9%
associate-+l-96.9%
*-commutative96.9%
associate-*r*95.8%
*-commutative95.8%
associate-+l-95.8%
*-commutative95.8%
associate-*r*96.9%
*-commutative96.9%
associate-*l*96.9%
associate-*l*81.8%
Simplified81.8%
Taylor expanded in x around 0 89.1%
Final simplification87.9%
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 (/ (- (/ b z) (* (* a t) 4.0)) c)))
(if (<= z -2.6e+41)
t_1
(if (<= z 2.2e-182)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (or (<= z 5.8e-98) (not (<= z 6.5e-56)))
t_1
(* (/ x z) (/ (* 9.0 y) 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 t_1 = ((b / z) - ((a * t) * 4.0)) / c;
double tmp;
if (z <= -2.6e+41) {
tmp = t_1;
} else if (z <= 2.2e-182) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if ((z <= 5.8e-98) || !(z <= 6.5e-56)) {
tmp = t_1;
} else {
tmp = (x / z) * ((9.0 * y) / 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) :: t_1
real(8) :: tmp
t_1 = ((b / z) - ((a * t) * 4.0d0)) / c
if (z <= (-2.6d+41)) then
tmp = t_1
else if (z <= 2.2d-182) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else if ((z <= 5.8d-98) .or. (.not. (z <= 6.5d-56))) then
tmp = t_1
else
tmp = (x / z) * ((9.0d0 * y) / 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 t_1 = ((b / z) - ((a * t) * 4.0)) / c;
double tmp;
if (z <= -2.6e+41) {
tmp = t_1;
} else if (z <= 2.2e-182) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if ((z <= 5.8e-98) || !(z <= 6.5e-56)) {
tmp = t_1;
} else {
tmp = (x / z) * ((9.0 * y) / 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): t_1 = ((b / z) - ((a * t) * 4.0)) / c tmp = 0 if z <= -2.6e+41: tmp = t_1 elif z <= 2.2e-182: tmp = (b + (9.0 * (x * y))) / (z * c) elif (z <= 5.8e-98) or not (z <= 6.5e-56): tmp = t_1 else: tmp = (x / z) * ((9.0 * y) / 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) t_1 = Float64(Float64(Float64(b / z) - Float64(Float64(a * t) * 4.0)) / c) tmp = 0.0 if (z <= -2.6e+41) tmp = t_1; elseif (z <= 2.2e-182) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif ((z <= 5.8e-98) || !(z <= 6.5e-56)) tmp = t_1; else tmp = Float64(Float64(x / z) * Float64(Float64(9.0 * y) / 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)
t_1 = ((b / z) - ((a * t) * 4.0)) / c;
tmp = 0.0;
if (z <= -2.6e+41)
tmp = t_1;
elseif (z <= 2.2e-182)
tmp = (b + (9.0 * (x * y))) / (z * c);
elseif ((z <= 5.8e-98) || ~((z <= 6.5e-56)))
tmp = t_1;
else
tmp = (x / z) * ((9.0 * y) / 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_] := Block[{t$95$1 = N[(N[(N[(b / z), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.6e+41], t$95$1, If[LessEqual[z, 2.2e-182], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5.8e-98], N[Not[LessEqual[z, 6.5e-56]], $MachinePrecision]], t$95$1, N[(N[(x / z), $MachinePrecision] * N[(N[(9.0 * y), $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}
t_1 := \frac{\frac{b}{z} - \left(a \cdot t\right) \cdot 4}{c}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-182}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-98} \lor \neg \left(z \leq 6.5 \cdot 10^{-56}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{9 \cdot y}{c}\\
\end{array}
\end{array}
if z < -2.6000000000000001e41 or 2.2e-182 < z < 5.8e-98 or 6.4999999999999997e-56 < z Initial program 72.3%
associate-+l-72.3%
*-commutative72.3%
associate-*r*72.2%
*-commutative72.2%
associate-+l-72.2%
*-commutative72.2%
associate-*r*72.3%
*-commutative72.3%
associate-*l*72.3%
associate-*l*75.1%
Simplified75.1%
Taylor expanded in x around 0 60.0%
div-sub58.1%
*-commutative58.1%
*-commutative58.1%
times-frac59.6%
*-commutative59.6%
Applied egg-rr59.6%
expm1-log1p-u40.1%
expm1-udef36.3%
associate-*l/36.3%
*-un-lft-identity36.3%
times-frac36.3%
metadata-eval36.3%
associate-/l*36.3%
Applied egg-rr36.3%
expm1-def41.4%
expm1-log1p60.9%
associate-*r/60.9%
*-commutative60.9%
associate-*r/60.9%
associate-/r/60.8%
*-commutative60.8%
associate-*l*63.2%
Simplified63.2%
Taylor expanded in c around 0 72.2%
if -2.6000000000000001e41 < z < 2.2e-182Initial program 96.9%
associate-+l-96.9%
*-commutative96.9%
associate-*r*98.7%
*-commutative98.7%
associate-+l-98.7%
*-commutative98.7%
associate-*r*96.9%
*-commutative96.9%
associate-*l*96.9%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in z around 0 85.5%
*-commutative85.5%
Simplified85.5%
if 5.8e-98 < z < 6.4999999999999997e-56Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*79.0%
*-commutative79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*79.0%
*-commutative79.0%
associate-*l*78.9%
associate-*l*67.8%
Simplified67.8%
Taylor expanded in x around inf 57.8%
associate-*r/58.0%
associate-*r*58.0%
*-commutative58.0%
associate-*r*57.8%
*-commutative57.8%
times-frac78.1%
Simplified78.1%
Final simplification77.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 (if (or (<= z -5e+47) (not (<= z 2.2e+76))) (/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c) (/ (+ b (- (* x (* 9.0 y)) (* (* 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 <= -5e+47) || !(z <= 2.2e+76)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((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 <= (-5d+47)) .or. (.not. (z <= 2.2d+76))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c
else
tmp = (b + ((x * (9.0d0 * y)) - ((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 <= -5e+47) || !(z <= 2.2e+76)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((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 <= -5e+47) or not (z <= 2.2e+76): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c else: tmp = (b + ((x * (9.0 * y)) - ((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 <= -5e+47) || !(z <= 2.2e+76)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(a * 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 <= -5e+47) || ~((z <= 2.2e+76)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
else
tmp = (b + ((x * (9.0 * y)) - ((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, -5e+47], N[Not[LessEqual[z, 2.2e+76]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * N[(z * 4.0), $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 -5 \cdot 10^{+47} \lor \neg \left(z \leq 2.2 \cdot 10^{+76}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(a \cdot t\right) \cdot \left(z \cdot 4\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -5.00000000000000022e47 or 2.2e76 < z Initial program 61.2%
associate-+l-61.2%
*-commutative61.2%
associate-*r*61.1%
*-commutative61.1%
associate-+l-61.1%
*-commutative61.1%
associate-*r*61.2%
*-commutative61.2%
associate-*l*61.1%
associate-*l*67.2%
Simplified67.2%
clear-num67.2%
associate-/r/67.2%
associate-/r*67.2%
reciprocal-define67.2%
associate-*r*61.2%
cancel-sign-sub-inv61.2%
fma-def61.2%
distribute-lft-neg-in61.2%
*-commutative61.2%
distribute-rgt-neg-in61.2%
*-commutative61.2%
distribute-rgt-neg-in61.2%
distribute-rgt-neg-in61.2%
metadata-eval61.2%
Applied egg-rr61.2%
associate-*l/68.5%
Applied egg-rr68.5%
Taylor expanded in z around 0 87.2%
if -5.00000000000000022e47 < z < 2.2e76Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
associate-*r*95.5%
*-commutative95.5%
associate-+l-95.5%
*-commutative95.5%
associate-*r*94.5%
*-commutative94.5%
associate-*l*94.6%
associate-*l*91.4%
Simplified91.4%
Final simplification89.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 (or (<= z -4e+42) (not (<= z 1.45e-9))) (/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c) (/ (+ b (- (* y (* 9.0 x)) (* 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 <= -4e+42) || !(z <= 1.45e-9)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
} else {
tmp = (b + ((y * (9.0 * x)) - (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 <= (-4d+42)) .or. (.not. (z <= 1.45d-9))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c
else
tmp = (b + ((y * (9.0d0 * x)) - (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 <= -4e+42) || !(z <= 1.45e-9)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
} else {
tmp = (b + ((y * (9.0 * x)) - (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 <= -4e+42) or not (z <= 1.45e-9): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c else: tmp = (b + ((y * (9.0 * x)) - (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 <= -4e+42) || !(z <= 1.45e-9)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - 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 <= -4e+42) || ~((z <= 1.45e-9)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c;
else
tmp = (b + ((y * (9.0 * x)) - (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, -4e+42], N[Not[LessEqual[z, 1.45e-9]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $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 -4 \cdot 10^{+42} \lor \neg \left(z \leq 1.45 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.00000000000000018e42 or 1.44999999999999996e-9 < z Initial program 66.4%
associate-+l-66.4%
*-commutative66.4%
associate-*r*66.3%
*-commutative66.3%
associate-+l-66.3%
*-commutative66.3%
associate-*r*66.4%
*-commutative66.4%
associate-*l*66.4%
associate-*l*72.2%
Simplified72.2%
clear-num72.1%
associate-/r/72.2%
associate-/r*72.2%
reciprocal-define72.2%
associate-*r*66.4%
cancel-sign-sub-inv66.4%
fma-def66.4%
distribute-lft-neg-in66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
*-commutative66.4%
distribute-rgt-neg-in66.4%
distribute-rgt-neg-in66.4%
metadata-eval66.4%
Applied egg-rr66.4%
associate-*l/72.4%
Applied egg-rr72.4%
Taylor expanded in z around 0 88.6%
if -4.00000000000000018e42 < z < 1.44999999999999996e-9Initial program 95.1%
Final simplification92.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 -2.1e+41)
(/ (- (/ b z) (* (* a t) 4.0)) c)
(if (<= z 1.45e-239)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= z 1.5e+45)
(/ (- b (* 4.0 (* a (* z t)))) (* z c))
(- (/ b (* z c)) (* 4.0 (/ a (/ c t))))))))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.1e+41) {
tmp = ((b / z) - ((a * t) * 4.0)) / c;
} else if (z <= 1.45e-239) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (z <= 1.5e+45) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = (b / (z * c)) - (4.0 * (a / (c / t)));
}
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.1d+41)) then
tmp = ((b / z) - ((a * t) * 4.0d0)) / c
else if (z <= 1.45d-239) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else if (z <= 1.5d+45) then
tmp = (b - (4.0d0 * (a * (z * t)))) / (z * c)
else
tmp = (b / (z * c)) - (4.0d0 * (a / (c / t)))
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.1e+41) {
tmp = ((b / z) - ((a * t) * 4.0)) / c;
} else if (z <= 1.45e-239) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (z <= 1.5e+45) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = (b / (z * c)) - (4.0 * (a / (c / t)));
}
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.1e+41: tmp = ((b / z) - ((a * t) * 4.0)) / c elif z <= 1.45e-239: tmp = (b + (9.0 * (x * y))) / (z * c) elif z <= 1.5e+45: tmp = (b - (4.0 * (a * (z * t)))) / (z * c) else: tmp = (b / (z * c)) - (4.0 * (a / (c / t))) 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.1e+41) tmp = Float64(Float64(Float64(b / z) - Float64(Float64(a * t) * 4.0)) / c); elseif (z <= 1.45e-239) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (z <= 1.5e+45) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); else tmp = Float64(Float64(b / Float64(z * c)) - Float64(4.0 * Float64(a / Float64(c / t)))); 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.1e+41)
tmp = ((b / z) - ((a * t) * 4.0)) / c;
elseif (z <= 1.45e-239)
tmp = (b + (9.0 * (x * y))) / (z * c);
elseif (z <= 1.5e+45)
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
else
tmp = (b / (z * c)) - (4.0 * (a / (c / t)));
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, -2.1e+41], N[(N[(N[(b / z), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.45e-239], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+45], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a / N[(c / t), $MachinePrecision]), $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}\;z \leq -2.1 \cdot 10^{+41}:\\
\;\;\;\;\frac{\frac{b}{z} - \left(a \cdot t\right) \cdot 4}{c}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-239}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+45}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c} - 4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -2.1e41Initial program 69.0%
associate-+l-69.0%
*-commutative69.0%
associate-*r*68.9%
*-commutative68.9%
associate-+l-68.9%
*-commutative68.9%
associate-*r*69.0%
*-commutative69.0%
associate-*l*68.9%
associate-*l*72.8%
Simplified72.8%
Taylor expanded in x around 0 60.2%
div-sub58.3%
*-commutative58.3%
*-commutative58.3%
times-frac56.7%
*-commutative56.7%
Applied egg-rr56.7%
expm1-log1p-u41.0%
expm1-udef32.0%
associate-*l/32.0%
*-un-lft-identity32.0%
times-frac32.0%
metadata-eval32.0%
associate-/l*35.1%
Applied egg-rr35.1%
expm1-def44.2%
expm1-log1p60.3%
associate-*r/60.3%
*-commutative60.3%
associate-*r/60.2%
associate-/r/62.0%
*-commutative62.0%
associate-*l*67.1%
Simplified67.1%
Taylor expanded in c around 0 72.5%
if -2.1e41 < z < 1.4500000000000001e-239Initial program 96.5%
associate-+l-96.5%
*-commutative96.5%
associate-*r*98.6%
*-commutative98.6%
associate-+l-98.6%
*-commutative98.6%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.5%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in z around 0 87.1%
*-commutative87.1%
Simplified87.1%
if 1.4500000000000001e-239 < z < 1.50000000000000005e45Initial program 93.0%
associate-+l-93.0%
*-commutative93.0%
associate-*r*92.7%
*-commutative92.7%
associate-+l-92.7%
*-commutative92.7%
associate-*r*93.0%
*-commutative93.0%
associate-*l*93.0%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in x around 0 72.1%
if 1.50000000000000005e45 < z Initial program 55.8%
associate-+l-55.8%
*-commutative55.8%
associate-*r*55.7%
*-commutative55.7%
associate-+l-55.7%
*-commutative55.7%
associate-*r*55.8%
*-commutative55.8%
associate-*l*55.8%
associate-*l*63.4%
Simplified63.4%
Taylor expanded in x around 0 44.4%
div-sub44.4%
*-commutative44.4%
*-commutative44.4%
times-frac47.2%
*-commutative47.2%
Applied egg-rr47.2%
Taylor expanded in z around 0 73.5%
*-commutative73.5%
associate-/l*78.9%
Simplified78.9%
Final simplification78.5%
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+218)
(* (/ x z) (/ (* 9.0 y) c))
(if (<= z -5.5e+50)
(* -4.0 (/ a (/ c t)))
(if (<= z 7.8e+150)
(/ (+ b (* 9.0 (* x y))) (* z c))
(* -4.0 (* t (/ a 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+218) {
tmp = (x / z) * ((9.0 * y) / c);
} else if (z <= -5.5e+50) {
tmp = -4.0 * (a / (c / t));
} else if (z <= 7.8e+150) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t * (a / 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+218)) then
tmp = (x / z) * ((9.0d0 * y) / c)
else if (z <= (-5.5d+50)) then
tmp = (-4.0d0) * (a / (c / t))
else if (z <= 7.8d+150) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (-4.0d0) * (t * (a / 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+218) {
tmp = (x / z) * ((9.0 * y) / c);
} else if (z <= -5.5e+50) {
tmp = -4.0 * (a / (c / t));
} else if (z <= 7.8e+150) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t * (a / 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+218: tmp = (x / z) * ((9.0 * y) / c) elif z <= -5.5e+50: tmp = -4.0 * (a / (c / t)) elif z <= 7.8e+150: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = -4.0 * (t * (a / 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+218) tmp = Float64(Float64(x / z) * Float64(Float64(9.0 * y) / c)); elseif (z <= -5.5e+50) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (z <= 7.8e+150) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t * Float64(a / 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+218)
tmp = (x / z) * ((9.0 * y) / c);
elseif (z <= -5.5e+50)
tmp = -4.0 * (a / (c / t));
elseif (z <= 7.8e+150)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = -4.0 * (t * (a / 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+218], N[(N[(x / z), $MachinePrecision] * N[(N[(9.0 * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e+50], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+150], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / 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}\;z \leq -5.4 \cdot 10^{+218}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{9 \cdot y}{c}\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+50}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+150}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if z < -5.40000000000000025e218Initial program 46.3%
associate-+l-46.3%
*-commutative46.3%
associate-*r*51.6%
*-commutative51.6%
associate-+l-51.6%
*-commutative51.6%
associate-*r*46.3%
*-commutative46.3%
associate-*l*46.3%
associate-*l*52.3%
Simplified52.3%
Taylor expanded in x around inf 25.5%
associate-*r/25.4%
associate-*r*25.4%
*-commutative25.4%
associate-*r*25.4%
*-commutative25.4%
times-frac60.2%
Simplified60.2%
if -5.40000000000000025e218 < z < -5.4999999999999998e50Initial program 82.3%
associate-+l-82.3%
*-commutative82.3%
associate-*r*79.4%
*-commutative79.4%
associate-+l-79.4%
*-commutative79.4%
associate-*r*82.3%
*-commutative82.3%
associate-*l*82.2%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in z around inf 67.8%
*-commutative67.8%
associate-/l*62.2%
Simplified62.2%
if -5.4999999999999998e50 < z < 7.79999999999999981e150Initial program 91.8%
associate-+l-91.8%
*-commutative91.8%
associate-*r*93.2%
*-commutative93.2%
associate-+l-93.2%
*-commutative93.2%
associate-*r*91.8%
*-commutative91.8%
associate-*l*91.8%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in z around 0 75.3%
*-commutative75.3%
Simplified75.3%
if 7.79999999999999981e150 < z Initial program 44.2%
associate-+l-44.2%
*-commutative44.2%
associate-*r*40.6%
*-commutative40.6%
associate-+l-40.6%
*-commutative40.6%
associate-*r*44.2%
*-commutative44.2%
associate-*l*44.2%
associate-*l*50.6%
Simplified50.6%
Taylor expanded in z around inf 71.3%
*-commutative71.3%
associate-/l*77.3%
associate-/r/70.9%
Simplified70.9%
Final simplification72.0%
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 -360000000.0)
(* -4.0 (* t (/ a c)))
(if (<= t -9e-199)
(/ b (* z c))
(if (<= t 8e-158) (* 9.0 (/ (* x y) (* 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 <= -360000000.0) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -9e-199) {
tmp = b / (z * c);
} else if (t <= 8e-158) {
tmp = 9.0 * ((x * y) / (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 <= (-360000000.0d0)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= (-9d-199)) then
tmp = b / (z * c)
else if (t <= 8d-158) then
tmp = 9.0d0 * ((x * y) / (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 <= -360000000.0) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -9e-199) {
tmp = b / (z * c);
} else if (t <= 8e-158) {
tmp = 9.0 * ((x * y) / (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 <= -360000000.0: tmp = -4.0 * (t * (a / c)) elif t <= -9e-199: tmp = b / (z * c) elif t <= 8e-158: tmp = 9.0 * ((x * y) / (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 <= -360000000.0) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= -9e-199) tmp = Float64(b / Float64(z * c)); elseif (t <= 8e-158) tmp = Float64(9.0 * Float64(Float64(x * y) / 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 <= -360000000.0)
tmp = -4.0 * (t * (a / c));
elseif (t <= -9e-199)
tmp = b / (z * c);
elseif (t <= 8e-158)
tmp = 9.0 * ((x * y) / (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, -360000000.0], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9e-199], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8e-158], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $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 -360000000:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-199}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-158}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if t < -3.6e8Initial program 81.1%
associate-+l-81.1%
*-commutative81.1%
associate-*r*84.1%
*-commutative84.1%
associate-+l-84.1%
*-commutative84.1%
associate-*r*81.1%
*-commutative81.1%
associate-*l*81.1%
associate-*l*74.4%
Simplified74.4%
Taylor expanded in z around inf 48.5%
*-commutative48.5%
associate-/l*56.7%
associate-/r/61.9%
Simplified61.9%
if -3.6e8 < t < -8.99999999999999995e-199Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*90.0%
*-commutative90.0%
associate-+l-90.0%
*-commutative90.0%
associate-*r*91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in b around inf 58.5%
*-commutative58.5%
Simplified58.5%
if -8.99999999999999995e-199 < t < 8.00000000000000052e-158Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*77.0%
*-commutative77.0%
associate-+l-77.0%
*-commutative77.0%
associate-*r*87.8%
*-commutative87.8%
associate-*l*87.7%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in x around inf 48.1%
if 8.00000000000000052e-158 < t Initial program 73.4%
associate-+l-73.4%
*-commutative73.4%
associate-*r*80.4%
*-commutative80.4%
associate-+l-80.4%
*-commutative80.4%
associate-*r*73.4%
*-commutative73.4%
associate-*l*73.4%
associate-*l*78.4%
Simplified78.4%
Taylor expanded in z around inf 49.1%
Final simplification53.5%
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.3e+43)
(/ (- (/ b z) (* (* a t) 4.0)) c)
(if (<= z 5.2e-211)
(/ (+ b (* 9.0 (* x y))) (* z c))
(+ (/ 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 (z <= -1.3e+43) {
tmp = ((b / z) - ((a * t) * 4.0)) / c;
} else if (z <= 5.2e-211) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (b / (z * c)) + (-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.3d+43)) then
tmp = ((b / z) - ((a * t) * 4.0d0)) / c
else if (z <= 5.2d-211) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (b / (z * c)) + ((-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.3e+43) {
tmp = ((b / z) - ((a * t) * 4.0)) / c;
} else if (z <= 5.2e-211) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (b / (z * c)) + (-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.3e+43: tmp = ((b / z) - ((a * t) * 4.0)) / c elif z <= 5.2e-211: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = (b / (z * c)) + (-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.3e+43) tmp = Float64(Float64(Float64(b / z) - Float64(Float64(a * t) * 4.0)) / c); elseif (z <= 5.2e-211) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(Float64(b / Float64(z * c)) + 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 (z <= -1.3e+43)
tmp = ((b / z) - ((a * t) * 4.0)) / c;
elseif (z <= 5.2e-211)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = (b / (z * c)) + (-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.3e+43], N[(N[(N[(b / z), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 5.2e-211], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(a * t), $MachinePrecision] / 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}\;z \leq -1.3 \cdot 10^{+43}:\\
\;\;\;\;\frac{\frac{b}{z} - \left(a \cdot t\right) \cdot 4}{c}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-211}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c} + -4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -1.3000000000000001e43Initial program 69.0%
associate-+l-69.0%
*-commutative69.0%
associate-*r*68.9%
*-commutative68.9%
associate-+l-68.9%
*-commutative68.9%
associate-*r*69.0%
*-commutative69.0%
associate-*l*68.9%
associate-*l*72.8%
Simplified72.8%
Taylor expanded in x around 0 60.2%
div-sub58.3%
*-commutative58.3%
*-commutative58.3%
times-frac56.7%
*-commutative56.7%
Applied egg-rr56.7%
expm1-log1p-u41.0%
expm1-udef32.0%
associate-*l/32.0%
*-un-lft-identity32.0%
times-frac32.0%
metadata-eval32.0%
associate-/l*35.1%
Applied egg-rr35.1%
expm1-def44.2%
expm1-log1p60.3%
associate-*r/60.3%
*-commutative60.3%
associate-*r/60.2%
associate-/r/62.0%
*-commutative62.0%
associate-*l*67.1%
Simplified67.1%
Taylor expanded in c around 0 72.5%
if -1.3000000000000001e43 < z < 5.2e-211Initial program 96.6%
associate-+l-96.6%
*-commutative96.6%
associate-*r*98.7%
*-commutative98.7%
associate-+l-98.7%
*-commutative98.7%
associate-*r*96.6%
*-commutative96.6%
associate-*l*96.6%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in z around 0 86.6%
*-commutative86.6%
Simplified86.6%
if 5.2e-211 < z Initial program 76.1%
associate-+l-76.1%
*-commutative76.1%
associate-*r*75.9%
*-commutative75.9%
associate-+l-75.9%
*-commutative75.9%
associate-*r*76.1%
*-commutative76.1%
associate-*l*76.1%
associate-*l*77.1%
Simplified77.1%
Taylor expanded in x around 0 58.7%
Taylor expanded in b around 0 69.9%
Final simplification76.3%
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 (<= b -8.5e+212) (not (<= b 112000000.0))) (/ 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 ((b <= -8.5e+212) || !(b <= 112000000.0)) {
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 ((b <= (-8.5d+212)) .or. (.not. (b <= 112000000.0d0))) 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 ((b <= -8.5e+212) || !(b <= 112000000.0)) {
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 (b <= -8.5e+212) or not (b <= 112000000.0): 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 ((b <= -8.5e+212) || !(b <= 112000000.0)) 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 ((b <= -8.5e+212) || ~((b <= 112000000.0)))
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[Or[LessEqual[b, -8.5e+212], N[Not[LessEqual[b, 112000000.0]], $MachinePrecision]], 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}\;b \leq -8.5 \cdot 10^{+212} \lor \neg \left(b \leq 112000000\right):\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if b < -8.49999999999999979e212 or 1.12e8 < b Initial program 89.6%
associate-+l-89.6%
*-commutative89.6%
associate-*r*91.0%
*-commutative91.0%
associate-+l-91.0%
*-commutative91.0%
associate-*r*89.6%
*-commutative89.6%
associate-*l*89.5%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in b around inf 73.7%
*-commutative73.7%
Simplified73.7%
if -8.49999999999999979e212 < b < 1.12e8Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*79.3%
*-commutative79.3%
associate-+l-79.3%
*-commutative79.3%
associate-*r*79.0%
*-commutative79.0%
associate-*l*79.0%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in z around inf 48.9%
Final simplification55.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 (if (<= t -13500000.0) (* -4.0 (* t (/ a c))) (if (<= t 9.5e-170) (/ 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 <= -13500000.0) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 9.5e-170) {
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 <= (-13500000.0d0)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= 9.5d-170) 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 <= -13500000.0) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 9.5e-170) {
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 <= -13500000.0: tmp = -4.0 * (t * (a / c)) elif t <= 9.5e-170: 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 <= -13500000.0) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= 9.5e-170) 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 <= -13500000.0)
tmp = -4.0 * (t * (a / c));
elseif (t <= 9.5e-170)
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, -13500000.0], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-170], 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 -13500000:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-170}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if t < -1.35e7Initial program 81.1%
associate-+l-81.1%
*-commutative81.1%
associate-*r*84.1%
*-commutative84.1%
associate-+l-84.1%
*-commutative84.1%
associate-*r*81.1%
*-commutative81.1%
associate-*l*81.1%
associate-*l*74.4%
Simplified74.4%
Taylor expanded in z around inf 48.5%
*-commutative48.5%
associate-/l*56.7%
associate-/r/61.9%
Simplified61.9%
if -1.35e7 < t < 9.5000000000000001e-170Initial program 90.5%
associate-+l-90.5%
*-commutative90.5%
associate-*r*83.8%
*-commutative83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*90.5%
*-commutative90.5%
associate-*l*90.4%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in b around inf 55.5%
*-commutative55.5%
Simplified55.5%
if 9.5000000000000001e-170 < t Initial program 72.9%
associate-+l-72.9%
*-commutative72.9%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*72.9%
*-commutative72.9%
associate-*l*72.9%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in z around inf 49.8%
Final simplification54.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 81.8%
associate-+l-81.8%
*-commutative81.8%
associate-*r*82.4%
*-commutative82.4%
associate-+l-82.4%
*-commutative82.4%
associate-*r*81.8%
*-commutative81.8%
associate-*l*81.8%
associate-*l*82.2%
Simplified82.2%
Taylor expanded in b around inf 39.7%
*-commutative39.7%
Simplified39.7%
Final simplification39.7%
(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 2024024
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(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)))