
(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 15 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 -3.2e+46)
(/ (- (fma (* y (/ x z)) -9.0 (- (* a (* t 4.0)) (/ b z)))) c)
(if (<= z 4.1e+54)
(* (/ 1.0 z) (/ (+ b (fma x (* y 9.0) (* a (* z (* t -4.0))))) 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 <= -3.2e+46) {
tmp = -fma((y * (x / z)), -9.0, ((a * (t * 4.0)) - (b / z))) / c;
} else if (z <= 4.1e+54) {
tmp = (1.0 / z) * ((b + fma(x, (y * 9.0), (a * (z * (t * -4.0))))) / 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 <= -3.2e+46) tmp = Float64(Float64(-fma(Float64(y * Float64(x / z)), -9.0, Float64(Float64(a * Float64(t * 4.0)) - Float64(b / z)))) / c); elseif (z <= 4.1e+54) tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + fma(x, Float64(y * 9.0), Float64(a * Float64(z * Float64(t * -4.0))))) / 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, -3.2e+46], N[((-N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[(a * N[(t * 4.0), $MachinePrecision]), $MachinePrecision] - N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) / c), $MachinePrecision], If[LessEqual[z, 4.1e+54], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision] + N[(a * N[(z * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 -3.2 \cdot 10^{+46}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(y \cdot \frac{x}{z}, -9, a \cdot \left(t \cdot 4\right) - \frac{b}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+54}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + \mathsf{fma}\left(x, y \cdot 9, a \cdot \left(z \cdot \left(t \cdot -4\right)\right)\right)}{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 < -3.1999999999999998e46Initial program 54.1%
associate-+l-54.1%
*-commutative54.1%
associate-*r*43.9%
*-commutative43.9%
associate-+l-43.9%
*-commutative43.9%
associate-*r*54.1%
*-commutative54.1%
associate-*l*54.1%
associate-*l*57.4%
Simplified57.4%
Taylor expanded in x around 0 72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
+-commutative72.8%
*-commutative72.8%
fma-def72.8%
associate-/l*72.6%
associate-/r/73.9%
fma-def73.8%
*-commutative73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in c around -inf 82.9%
associate-*r/82.9%
mul-1-neg82.9%
*-commutative82.9%
fma-def82.9%
associate-*l/84.6%
*-commutative84.6%
+-commutative84.6%
mul-1-neg84.6%
unsub-neg84.6%
*-commutative84.6%
associate-*l*84.6%
Simplified84.6%
if -3.1999999999999998e46 < z < 4.09999999999999967e54Initial program 93.6%
associate-+l-93.6%
*-commutative93.6%
associate-*r*94.0%
*-commutative94.0%
associate-+l-94.0%
*-commutative94.0%
associate-*r*93.6%
*-commutative93.6%
associate-*l*93.7%
associate-*l*90.3%
Simplified90.3%
Applied egg-rr97.3%
if 4.09999999999999967e54 < z Initial program 57.3%
associate-+l-57.3%
*-commutative57.3%
associate-*r*55.1%
*-commutative55.1%
associate-+l-55.1%
*-commutative55.1%
associate-*r*57.3%
*-commutative57.3%
associate-*l*57.2%
associate-*l*63.2%
Simplified63.2%
Taylor expanded in x around 0 79.7%
cancel-sign-sub-inv79.7%
metadata-eval79.7%
+-commutative79.7%
fma-def79.7%
associate-/l*79.8%
fma-def79.8%
times-frac89.6%
*-commutative89.6%
Simplified89.6%
Final simplification93.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 (or (<= z -8.8e+46) (not (<= z 1.6e-115))) (/ (- (fma (* y (/ x z)) -9.0 (- (* a (* t 4.0)) (/ b z)))) c) (* (/ 1.0 z) (/ (+ b (fma x (* y 9.0) (* a (* z (* t -4.0))))) 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.8e+46) || !(z <= 1.6e-115)) {
tmp = -fma((y * (x / z)), -9.0, ((a * (t * 4.0)) - (b / z))) / c;
} else {
tmp = (1.0 / z) * ((b + fma(x, (y * 9.0), (a * (z * (t * -4.0))))) / 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.8e+46) || !(z <= 1.6e-115)) tmp = Float64(Float64(-fma(Float64(y * Float64(x / z)), -9.0, Float64(Float64(a * Float64(t * 4.0)) - Float64(b / z)))) / c); else tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + fma(x, Float64(y * 9.0), Float64(a * Float64(z * Float64(t * -4.0))))) / 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[Or[LessEqual[z, -8.8e+46], N[Not[LessEqual[z, 1.6e-115]], $MachinePrecision]], N[((-N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[(a * N[(t * 4.0), $MachinePrecision]), $MachinePrecision] - N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) / c), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision] + N[(a * N[(z * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -8.8 \cdot 10^{+46} \lor \neg \left(z \leq 1.6 \cdot 10^{-115}\right):\\
\;\;\;\;\frac{-\mathsf{fma}\left(y \cdot \frac{x}{z}, -9, a \cdot \left(t \cdot 4\right) - \frac{b}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + \mathsf{fma}\left(x, y \cdot 9, a \cdot \left(z \cdot \left(t \cdot -4\right)\right)\right)}{c}\\
\end{array}
\end{array}
if z < -8.8000000000000001e46 or 1.6e-115 < z Initial program 64.5%
associate-+l-64.5%
*-commutative64.5%
associate-*r*59.4%
*-commutative59.4%
associate-+l-59.4%
*-commutative59.4%
associate-*r*64.5%
*-commutative64.5%
associate-*l*64.5%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in x around 0 79.4%
cancel-sign-sub-inv79.4%
metadata-eval79.4%
+-commutative79.4%
*-commutative79.4%
fma-def79.4%
associate-/l*77.8%
associate-/r/79.0%
fma-def79.0%
*-commutative79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in c around -inf 87.1%
associate-*r/87.1%
mul-1-neg87.1%
*-commutative87.1%
fma-def87.1%
associate-*l/89.2%
*-commutative89.2%
+-commutative89.2%
mul-1-neg89.2%
unsub-neg89.2%
*-commutative89.2%
associate-*l*89.2%
Simplified89.2%
if -8.8000000000000001e46 < z < 1.6e-115Initial program 93.6%
associate-+l-93.6%
*-commutative93.6%
associate-*r*94.1%
*-commutative94.1%
associate-+l-94.1%
*-commutative94.1%
associate-*r*93.6%
*-commutative93.6%
associate-*l*93.7%
associate-*l*89.4%
Simplified89.4%
Applied egg-rr97.5%
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 (if (or (<= z -5e+46) (not (<= z 6.2e-82))) (/ (- (fma (* y (/ x z)) -9.0 (- (* a (* t 4.0)) (/ b z)))) 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 <= -5e+46) || !(z <= 6.2e-82)) {
tmp = -fma((y * (x / z)), -9.0, ((a * (t * 4.0)) - (b / z))) / 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 <= -5e+46) || !(z <= 6.2e-82)) tmp = Float64(Float64(-fma(Float64(y * Float64(x / z)), -9.0, Float64(Float64(a * Float64(t * 4.0)) - Float64(b / z)))) / 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
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+46], N[Not[LessEqual[z, 6.2e-82]], $MachinePrecision]], N[((-N[(N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision] * -9.0 + N[(N[(a * N[(t * 4.0), $MachinePrecision]), $MachinePrecision] - N[(b / z), $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 -5 \cdot 10^{+46} \lor \neg \left(z \leq 6.2 \cdot 10^{-82}\right):\\
\;\;\;\;\frac{-\mathsf{fma}\left(y \cdot \frac{x}{z}, -9, a \cdot \left(t \cdot 4\right) - \frac{b}{z}\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 < -5.0000000000000002e46 or 6.19999999999999999e-82 < z Initial program 62.5%
associate-+l-62.5%
*-commutative62.5%
associate-*r*57.2%
*-commutative57.2%
associate-+l-57.2%
*-commutative57.2%
associate-*r*62.5%
*-commutative62.5%
associate-*l*62.5%
associate-*l*66.2%
Simplified66.2%
Taylor expanded in x around 0 78.3%
cancel-sign-sub-inv78.3%
metadata-eval78.3%
+-commutative78.3%
*-commutative78.3%
fma-def78.3%
associate-/l*77.4%
associate-/r/77.9%
fma-def77.9%
*-commutative77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in c around -inf 86.4%
associate-*r/86.4%
mul-1-neg86.4%
*-commutative86.4%
fma-def86.4%
associate-*l/88.7%
*-commutative88.7%
+-commutative88.7%
mul-1-neg88.7%
unsub-neg88.7%
*-commutative88.7%
associate-*l*88.7%
Simplified88.7%
if -5.0000000000000002e46 < z < 6.19999999999999999e-82Initial program 94.0%
Final simplification91.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
(let* ((t_1 (* -4.0 (/ a (/ c t))))
(t_2 (* 9.0 (/ y (* z (/ c x)))))
(t_3 (/ z (* z (/ (/ c (* a -4.0)) t)))))
(if (<= x -3e+70)
t_2
(if (<= x -1.16e-37)
t_1
(if (<= x -8.2e-241)
(/ b (* z c))
(if (<= x -1.7e-277)
t_1
(if (<= x -7.5e-295)
(* b (/ 1.0 (* z c)))
(if (<= x 8.2e-262)
t_3
(if (<= x 1.15e-212)
(/ (/ b c) z)
(if (<= x 2.2e-32) t_3 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 = -4.0 * (a / (c / t));
double t_2 = 9.0 * (y / (z * (c / x)));
double t_3 = z / (z * ((c / (a * -4.0)) / t));
double tmp;
if (x <= -3e+70) {
tmp = t_2;
} else if (x <= -1.16e-37) {
tmp = t_1;
} else if (x <= -8.2e-241) {
tmp = b / (z * c);
} else if (x <= -1.7e-277) {
tmp = t_1;
} else if (x <= -7.5e-295) {
tmp = b * (1.0 / (z * c));
} else if (x <= 8.2e-262) {
tmp = t_3;
} else if (x <= 1.15e-212) {
tmp = (b / c) / z;
} else if (x <= 2.2e-32) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * (a / (c / t))
t_2 = 9.0d0 * (y / (z * (c / x)))
t_3 = z / (z * ((c / (a * (-4.0d0))) / t))
if (x <= (-3d+70)) then
tmp = t_2
else if (x <= (-1.16d-37)) then
tmp = t_1
else if (x <= (-8.2d-241)) then
tmp = b / (z * c)
else if (x <= (-1.7d-277)) then
tmp = t_1
else if (x <= (-7.5d-295)) then
tmp = b * (1.0d0 / (z * c))
else if (x <= 8.2d-262) then
tmp = t_3
else if (x <= 1.15d-212) then
tmp = (b / c) / z
else if (x <= 2.2d-32) then
tmp = t_3
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 = -4.0 * (a / (c / t));
double t_2 = 9.0 * (y / (z * (c / x)));
double t_3 = z / (z * ((c / (a * -4.0)) / t));
double tmp;
if (x <= -3e+70) {
tmp = t_2;
} else if (x <= -1.16e-37) {
tmp = t_1;
} else if (x <= -8.2e-241) {
tmp = b / (z * c);
} else if (x <= -1.7e-277) {
tmp = t_1;
} else if (x <= -7.5e-295) {
tmp = b * (1.0 / (z * c));
} else if (x <= 8.2e-262) {
tmp = t_3;
} else if (x <= 1.15e-212) {
tmp = (b / c) / z;
} else if (x <= 2.2e-32) {
tmp = t_3;
} 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 = -4.0 * (a / (c / t)) t_2 = 9.0 * (y / (z * (c / x))) t_3 = z / (z * ((c / (a * -4.0)) / t)) tmp = 0 if x <= -3e+70: tmp = t_2 elif x <= -1.16e-37: tmp = t_1 elif x <= -8.2e-241: tmp = b / (z * c) elif x <= -1.7e-277: tmp = t_1 elif x <= -7.5e-295: tmp = b * (1.0 / (z * c)) elif x <= 8.2e-262: tmp = t_3 elif x <= 1.15e-212: tmp = (b / c) / z elif x <= 2.2e-32: tmp = t_3 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(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))) t_3 = Float64(z / Float64(z * Float64(Float64(c / Float64(a * -4.0)) / t))) tmp = 0.0 if (x <= -3e+70) tmp = t_2; elseif (x <= -1.16e-37) tmp = t_1; elseif (x <= -8.2e-241) tmp = Float64(b / Float64(z * c)); elseif (x <= -1.7e-277) tmp = t_1; elseif (x <= -7.5e-295) tmp = Float64(b * Float64(1.0 / Float64(z * c))); elseif (x <= 8.2e-262) tmp = t_3; elseif (x <= 1.15e-212) tmp = Float64(Float64(b / c) / z); elseif (x <= 2.2e-32) tmp = t_3; 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 = -4.0 * (a / (c / t));
t_2 = 9.0 * (y / (z * (c / x)));
t_3 = z / (z * ((c / (a * -4.0)) / t));
tmp = 0.0;
if (x <= -3e+70)
tmp = t_2;
elseif (x <= -1.16e-37)
tmp = t_1;
elseif (x <= -8.2e-241)
tmp = b / (z * c);
elseif (x <= -1.7e-277)
tmp = t_1;
elseif (x <= -7.5e-295)
tmp = b * (1.0 / (z * c));
elseif (x <= 8.2e-262)
tmp = t_3;
elseif (x <= 1.15e-212)
tmp = (b / c) / z;
elseif (x <= 2.2e-32)
tmp = t_3;
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[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z / N[(z * N[(N[(c / N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+70], t$95$2, If[LessEqual[x, -1.16e-37], t$95$1, If[LessEqual[x, -8.2e-241], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-277], t$95$1, If[LessEqual[x, -7.5e-295], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e-262], t$95$3, If[LessEqual[x, 1.15e-212], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 2.2e-32], t$95$3, 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 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := 9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
t_3 := \frac{z}{z \cdot \frac{\frac{c}{a \cdot -4}}{t}}\\
\mathbf{if}\;x \leq -3 \cdot 10^{+70}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-241}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-277}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-295}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-262}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-212}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-32}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.99999999999999976e70 or 2.2e-32 < x Initial program 78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*73.6%
*-commutative73.6%
associate-+l-73.6%
*-commutative73.6%
associate-*r*78.6%
*-commutative78.6%
associate-*l*78.6%
associate-*l*75.3%
Simplified75.3%
Taylor expanded in x around 0 69.5%
cancel-sign-sub-inv69.5%
metadata-eval69.5%
+-commutative69.5%
*-commutative69.5%
fma-def69.5%
associate-/l*67.8%
associate-/r/71.9%
fma-def71.9%
*-commutative71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in c around -inf 76.3%
associate-*r/76.3%
mul-1-neg76.3%
*-commutative76.3%
fma-def76.3%
associate-*l/78.8%
*-commutative78.8%
+-commutative78.8%
mul-1-neg78.8%
unsub-neg78.8%
*-commutative78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in y around inf 55.2%
associate-*r/55.1%
times-frac55.3%
*-commutative55.3%
associate-/l*60.8%
times-frac66.5%
*-commutative66.5%
associate-/r/66.4%
associate-*r/66.4%
associate-/r/66.5%
associate-*l/60.7%
/-rgt-identity60.7%
associate-/r*60.7%
times-frac65.6%
/-rgt-identity65.6%
Simplified65.6%
if -2.99999999999999976e70 < x < -1.15999999999999998e-37 or -8.1999999999999997e-241 < x < -1.69999999999999991e-277Initial program 70.9%
associate-+l-70.9%
*-commutative70.9%
associate-*r*79.0%
*-commutative79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*70.9%
*-commutative70.9%
associate-*l*70.9%
associate-*l*79.1%
Simplified79.1%
Taylor expanded in z around inf 65.8%
*-commutative65.8%
associate-/l*70.0%
Simplified70.0%
if -1.15999999999999998e-37 < x < -8.1999999999999997e-241Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*82.9%
*-commutative82.9%
associate-+l-82.9%
*-commutative82.9%
associate-*r*85.3%
*-commutative85.3%
associate-*l*85.3%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in b around inf 49.1%
*-commutative49.1%
Simplified49.1%
if -1.69999999999999991e-277 < x < -7.4999999999999997e-295Initial program 77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*77.5%
*-commutative77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*77.5%
*-commutative77.5%
associate-*l*77.5%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in b around inf 28.3%
*-commutative28.3%
Simplified28.3%
div-inv27.9%
Applied egg-rr27.9%
if -7.4999999999999997e-295 < x < 8.20000000000000052e-262 or 1.15e-212 < x < 2.2e-32Initial program 74.7%
associate-+l-74.7%
*-commutative74.7%
associate-*r*74.1%
*-commutative74.1%
associate-+l-74.1%
*-commutative74.1%
associate-*r*74.7%
*-commutative74.7%
associate-*l*74.7%
associate-*l*77.6%
Simplified77.6%
Applied egg-rr80.0%
Taylor expanded in a around inf 29.8%
*-commutative29.8%
associate-*r/29.8%
metadata-eval29.8%
distribute-lft-neg-in29.8%
distribute-lft-neg-in29.8%
metadata-eval29.8%
associate-*r*29.8%
*-commutative29.8%
associate-/l*31.5%
Simplified31.5%
associate-/l*36.0%
frac-times45.0%
*-un-lft-identity45.0%
*-commutative45.0%
Applied egg-rr45.0%
if 8.20000000000000052e-262 < x < 1.15e-212Initial program 76.0%
associate-+l-76.0%
*-commutative76.0%
associate-*r*67.9%
*-commutative67.9%
associate-+l-67.9%
*-commutative67.9%
associate-*r*76.0%
*-commutative76.0%
associate-*l*76.2%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in b around inf 51.9%
*-commutative51.9%
Simplified51.9%
div-inv51.8%
Applied egg-rr51.8%
*-commutative51.8%
div-inv51.9%
associate-/r*59.9%
Applied egg-rr59.9%
Final simplification57.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 (* -4.0 (/ a (/ c t)))) (t_2 (* 9.0 (* (/ x z) (/ y c)))))
(if (<= x -1.6e+72)
t_2
(if (<= x -4e-38)
t_1
(if (<= x -2.05e-241)
(/ b (* z c))
(if (<= x -1.85e-308)
t_1
(if (<= x 1e-185) (/ (/ b c) z) (if (<= x 2.1e-32) 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 = -4.0 * (a / (c / t));
double t_2 = 9.0 * ((x / z) * (y / c));
double tmp;
if (x <= -1.6e+72) {
tmp = t_2;
} else if (x <= -4e-38) {
tmp = t_1;
} else if (x <= -2.05e-241) {
tmp = b / (z * c);
} else if (x <= -1.85e-308) {
tmp = t_1;
} else if (x <= 1e-185) {
tmp = (b / c) / z;
} else if (x <= 2.1e-32) {
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 = (-4.0d0) * (a / (c / t))
t_2 = 9.0d0 * ((x / z) * (y / c))
if (x <= (-1.6d+72)) then
tmp = t_2
else if (x <= (-4d-38)) then
tmp = t_1
else if (x <= (-2.05d-241)) then
tmp = b / (z * c)
else if (x <= (-1.85d-308)) then
tmp = t_1
else if (x <= 1d-185) then
tmp = (b / c) / z
else if (x <= 2.1d-32) 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 = -4.0 * (a / (c / t));
double t_2 = 9.0 * ((x / z) * (y / c));
double tmp;
if (x <= -1.6e+72) {
tmp = t_2;
} else if (x <= -4e-38) {
tmp = t_1;
} else if (x <= -2.05e-241) {
tmp = b / (z * c);
} else if (x <= -1.85e-308) {
tmp = t_1;
} else if (x <= 1e-185) {
tmp = (b / c) / z;
} else if (x <= 2.1e-32) {
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 = -4.0 * (a / (c / t)) t_2 = 9.0 * ((x / z) * (y / c)) tmp = 0 if x <= -1.6e+72: tmp = t_2 elif x <= -4e-38: tmp = t_1 elif x <= -2.05e-241: tmp = b / (z * c) elif x <= -1.85e-308: tmp = t_1 elif x <= 1e-185: tmp = (b / c) / z elif x <= 2.1e-32: 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(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))) tmp = 0.0 if (x <= -1.6e+72) tmp = t_2; elseif (x <= -4e-38) tmp = t_1; elseif (x <= -2.05e-241) tmp = Float64(b / Float64(z * c)); elseif (x <= -1.85e-308) tmp = t_1; elseif (x <= 1e-185) tmp = Float64(Float64(b / c) / z); elseif (x <= 2.1e-32) 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 = -4.0 * (a / (c / t));
t_2 = 9.0 * ((x / z) * (y / c));
tmp = 0.0;
if (x <= -1.6e+72)
tmp = t_2;
elseif (x <= -4e-38)
tmp = t_1;
elseif (x <= -2.05e-241)
tmp = b / (z * c);
elseif (x <= -1.85e-308)
tmp = t_1;
elseif (x <= 1e-185)
tmp = (b / c) / z;
elseif (x <= 2.1e-32)
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[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+72], t$95$2, If[LessEqual[x, -4e-38], t$95$1, If[LessEqual[x, -2.05e-241], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.85e-308], t$95$1, If[LessEqual[x, 1e-185], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 2.1e-32], 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 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{-241}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-308}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 10^{-185}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.6000000000000001e72 or 2.0999999999999999e-32 < x Initial program 78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*73.6%
*-commutative73.6%
associate-+l-73.6%
*-commutative73.6%
associate-*r*78.6%
*-commutative78.6%
associate-*l*78.6%
associate-*l*75.3%
Simplified75.3%
Applied egg-rr78.3%
Taylor expanded in x around inf 55.2%
*-commutative55.2%
times-frac62.2%
Simplified62.2%
if -1.6000000000000001e72 < x < -3.9999999999999998e-38 or -2.0499999999999999e-241 < x < -1.8499999999999998e-308 or 9.9999999999999999e-186 < x < 2.0999999999999999e-32Initial program 74.3%
associate-+l-74.3%
*-commutative74.3%
associate-*r*76.7%
*-commutative76.7%
associate-+l-76.7%
*-commutative76.7%
associate-*r*74.3%
*-commutative74.3%
associate-*l*74.3%
associate-*l*78.3%
Simplified78.3%
Taylor expanded in z around inf 56.1%
*-commutative56.1%
associate-/l*60.6%
Simplified60.6%
if -3.9999999999999998e-38 < x < -2.0499999999999999e-241Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*82.9%
*-commutative82.9%
associate-+l-82.9%
*-commutative82.9%
associate-*r*85.3%
*-commutative85.3%
associate-*l*85.3%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in b around inf 49.1%
*-commutative49.1%
Simplified49.1%
if -1.8499999999999998e-308 < x < 9.9999999999999999e-186Initial program 73.7%
associate-+l-73.7%
*-commutative73.7%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
*-commutative70.8%
associate-*r*73.7%
*-commutative73.7%
associate-*l*73.8%
associate-*l*76.7%
Simplified76.7%
Taylor expanded in b around inf 50.1%
*-commutative50.1%
Simplified50.1%
div-inv50.0%
Applied egg-rr50.0%
*-commutative50.0%
div-inv50.1%
associate-/r*58.7%
Applied egg-rr58.7%
Final simplification59.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
(let* ((t_1 (* -4.0 (/ a (/ c t)))) (t_2 (* 9.0 (/ y (* z (/ c x))))))
(if (<= x -1.85e+72)
t_2
(if (<= x -5.8e-38)
t_1
(if (<= x -3e-242)
(/ b (* z c))
(if (<= x 1.95e-307)
t_1
(if (<= x 1.9e-185) (/ (/ b c) z) (if (<= x 3.8e-33) 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 = -4.0 * (a / (c / t));
double t_2 = 9.0 * (y / (z * (c / x)));
double tmp;
if (x <= -1.85e+72) {
tmp = t_2;
} else if (x <= -5.8e-38) {
tmp = t_1;
} else if (x <= -3e-242) {
tmp = b / (z * c);
} else if (x <= 1.95e-307) {
tmp = t_1;
} else if (x <= 1.9e-185) {
tmp = (b / c) / z;
} else if (x <= 3.8e-33) {
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 = (-4.0d0) * (a / (c / t))
t_2 = 9.0d0 * (y / (z * (c / x)))
if (x <= (-1.85d+72)) then
tmp = t_2
else if (x <= (-5.8d-38)) then
tmp = t_1
else if (x <= (-3d-242)) then
tmp = b / (z * c)
else if (x <= 1.95d-307) then
tmp = t_1
else if (x <= 1.9d-185) then
tmp = (b / c) / z
else if (x <= 3.8d-33) 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 = -4.0 * (a / (c / t));
double t_2 = 9.0 * (y / (z * (c / x)));
double tmp;
if (x <= -1.85e+72) {
tmp = t_2;
} else if (x <= -5.8e-38) {
tmp = t_1;
} else if (x <= -3e-242) {
tmp = b / (z * c);
} else if (x <= 1.95e-307) {
tmp = t_1;
} else if (x <= 1.9e-185) {
tmp = (b / c) / z;
} else if (x <= 3.8e-33) {
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 = -4.0 * (a / (c / t)) t_2 = 9.0 * (y / (z * (c / x))) tmp = 0 if x <= -1.85e+72: tmp = t_2 elif x <= -5.8e-38: tmp = t_1 elif x <= -3e-242: tmp = b / (z * c) elif x <= 1.95e-307: tmp = t_1 elif x <= 1.9e-185: tmp = (b / c) / z elif x <= 3.8e-33: 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(-4.0 * Float64(a / Float64(c / t))) t_2 = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))) tmp = 0.0 if (x <= -1.85e+72) tmp = t_2; elseif (x <= -5.8e-38) tmp = t_1; elseif (x <= -3e-242) tmp = Float64(b / Float64(z * c)); elseif (x <= 1.95e-307) tmp = t_1; elseif (x <= 1.9e-185) tmp = Float64(Float64(b / c) / z); elseif (x <= 3.8e-33) 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 = -4.0 * (a / (c / t));
t_2 = 9.0 * (y / (z * (c / x)));
tmp = 0.0;
if (x <= -1.85e+72)
tmp = t_2;
elseif (x <= -5.8e-38)
tmp = t_1;
elseif (x <= -3e-242)
tmp = b / (z * c);
elseif (x <= 1.95e-307)
tmp = t_1;
elseif (x <= 1.9e-185)
tmp = (b / c) / z;
elseif (x <= 3.8e-33)
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[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e+72], t$95$2, If[LessEqual[x, -5.8e-38], t$95$1, If[LessEqual[x, -3e-242], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e-307], t$95$1, If[LessEqual[x, 1.9e-185], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 3.8e-33], 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 := -4 \cdot \frac{a}{\frac{c}{t}}\\
t_2 := 9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3 \cdot 10^{-242}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-185}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.8500000000000001e72 or 3.79999999999999994e-33 < x Initial program 78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*73.6%
*-commutative73.6%
associate-+l-73.6%
*-commutative73.6%
associate-*r*78.6%
*-commutative78.6%
associate-*l*78.6%
associate-*l*75.3%
Simplified75.3%
Taylor expanded in x around 0 69.5%
cancel-sign-sub-inv69.5%
metadata-eval69.5%
+-commutative69.5%
*-commutative69.5%
fma-def69.5%
associate-/l*67.8%
associate-/r/71.9%
fma-def71.9%
*-commutative71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in c around -inf 76.3%
associate-*r/76.3%
mul-1-neg76.3%
*-commutative76.3%
fma-def76.3%
associate-*l/78.8%
*-commutative78.8%
+-commutative78.8%
mul-1-neg78.8%
unsub-neg78.8%
*-commutative78.8%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in y around inf 55.2%
associate-*r/55.1%
times-frac55.3%
*-commutative55.3%
associate-/l*60.8%
times-frac66.5%
*-commutative66.5%
associate-/r/66.4%
associate-*r/66.4%
associate-/r/66.5%
associate-*l/60.7%
/-rgt-identity60.7%
associate-/r*60.7%
times-frac65.6%
/-rgt-identity65.6%
Simplified65.6%
if -1.8500000000000001e72 < x < -5.79999999999999988e-38 or -3e-242 < x < 1.95e-307 or 1.9e-185 < x < 3.79999999999999994e-33Initial program 74.7%
associate-+l-74.7%
*-commutative74.7%
associate-*r*77.1%
*-commutative77.1%
associate-+l-77.1%
*-commutative77.1%
associate-*r*74.7%
*-commutative74.7%
associate-*l*74.7%
associate-*l*78.7%
Simplified78.7%
Taylor expanded in z around inf 56.8%
*-commutative56.8%
associate-/l*61.3%
Simplified61.3%
if -5.79999999999999988e-38 < x < -3e-242Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*82.9%
*-commutative82.9%
associate-+l-82.9%
*-commutative82.9%
associate-*r*85.3%
*-commutative85.3%
associate-*l*85.3%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in b around inf 49.1%
*-commutative49.1%
Simplified49.1%
if 1.95e-307 < x < 1.9e-185Initial program 72.9%
associate-+l-72.9%
*-commutative72.9%
associate-*r*69.9%
*-commutative69.9%
associate-+l-69.9%
*-commutative69.9%
associate-*r*72.9%
*-commutative72.9%
associate-*l*72.9%
associate-*l*75.9%
Simplified75.9%
Taylor expanded in b around inf 51.6%
*-commutative51.6%
Simplified51.6%
div-inv51.5%
Applied egg-rr51.5%
*-commutative51.5%
div-inv51.6%
associate-/r*60.5%
Applied egg-rr60.5%
Final simplification61.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
(let* ((t_1 (* y (* x 9.0))))
(if (<= t_1 -1e+257)
(* 9.0 (* (/ x z) (/ y c)))
(if (<= t_1 1e+248)
(/ (+ (* -4.0 (* a t)) (+ (/ b z) (* 9.0 (/ (* y x) z)))) c)
(/ (* (* y 9.0) (/ x 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -1e+257) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (t_1 <= 1e+248) {
tmp = ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((y * x) / z)))) / c;
} else {
tmp = ((y * 9.0) * (x / 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 = y * (x * 9.0d0)
if (t_1 <= (-1d+257)) then
tmp = 9.0d0 * ((x / z) * (y / c))
else if (t_1 <= 1d+248) then
tmp = (((-4.0d0) * (a * t)) + ((b / z) + (9.0d0 * ((y * x) / z)))) / c
else
tmp = ((y * 9.0d0) * (x / 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -1e+257) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (t_1 <= 1e+248) {
tmp = ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((y * x) / z)))) / c;
} else {
tmp = ((y * 9.0) * (x / 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 = y * (x * 9.0) tmp = 0 if t_1 <= -1e+257: tmp = 9.0 * ((x / z) * (y / c)) elif t_1 <= 1e+248: tmp = ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((y * x) / z)))) / c else: tmp = ((y * 9.0) * (x / 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(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= -1e+257) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); elseif (t_1 <= 1e+248) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(b / z) + Float64(9.0 * Float64(Float64(y * x) / z)))) / c); else tmp = Float64(Float64(Float64(y * 9.0) * Float64(x / 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 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -1e+257)
tmp = 9.0 * ((x / z) * (y / c));
elseif (t_1 <= 1e+248)
tmp = ((-4.0 * (a * t)) + ((b / z) + (9.0 * ((y * x) / z)))) / c;
else
tmp = ((y * 9.0) * (x / 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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+257], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+248], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(y * 9.0), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision] / z), $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 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+257}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{elif}\;t_1 \leq 10^{+248}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(\frac{b}{z} + 9 \cdot \frac{y \cdot x}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y \cdot 9\right) \cdot \frac{x}{c}}{z}\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -1.00000000000000003e257Initial program 63.5%
associate-+l-63.5%
*-commutative63.5%
associate-*r*63.5%
*-commutative63.5%
associate-+l-63.5%
*-commutative63.5%
associate-*r*63.5%
*-commutative63.5%
associate-*l*63.5%
associate-*l*59.3%
Simplified59.3%
Applied egg-rr67.8%
Taylor expanded in x around inf 67.8%
*-commutative67.8%
times-frac94.8%
Simplified94.8%
if -1.00000000000000003e257 < (*.f64 (*.f64 x 9) y) < 1.00000000000000005e248Initial program 78.8%
associate-+l-78.8%
*-commutative78.8%
associate-*r*75.7%
*-commutative75.7%
associate-+l-75.7%
*-commutative75.7%
associate-*r*78.8%
*-commutative78.8%
associate-*l*78.8%
associate-*l*80.1%
Simplified80.1%
Taylor expanded in x around 0 80.2%
cancel-sign-sub-inv80.2%
metadata-eval80.2%
+-commutative80.2%
*-commutative80.2%
fma-def80.2%
associate-/l*81.5%
associate-/r/80.8%
fma-def80.8%
*-commutative80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in c around 0 89.8%
if 1.00000000000000005e248 < (*.f64 (*.f64 x 9) y) Initial program 86.4%
associate-+l-86.4%
*-commutative86.4%
associate-*r*86.4%
*-commutative86.4%
associate-+l-86.4%
*-commutative86.4%
associate-*r*86.4%
*-commutative86.4%
associate-*l*86.3%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in x around inf 86.5%
associate-*r/86.4%
*-commutative86.4%
associate-*r*86.3%
*-commutative86.3%
times-frac90.9%
Simplified90.9%
associate-*l/95.3%
Applied egg-rr95.3%
Final simplification90.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 (<= x -5.8e+266)
(* 9.0 (/ y (* z (/ c x))))
(if (<= x -9.2e+70)
(/ (/ (+ b (* y (* x 9.0))) c) z)
(if (<= x 5.2e-84)
(/ (- (/ b z) (* t (* a 4.0))) c)
(+ (* -4.0 (/ (* a t) c)) (* 9.0 (/ (* y x) (* 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 (x <= -5.8e+266) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (x <= -9.2e+70) {
tmp = ((b + (y * (x * 9.0))) / c) / z;
} else if (x <= 5.2e-84) {
tmp = ((b / z) - (t * (a * 4.0))) / c;
} else {
tmp = (-4.0 * ((a * t) / c)) + (9.0 * ((y * x) / (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 (x <= (-5.8d+266)) then
tmp = 9.0d0 * (y / (z * (c / x)))
else if (x <= (-9.2d+70)) then
tmp = ((b + (y * (x * 9.0d0))) / c) / z
else if (x <= 5.2d-84) then
tmp = ((b / z) - (t * (a * 4.0d0))) / c
else
tmp = ((-4.0d0) * ((a * t) / c)) + (9.0d0 * ((y * x) / (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 (x <= -5.8e+266) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (x <= -9.2e+70) {
tmp = ((b + (y * (x * 9.0))) / c) / z;
} else if (x <= 5.2e-84) {
tmp = ((b / z) - (t * (a * 4.0))) / c;
} else {
tmp = (-4.0 * ((a * t) / c)) + (9.0 * ((y * x) / (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 x <= -5.8e+266: tmp = 9.0 * (y / (z * (c / x))) elif x <= -9.2e+70: tmp = ((b + (y * (x * 9.0))) / c) / z elif x <= 5.2e-84: tmp = ((b / z) - (t * (a * 4.0))) / c else: tmp = (-4.0 * ((a * t) / c)) + (9.0 * ((y * x) / (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 (x <= -5.8e+266) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); elseif (x <= -9.2e+70) tmp = Float64(Float64(Float64(b + Float64(y * Float64(x * 9.0))) / c) / z); elseif (x <= 5.2e-84) tmp = Float64(Float64(Float64(b / z) - Float64(t * Float64(a * 4.0))) / c); else tmp = Float64(Float64(-4.0 * Float64(Float64(a * t) / c)) + Float64(9.0 * Float64(Float64(y * x) / 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 (x <= -5.8e+266)
tmp = 9.0 * (y / (z * (c / x)));
elseif (x <= -9.2e+70)
tmp = ((b + (y * (x * 9.0))) / c) / z;
elseif (x <= 5.2e-84)
tmp = ((b / z) - (t * (a * 4.0))) / c;
else
tmp = (-4.0 * ((a * t) / c)) + (9.0 * ((y * x) / (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[x, -5.8e+266], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.2e+70], N[(N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 5.2e-84], N[(N[(N[(b / z), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(y * x), $MachinePrecision] / 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}\;x \leq -5.8 \cdot 10^{+266}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{+70}:\\
\;\;\;\;\frac{\frac{b + y \cdot \left(x \cdot 9\right)}{c}}{z}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{\frac{b}{z} - t \cdot \left(a \cdot 4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c} + 9 \cdot \frac{y \cdot x}{z \cdot c}\\
\end{array}
\end{array}
if x < -5.80000000000000035e266Initial program 76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*76.6%
*-commutative76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*76.6%
*-commutative76.6%
associate-*l*76.6%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in x around 0 76.6%
cancel-sign-sub-inv76.6%
metadata-eval76.6%
+-commutative76.6%
*-commutative76.6%
fma-def76.6%
associate-/l*51.6%
associate-/r/76.6%
fma-def76.6%
*-commutative76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in c around -inf 99.6%
associate-*r/99.6%
mul-1-neg99.6%
*-commutative99.6%
fma-def99.6%
associate-*l/99.6%
*-commutative99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 76.6%
associate-*r/76.6%
times-frac99.6%
*-commutative99.6%
associate-/l*99.2%
times-frac100.0%
*-commutative100.0%
associate-/r/99.6%
associate-*r/99.6%
associate-/r/100.0%
associate-*l/76.6%
/-rgt-identity76.6%
associate-/r*76.6%
times-frac99.6%
/-rgt-identity99.6%
Simplified99.6%
if -5.80000000000000035e266 < x < -9.19999999999999975e70Initial program 69.8%
associate-+l-69.8%
*-commutative69.8%
associate-*r*60.1%
*-commutative60.1%
associate-+l-60.1%
*-commutative60.1%
associate-*r*69.8%
*-commutative69.8%
associate-*l*69.8%
associate-*l*63.0%
Simplified63.0%
Taylor expanded in x around 0 56.0%
cancel-sign-sub-inv56.0%
metadata-eval56.0%
+-commutative56.0%
*-commutative56.0%
fma-def56.0%
associate-/l*53.5%
associate-/r/62.7%
fma-def62.7%
*-commutative62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in z around 0 56.0%
Taylor expanded in c around 0 65.6%
associate-*r*65.6%
Simplified65.6%
if -9.19999999999999975e70 < x < 5.2e-84Initial program 76.7%
associate-+l-76.7%
*-commutative76.7%
associate-*r*77.2%
*-commutative77.2%
associate-+l-77.2%
*-commutative77.2%
associate-*r*76.7%
*-commutative76.7%
associate-*l*76.8%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in x around 0 79.0%
cancel-sign-sub-inv79.0%
metadata-eval79.0%
+-commutative79.0%
*-commutative79.0%
fma-def79.0%
associate-/l*82.5%
associate-/r/79.3%
fma-def79.3%
*-commutative79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in c around -inf 91.6%
associate-*r/91.6%
mul-1-neg91.6%
*-commutative91.6%
fma-def91.6%
associate-*l/90.1%
*-commutative90.1%
+-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
*-commutative90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in y around 0 78.0%
associate-*r/78.0%
*-commutative78.0%
associate-*r*78.0%
mul-1-neg78.0%
*-commutative78.0%
associate-*l*78.0%
Simplified78.0%
if 5.2e-84 < x Initial program 84.3%
associate-+l-84.3%
*-commutative84.3%
associate-*r*80.8%
*-commutative80.8%
associate-+l-80.8%
*-commutative80.8%
associate-*r*84.3%
*-commutative84.3%
associate-*l*84.3%
associate-*l*83.0%
Simplified83.0%
Taylor expanded in b around 0 69.1%
Taylor expanded in x around 0 69.0%
Final simplification73.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 (<= x -1.7e+267)
(* 9.0 (/ y (* z (/ c x))))
(if (or (<= x -1.8e+73) (not (<= x 6.5e-97)))
(/ (/ (+ b (* y (* x 9.0))) c) z)
(/ (- (/ b z) (* t (* a 4.0))) 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 (x <= -1.7e+267) {
tmp = 9.0 * (y / (z * (c / x)));
} else if ((x <= -1.8e+73) || !(x <= 6.5e-97)) {
tmp = ((b + (y * (x * 9.0))) / c) / z;
} else {
tmp = ((b / z) - (t * (a * 4.0))) / 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 (x <= (-1.7d+267)) then
tmp = 9.0d0 * (y / (z * (c / x)))
else if ((x <= (-1.8d+73)) .or. (.not. (x <= 6.5d-97))) then
tmp = ((b + (y * (x * 9.0d0))) / c) / z
else
tmp = ((b / z) - (t * (a * 4.0d0))) / 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 (x <= -1.7e+267) {
tmp = 9.0 * (y / (z * (c / x)));
} else if ((x <= -1.8e+73) || !(x <= 6.5e-97)) {
tmp = ((b + (y * (x * 9.0))) / c) / z;
} else {
tmp = ((b / z) - (t * (a * 4.0))) / 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 x <= -1.7e+267: tmp = 9.0 * (y / (z * (c / x))) elif (x <= -1.8e+73) or not (x <= 6.5e-97): tmp = ((b + (y * (x * 9.0))) / c) / z else: tmp = ((b / z) - (t * (a * 4.0))) / 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 (x <= -1.7e+267) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); elseif ((x <= -1.8e+73) || !(x <= 6.5e-97)) tmp = Float64(Float64(Float64(b + Float64(y * Float64(x * 9.0))) / c) / z); else tmp = Float64(Float64(Float64(b / z) - Float64(t * Float64(a * 4.0))) / 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 (x <= -1.7e+267)
tmp = 9.0 * (y / (z * (c / x)));
elseif ((x <= -1.8e+73) || ~((x <= 6.5e-97)))
tmp = ((b + (y * (x * 9.0))) / c) / z;
else
tmp = ((b / z) - (t * (a * 4.0))) / 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[x, -1.7e+267], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.8e+73], N[Not[LessEqual[x, 6.5e-97]], $MachinePrecision]], N[(N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - N[(t * N[(a * 4.0), $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}\;x \leq -1.7 \cdot 10^{+267}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{+73} \lor \neg \left(x \leq 6.5 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{\frac{b + y \cdot \left(x \cdot 9\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - t \cdot \left(a \cdot 4\right)}{c}\\
\end{array}
\end{array}
if x < -1.69999999999999991e267Initial program 76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*76.6%
*-commutative76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*76.6%
*-commutative76.6%
associate-*l*76.6%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in x around 0 76.6%
cancel-sign-sub-inv76.6%
metadata-eval76.6%
+-commutative76.6%
*-commutative76.6%
fma-def76.6%
associate-/l*51.6%
associate-/r/76.6%
fma-def76.6%
*-commutative76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in c around -inf 99.6%
associate-*r/99.6%
mul-1-neg99.6%
*-commutative99.6%
fma-def99.6%
associate-*l/99.6%
*-commutative99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around inf 76.6%
associate-*r/76.6%
times-frac99.6%
*-commutative99.6%
associate-/l*99.2%
times-frac100.0%
*-commutative100.0%
associate-/r/99.6%
associate-*r/99.6%
associate-/r/100.0%
associate-*l/76.6%
/-rgt-identity76.6%
associate-/r*76.6%
times-frac99.6%
/-rgt-identity99.6%
Simplified99.6%
if -1.69999999999999991e267 < x < -1.7999999999999999e73 or 6.5000000000000004e-97 < x Initial program 78.5%
associate-+l-78.5%
*-commutative78.5%
associate-*r*73.1%
*-commutative73.1%
associate-+l-73.1%
*-commutative73.1%
associate-*r*78.5%
*-commutative78.5%
associate-*l*78.6%
associate-*l*75.5%
Simplified75.5%
Taylor expanded in x around 0 70.1%
cancel-sign-sub-inv70.1%
metadata-eval70.1%
+-commutative70.1%
*-commutative70.1%
fma-def70.1%
associate-/l*69.3%
associate-/r/72.3%
fma-def72.3%
*-commutative72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in z around 0 61.9%
Taylor expanded in c around 0 66.7%
associate-*r*66.7%
Simplified66.7%
if -1.7999999999999999e73 < x < 6.5000000000000004e-97Initial program 77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*78.0%
*-commutative78.0%
associate-+l-78.0%
*-commutative78.0%
associate-*r*77.5%
*-commutative77.5%
associate-*l*77.6%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in x around 0 79.9%
cancel-sign-sub-inv79.9%
metadata-eval79.9%
+-commutative79.9%
*-commutative79.9%
fma-def79.9%
associate-/l*83.5%
associate-/r/80.1%
fma-def80.1%
*-commutative80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in c around -inf 91.3%
associate-*r/91.3%
mul-1-neg91.3%
*-commutative91.3%
fma-def91.3%
associate-*l/89.8%
*-commutative89.8%
+-commutative89.8%
mul-1-neg89.8%
unsub-neg89.8%
*-commutative89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in y around 0 77.3%
associate-*r/77.3%
*-commutative77.3%
associate-*r*77.3%
mul-1-neg77.3%
*-commutative77.3%
associate-*l*77.3%
Simplified77.3%
Final simplification72.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 -2.2e+158)
(/ z (* z (/ (/ c (* a -4.0)) t)))
(if (<= t 1.2e+42)
(/ (+ b (* 9.0 (* y x))) (* 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 (t <= -2.2e+158) {
tmp = z / (z * ((c / (a * -4.0)) / t));
} else if (t <= 1.2e+42) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = -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 (t <= (-2.2d+158)) then
tmp = z / (z * ((c / (a * (-4.0d0))) / t))
else if (t <= 1.2d+42) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else
tmp = (-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 (t <= -2.2e+158) {
tmp = z / (z * ((c / (a * -4.0)) / t));
} else if (t <= 1.2e+42) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = -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 t <= -2.2e+158: tmp = z / (z * ((c / (a * -4.0)) / t)) elif t <= 1.2e+42: tmp = (b + (9.0 * (y * x))) / (z * c) else: tmp = -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 (t <= -2.2e+158) tmp = Float64(z / Float64(z * Float64(Float64(c / Float64(a * -4.0)) / t))); elseif (t <= 1.2e+42) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); else tmp = 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 (t <= -2.2e+158)
tmp = z / (z * ((c / (a * -4.0)) / t));
elseif (t <= 1.2e+42)
tmp = (b + (9.0 * (y * x))) / (z * c);
else
tmp = -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[t, -2.2e+158], N[(z / N[(z * N[(N[(c / N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+42], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $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 -2.2 \cdot 10^{+158}:\\
\;\;\;\;\frac{z}{z \cdot \frac{\frac{c}{a \cdot -4}}{t}}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+42}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if t < -2.2000000000000001e158Initial program 68.6%
associate-+l-68.6%
*-commutative68.6%
associate-*r*72.2%
*-commutative72.2%
associate-+l-72.2%
*-commutative72.2%
associate-*r*68.6%
*-commutative68.6%
associate-*l*68.6%
associate-*l*64.8%
Simplified64.8%
Applied egg-rr69.1%
Taylor expanded in a around inf 57.7%
*-commutative57.7%
associate-*r/57.7%
metadata-eval57.7%
distribute-lft-neg-in57.7%
distribute-lft-neg-in57.7%
metadata-eval57.7%
associate-*r*57.7%
*-commutative57.7%
associate-/l*61.5%
Simplified61.5%
associate-/l*69.3%
frac-times87.8%
*-un-lft-identity87.8%
*-commutative87.8%
Applied egg-rr87.8%
if -2.2000000000000001e158 < t < 1.1999999999999999e42Initial program 80.5%
associate-+l-80.5%
*-commutative80.5%
associate-*r*74.3%
*-commutative74.3%
associate-+l-74.3%
*-commutative74.3%
associate-*r*80.5%
*-commutative80.5%
associate-*l*80.6%
associate-*l*80.8%
Simplified80.8%
Taylor expanded in x around inf 69.6%
if 1.1999999999999999e42 < t Initial program 75.5%
associate-+l-75.5%
*-commutative75.5%
associate-*r*79.7%
*-commutative79.7%
associate-+l-79.7%
*-commutative79.7%
associate-*r*75.5%
*-commutative75.5%
associate-*l*75.5%
associate-*l*75.6%
Simplified75.6%
Taylor expanded in z around inf 43.9%
*-commutative43.9%
associate-/l*57.7%
Simplified57.7%
Final simplification68.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 -1.9e+156)
(/ z (* z (/ (/ c (* a -4.0)) t)))
(if (<= t 7.6e+53)
(/ (/ (+ b (* y (* x 9.0))) c) z)
(* -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 (t <= -1.9e+156) {
tmp = z / (z * ((c / (a * -4.0)) / t));
} else if (t <= 7.6e+53) {
tmp = ((b + (y * (x * 9.0))) / c) / z;
} else {
tmp = -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 (t <= (-1.9d+156)) then
tmp = z / (z * ((c / (a * (-4.0d0))) / t))
else if (t <= 7.6d+53) then
tmp = ((b + (y * (x * 9.0d0))) / c) / z
else
tmp = (-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 (t <= -1.9e+156) {
tmp = z / (z * ((c / (a * -4.0)) / t));
} else if (t <= 7.6e+53) {
tmp = ((b + (y * (x * 9.0))) / c) / z;
} else {
tmp = -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 t <= -1.9e+156: tmp = z / (z * ((c / (a * -4.0)) / t)) elif t <= 7.6e+53: tmp = ((b + (y * (x * 9.0))) / c) / z else: tmp = -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 (t <= -1.9e+156) tmp = Float64(z / Float64(z * Float64(Float64(c / Float64(a * -4.0)) / t))); elseif (t <= 7.6e+53) tmp = Float64(Float64(Float64(b + Float64(y * Float64(x * 9.0))) / c) / z); else tmp = 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 (t <= -1.9e+156)
tmp = z / (z * ((c / (a * -4.0)) / t));
elseif (t <= 7.6e+53)
tmp = ((b + (y * (x * 9.0))) / c) / z;
else
tmp = -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[t, -1.9e+156], N[(z / N[(z * N[(N[(c / N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e+53], N[(N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $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 -1.9 \cdot 10^{+156}:\\
\;\;\;\;\frac{z}{z \cdot \frac{\frac{c}{a \cdot -4}}{t}}\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{+53}:\\
\;\;\;\;\frac{\frac{b + y \cdot \left(x \cdot 9\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if t < -1.90000000000000012e156Initial program 68.6%
associate-+l-68.6%
*-commutative68.6%
associate-*r*72.2%
*-commutative72.2%
associate-+l-72.2%
*-commutative72.2%
associate-*r*68.6%
*-commutative68.6%
associate-*l*68.6%
associate-*l*64.8%
Simplified64.8%
Applied egg-rr69.1%
Taylor expanded in a around inf 57.7%
*-commutative57.7%
associate-*r/57.7%
metadata-eval57.7%
distribute-lft-neg-in57.7%
distribute-lft-neg-in57.7%
metadata-eval57.7%
associate-*r*57.7%
*-commutative57.7%
associate-/l*61.5%
Simplified61.5%
associate-/l*69.3%
frac-times87.8%
*-un-lft-identity87.8%
*-commutative87.8%
Applied egg-rr87.8%
if -1.90000000000000012e156 < t < 7.59999999999999995e53Initial program 80.4%
associate-+l-80.4%
*-commutative80.4%
associate-*r*74.3%
*-commutative74.3%
associate-+l-74.3%
*-commutative74.3%
associate-*r*80.4%
*-commutative80.4%
associate-*l*80.5%
associate-*l*80.7%
Simplified80.7%
Taylor expanded in x around 0 76.3%
cancel-sign-sub-inv76.3%
metadata-eval76.3%
+-commutative76.3%
*-commutative76.3%
fma-def76.3%
associate-/l*73.9%
associate-/r/71.5%
fma-def71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in z around 0 71.9%
Taylor expanded in c around 0 75.6%
associate-*r*75.6%
Simplified75.6%
if 7.59999999999999995e53 < t Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*75.4%
*-commutative75.4%
associate-*l*75.4%
associate-*l*75.6%
Simplified75.6%
Taylor expanded in z around inf 45.0%
*-commutative45.0%
associate-/l*59.6%
Simplified59.6%
Final simplification72.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 (<= b -1.45e+26) (not (<= b 1.2e-18))) (/ (/ b c) 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 ((b <= -1.45e+26) || !(b <= 1.2e-18)) {
tmp = (b / c) / z;
} 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 <= (-1.45d+26)) .or. (.not. (b <= 1.2d-18))) then
tmp = (b / c) / z
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 <= -1.45e+26) || !(b <= 1.2e-18)) {
tmp = (b / c) / z;
} 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 <= -1.45e+26) or not (b <= 1.2e-18): tmp = (b / c) / z 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 <= -1.45e+26) || !(b <= 1.2e-18)) tmp = Float64(Float64(b / c) / z); 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 <= -1.45e+26) || ~((b <= 1.2e-18)))
tmp = (b / c) / z;
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, -1.45e+26], N[Not[LessEqual[b, 1.2e-18]], $MachinePrecision]], N[(N[(b / c), $MachinePrecision] / z), $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 -1.45 \cdot 10^{+26} \lor \neg \left(b \leq 1.2 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if b < -1.45e26 or 1.19999999999999997e-18 < b Initial program 77.0%
associate-+l-77.0%
*-commutative77.0%
associate-*r*72.2%
*-commutative72.2%
associate-+l-72.2%
*-commutative72.2%
associate-*r*77.0%
*-commutative77.0%
associate-*l*77.0%
associate-*l*75.5%
Simplified75.5%
Taylor expanded in b around inf 51.2%
*-commutative51.2%
Simplified51.2%
div-inv51.2%
Applied egg-rr51.2%
*-commutative51.2%
div-inv51.2%
associate-/r*53.6%
Applied egg-rr53.6%
if -1.45e26 < b < 1.19999999999999997e-18Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*78.6%
*-commutative78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*79.0%
*-commutative79.0%
associate-*l*79.0%
associate-*l*80.1%
Simplified80.1%
Taylor expanded in z around inf 46.8%
Final simplification50.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 (<= t -3.4e-80) (not (<= t 3.6e-73))) (* -4.0 (/ a (/ c t))) (/ 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 ((t <= -3.4e-80) || !(t <= 3.6e-73)) {
tmp = -4.0 * (a / (c / t));
} 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 ((t <= (-3.4d-80)) .or. (.not. (t <= 3.6d-73))) then
tmp = (-4.0d0) * (a / (c / t))
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 ((t <= -3.4e-80) || !(t <= 3.6e-73)) {
tmp = -4.0 * (a / (c / t));
} 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 (t <= -3.4e-80) or not (t <= 3.6e-73): tmp = -4.0 * (a / (c / t)) 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 ((t <= -3.4e-80) || !(t <= 3.6e-73)) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 ((t <= -3.4e-80) || ~((t <= 3.6e-73)))
tmp = -4.0 * (a / (c / t));
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[t, -3.4e-80], N[Not[LessEqual[t, 3.6e-73]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $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}\;t \leq -3.4 \cdot 10^{-80} \lor \neg \left(t \leq 3.6 \cdot 10^{-73}\right):\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if t < -3.4000000000000001e-80 or 3.5999999999999999e-73 < t Initial program 75.9%
associate-+l-75.9%
*-commutative75.9%
associate-*r*77.6%
*-commutative77.6%
associate-+l-77.6%
*-commutative77.6%
associate-*r*75.9%
*-commutative75.9%
associate-*l*75.9%
associate-*l*75.3%
Simplified75.3%
Taylor expanded in z around inf 43.2%
*-commutative43.2%
associate-/l*50.9%
Simplified50.9%
if -3.4000000000000001e-80 < t < 3.5999999999999999e-73Initial program 81.5%
associate-+l-81.5%
*-commutative81.5%
associate-*r*72.1%
*-commutative72.1%
associate-+l-72.1%
*-commutative72.1%
associate-*r*81.5%
*-commutative81.5%
associate-*l*81.6%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in b around inf 48.2%
*-commutative48.2%
Simplified48.2%
Final simplification49.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 (<= a 2e-121) (/ (/ b c) 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 (a <= 2e-121) {
tmp = (b / c) / z;
} 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 (a <= 2d-121) then
tmp = (b / c) / z
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 (a <= 2e-121) {
tmp = (b / c) / z;
} 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 a <= 2e-121: tmp = (b / c) / z 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 (a <= 2e-121) tmp = Float64(Float64(b / c) / z); 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 (a <= 2e-121)
tmp = (b / c) / z;
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[LessEqual[a, 2e-121], N[(N[(b / c), $MachinePrecision] / z), $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}\;a \leq 2 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if a < 2e-121Initial program 76.4%
associate-+l-76.4%
*-commutative76.4%
associate-*r*75.5%
*-commutative75.5%
associate-+l-75.5%
*-commutative75.5%
associate-*r*76.4%
*-commutative76.4%
associate-*l*76.4%
associate-*l*76.7%
Simplified76.7%
Taylor expanded in b around inf 34.2%
*-commutative34.2%
Simplified34.2%
div-inv34.1%
Applied egg-rr34.1%
*-commutative34.1%
div-inv34.2%
associate-/r*35.3%
Applied egg-rr35.3%
if 2e-121 < a Initial program 80.6%
associate-+l-80.6%
*-commutative80.6%
associate-*r*75.5%
*-commutative75.5%
associate-+l-75.5%
*-commutative75.5%
associate-*r*80.6%
*-commutative80.6%
associate-*l*80.7%
associate-*l*79.8%
Simplified79.8%
Taylor expanded in b around inf 31.7%
*-commutative31.7%
Simplified31.7%
Final simplification34.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 (/ 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 78.0%
associate-+l-78.0%
*-commutative78.0%
associate-*r*75.5%
*-commutative75.5%
associate-+l-75.5%
*-commutative75.5%
associate-*r*78.0%
*-commutative78.0%
associate-*l*78.0%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in b around inf 33.3%
*-commutative33.3%
Simplified33.3%
Final simplification33.3%
(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 2024019
(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)))