
(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 16 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}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 8.2e+15)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(if (<= c_m 2.9e+266)
(fma
9.0
(/ (* x (/ y c_m)) z)
(fma (* a (/ t c_m)) -4.0 (/ b (* c_m z))))
(*
t
(+
(* -4.0 (/ a c_m))
(+ (* 9.0 (* (/ x c_m) (/ y (* z t)))) (/ b (* c_m (* z t))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 8.2e+15) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else if (c_m <= 2.9e+266) {
tmp = fma(9.0, ((x * (y / c_m)) / z), fma((a * (t / c_m)), -4.0, (b / (c_m * z))));
} else {
tmp = t * ((-4.0 * (a / c_m)) + ((9.0 * ((x / c_m) * (y / (z * t)))) + (b / (c_m * (z * t)))));
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 8.2e+15) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); elseif (c_m <= 2.9e+266) tmp = fma(9.0, Float64(Float64(x * Float64(y / c_m)) / z), fma(Float64(a * Float64(t / c_m)), -4.0, Float64(b / Float64(c_m * z)))); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / Float64(z * t)))) + Float64(b / Float64(c_m * Float64(z * t)))))); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 8.2e+15], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c$95$m, 2.9e+266], N[(9.0 * N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 8.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;c\_m \leq 2.9 \cdot 10^{+266}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{x \cdot \frac{y}{c\_m}}{z}, \mathsf{fma}\left(a \cdot \frac{t}{c\_m}, -4, \frac{b}{c\_m \cdot z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \left(9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z \cdot t}\right) + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\right)\\
\end{array}
\end{array}
if c < 8.2e15Initial program 86.8%
+-commutative86.8%
associate-+r-86.8%
*-commutative86.8%
associate-*r*89.2%
*-commutative89.2%
associate-+r-89.2%
+-commutative89.2%
associate-*l*89.2%
associate-*l*88.7%
*-commutative88.7%
Simplified88.7%
if 8.2e15 < c < 2.90000000000000017e266Initial program 66.2%
+-commutative66.2%
associate-+r-66.2%
*-commutative66.2%
associate-*r*61.8%
*-commutative61.8%
associate-+r-61.8%
+-commutative61.8%
associate-*l*61.7%
associate-*l*64.2%
*-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 75.4%
associate--l+75.4%
fma-define75.4%
associate-/r*78.7%
associate-/l*83.5%
cancel-sign-sub-inv83.5%
metadata-eval83.5%
+-commutative83.5%
*-commutative83.5%
fma-define83.5%
associate-/l*97.4%
*-commutative97.4%
Simplified97.4%
if 2.90000000000000017e266 < c Initial program 45.9%
+-commutative45.9%
associate-+r-45.9%
*-commutative45.9%
associate-*r*52.1%
*-commutative52.1%
associate-+r-52.1%
+-commutative52.1%
associate-*l*52.1%
associate-*l*52.7%
*-commutative52.7%
Simplified52.7%
Taylor expanded in t around inf 63.3%
times-frac73.6%
*-commutative73.6%
Applied egg-rr73.6%
Final simplification89.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1.4e-36) (not (<= z 3e+60)))
(/ (* t (+ (* a -4.0) (+ (* 9.0 (/ (* x y) (* z t))) (/ b (* z t))))) c_m)
(/ (+ b (fma x (* 9.0 y) (* t (* a (* z -4.0))))) (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.4e-36) || !(z <= 3e+60)) {
tmp = (t * ((a * -4.0) + ((9.0 * ((x * y) / (z * t))) + (b / (z * t))))) / c_m;
} else {
tmp = (b + fma(x, (9.0 * y), (t * (a * (z * -4.0))))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -1.4e-36) || !(z <= 3e+60)) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) + Float64(Float64(9.0 * Float64(Float64(x * y) / Float64(z * t))) + Float64(b / Float64(z * t))))) / c_m); else tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -1.4e-36], N[Not[LessEqual[z, 3e+60]], $MachinePrecision]], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-36} \lor \neg \left(z \leq 3 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4 + \left(9 \cdot \frac{x \cdot y}{z \cdot t} + \frac{b}{z \cdot t}\right)\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -1.4000000000000001e-36 or 2.9999999999999998e60 < z Initial program 66.5%
+-commutative66.5%
associate-+r-66.5%
*-commutative66.5%
associate-*r*69.5%
*-commutative69.5%
associate-+r-69.5%
+-commutative69.5%
associate-*l*69.4%
associate-*l*72.7%
*-commutative72.7%
Simplified72.7%
Taylor expanded in t around inf 81.9%
Taylor expanded in c around 0 86.0%
if -1.4000000000000001e-36 < z < 2.9999999999999998e60Initial program 96.3%
Simplified97.0%
Final simplification91.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (* x (* 9.0 y)) b) (* c_m z)))
(t_2 (* t (* -4.0 (/ a c_m)))))
(*
c_s
(if (<= a -3.5e-37)
t_2
(if (<= a 5.4e+41)
t_1
(if (<= a 2.7e+142)
t_2
(if (<= a 1e+184) t_1 (* a (/ (* t -4.0) c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((x * (9.0 * y)) + b) / (c_m * z);
double t_2 = t * (-4.0 * (a / c_m));
double tmp;
if (a <= -3.5e-37) {
tmp = t_2;
} else if (a <= 5.4e+41) {
tmp = t_1;
} else if (a <= 2.7e+142) {
tmp = t_2;
} else if (a <= 1e+184) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * (9.0d0 * y)) + b) / (c_m * z)
t_2 = t * ((-4.0d0) * (a / c_m))
if (a <= (-3.5d-37)) then
tmp = t_2
else if (a <= 5.4d+41) then
tmp = t_1
else if (a <= 2.7d+142) then
tmp = t_2
else if (a <= 1d+184) then
tmp = t_1
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((x * (9.0 * y)) + b) / (c_m * z);
double t_2 = t * (-4.0 * (a / c_m));
double tmp;
if (a <= -3.5e-37) {
tmp = t_2;
} else if (a <= 5.4e+41) {
tmp = t_1;
} else if (a <= 2.7e+142) {
tmp = t_2;
} else if (a <= 1e+184) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((x * (9.0 * y)) + b) / (c_m * z) t_2 = t * (-4.0 * (a / c_m)) tmp = 0 if a <= -3.5e-37: tmp = t_2 elif a <= 5.4e+41: tmp = t_1 elif a <= 2.7e+142: tmp = t_2 elif a <= 1e+184: tmp = t_1 else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c_m * z)) t_2 = Float64(t * Float64(-4.0 * Float64(a / c_m))) tmp = 0.0 if (a <= -3.5e-37) tmp = t_2; elseif (a <= 5.4e+41) tmp = t_1; elseif (a <= 2.7e+142) tmp = t_2; elseif (a <= 1e+184) tmp = t_1; else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((x * (9.0 * y)) + b) / (c_m * z);
t_2 = t * (-4.0 * (a / c_m));
tmp = 0.0;
if (a <= -3.5e-37)
tmp = t_2;
elseif (a <= 5.4e+41)
tmp = t_1;
elseif (a <= 2.7e+142)
tmp = t_2;
elseif (a <= 1e+184)
tmp = t_1;
else
tmp = a * ((t * -4.0) / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -3.5e-37], t$95$2, If[LessEqual[a, 5.4e+41], t$95$1, If[LessEqual[a, 2.7e+142], t$95$2, If[LessEqual[a, 1e+184], t$95$1, N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(9 \cdot y\right) + b}{c\_m \cdot z}\\
t_2 := t \cdot \left(-4 \cdot \frac{a}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-37}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
\end{array}
if a < -3.5000000000000001e-37 or 5.39999999999999999e41 < a < 2.69999999999999983e142Initial program 80.2%
+-commutative80.2%
associate-+r-80.2%
*-commutative80.2%
associate-*r*79.3%
*-commutative79.3%
associate-+r-79.3%
+-commutative79.3%
associate-*l*79.3%
associate-*l*79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in x around 0 69.7%
Taylor expanded in t around inf 75.1%
Taylor expanded in a around inf 68.2%
if -3.5000000000000001e-37 < a < 5.39999999999999999e41 or 2.69999999999999983e142 < a < 1.00000000000000002e184Initial program 82.0%
+-commutative82.0%
associate-+r-82.0%
*-commutative82.0%
associate-*r*87.2%
*-commutative87.2%
associate-+r-87.2%
+-commutative87.2%
associate-*l*87.2%
associate-*l*85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in x around inf 72.0%
associate-*r*72.0%
*-commutative72.0%
associate-*r*72.0%
Simplified72.0%
if 1.00000000000000002e184 < a Initial program 89.6%
+-commutative89.6%
associate-+r-89.6%
*-commutative89.6%
associate-*r*82.5%
*-commutative82.5%
associate-+r-82.5%
+-commutative82.5%
associate-*l*82.5%
associate-*l*89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in z around inf 71.5%
*-commutative71.5%
associate-/l*71.4%
associate-*r*71.4%
associate-*l/71.4%
Simplified71.4%
Final simplification70.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= y -8.4e-51)
(/ (+ (* x (* 9.0 y)) b) (* c_m z))
(if (<= y 1.55e-97)
(/ (+ b (* t (* z (* a -4.0)))) (* c_m z))
(if (<= y 1.12e+179)
(* a (- (/ b (* z (* c_m a))) (* (/ t c_m) 4.0)))
(* 9.0 (* x (/ (/ y c_m) z))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (y <= -8.4e-51) {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
} else if (y <= 1.55e-97) {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
} else if (y <= 1.12e+179) {
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0));
} else {
tmp = 9.0 * (x * ((y / c_m) / z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (y <= (-8.4d-51)) then
tmp = ((x * (9.0d0 * y)) + b) / (c_m * z)
else if (y <= 1.55d-97) then
tmp = (b + (t * (z * (a * (-4.0d0))))) / (c_m * z)
else if (y <= 1.12d+179) then
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0d0))
else
tmp = 9.0d0 * (x * ((y / c_m) / z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (y <= -8.4e-51) {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
} else if (y <= 1.55e-97) {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
} else if (y <= 1.12e+179) {
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0));
} else {
tmp = 9.0 * (x * ((y / c_m) / z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if y <= -8.4e-51: tmp = ((x * (9.0 * y)) + b) / (c_m * z) elif y <= 1.55e-97: tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z) elif y <= 1.12e+179: tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0)) else: tmp = 9.0 * (x * ((y / c_m) / z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (y <= -8.4e-51) tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c_m * z)); elseif (y <= 1.55e-97) tmp = Float64(Float64(b + Float64(t * Float64(z * Float64(a * -4.0)))) / Float64(c_m * z)); elseif (y <= 1.12e+179) tmp = Float64(a * Float64(Float64(b / Float64(z * Float64(c_m * a))) - Float64(Float64(t / c_m) * 4.0))); else tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (y <= -8.4e-51)
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
elseif (y <= 1.55e-97)
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
elseif (y <= 1.12e+179)
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0));
else
tmp = 9.0 * (x * ((y / c_m) / z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[y, -8.4e-51], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-97], N[(N[(b + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e+179], N[(a * N[(N[(b / N[(z * N[(c$95$m * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t / c$95$m), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-51}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-97}:\\
\;\;\;\;\frac{b + t \cdot \left(z \cdot \left(a \cdot -4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+179}:\\
\;\;\;\;a \cdot \left(\frac{b}{z \cdot \left(c\_m \cdot a\right)} - \frac{t}{c\_m} \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\end{array}
\end{array}
if y < -8.40000000000000006e-51Initial program 79.9%
+-commutative79.9%
associate-+r-79.9%
*-commutative79.9%
associate-*r*81.3%
*-commutative81.3%
associate-+r-81.3%
+-commutative81.3%
associate-*l*81.3%
associate-*l*83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in x around inf 56.7%
associate-*r*56.6%
*-commutative56.6%
associate-*r*56.7%
Simplified56.7%
if -8.40000000000000006e-51 < y < 1.55000000000000001e-97Initial program 90.7%
+-commutative90.7%
associate-+r-90.7%
*-commutative90.7%
associate-*r*93.7%
*-commutative93.7%
associate-+r-93.7%
+-commutative93.7%
associate-*l*93.7%
associate-*l*92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in t around inf 92.6%
Taylor expanded in x around 0 85.5%
associate-*r*85.5%
Simplified85.5%
if 1.55000000000000001e-97 < y < 1.11999999999999997e179Initial program 72.5%
+-commutative72.5%
associate-+r-72.5%
*-commutative72.5%
associate-*r*72.1%
*-commutative72.1%
associate-+r-72.1%
+-commutative72.1%
associate-*l*72.0%
associate-*l*72.0%
*-commutative72.0%
Simplified72.0%
Taylor expanded in x around 0 50.2%
Taylor expanded in a around -inf 61.8%
mul-1-neg61.8%
distribute-rgt-neg-in61.8%
+-commutative61.8%
mul-1-neg61.8%
unsub-neg61.8%
*-commutative61.8%
*-commutative61.8%
associate-*l*68.7%
Simplified68.7%
if 1.11999999999999997e179 < y Initial program 79.1%
+-commutative79.1%
associate-+r-79.1%
*-commutative79.1%
associate-*r*78.9%
*-commutative78.9%
associate-+r-78.9%
+-commutative78.9%
associate-*l*78.9%
associate-*l*75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in x around inf 58.5%
associate-/l*62.1%
associate-/r*72.3%
Simplified72.3%
Final simplification71.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -8.1e+201)
(* a (/ (* t -4.0) c_m))
(if (<= z 6.6e+125)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -8.1e+201) {
tmp = a * ((t * -4.0) / c_m);
} else if (z <= 6.6e+125) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (z <= (-8.1d+201)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (z <= 6.6d+125) then
tmp = (((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a))) + b) / (c_m * z)
else
tmp = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -8.1e+201) {
tmp = a * ((t * -4.0) / c_m);
} else if (z <= 6.6e+125) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -8.1e+201: tmp = a * ((t * -4.0) / c_m) elif z <= 6.6e+125: tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) else: tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -8.1e+201) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (z <= 6.6e+125) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -8.1e+201)
tmp = a * ((t * -4.0) / c_m);
elseif (z <= 6.6e+125)
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
else
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -8.1e+201], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+125], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8.1 \cdot 10^{+201}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+125}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\end{array}
\end{array}
if z < -8.0999999999999999e201Initial program 48.6%
+-commutative48.6%
associate-+r-48.6%
*-commutative48.6%
associate-*r*47.5%
*-commutative47.5%
associate-+r-47.5%
+-commutative47.5%
associate-*l*47.6%
associate-*l*51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in z around inf 74.7%
*-commutative74.7%
associate-/l*75.0%
associate-*r*75.1%
associate-*l/75.1%
Simplified75.1%
if -8.0999999999999999e201 < z < 6.60000000000000011e125Initial program 91.1%
+-commutative91.1%
associate-+r-91.1%
*-commutative91.1%
associate-*r*92.4%
*-commutative92.4%
associate-+r-92.4%
+-commutative92.4%
associate-*l*92.4%
associate-*l*91.0%
*-commutative91.0%
Simplified91.0%
if 6.60000000000000011e125 < z Initial program 54.4%
+-commutative54.4%
associate-+r-54.4%
*-commutative54.4%
associate-*r*57.5%
*-commutative57.5%
associate-+r-57.5%
+-commutative57.5%
associate-*l*57.5%
associate-*l*62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in x around 0 48.7%
Taylor expanded in t around inf 86.2%
Final simplification88.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -4.4e+122)
(* a (- (/ b (* z (* c_m a))) (* (/ t c_m) 4.0)))
(if (<= z 4.8e+125)
(/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c_m z))
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -4.4e+122) {
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0));
} else if (z <= 4.8e+125) {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (z <= (-4.4d+122)) then
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0d0))
else if (z <= 4.8d+125) then
tmp = (b + ((y * (x * 9.0d0)) - (a * ((z * 4.0d0) * t)))) / (c_m * z)
else
tmp = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -4.4e+122) {
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0));
} else if (z <= 4.8e+125) {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -4.4e+122: tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0)) elif z <= 4.8e+125: tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z) else: tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -4.4e+122) tmp = Float64(a * Float64(Float64(b / Float64(z * Float64(c_m * a))) - Float64(Float64(t / c_m) * 4.0))); elseif (z <= 4.8e+125) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c_m * z)); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -4.4e+122)
tmp = a * ((b / (z * (c_m * a))) - ((t / c_m) * 4.0));
elseif (z <= 4.8e+125)
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
else
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -4.4e+122], N[(a * N[(N[(b / N[(z * N[(c$95$m * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t / c$95$m), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+125], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+122}:\\
\;\;\;\;a \cdot \left(\frac{b}{z \cdot \left(c\_m \cdot a\right)} - \frac{t}{c\_m} \cdot 4\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+125}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\end{array}
\end{array}
if z < -4.3999999999999998e122Initial program 58.0%
+-commutative58.0%
associate-+r-58.0%
*-commutative58.0%
associate-*r*57.2%
*-commutative57.2%
associate-+r-57.2%
+-commutative57.2%
associate-*l*57.2%
associate-*l*62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in x around 0 53.1%
Taylor expanded in a around -inf 75.8%
mul-1-neg75.8%
distribute-rgt-neg-in75.8%
+-commutative75.8%
mul-1-neg75.8%
unsub-neg75.8%
*-commutative75.8%
*-commutative75.8%
associate-*l*75.8%
Simplified75.8%
if -4.3999999999999998e122 < z < 4.7999999999999999e125Initial program 92.0%
if 4.7999999999999999e125 < z Initial program 54.4%
+-commutative54.4%
associate-+r-54.4%
*-commutative54.4%
associate-*r*57.5%
*-commutative57.5%
associate-+r-57.5%
+-commutative57.5%
associate-*l*57.5%
associate-*l*62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in x around 0 48.7%
Taylor expanded in t around inf 86.2%
Final simplification89.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -1.4e-38)
(/ (* t (+ (* a -4.0) (+ (* 9.0 (/ (* x y) (* z t))) (/ b (* z t))))) c_m)
(if (<= z 1.58e+125)
(/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c_m z))
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.4e-38) {
tmp = (t * ((a * -4.0) + ((9.0 * ((x * y) / (z * t))) + (b / (z * t))))) / c_m;
} else if (z <= 1.58e+125) {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (z <= (-1.4d-38)) then
tmp = (t * ((a * (-4.0d0)) + ((9.0d0 * ((x * y) / (z * t))) + (b / (z * t))))) / c_m
else if (z <= 1.58d+125) then
tmp = (b + ((y * (x * 9.0d0)) - (a * ((z * 4.0d0) * t)))) / (c_m * z)
else
tmp = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.4e-38) {
tmp = (t * ((a * -4.0) + ((9.0 * ((x * y) / (z * t))) + (b / (z * t))))) / c_m;
} else if (z <= 1.58e+125) {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -1.4e-38: tmp = (t * ((a * -4.0) + ((9.0 * ((x * y) / (z * t))) + (b / (z * t))))) / c_m elif z <= 1.58e+125: tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z) else: tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -1.4e-38) tmp = Float64(Float64(t * Float64(Float64(a * -4.0) + Float64(Float64(9.0 * Float64(Float64(x * y) / Float64(z * t))) + Float64(b / Float64(z * t))))) / c_m); elseif (z <= 1.58e+125) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c_m * z)); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -1.4e-38)
tmp = (t * ((a * -4.0) + ((9.0 * ((x * y) / (z * t))) + (b / (z * t))))) / c_m;
elseif (z <= 1.58e+125)
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
else
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -1.4e-38], N[(N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[z, 1.58e+125], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-38}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4 + \left(9 \cdot \frac{x \cdot y}{z \cdot t} + \frac{b}{z \cdot t}\right)\right)}{c\_m}\\
\mathbf{elif}\;z \leq 1.58 \cdot 10^{+125}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\end{array}
\end{array}
if z < -1.4e-38Initial program 70.1%
+-commutative70.1%
associate-+r-70.1%
*-commutative70.1%
associate-*r*72.5%
*-commutative72.5%
associate-+r-72.5%
+-commutative72.5%
associate-*l*72.5%
associate-*l*75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in t around inf 77.9%
Taylor expanded in c around 0 88.5%
if -1.4e-38 < z < 1.5800000000000001e125Initial program 94.2%
if 1.5800000000000001e125 < z Initial program 54.4%
+-commutative54.4%
associate-+r-54.4%
*-commutative54.4%
associate-*r*57.5%
*-commutative57.5%
associate-+r-57.5%
+-commutative57.5%
associate-*l*57.5%
associate-*l*62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in x around 0 48.7%
Taylor expanded in t around inf 86.2%
Final simplification91.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.1e+200)
(* t (* -4.0 (/ a c_m)))
(if (or (<= t -1050000000.0) (not (<= t 1.45e-99)))
(/ (+ b (* t (* z (* a -4.0)))) (* c_m z))
(/ (+ (* x (* 9.0 y)) b) (* c_m z))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.1e+200) {
tmp = t * (-4.0 * (a / c_m));
} else if ((t <= -1050000000.0) || !(t <= 1.45e-99)) {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
} else {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (t <= (-1.1d+200)) then
tmp = t * ((-4.0d0) * (a / c_m))
else if ((t <= (-1050000000.0d0)) .or. (.not. (t <= 1.45d-99))) then
tmp = (b + (t * (z * (a * (-4.0d0))))) / (c_m * z)
else
tmp = ((x * (9.0d0 * y)) + b) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.1e+200) {
tmp = t * (-4.0 * (a / c_m));
} else if ((t <= -1050000000.0) || !(t <= 1.45e-99)) {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
} else {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.1e+200: tmp = t * (-4.0 * (a / c_m)) elif (t <= -1050000000.0) or not (t <= 1.45e-99): tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z) else: tmp = ((x * (9.0 * y)) + b) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.1e+200) tmp = Float64(t * Float64(-4.0 * Float64(a / c_m))); elseif ((t <= -1050000000.0) || !(t <= 1.45e-99)) tmp = Float64(Float64(b + Float64(t * Float64(z * Float64(a * -4.0)))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1.1e+200)
tmp = t * (-4.0 * (a / c_m));
elseif ((t <= -1050000000.0) || ~((t <= 1.45e-99)))
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
else
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.1e+200], N[(t * N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1050000000.0], N[Not[LessEqual[t, 1.45e-99]], $MachinePrecision]], N[(N[(b + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+200}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;t \leq -1050000000 \lor \neg \left(t \leq 1.45 \cdot 10^{-99}\right):\\
\;\;\;\;\frac{b + t \cdot \left(z \cdot \left(a \cdot -4\right)\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -1.1e200Initial program 64.5%
+-commutative64.5%
associate-+r-64.5%
*-commutative64.5%
associate-*r*76.2%
*-commutative76.2%
associate-+r-76.2%
+-commutative76.2%
associate-*l*76.1%
associate-*l*64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in x around 0 57.2%
Taylor expanded in t around inf 69.2%
Taylor expanded in a around inf 73.1%
if -1.1e200 < t < -1.05e9 or 1.44999999999999993e-99 < t Initial program 80.9%
+-commutative80.9%
associate-+r-80.9%
*-commutative80.9%
associate-*r*84.1%
*-commutative84.1%
associate-+r-84.1%
+-commutative84.1%
associate-*l*84.1%
associate-*l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in t around inf 84.1%
Taylor expanded in x around 0 72.4%
associate-*r*72.4%
Simplified72.4%
if -1.05e9 < t < 1.44999999999999993e-99Initial program 89.0%
+-commutative89.0%
associate-+r-89.0%
*-commutative89.0%
associate-*r*84.5%
*-commutative84.5%
associate-+r-84.5%
+-commutative84.5%
associate-*l*84.5%
associate-*l*88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in x around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*r*78.4%
Simplified78.4%
Final simplification74.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (* x (/ (/ y c_m) z)))))
(*
c_s
(if (<= y -9.1e-7)
t_1
(if (<= y -2.25e-284)
(/ b (* c_m z))
(if (<= y 3.8e+110) (* a (/ (* t -4.0) c_m)) t_1))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * (x * ((y / c_m) / z));
double tmp;
if (y <= -9.1e-7) {
tmp = t_1;
} else if (y <= -2.25e-284) {
tmp = b / (c_m * z);
} else if (y <= 3.8e+110) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * (x * ((y / c_m) / z))
if (y <= (-9.1d-7)) then
tmp = t_1
else if (y <= (-2.25d-284)) then
tmp = b / (c_m * z)
else if (y <= 3.8d+110) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = t_1
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * (x * ((y / c_m) / z));
double tmp;
if (y <= -9.1e-7) {
tmp = t_1;
} else if (y <= -2.25e-284) {
tmp = b / (c_m * z);
} else if (y <= 3.8e+110) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 9.0 * (x * ((y / c_m) / z)) tmp = 0 if y <= -9.1e-7: tmp = t_1 elif y <= -2.25e-284: tmp = b / (c_m * z) elif y <= 3.8e+110: tmp = a * ((t * -4.0) / c_m) else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))) tmp = 0.0 if (y <= -9.1e-7) tmp = t_1; elseif (y <= -2.25e-284) tmp = Float64(b / Float64(c_m * z)); elseif (y <= 3.8e+110) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 9.0 * (x * ((y / c_m) / z));
tmp = 0.0;
if (y <= -9.1e-7)
tmp = t_1;
elseif (y <= -2.25e-284)
tmp = b / (c_m * z);
elseif (y <= 3.8e+110)
tmp = a * ((t * -4.0) / c_m);
else
tmp = t_1;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -9.1e-7], t$95$1, If[LessEqual[y, -2.25e-284], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+110], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -9.1 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-284}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+110}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -9.0999999999999997e-7 or 3.79999999999999989e110 < y Initial program 78.9%
+-commutative78.9%
associate-+r-78.9%
*-commutative78.9%
associate-*r*79.7%
*-commutative79.7%
associate-+r-79.7%
+-commutative79.7%
associate-*l*79.8%
associate-*l*80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x around inf 45.2%
associate-/l*48.7%
associate-/r*56.4%
Simplified56.4%
if -9.0999999999999997e-7 < y < -2.25e-284Initial program 89.9%
+-commutative89.9%
associate-+r-89.9%
*-commutative89.9%
associate-*r*93.9%
*-commutative93.9%
associate-+r-93.9%
+-commutative93.9%
associate-*l*93.9%
associate-*l*91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in b around inf 58.5%
*-commutative58.5%
Simplified58.5%
if -2.25e-284 < y < 3.79999999999999989e110Initial program 82.0%
+-commutative82.0%
associate-+r-82.0%
*-commutative82.0%
associate-*r*82.7%
*-commutative82.7%
associate-+r-82.7%
+-commutative82.7%
associate-*l*82.7%
associate-*l*82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in z around inf 57.8%
*-commutative57.8%
associate-/l*60.1%
associate-*r*60.1%
associate-*l/60.1%
Simplified60.1%
Final simplification58.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= y -2.9e-14)
(* 9.0 (/ (* x (/ y c_m)) z))
(if (<= y -5e-289)
(/ b (* c_m z))
(if (<= y 1.05e+111)
(* a (/ (* t -4.0) c_m))
(* 9.0 (* x (/ (/ y c_m) z))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (y <= -2.9e-14) {
tmp = 9.0 * ((x * (y / c_m)) / z);
} else if (y <= -5e-289) {
tmp = b / (c_m * z);
} else if (y <= 1.05e+111) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = 9.0 * (x * ((y / c_m) / z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (y <= (-2.9d-14)) then
tmp = 9.0d0 * ((x * (y / c_m)) / z)
else if (y <= (-5d-289)) then
tmp = b / (c_m * z)
else if (y <= 1.05d+111) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = 9.0d0 * (x * ((y / c_m) / z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (y <= -2.9e-14) {
tmp = 9.0 * ((x * (y / c_m)) / z);
} else if (y <= -5e-289) {
tmp = b / (c_m * z);
} else if (y <= 1.05e+111) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = 9.0 * (x * ((y / c_m) / z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if y <= -2.9e-14: tmp = 9.0 * ((x * (y / c_m)) / z) elif y <= -5e-289: tmp = b / (c_m * z) elif y <= 1.05e+111: tmp = a * ((t * -4.0) / c_m) else: tmp = 9.0 * (x * ((y / c_m) / z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (y <= -2.9e-14) tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c_m)) / z)); elseif (y <= -5e-289) tmp = Float64(b / Float64(c_m * z)); elseif (y <= 1.05e+111) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (y <= -2.9e-14)
tmp = 9.0 * ((x * (y / c_m)) / z);
elseif (y <= -5e-289)
tmp = b / (c_m * z);
elseif (y <= 1.05e+111)
tmp = a * ((t * -4.0) / c_m);
else
tmp = 9.0 * (x * ((y / c_m) / z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[y, -2.9e-14], N[(9.0 * N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5e-289], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+111], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-14}:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c\_m}}{z}\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-289}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+111}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\end{array}
\end{array}
if y < -2.9000000000000003e-14Initial program 78.0%
+-commutative78.0%
associate-+r-78.0%
*-commutative78.0%
associate-*r*79.5%
*-commutative79.5%
associate-+r-79.5%
+-commutative79.5%
associate-*l*79.6%
associate-*l*82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in x around inf 38.9%
associate-/r*44.3%
associate-/l*49.7%
Simplified49.7%
if -2.9000000000000003e-14 < y < -5.00000000000000029e-289Initial program 89.5%
+-commutative89.5%
associate-+r-89.5%
*-commutative89.5%
associate-*r*93.6%
*-commutative93.6%
associate-+r-93.6%
+-commutative93.6%
associate-*l*93.6%
associate-*l*91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in b around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -5.00000000000000029e-289 < y < 1.04999999999999997e111Initial program 82.0%
+-commutative82.0%
associate-+r-82.0%
*-commutative82.0%
associate-*r*82.7%
*-commutative82.7%
associate-+r-82.7%
+-commutative82.7%
associate-*l*82.7%
associate-*l*82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in z around inf 57.8%
*-commutative57.8%
associate-/l*60.1%
associate-*r*60.1%
associate-*l/60.1%
Simplified60.1%
if 1.04999999999999997e111 < y Initial program 81.2%
+-commutative81.2%
associate-+r-81.2%
*-commutative81.2%
associate-*r*81.1%
*-commutative81.1%
associate-+r-81.1%
+-commutative81.1%
associate-*l*81.1%
associate-*l*78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in x around inf 56.1%
associate-/l*58.5%
associate-/r*65.3%
Simplified65.3%
Final simplification57.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -54000000.0)
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))
(if (<= t 7.6e-98)
(/ (+ (* x (* 9.0 y)) b) (* c_m z))
(/ (+ b (* t (* z (* a -4.0)))) (* c_m z))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -54000000.0) {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
} else if (t <= 7.6e-98) {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
} else {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (t <= (-54000000.0d0)) then
tmp = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
else if (t <= 7.6d-98) then
tmp = ((x * (9.0d0 * y)) + b) / (c_m * z)
else
tmp = (b + (t * (z * (a * (-4.0d0))))) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -54000000.0) {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
} else if (t <= 7.6e-98) {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
} else {
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -54000000.0: tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) elif t <= 7.6e-98: tmp = ((x * (9.0 * y)) + b) / (c_m * z) else: tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -54000000.0) tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); elseif (t <= 7.6e-98) tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c_m * z)); else tmp = Float64(Float64(b + Float64(t * Float64(z * Float64(a * -4.0)))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -54000000.0)
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
elseif (t <= 7.6e-98)
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
else
tmp = (b + (t * (z * (a * -4.0)))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -54000000.0], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e-98], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(t * N[(z * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -54000000:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\mathbf{elif}\;t \leq 7.6 \cdot 10^{-98}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + t \cdot \left(z \cdot \left(a \cdot -4\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -5.4e7Initial program 64.9%
+-commutative64.9%
associate-+r-64.9%
*-commutative64.9%
associate-*r*73.1%
*-commutative73.1%
associate-+r-73.1%
+-commutative73.1%
associate-*l*73.1%
associate-*l*67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in x around 0 56.5%
Taylor expanded in t around inf 76.3%
if -5.4e7 < t < 7.6000000000000006e-98Initial program 89.0%
+-commutative89.0%
associate-+r-89.0%
*-commutative89.0%
associate-*r*84.5%
*-commutative84.5%
associate-+r-84.5%
+-commutative84.5%
associate-*l*84.5%
associate-*l*88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in x around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*r*78.4%
Simplified78.4%
if 7.6000000000000006e-98 < t Initial program 87.5%
+-commutative87.5%
associate-+r-87.5%
*-commutative87.5%
associate-*r*89.5%
*-commutative89.5%
associate-+r-89.5%
+-commutative89.5%
associate-*l*89.5%
associate-*l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 88.5%
Taylor expanded in x around 0 76.6%
associate-*r*76.6%
Simplified76.6%
Final simplification77.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= t -1350000.0) (not (<= t 1.1e-141)))
(* a (* t (/ -4.0 c_m)))
(/ b (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -1350000.0) || !(t <= 1.1e-141)) {
tmp = a * (t * (-4.0 / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if ((t <= (-1350000.0d0)) .or. (.not. (t <= 1.1d-141))) then
tmp = a * (t * ((-4.0d0) / c_m))
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -1350000.0) || !(t <= 1.1e-141)) {
tmp = a * (t * (-4.0 / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (t <= -1350000.0) or not (t <= 1.1e-141): tmp = a * (t * (-4.0 / c_m)) else: tmp = b / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((t <= -1350000.0) || !(t <= 1.1e-141)) tmp = Float64(a * Float64(t * Float64(-4.0 / c_m))); else tmp = Float64(b / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((t <= -1350000.0) || ~((t <= 1.1e-141)))
tmp = a * (t * (-4.0 / c_m));
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[t, -1350000.0], N[Not[LessEqual[t, 1.1e-141]], $MachinePrecision]], N[(a * N[(t * N[(-4.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1350000 \lor \neg \left(t \leq 1.1 \cdot 10^{-141}\right):\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -1.35e6 or 1.10000000000000005e-141 < t Initial program 78.9%
+-commutative78.9%
associate-+r-78.9%
*-commutative78.9%
associate-*r*82.6%
*-commutative82.6%
associate-+r-82.6%
+-commutative82.6%
associate-*l*82.6%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*59.3%
associate-*r*59.3%
associate-*l/59.3%
Simplified59.3%
associate-/l*59.3%
Applied egg-rr59.3%
if -1.35e6 < t < 1.10000000000000005e-141Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
associate-*r*85.5%
*-commutative85.5%
associate-+r-85.5%
+-commutative85.5%
associate-*l*85.5%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in b around inf 45.7%
*-commutative45.7%
Simplified45.7%
Final simplification55.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= t -2300.0) (not (<= t 1.1e-141)))
(* a (/ (* t -4.0) c_m))
(/ b (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -2300.0) || !(t <= 1.1e-141)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if ((t <= (-2300.0d0)) .or. (.not. (t <= 1.1d-141))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -2300.0) || !(t <= 1.1e-141)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (t <= -2300.0) or not (t <= 1.1e-141): tmp = a * ((t * -4.0) / c_m) else: tmp = b / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((t <= -2300.0) || !(t <= 1.1e-141)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((t <= -2300.0) || ~((t <= 1.1e-141)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[t, -2300.0], N[Not[LessEqual[t, 1.1e-141]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2300 \lor \neg \left(t \leq 1.1 \cdot 10^{-141}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -2300 or 1.10000000000000005e-141 < t Initial program 78.9%
+-commutative78.9%
associate-+r-78.9%
*-commutative78.9%
associate-*r*82.6%
*-commutative82.6%
associate-+r-82.6%
+-commutative82.6%
associate-*l*82.6%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*59.3%
associate-*r*59.3%
associate-*l/59.3%
Simplified59.3%
if -2300 < t < 1.10000000000000005e-141Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
associate-*r*85.5%
*-commutative85.5%
associate-+r-85.5%
+-commutative85.5%
associate-*l*85.5%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in b around inf 45.7%
*-commutative45.7%
Simplified45.7%
Final simplification55.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= t -2900.0) (not (<= t 6.2e-142)))
(* a (/ (* t -4.0) c_m))
(* b (/ 1.0 (* c_m z))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -2900.0) || !(t <= 6.2e-142)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b * (1.0 / (c_m * z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if ((t <= (-2900.0d0)) .or. (.not. (t <= 6.2d-142))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b * (1.0d0 / (c_m * z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -2900.0) || !(t <= 6.2e-142)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b * (1.0 / (c_m * z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (t <= -2900.0) or not (t <= 6.2e-142): tmp = a * ((t * -4.0) / c_m) else: tmp = b * (1.0 / (c_m * z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((t <= -2900.0) || !(t <= 6.2e-142)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((t <= -2900.0) || ~((t <= 6.2e-142)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b * (1.0 / (c_m * z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[t, -2900.0], N[Not[LessEqual[t, 6.2e-142]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2900 \lor \neg \left(t \leq 6.2 \cdot 10^{-142}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -2900 or 6.2e-142 < t Initial program 78.9%
+-commutative78.9%
associate-+r-78.9%
*-commutative78.9%
associate-*r*82.6%
*-commutative82.6%
associate-+r-82.6%
+-commutative82.6%
associate-*l*82.6%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*59.3%
associate-*r*59.3%
associate-*l/59.3%
Simplified59.3%
if -2900 < t < 6.2e-142Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
associate-*r*85.5%
*-commutative85.5%
associate-+r-85.5%
+-commutative85.5%
associate-*l*85.5%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in b around inf 45.7%
*-commutative45.7%
Simplified45.7%
div-inv46.8%
*-commutative46.8%
Applied egg-rr46.8%
Final simplification55.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1950.0)
(* a (/ (* t -4.0) c_m))
(if (<= t 7.2e-146) (* b (/ 1.0 (* c_m z))) (* t (* -4.0 (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1950.0) {
tmp = a * ((t * -4.0) / c_m);
} else if (t <= 7.2e-146) {
tmp = b * (1.0 / (c_m * z));
} else {
tmp = t * (-4.0 * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
real(8) :: tmp
if (t <= (-1950.0d0)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (t <= 7.2d-146) then
tmp = b * (1.0d0 / (c_m * z))
else
tmp = t * ((-4.0d0) * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1950.0) {
tmp = a * ((t * -4.0) / c_m);
} else if (t <= 7.2e-146) {
tmp = b * (1.0 / (c_m * z));
} else {
tmp = t * (-4.0 * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1950.0: tmp = a * ((t * -4.0) / c_m) elif t <= 7.2e-146: tmp = b * (1.0 / (c_m * z)) else: tmp = t * (-4.0 * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1950.0) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (t <= 7.2e-146) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); else tmp = Float64(t * Float64(-4.0 * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1950.0)
tmp = a * ((t * -4.0) / c_m);
elseif (t <= 7.2e-146)
tmp = b * (1.0 / (c_m * z));
else
tmp = t * (-4.0 * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1950.0], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-146], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1950:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-146}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if t < -1950Initial program 64.9%
+-commutative64.9%
associate-+r-64.9%
*-commutative64.9%
associate-*r*73.1%
*-commutative73.1%
associate-+r-73.1%
+-commutative73.1%
associate-*l*73.1%
associate-*l*67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 57.5%
*-commutative57.5%
associate-/l*67.5%
associate-*r*67.5%
associate-*l/67.5%
Simplified67.5%
if -1950 < t < 7.19999999999999957e-146Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
associate-*r*85.5%
*-commutative85.5%
associate-+r-85.5%
+-commutative85.5%
associate-*l*85.5%
associate-*l*89.0%
*-commutative89.0%
Simplified89.0%
Taylor expanded in b around inf 45.7%
*-commutative45.7%
Simplified45.7%
div-inv46.8%
*-commutative46.8%
Applied egg-rr46.8%
if 7.19999999999999957e-146 < t Initial program 87.5%
+-commutative87.5%
associate-+r-87.5%
*-commutative87.5%
associate-*r*88.4%
*-commutative88.4%
associate-+r-88.4%
+-commutative88.4%
associate-*l*88.4%
associate-*l*89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in x around 0 73.0%
Taylor expanded in t around inf 78.0%
Taylor expanded in a around inf 59.3%
Final simplification57.6%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* c_m z))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
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_m
code = c_s * (b / (c_m * z))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (c_m * z));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 82.1%
+-commutative82.1%
associate-+r-82.1%
*-commutative82.1%
associate-*r*83.5%
*-commutative83.5%
associate-+r-83.5%
+-commutative83.5%
associate-*l*83.5%
associate-*l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in b around inf 32.3%
*-commutative32.3%
Simplified32.3%
Final simplification32.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 2024075
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))