
(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 18 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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m))))
(*
c_s
(if (<= t_1 -1e-84)
(/ (+ b (fma x (* 9.0 y) (* t (* a (* z -4.0))))) (* z c_m))
(if (<= t_1 0.0)
(*
(/ 1.0 z)
(/ (fma z (fma 9.0 (* x (/ y z)) (* -4.0 (* t a))) b) c_m))
(if (<= t_1 INFINITY)
(/ (- (+ b (* 9.0 (* x y))) (* 4.0 (* z (* t a)))) (* z c_m))
(* -4.0 (* a (/ t 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -1e-84) {
tmp = (b + fma(x, (9.0 * y), (t * (a * (z * -4.0))))) / (z * c_m);
} else if (t_1 <= 0.0) {
tmp = (1.0 / z) * (fma(z, fma(9.0, (x * (y / z)), (-4.0 * (t * a))), b) / c_m);
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
} else {
tmp = -4.0 * (a * (t / 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(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -1e-84) tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(z * c_m)); elseif (t_1 <= 0.0) tmp = Float64(Float64(1.0 / z) * Float64(fma(z, fma(9.0, Float64(x * Float64(y / z)), Float64(-4.0 * Float64(t * a))), b) / c_m)); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(x * y))) - Float64(4.0 * Float64(z * Float64(t * a)))) / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); 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_] := Block[{t$95$1 = 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$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-84], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(z * N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(z * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / 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])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-84}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{z \cdot c\_m}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(9, x \cdot \frac{y}{z}, -4 \cdot \left(t \cdot a\right)\right), b\right)}{c\_m}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\left(b + 9 \cdot \left(x \cdot y\right)\right) - 4 \cdot \left(z \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1e-84Initial program 89.7%
Simplified89.7%
if -1e-84 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 59.9%
associate-+l-59.9%
*-commutative59.9%
associate-*r*56.7%
*-commutative56.7%
associate-+l-56.7%
associate-*l*56.7%
associate-*l*59.9%
*-commutative59.9%
Simplified59.9%
Taylor expanded in z around inf 59.8%
*-un-lft-identity59.8%
times-frac95.9%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.1%
associate-/l*93.0%
metadata-eval93.0%
Applied egg-rr93.0%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.3%
Simplified93.1%
associate-*r*92.1%
metadata-eval92.1%
distribute-rgt-neg-in92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
fma-neg92.1%
+-commutative92.1%
associate-+r-92.1%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.2%
*-commutative92.2%
associate-*l*92.2%
Applied egg-rr92.2%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
*-commutative18.2%
fma-neg7.3%
+-commutative7.3%
associate-+r-7.3%
associate-*r*3.8%
*-commutative3.8%
associate-*l*7.3%
*-commutative7.3%
associate-*l*7.3%
Applied egg-rr7.3%
Taylor expanded in z around inf 73.6%
*-commutative73.6%
associate-/l*81.1%
Simplified81.1%
Final simplification90.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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m))))
(*
c_s
(if (<= t_1 -1e+95)
(/ (+ b (fma x (* 9.0 y) (* t (* a (* z -4.0))))) (* z c_m))
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (/ (* x y) c_m)) (/ b c_m)))
z)
(if (<= t_1 INFINITY)
(/ (- (+ b (* 9.0 (* x y))) (* 4.0 (* z (* t a)))) (* z c_m))
(* -4.0 (* a (/ t 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -1e+95) {
tmp = (b + fma(x, (9.0 * y), (t * (a * (z * -4.0))))) / (z * c_m);
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
} else {
tmp = -4.0 * (a * (t / 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(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -1e+95) tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(z * c_m)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / c_m)) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(x * y))) - Float64(4.0 * Float64(z * Float64(t * a)))) / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); 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_] := Block[{t$95$1 = 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$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e+95], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(z * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / 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])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+95}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{z \cdot c\_m}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \frac{x \cdot y}{c\_m} + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\left(b + 9 \cdot \left(x \cdot y\right)\right) - 4 \cdot \left(z \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.00000000000000002e95Initial program 87.6%
Simplified88.8%
if -1.00000000000000002e95 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 74.7%
associate-+l-74.7%
*-commutative74.7%
associate-*r*70.7%
*-commutative70.7%
associate-+l-70.7%
associate-*l*70.7%
associate-*l*74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in z around 0 97.3%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.3%
Simplified93.1%
associate-*r*92.1%
metadata-eval92.1%
distribute-rgt-neg-in92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
fma-neg92.1%
+-commutative92.1%
associate-+r-92.1%
associate-*r*92.2%
*-commutative92.2%
associate-*l*92.2%
*-commutative92.2%
associate-*l*92.2%
Applied egg-rr92.2%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
*-commutative18.2%
fma-neg7.3%
+-commutative7.3%
associate-+r-7.3%
associate-*r*3.8%
*-commutative3.8%
associate-*l*7.3%
*-commutative7.3%
associate-*l*7.3%
Applied egg-rr7.3%
Taylor expanded in z around inf 73.6%
*-commutative73.6%
associate-/l*81.1%
Simplified81.1%
Final simplification90.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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m)))
(t_2 (/ (- (+ b (* 9.0 (* x y))) (* 4.0 (* z (* t a)))) (* z c_m))))
(*
c_s
(if (<= t_1 -1e+95)
t_2
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (/ (* x y) c_m)) (/ b c_m)))
z)
(if (<= t_1 INFINITY) t_2 (* -4.0 (* a (/ t 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -1e+95) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -1e+95) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = -4.0 * (a * (t / 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m) t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m) tmp = 0 if t_1 <= -1e+95: tmp = t_2 elif t_1 <= 0.0: tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z elif t_1 <= math.inf: tmp = t_2 else: tmp = -4.0 * (a * (t / 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(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) t_2 = Float64(Float64(Float64(b + Float64(9.0 * Float64(x * y))) - Float64(4.0 * Float64(z * Float64(t * a)))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -1e+95) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / c_m)) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(a * Float64(t / 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -1e+95)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = -4.0 * (a * (t / 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[(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$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(z * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e+95], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(a * N[(t / 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])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
t_2 := \frac{\left(b + 9 \cdot \left(x \cdot y\right)\right) - 4 \cdot \left(z \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \frac{x \cdot y}{c\_m} + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.00000000000000002e95 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 88.5%
Simplified91.2%
associate-*r*90.6%
metadata-eval90.6%
distribute-rgt-neg-in90.6%
distribute-rgt-neg-in90.6%
*-commutative90.6%
fma-neg90.6%
+-commutative90.6%
associate-+r-90.6%
associate-*r*90.7%
*-commutative90.7%
associate-*l*90.7%
*-commutative90.7%
associate-*l*90.7%
Applied egg-rr90.7%
if -1.00000000000000002e95 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 74.7%
associate-+l-74.7%
*-commutative74.7%
associate-*r*70.7%
*-commutative70.7%
associate-+l-70.7%
associate-*l*70.7%
associate-*l*74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in z around 0 97.3%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
*-commutative18.2%
fma-neg7.3%
+-commutative7.3%
associate-+r-7.3%
associate-*r*3.8%
*-commutative3.8%
associate-*l*7.3%
*-commutative7.3%
associate-*l*7.3%
Applied egg-rr7.3%
Taylor expanded in z around inf 73.6%
*-commutative73.6%
associate-/l*81.1%
Simplified81.1%
Final simplification90.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
(let* ((t_1 (* 9.0 (* x y)))
(t_2 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m)))
(t_3 (/ (- (+ b t_1) (* 4.0 (* z (* t a)))) (* z c_m))))
(*
c_s
(if (<= t_2 -5e-202)
t_3
(if (<= t_2 0.0)
(* (/ 1.0 z) (/ (+ b (+ t_1 (* -4.0 (* a (* z t))))) c_m))
(if (<= t_2 INFINITY) t_3 (* -4.0 (* a (/ t 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 = 9.0 * (x * y);
double t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_3 = ((b + t_1) - (4.0 * (z * (t * a)))) / (z * c_m);
double tmp;
if (t_2 <= -5e-202) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = (1.0 / z) * ((b + (t_1 + (-4.0 * (a * (z * t))))) / c_m);
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
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);
double t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_3 = ((b + t_1) - (4.0 * (z * (t * a)))) / (z * c_m);
double tmp;
if (t_2 <= -5e-202) {
tmp = t_3;
} else if (t_2 <= 0.0) {
tmp = (1.0 / z) * ((b + (t_1 + (-4.0 * (a * (z * t))))) / c_m);
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = -4.0 * (a * (t / 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 = 9.0 * (x * y) t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m) t_3 = ((b + t_1) - (4.0 * (z * (t * a)))) / (z * c_m) tmp = 0 if t_2 <= -5e-202: tmp = t_3 elif t_2 <= 0.0: tmp = (1.0 / z) * ((b + (t_1 + (-4.0 * (a * (z * t))))) / c_m) elif t_2 <= math.inf: tmp = t_3 else: tmp = -4.0 * (a * (t / 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(9.0 * Float64(x * y)) t_2 = Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) t_3 = Float64(Float64(Float64(b + t_1) - Float64(4.0 * Float64(z * Float64(t * a)))) / Float64(z * c_m)) tmp = 0.0 if (t_2 <= -5e-202) tmp = t_3; elseif (t_2 <= 0.0) tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + Float64(t_1 + Float64(-4.0 * Float64(a * Float64(z * t))))) / c_m)); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(-4.0 * Float64(a * Float64(t / 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 = 9.0 * (x * y);
t_2 = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
t_3 = ((b + t_1) - (4.0 * (z * (t * a)))) / (z * c_m);
tmp = 0.0;
if (t_2 <= -5e-202)
tmp = t_3;
elseif (t_2 <= 0.0)
tmp = (1.0 / z) * ((b + (t_1 + (-4.0 * (a * (z * t))))) / c_m);
elseif (t_2 <= Inf)
tmp = t_3;
else
tmp = -4.0 * (a * (t / 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[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(b + t$95$1), $MachinePrecision] - N[(4.0 * N[(z * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$2, -5e-202], t$95$3, If[LessEqual[t$95$2, 0.0], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(t$95$1 + N[(-4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(-4.0 * N[(a * N[(t / 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])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(x \cdot y\right)\\
t_2 := \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\_m}\\
t_3 := \frac{\left(b + t\_1\right) - 4 \cdot \left(z \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-202}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + \left(t\_1 + -4 \cdot \left(a \cdot \left(z \cdot t\right)\right)\right)}{c\_m}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -4.99999999999999973e-202 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.8%
Simplified91.6%
associate-*r*91.6%
metadata-eval91.6%
distribute-rgt-neg-in91.6%
distribute-rgt-neg-in91.6%
*-commutative91.6%
fma-neg91.6%
+-commutative91.6%
associate-+r-91.6%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
*-commutative91.7%
associate-*l*91.7%
Applied egg-rr91.7%
if -4.99999999999999973e-202 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 51.8%
associate-+l-51.8%
*-commutative51.8%
associate-*r*48.1%
*-commutative48.1%
associate-+l-48.1%
associate-*l*48.1%
associate-*l*51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in z around inf 51.8%
*-un-lft-identity51.8%
times-frac95.2%
fma-define95.3%
cancel-sign-sub-inv95.3%
fma-define95.3%
associate-/l*91.7%
metadata-eval91.7%
Applied egg-rr91.7%
Taylor expanded in z around 0 95.3%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
*-commutative18.2%
fma-neg7.3%
+-commutative7.3%
associate-+r-7.3%
associate-*r*3.8%
*-commutative3.8%
associate-*l*7.3%
*-commutative7.3%
associate-*l*7.3%
Applied egg-rr7.3%
Taylor expanded in z around inf 73.6%
*-commutative73.6%
associate-/l*81.1%
Simplified81.1%
Final simplification90.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
(let* ((t_1 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c_m)))
(t_2 (/ (- (+ b (* 9.0 (* x y))) (* 4.0 (* z (* t a)))) (* z c_m))))
(*
c_s
(if (<= t_1 -5e-202)
t_2
(if (<= t_1 0.0)
(/ (- (* 9.0 (/ (* x y) z)) (* 4.0 (* t a))) c_m)
(if (<= t_1 INFINITY) t_2 (* -4.0 (* a (/ t 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -5e-202) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -5e-202) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = -4.0 * (a * (t / 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m) t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m) tmp = 0 if t_1 <= -5e-202: tmp = t_2 elif t_1 <= 0.0: tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m elif t_1 <= math.inf: tmp = t_2 else: tmp = -4.0 * (a * (t / 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(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) t_2 = Float64(Float64(Float64(b + Float64(9.0 * Float64(x * y))) - Float64(4.0 * Float64(z * Float64(t * a)))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -5e-202) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) - Float64(4.0 * Float64(t * a))) / c_m); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(a * Float64(t / 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
t_2 = ((b + (9.0 * (x * y))) - (4.0 * (z * (t * a)))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -5e-202)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = -4.0 * (a * (t / 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[(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$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(z * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -5e-202], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(a * N[(t / 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])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
t_2 := \frac{\left(b + 9 \cdot \left(x \cdot y\right)\right) - 4 \cdot \left(z \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-202}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}{c\_m}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -4.99999999999999973e-202 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.8%
Simplified91.6%
associate-*r*91.6%
metadata-eval91.6%
distribute-rgt-neg-in91.6%
distribute-rgt-neg-in91.6%
*-commutative91.6%
fma-neg91.6%
+-commutative91.6%
associate-+r-91.6%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.7%
*-commutative91.7%
associate-*l*91.7%
Applied egg-rr91.7%
if -4.99999999999999973e-202 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 51.8%
associate-+l-51.8%
*-commutative51.8%
associate-*r*48.1%
*-commutative48.1%
associate-+l-48.1%
associate-*l*48.1%
associate-*l*51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in z around inf 51.8%
Taylor expanded in b around 0 84.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
*-commutative18.2%
fma-neg7.3%
+-commutative7.3%
associate-+r-7.3%
associate-*r*3.8%
*-commutative3.8%
associate-*l*7.3%
*-commutative7.3%
associate-*l*7.3%
Applied egg-rr7.3%
Taylor expanded in z around inf 73.6%
*-commutative73.6%
associate-/l*81.1%
Simplified81.1%
Final simplification89.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) (* (* (* z 4.0) t) a)) b) (* z c_m)))
(t_2 (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m))))
(*
c_s
(if (<= t_1 -5e-202)
t_2
(if (<= t_1 0.0)
(/ (- (* 9.0 (/ (* x y) z)) (* 4.0 (* t a))) c_m)
(if (<= t_1 INFINITY) t_2 (* -4.0 (* a (/ t 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -5e-202) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -5e-202) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = -4.0 * (a * (t / 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m) t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m) tmp = 0 if t_1 <= -5e-202: tmp = t_2 elif t_1 <= 0.0: tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m elif t_1 <= math.inf: tmp = t_2 else: tmp = -4.0 * (a * (t / 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(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) t_2 = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -5e-202) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) - Float64(4.0 * Float64(t * a))) / c_m); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(a * Float64(t / 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) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -5e-202)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = ((9.0 * ((x * y) / z)) - (4.0 * (t * a))) / c_m;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = -4.0 * (a * (t / 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[(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$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -5e-202], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(a * N[(t / 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])\\
\\
\begin{array}{l}
t_1 := \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\_m}\\
t_2 := \frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-202}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}{c\_m}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -4.99999999999999973e-202 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.8%
associate-+l-89.8%
*-commutative89.8%
associate-*r*91.7%
*-commutative91.7%
associate-+l-91.7%
associate-*l*91.6%
associate-*l*91.6%
*-commutative91.6%
Simplified91.6%
if -4.99999999999999973e-202 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 51.8%
associate-+l-51.8%
*-commutative51.8%
associate-*r*48.1%
*-commutative48.1%
associate-+l-48.1%
associate-*l*48.1%
associate-*l*51.8%
*-commutative51.8%
Simplified51.8%
Taylor expanded in z around inf 51.8%
Taylor expanded in b around 0 84.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
Simplified18.2%
associate-*r*18.2%
metadata-eval18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
*-commutative18.2%
fma-neg7.3%
+-commutative7.3%
associate-+r-7.3%
associate-*r*3.8%
*-commutative3.8%
associate-*l*7.3%
*-commutative7.3%
associate-*l*7.3%
Applied egg-rr7.3%
Taylor expanded in z around inf 73.6%
*-commutative73.6%
associate-/l*81.1%
Simplified81.1%
Final simplification89.7%
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) z)) (* 4.0 (* t a))) c_m))
(t_2 (* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))))
(*
c_s
(if (<= t -2e+178)
t_2
(if (<= t -8.8e+47)
t_1
(if (<= t -7.2e-72)
t_2
(if (<= t 3.9e-60) (/ (+ b (* x (* 9.0 y))) (* z 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) / z)) - (4.0 * (t * a))) / c_m;
double t_2 = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
double tmp;
if (t <= -2e+178) {
tmp = t_2;
} else if (t <= -8.8e+47) {
tmp = t_1;
} else if (t <= -7.2e-72) {
tmp = t_2;
} else if (t <= 3.9e-60) {
tmp = (b + (x * (9.0 * y))) / (z * 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) :: t_2
real(8) :: tmp
t_1 = ((9.0d0 * ((x * y) / z)) - (4.0d0 * (t * a))) / c_m
t_2 = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
if (t <= (-2d+178)) then
tmp = t_2
else if (t <= (-8.8d+47)) then
tmp = t_1
else if (t <= (-7.2d-72)) then
tmp = t_2
else if (t <= 3.9d-60) then
tmp = (b + (x * (9.0d0 * y))) / (z * 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) / z)) - (4.0 * (t * a))) / c_m;
double t_2 = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
double tmp;
if (t <= -2e+178) {
tmp = t_2;
} else if (t <= -8.8e+47) {
tmp = t_1;
} else if (t <= -7.2e-72) {
tmp = t_2;
} else if (t <= 3.9e-60) {
tmp = (b + (x * (9.0 * y))) / (z * 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) / z)) - (4.0 * (t * a))) / c_m t_2 = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) tmp = 0 if t <= -2e+178: tmp = t_2 elif t <= -8.8e+47: tmp = t_1 elif t <= -7.2e-72: tmp = t_2 elif t <= 3.9e-60: tmp = (b + (x * (9.0 * y))) / (z * 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(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) - Float64(4.0 * Float64(t * a))) / c_m) t_2 = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))) tmp = 0.0 if (t <= -2e+178) tmp = t_2; elseif (t <= -8.8e+47) tmp = t_1; elseif (t <= -7.2e-72) tmp = t_2; elseif (t <= 3.9e-60) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * 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) / z)) - (4.0 * (t * a))) / c_m;
t_2 = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
tmp = 0.0;
if (t <= -2e+178)
tmp = t_2;
elseif (t <= -8.8e+47)
tmp = t_1;
elseif (t <= -7.2e-72)
tmp = t_2;
elseif (t <= 3.9e-60)
tmp = (b + (x * (9.0 * y))) / (z * 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[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]}, Block[{t$95$2 = 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]}, N[(c$95$s * If[LessEqual[t, -2e+178], t$95$2, If[LessEqual[t, -8.8e+47], t$95$1, If[LessEqual[t, -7.2e-72], t$95$2, If[LessEqual[t, 3.9e-60], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 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 := \frac{9 \cdot \frac{x \cdot y}{z} - 4 \cdot \left(t \cdot a\right)}{c\_m}\\
t_2 := t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+178}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{-72}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-60}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.0000000000000001e178 or -8.7999999999999997e47 < t < -7.2e-72Initial program 63.2%
associate-+l-63.2%
*-commutative63.2%
associate-*r*66.5%
*-commutative66.5%
associate-+l-66.5%
associate-*l*68.1%
associate-*l*64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in z around 0 70.0%
Taylor expanded in x around 0 64.0%
Taylor expanded in t around inf 79.7%
if -2.0000000000000001e178 < t < -8.7999999999999997e47 or 3.9000000000000002e-60 < t Initial program 68.9%
associate-+l-68.9%
*-commutative68.9%
associate-*r*74.3%
*-commutative74.3%
associate-+l-74.3%
associate-*l*74.3%
associate-*l*74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in z around inf 73.0%
Taylor expanded in b around 0 75.4%
if -7.2e-72 < t < 3.9000000000000002e-60Initial program 90.0%
associate-+l-90.0%
*-commutative90.0%
associate-*r*87.3%
*-commutative87.3%
associate-+l-87.3%
associate-*l*87.3%
associate-*l*90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in x around inf 81.1%
associate-*r*81.1%
*-commutative81.1%
associate-*r*81.1%
Simplified81.1%
Final simplification78.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 (* b (/ (/ 1.0 c_m) z))))
(*
c_s
(if (<= x -3.4e+187)
(* x (* (/ y z) (/ 9.0 c_m)))
(if (<= x -1.15e-5)
(* -4.0 (/ (* t a) c_m))
(if (<= x -1.05e-144)
t_1
(if (<= x -7.5e-248)
(* t (/ (* a -4.0) c_m))
(if (<= x 1.15e-124) t_1 (* 9.0 (* x (/ y (* z 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 = b * ((1.0 / c_m) / z);
double tmp;
if (x <= -3.4e+187) {
tmp = x * ((y / z) * (9.0 / c_m));
} else if (x <= -1.15e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -1.05e-144) {
tmp = t_1;
} else if (x <= -7.5e-248) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 1.15e-124) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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) :: tmp
t_1 = b * ((1.0d0 / c_m) / z)
if (x <= (-3.4d+187)) then
tmp = x * ((y / z) * (9.0d0 / c_m))
else if (x <= (-1.15d-5)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (x <= (-1.05d-144)) then
tmp = t_1
else if (x <= (-7.5d-248)) then
tmp = t * ((a * (-4.0d0)) / c_m)
else if (x <= 1.15d-124) then
tmp = t_1
else
tmp = 9.0d0 * (x * (y / (z * 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 = b * ((1.0 / c_m) / z);
double tmp;
if (x <= -3.4e+187) {
tmp = x * ((y / z) * (9.0 / c_m));
} else if (x <= -1.15e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -1.05e-144) {
tmp = t_1;
} else if (x <= -7.5e-248) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 1.15e-124) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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 = b * ((1.0 / c_m) / z) tmp = 0 if x <= -3.4e+187: tmp = x * ((y / z) * (9.0 / c_m)) elif x <= -1.15e-5: tmp = -4.0 * ((t * a) / c_m) elif x <= -1.05e-144: tmp = t_1 elif x <= -7.5e-248: tmp = t * ((a * -4.0) / c_m) elif x <= 1.15e-124: tmp = t_1 else: tmp = 9.0 * (x * (y / (z * 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(b * Float64(Float64(1.0 / c_m) / z)) tmp = 0.0 if (x <= -3.4e+187) tmp = Float64(x * Float64(Float64(y / z) * Float64(9.0 / c_m))); elseif (x <= -1.15e-5) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (x <= -1.05e-144) tmp = t_1; elseif (x <= -7.5e-248) tmp = Float64(t * Float64(Float64(a * -4.0) / c_m)); elseif (x <= 1.15e-124) tmp = t_1; else tmp = Float64(9.0 * Float64(x * Float64(y / Float64(z * 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 = b * ((1.0 / c_m) / z);
tmp = 0.0;
if (x <= -3.4e+187)
tmp = x * ((y / z) * (9.0 / c_m));
elseif (x <= -1.15e-5)
tmp = -4.0 * ((t * a) / c_m);
elseif (x <= -1.05e-144)
tmp = t_1;
elseif (x <= -7.5e-248)
tmp = t * ((a * -4.0) / c_m);
elseif (x <= 1.15e-124)
tmp = t_1;
else
tmp = 9.0 * (x * (y / (z * 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[(b * N[(N[(1.0 / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -3.4e+187], N[(x * N[(N[(y / z), $MachinePrecision] * N[(9.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-5], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e-144], t$95$1, If[LessEqual[x, -7.5e-248], N[(t * N[(N[(a * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-124], t$95$1, N[(9.0 * N[(x * N[(y / N[(z * c$95$m), $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])\\
\\
\begin{array}{l}
t_1 := b \cdot \frac{\frac{1}{c\_m}}{z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+187}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} \cdot \frac{9}{c\_m}\right)\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-5}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-248}:\\
\;\;\;\;t \cdot \frac{a \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{z \cdot c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if x < -3.4e187Initial program 61.3%
associate-+l-61.3%
*-commutative61.3%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.4%
associate-*l*64.4%
*-commutative64.4%
Simplified64.4%
Taylor expanded in x around inf 57.7%
*-commutative57.7%
associate-/l*63.6%
associate-*l*63.6%
*-commutative63.6%
associate-*r/63.7%
*-commutative63.7%
*-commutative63.7%
times-frac61.3%
Simplified61.3%
if -3.4e187 < x < -1.15e-5Initial program 66.5%
associate-+l-66.5%
*-commutative66.5%
associate-*r*69.2%
*-commutative69.2%
associate-+l-69.2%
associate-*l*69.2%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -1.15e-5 < x < -1.0500000000000001e-144 or -7.4999999999999994e-248 < x < 1.15000000000000006e-124Initial program 85.9%
Simplified85.9%
associate-*r*86.0%
metadata-eval86.0%
distribute-rgt-neg-in86.0%
distribute-rgt-neg-in86.0%
*-commutative86.0%
fma-neg86.0%
+-commutative86.0%
associate-+r-86.0%
associate-*r*86.0%
*-commutative86.0%
associate-*l*86.0%
*-commutative86.0%
associate-*l*86.0%
Applied egg-rr86.0%
Taylor expanded in b around inf 53.2%
associate-/r*47.7%
Simplified47.7%
div-inv47.7%
*-un-lft-identity47.7%
times-frac53.3%
Applied egg-rr53.3%
if -1.0500000000000001e-144 < x < -7.4999999999999994e-248Initial program 69.5%
associate-+l-69.5%
*-commutative69.5%
associate-*r*69.3%
*-commutative69.3%
associate-+l-69.3%
associate-*l*69.0%
associate-*l*73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in z around inf 74.3%
*-un-lft-identity74.3%
times-frac73.9%
fma-define73.9%
cancel-sign-sub-inv73.9%
fma-define73.9%
associate-/l*73.9%
metadata-eval73.9%
Applied egg-rr73.9%
Taylor expanded in z around inf 59.0%
associate-*r/59.0%
associate-*r*59.0%
*-commutative59.0%
associate-*r/63.9%
Simplified63.9%
if 1.15000000000000006e-124 < x Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*80.9%
associate-*l*82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 39.0%
associate-/l*42.2%
*-commutative42.2%
Simplified42.2%
Final simplification51.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
(let* ((t_1 (/ b (* z c_m))))
(*
c_s
(if (<= x -9.5e+187)
(* x (* (/ y z) (/ 9.0 c_m)))
(if (<= x -8e-5)
(* -4.0 (/ (* t a) c_m))
(if (<= x -4.8e-147)
t_1
(if (<= x -9.5e-248)
(* t (/ (* a -4.0) c_m))
(if (<= x 4.2e-122) t_1 (* 9.0 (* x (/ y (* z 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 = b / (z * c_m);
double tmp;
if (x <= -9.5e+187) {
tmp = x * ((y / z) * (9.0 / c_m));
} else if (x <= -8e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -4.8e-147) {
tmp = t_1;
} else if (x <= -9.5e-248) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 4.2e-122) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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) :: tmp
t_1 = b / (z * c_m)
if (x <= (-9.5d+187)) then
tmp = x * ((y / z) * (9.0d0 / c_m))
else if (x <= (-8d-5)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (x <= (-4.8d-147)) then
tmp = t_1
else if (x <= (-9.5d-248)) then
tmp = t * ((a * (-4.0d0)) / c_m)
else if (x <= 4.2d-122) then
tmp = t_1
else
tmp = 9.0d0 * (x * (y / (z * 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 = b / (z * c_m);
double tmp;
if (x <= -9.5e+187) {
tmp = x * ((y / z) * (9.0 / c_m));
} else if (x <= -8e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -4.8e-147) {
tmp = t_1;
} else if (x <= -9.5e-248) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 4.2e-122) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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 = b / (z * c_m) tmp = 0 if x <= -9.5e+187: tmp = x * ((y / z) * (9.0 / c_m)) elif x <= -8e-5: tmp = -4.0 * ((t * a) / c_m) elif x <= -4.8e-147: tmp = t_1 elif x <= -9.5e-248: tmp = t * ((a * -4.0) / c_m) elif x <= 4.2e-122: tmp = t_1 else: tmp = 9.0 * (x * (y / (z * 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(b / Float64(z * c_m)) tmp = 0.0 if (x <= -9.5e+187) tmp = Float64(x * Float64(Float64(y / z) * Float64(9.0 / c_m))); elseif (x <= -8e-5) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (x <= -4.8e-147) tmp = t_1; elseif (x <= -9.5e-248) tmp = Float64(t * Float64(Float64(a * -4.0) / c_m)); elseif (x <= 4.2e-122) tmp = t_1; else tmp = Float64(9.0 * Float64(x * Float64(y / Float64(z * 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 = b / (z * c_m);
tmp = 0.0;
if (x <= -9.5e+187)
tmp = x * ((y / z) * (9.0 / c_m));
elseif (x <= -8e-5)
tmp = -4.0 * ((t * a) / c_m);
elseif (x <= -4.8e-147)
tmp = t_1;
elseif (x <= -9.5e-248)
tmp = t * ((a * -4.0) / c_m);
elseif (x <= 4.2e-122)
tmp = t_1;
else
tmp = 9.0 * (x * (y / (z * 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[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -9.5e+187], N[(x * N[(N[(y / z), $MachinePrecision] * N[(9.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-5], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-147], t$95$1, If[LessEqual[x, -9.5e-248], N[(t * N[(N[(a * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-122], t$95$1, N[(9.0 * N[(x * N[(y / N[(z * c$95$m), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+187}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} \cdot \frac{9}{c\_m}\right)\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-5}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-248}:\\
\;\;\;\;t \cdot \frac{a \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{z \cdot c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if x < -9.4999999999999996e187Initial program 61.3%
associate-+l-61.3%
*-commutative61.3%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.4%
associate-*l*64.4%
*-commutative64.4%
Simplified64.4%
Taylor expanded in x around inf 57.7%
*-commutative57.7%
associate-/l*63.6%
associate-*l*63.6%
*-commutative63.6%
associate-*r/63.7%
*-commutative63.7%
*-commutative63.7%
times-frac61.3%
Simplified61.3%
if -9.4999999999999996e187 < x < -8.00000000000000065e-5Initial program 66.5%
associate-+l-66.5%
*-commutative66.5%
associate-*r*69.2%
*-commutative69.2%
associate-+l-69.2%
associate-*l*69.2%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -8.00000000000000065e-5 < x < -4.79999999999999997e-147 or -9.49999999999999971e-248 < x < 4.19999999999999985e-122Initial program 86.1%
associate-+l-86.1%
*-commutative86.1%
associate-*r*86.1%
*-commutative86.1%
associate-+l-86.1%
associate-*l*86.1%
associate-*l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in b around inf 52.6%
*-commutative52.6%
Simplified52.6%
if -4.79999999999999997e-147 < x < -9.49999999999999971e-248Initial program 67.8%
associate-+l-67.8%
*-commutative67.8%
associate-*r*67.7%
*-commutative67.7%
associate-+l-67.7%
associate-*l*67.3%
associate-*l*72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in z around inf 73.0%
*-un-lft-identity73.0%
times-frac72.5%
fma-define72.5%
cancel-sign-sub-inv72.5%
fma-define72.5%
associate-/l*72.5%
metadata-eval72.5%
Applied egg-rr72.5%
Taylor expanded in z around inf 56.8%
associate-*r/56.8%
associate-*r*56.8%
*-commutative56.8%
associate-*r/61.9%
Simplified61.9%
if 4.19999999999999985e-122 < x Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*80.9%
associate-*l*82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 39.0%
associate-/l*42.2%
*-commutative42.2%
Simplified42.2%
Final simplification51.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
(let* ((t_1 (/ b (* z c_m))))
(*
c_s
(if (<= x -2.7e+187)
(* x (* (/ y c_m) (/ 9.0 z)))
(if (<= x -6.5e-5)
(* -4.0 (/ (* t a) c_m))
(if (<= x -6.5e-151)
t_1
(if (<= x -1.4e-246)
(* t (/ (* a -4.0) c_m))
(if (<= x 2.3e-122) t_1 (* 9.0 (* x (/ y (* z 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 = b / (z * c_m);
double tmp;
if (x <= -2.7e+187) {
tmp = x * ((y / c_m) * (9.0 / z));
} else if (x <= -6.5e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -6.5e-151) {
tmp = t_1;
} else if (x <= -1.4e-246) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 2.3e-122) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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) :: tmp
t_1 = b / (z * c_m)
if (x <= (-2.7d+187)) then
tmp = x * ((y / c_m) * (9.0d0 / z))
else if (x <= (-6.5d-5)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (x <= (-6.5d-151)) then
tmp = t_1
else if (x <= (-1.4d-246)) then
tmp = t * ((a * (-4.0d0)) / c_m)
else if (x <= 2.3d-122) then
tmp = t_1
else
tmp = 9.0d0 * (x * (y / (z * 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 = b / (z * c_m);
double tmp;
if (x <= -2.7e+187) {
tmp = x * ((y / c_m) * (9.0 / z));
} else if (x <= -6.5e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -6.5e-151) {
tmp = t_1;
} else if (x <= -1.4e-246) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 2.3e-122) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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 = b / (z * c_m) tmp = 0 if x <= -2.7e+187: tmp = x * ((y / c_m) * (9.0 / z)) elif x <= -6.5e-5: tmp = -4.0 * ((t * a) / c_m) elif x <= -6.5e-151: tmp = t_1 elif x <= -1.4e-246: tmp = t * ((a * -4.0) / c_m) elif x <= 2.3e-122: tmp = t_1 else: tmp = 9.0 * (x * (y / (z * 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(b / Float64(z * c_m)) tmp = 0.0 if (x <= -2.7e+187) tmp = Float64(x * Float64(Float64(y / c_m) * Float64(9.0 / z))); elseif (x <= -6.5e-5) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (x <= -6.5e-151) tmp = t_1; elseif (x <= -1.4e-246) tmp = Float64(t * Float64(Float64(a * -4.0) / c_m)); elseif (x <= 2.3e-122) tmp = t_1; else tmp = Float64(9.0 * Float64(x * Float64(y / Float64(z * 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 = b / (z * c_m);
tmp = 0.0;
if (x <= -2.7e+187)
tmp = x * ((y / c_m) * (9.0 / z));
elseif (x <= -6.5e-5)
tmp = -4.0 * ((t * a) / c_m);
elseif (x <= -6.5e-151)
tmp = t_1;
elseif (x <= -1.4e-246)
tmp = t * ((a * -4.0) / c_m);
elseif (x <= 2.3e-122)
tmp = t_1;
else
tmp = 9.0 * (x * (y / (z * 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[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -2.7e+187], N[(x * N[(N[(y / c$95$m), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5e-5], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5e-151], t$95$1, If[LessEqual[x, -1.4e-246], N[(t * N[(N[(a * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e-122], t$95$1, N[(9.0 * N[(x * N[(y / N[(z * c$95$m), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+187}:\\
\;\;\;\;x \cdot \left(\frac{y}{c\_m} \cdot \frac{9}{z}\right)\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-5}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-246}:\\
\;\;\;\;t \cdot \frac{a \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{z \cdot c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if x < -2.70000000000000008e187Initial program 61.3%
Simplified64.4%
associate-*r*64.4%
metadata-eval64.4%
distribute-rgt-neg-in64.4%
distribute-rgt-neg-in64.4%
*-commutative64.4%
fma-neg64.4%
+-commutative64.4%
associate-+r-64.4%
associate-*r*64.5%
*-commutative64.5%
associate-*l*64.4%
*-commutative64.4%
associate-*l*64.4%
Applied egg-rr64.4%
Taylor expanded in x around inf 57.7%
*-commutative57.7%
associate-/l*63.6%
associate-*r*63.6%
*-commutative63.6%
associate-*r/63.7%
*-commutative63.7%
times-frac64.4%
Simplified64.4%
if -2.70000000000000008e187 < x < -6.49999999999999943e-5Initial program 66.5%
associate-+l-66.5%
*-commutative66.5%
associate-*r*69.2%
*-commutative69.2%
associate-+l-69.2%
associate-*l*69.2%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -6.49999999999999943e-5 < x < -6.4999999999999994e-151 or -1.4e-246 < x < 2.30000000000000007e-122Initial program 86.2%
associate-+l-86.2%
*-commutative86.2%
associate-*r*86.3%
*-commutative86.3%
associate-+l-86.3%
associate-*l*86.2%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in b around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -6.4999999999999994e-151 < x < -1.4e-246Initial program 65.9%
associate-+l-65.9%
*-commutative65.9%
associate-*r*65.8%
*-commutative65.8%
associate-+l-65.8%
associate-*l*65.4%
associate-*l*71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 71.5%
*-un-lft-identity71.5%
times-frac76.6%
fma-define76.6%
cancel-sign-sub-inv76.6%
fma-define76.6%
associate-/l*76.6%
metadata-eval76.6%
Applied egg-rr76.6%
Taylor expanded in z around inf 54.3%
associate-*r/54.3%
associate-*r*54.3%
*-commutative54.3%
associate-*r/59.6%
Simplified59.6%
if 2.30000000000000007e-122 < x Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*80.9%
associate-*l*82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 39.0%
associate-/l*42.2%
*-commutative42.2%
Simplified42.2%
Final simplification51.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
(let* ((t_1 (/ b (* z c_m))))
(*
c_s
(if (<= x -2.5e+187)
(* 9.0 (* x (/ (/ y c_m) z)))
(if (<= x -2.62e-5)
(* -4.0 (/ (* t a) c_m))
(if (<= x -5.8e-150)
t_1
(if (<= x -2.1e-245)
(* t (/ (* a -4.0) c_m))
(if (<= x 4.2e-122) t_1 (* 9.0 (* x (/ y (* z 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 = b / (z * c_m);
double tmp;
if (x <= -2.5e+187) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else if (x <= -2.62e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -5.8e-150) {
tmp = t_1;
} else if (x <= -2.1e-245) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 4.2e-122) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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) :: tmp
t_1 = b / (z * c_m)
if (x <= (-2.5d+187)) then
tmp = 9.0d0 * (x * ((y / c_m) / z))
else if (x <= (-2.62d-5)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (x <= (-5.8d-150)) then
tmp = t_1
else if (x <= (-2.1d-245)) then
tmp = t * ((a * (-4.0d0)) / c_m)
else if (x <= 4.2d-122) then
tmp = t_1
else
tmp = 9.0d0 * (x * (y / (z * 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 = b / (z * c_m);
double tmp;
if (x <= -2.5e+187) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else if (x <= -2.62e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -5.8e-150) {
tmp = t_1;
} else if (x <= -2.1e-245) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 4.2e-122) {
tmp = t_1;
} else {
tmp = 9.0 * (x * (y / (z * 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 = b / (z * c_m) tmp = 0 if x <= -2.5e+187: tmp = 9.0 * (x * ((y / c_m) / z)) elif x <= -2.62e-5: tmp = -4.0 * ((t * a) / c_m) elif x <= -5.8e-150: tmp = t_1 elif x <= -2.1e-245: tmp = t * ((a * -4.0) / c_m) elif x <= 4.2e-122: tmp = t_1 else: tmp = 9.0 * (x * (y / (z * 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(b / Float64(z * c_m)) tmp = 0.0 if (x <= -2.5e+187) tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); elseif (x <= -2.62e-5) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (x <= -5.8e-150) tmp = t_1; elseif (x <= -2.1e-245) tmp = Float64(t * Float64(Float64(a * -4.0) / c_m)); elseif (x <= 4.2e-122) tmp = t_1; else tmp = Float64(9.0 * Float64(x * Float64(y / Float64(z * 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 = b / (z * c_m);
tmp = 0.0;
if (x <= -2.5e+187)
tmp = 9.0 * (x * ((y / c_m) / z));
elseif (x <= -2.62e-5)
tmp = -4.0 * ((t * a) / c_m);
elseif (x <= -5.8e-150)
tmp = t_1;
elseif (x <= -2.1e-245)
tmp = t * ((a * -4.0) / c_m);
elseif (x <= 4.2e-122)
tmp = t_1;
else
tmp = 9.0 * (x * (y / (z * 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[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -2.5e+187], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.62e-5], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.8e-150], t$95$1, If[LessEqual[x, -2.1e-245], N[(t * N[(N[(a * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-122], t$95$1, N[(9.0 * N[(x * N[(y / N[(z * c$95$m), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+187}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\mathbf{elif}\;x \leq -2.62 \cdot 10^{-5}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-245}:\\
\;\;\;\;t \cdot \frac{a \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{z \cdot c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if x < -2.5000000000000001e187Initial program 61.3%
Simplified64.4%
associate-*r*64.4%
metadata-eval64.4%
distribute-rgt-neg-in64.4%
distribute-rgt-neg-in64.4%
*-commutative64.4%
fma-neg64.4%
+-commutative64.4%
associate-+r-64.4%
associate-*r*64.5%
*-commutative64.5%
associate-*l*64.4%
*-commutative64.4%
associate-*l*64.4%
Applied egg-rr64.4%
Taylor expanded in x around inf 57.7%
associate-/l*63.6%
associate-/r*64.4%
Simplified64.4%
if -2.5000000000000001e187 < x < -2.62e-5Initial program 66.5%
associate-+l-66.5%
*-commutative66.5%
associate-*r*69.2%
*-commutative69.2%
associate-+l-69.2%
associate-*l*69.2%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -2.62e-5 < x < -5.7999999999999996e-150 or -2.1000000000000001e-245 < x < 4.19999999999999985e-122Initial program 86.2%
associate-+l-86.2%
*-commutative86.2%
associate-*r*86.3%
*-commutative86.3%
associate-+l-86.3%
associate-*l*86.2%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in b around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -5.7999999999999996e-150 < x < -2.1000000000000001e-245Initial program 65.9%
associate-+l-65.9%
*-commutative65.9%
associate-*r*65.8%
*-commutative65.8%
associate-+l-65.8%
associate-*l*65.4%
associate-*l*71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in z around inf 71.5%
*-un-lft-identity71.5%
times-frac76.6%
fma-define76.6%
cancel-sign-sub-inv76.6%
fma-define76.6%
associate-/l*76.6%
metadata-eval76.6%
Applied egg-rr76.6%
Taylor expanded in z around inf 54.3%
associate-*r/54.3%
associate-*r*54.3%
*-commutative54.3%
associate-*r/59.6%
Simplified59.6%
if 4.19999999999999985e-122 < x Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*80.9%
associate-*l*82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 39.0%
associate-/l*42.2%
*-commutative42.2%
Simplified42.2%
Final simplification51.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
(let* ((t_1 (/ b (* z c_m))) (t_2 (* 9.0 (* x (/ y (* z c_m))))))
(*
c_s
(if (<= x -9.5e+187)
t_2
(if (<= x -1.8e-5)
(* -4.0 (/ (* t a) c_m))
(if (<= x -5.6e-147)
t_1
(if (<= x -6.5e-248)
(* t (/ (* a -4.0) c_m))
(if (<= x 4.2e-122) t_1 t_2))))))))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 = b / (z * c_m);
double t_2 = 9.0 * (x * (y / (z * c_m)));
double tmp;
if (x <= -9.5e+187) {
tmp = t_2;
} else if (x <= -1.8e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -5.6e-147) {
tmp = t_1;
} else if (x <= -6.5e-248) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 4.2e-122) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = b / (z * c_m)
t_2 = 9.0d0 * (x * (y / (z * c_m)))
if (x <= (-9.5d+187)) then
tmp = t_2
else if (x <= (-1.8d-5)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (x <= (-5.6d-147)) then
tmp = t_1
else if (x <= (-6.5d-248)) then
tmp = t * ((a * (-4.0d0)) / c_m)
else if (x <= 4.2d-122) then
tmp = t_1
else
tmp = t_2
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 = b / (z * c_m);
double t_2 = 9.0 * (x * (y / (z * c_m)));
double tmp;
if (x <= -9.5e+187) {
tmp = t_2;
} else if (x <= -1.8e-5) {
tmp = -4.0 * ((t * a) / c_m);
} else if (x <= -5.6e-147) {
tmp = t_1;
} else if (x <= -6.5e-248) {
tmp = t * ((a * -4.0) / c_m);
} else if (x <= 4.2e-122) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = b / (z * c_m) t_2 = 9.0 * (x * (y / (z * c_m))) tmp = 0 if x <= -9.5e+187: tmp = t_2 elif x <= -1.8e-5: tmp = -4.0 * ((t * a) / c_m) elif x <= -5.6e-147: tmp = t_1 elif x <= -6.5e-248: tmp = t * ((a * -4.0) / c_m) elif x <= 4.2e-122: tmp = t_1 else: tmp = t_2 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(b / Float64(z * c_m)) t_2 = Float64(9.0 * Float64(x * Float64(y / Float64(z * c_m)))) tmp = 0.0 if (x <= -9.5e+187) tmp = t_2; elseif (x <= -1.8e-5) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (x <= -5.6e-147) tmp = t_1; elseif (x <= -6.5e-248) tmp = Float64(t * Float64(Float64(a * -4.0) / c_m)); elseif (x <= 4.2e-122) tmp = t_1; else tmp = t_2; 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 = b / (z * c_m);
t_2 = 9.0 * (x * (y / (z * c_m)));
tmp = 0.0;
if (x <= -9.5e+187)
tmp = t_2;
elseif (x <= -1.8e-5)
tmp = -4.0 * ((t * a) / c_m);
elseif (x <= -5.6e-147)
tmp = t_1;
elseif (x <= -6.5e-248)
tmp = t * ((a * -4.0) / c_m);
elseif (x <= 4.2e-122)
tmp = t_1;
else
tmp = t_2;
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[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(x * N[(y / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -9.5e+187], t$95$2, If[LessEqual[x, -1.8e-5], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.6e-147], t$95$1, If[LessEqual[x, -6.5e-248], N[(t * N[(N[(a * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-122], t$95$1, t$95$2]]]]]), $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{b}{z \cdot c\_m}\\
t_2 := 9 \cdot \left(x \cdot \frac{y}{z \cdot c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-5}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-248}:\\
\;\;\;\;t \cdot \frac{a \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if x < -9.4999999999999996e187 or 4.19999999999999985e-122 < x Initial program 73.2%
associate-+l-73.2%
*-commutative73.2%
associate-*r*75.8%
*-commutative75.8%
associate-+l-75.8%
associate-*l*76.7%
associate-*l*77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in x around inf 43.8%
associate-/l*47.7%
*-commutative47.7%
Simplified47.7%
if -9.4999999999999996e187 < x < -1.80000000000000005e-5Initial program 66.5%
associate-+l-66.5%
*-commutative66.5%
associate-*r*69.2%
*-commutative69.2%
associate-+l-69.2%
associate-*l*69.2%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -1.80000000000000005e-5 < x < -5.6000000000000001e-147 or -6.5e-248 < x < 4.19999999999999985e-122Initial program 86.1%
associate-+l-86.1%
*-commutative86.1%
associate-*r*86.1%
*-commutative86.1%
associate-+l-86.1%
associate-*l*86.1%
associate-*l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in b around inf 52.6%
*-commutative52.6%
Simplified52.6%
if -5.6000000000000001e-147 < x < -6.5e-248Initial program 67.8%
associate-+l-67.8%
*-commutative67.8%
associate-*r*67.7%
*-commutative67.7%
associate-+l-67.7%
associate-*l*67.3%
associate-*l*72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in z around inf 73.0%
*-un-lft-identity73.0%
times-frac72.5%
fma-define72.5%
cancel-sign-sub-inv72.5%
fma-define72.5%
associate-/l*72.5%
metadata-eval72.5%
Applied egg-rr72.5%
Taylor expanded in z around inf 56.8%
associate-*r/56.8%
associate-*r*56.8%
*-commutative56.8%
associate-*r/61.9%
Simplified61.9%
Final simplification51.3%
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 (* a (/ (* t -4.0) c_m))))
(*
c_s
(if (<= t -1.3e+235)
t_1
(if (<= t -5.5e-69)
(/ (- b (* z (* a (* 4.0 t)))) (* z c_m))
(if (<= t 4.2e-15) (/ (+ b (* x (* 9.0 y))) (* z 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 = a * ((t * -4.0) / c_m);
double tmp;
if (t <= -1.3e+235) {
tmp = t_1;
} else if (t <= -5.5e-69) {
tmp = (b - (z * (a * (4.0 * t)))) / (z * c_m);
} else if (t <= 4.2e-15) {
tmp = (b + (x * (9.0 * y))) / (z * 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 = a * ((t * (-4.0d0)) / c_m)
if (t <= (-1.3d+235)) then
tmp = t_1
else if (t <= (-5.5d-69)) then
tmp = (b - (z * (a * (4.0d0 * t)))) / (z * c_m)
else if (t <= 4.2d-15) then
tmp = (b + (x * (9.0d0 * y))) / (z * 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 = a * ((t * -4.0) / c_m);
double tmp;
if (t <= -1.3e+235) {
tmp = t_1;
} else if (t <= -5.5e-69) {
tmp = (b - (z * (a * (4.0 * t)))) / (z * c_m);
} else if (t <= 4.2e-15) {
tmp = (b + (x * (9.0 * y))) / (z * 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 = a * ((t * -4.0) / c_m) tmp = 0 if t <= -1.3e+235: tmp = t_1 elif t <= -5.5e-69: tmp = (b - (z * (a * (4.0 * t)))) / (z * c_m) elif t <= 4.2e-15: tmp = (b + (x * (9.0 * y))) / (z * 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(a * Float64(Float64(t * -4.0) / c_m)) tmp = 0.0 if (t <= -1.3e+235) tmp = t_1; elseif (t <= -5.5e-69) tmp = Float64(Float64(b - Float64(z * Float64(a * Float64(4.0 * t)))) / Float64(z * c_m)); elseif (t <= 4.2e-15) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * 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 = a * ((t * -4.0) / c_m);
tmp = 0.0;
if (t <= -1.3e+235)
tmp = t_1;
elseif (t <= -5.5e-69)
tmp = (b - (z * (a * (4.0 * t)))) / (z * c_m);
elseif (t <= 4.2e-15)
tmp = (b + (x * (9.0 * y))) / (z * 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[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -1.3e+235], t$95$1, If[LessEqual[t, -5.5e-69], N[(N[(b - N[(z * N[(a * N[(4.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-15], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 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 := a \cdot \frac{t \cdot -4}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+235}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-69}:\\
\;\;\;\;\frac{b - z \cdot \left(a \cdot \left(4 \cdot t\right)\right)}{z \cdot c\_m}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -1.2999999999999999e235 or 4.19999999999999962e-15 < t Initial program 60.0%
associate-+l-60.0%
*-commutative60.0%
associate-*r*64.2%
*-commutative64.2%
associate-+l-64.2%
associate-*l*64.1%
associate-*l*64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in z around inf 62.1%
associate-/l*71.3%
associate-*r*71.3%
*-commutative71.3%
associate-*r*71.3%
*-commutative71.3%
associate-*l/71.3%
Simplified71.3%
if -1.2999999999999999e235 < t < -5.50000000000000006e-69Initial program 73.0%
associate-+l-73.0%
*-commutative73.0%
associate-*r*78.6%
*-commutative78.6%
associate-+l-78.6%
associate-*l*80.1%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in x around 0 59.1%
*-commutative59.1%
associate-*r*59.1%
associate-*r*59.1%
*-commutative59.1%
associate-*r*63.1%
*-commutative63.1%
Simplified63.1%
if -5.50000000000000006e-69 < t < 4.19999999999999962e-15Initial program 88.1%
associate-+l-88.1%
*-commutative88.1%
associate-*r*85.7%
*-commutative85.7%
associate-+l-85.7%
associate-*l*85.7%
associate-*l*88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in x around inf 77.9%
associate-*r*77.9%
*-commutative77.9%
associate-*r*77.9%
Simplified77.9%
Final simplification72.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 -1.8e-71) (not (<= t 3.7e-56)))
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))
(/ (+ b (* x (* 9.0 y))) (* z 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 <= -1.8e-71) || !(t <= 3.7e-56)) {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
} else {
tmp = (b + (x * (9.0 * y))) / (z * 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 <= (-1.8d-71)) .or. (.not. (t <= 3.7d-56))) then
tmp = t * (((-4.0d0) * (a / c_m)) + (b / (c_m * (z * t))))
else
tmp = (b + (x * (9.0d0 * y))) / (z * 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 <= -1.8e-71) || !(t <= 3.7e-56)) {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
} else {
tmp = (b + (x * (9.0 * y))) / (z * 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 <= -1.8e-71) or not (t <= 3.7e-56): tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) else: tmp = (b + (x * (9.0 * y))) / (z * 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 <= -1.8e-71) || !(t <= 3.7e-56)) tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); else tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * 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 <= -1.8e-71) || ~((t <= 3.7e-56)))
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
else
tmp = (b + (x * (9.0 * y))) / (z * 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[Or[LessEqual[t, -1.8e-71], N[Not[LessEqual[t, 3.7e-56]], $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], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-71} \lor \neg \left(t \leq 3.7 \cdot 10^{-56}\right):\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\end{array}
\end{array}
if t < -1.8e-71 or 3.7000000000000002e-56 < t Initial program 66.2%
associate-+l-66.2%
*-commutative66.2%
associate-*r*70.9%
*-commutative70.9%
associate-+l-70.9%
associate-*l*71.5%
associate-*l*70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in z around 0 68.5%
Taylor expanded in x around 0 57.9%
Taylor expanded in t around inf 75.9%
if -1.8e-71 < t < 3.7000000000000002e-56Initial program 90.2%
associate-+l-90.2%
*-commutative90.2%
associate-*r*87.5%
*-commutative87.5%
associate-+l-87.5%
associate-*l*87.5%
associate-*l*90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in x around inf 80.8%
associate-*r*80.8%
*-commutative80.8%
associate-*r*80.8%
Simplified80.8%
Final simplification78.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 -2.7e+68) (not (<= t 5.9e-15)))
(* a (/ (* t -4.0) c_m))
(/ (+ b (* x (* 9.0 y))) (* z 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 <= -2.7e+68) || !(t <= 5.9e-15)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b + (x * (9.0 * y))) / (z * 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 <= (-2.7d+68)) .or. (.not. (t <= 5.9d-15))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = (b + (x * (9.0d0 * y))) / (z * 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 <= -2.7e+68) || !(t <= 5.9e-15)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b + (x * (9.0 * y))) / (z * 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 <= -2.7e+68) or not (t <= 5.9e-15): tmp = a * ((t * -4.0) / c_m) else: tmp = (b + (x * (9.0 * y))) / (z * 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 <= -2.7e+68) || !(t <= 5.9e-15)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * 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 <= -2.7e+68) || ~((t <= 5.9e-15)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = (b + (x * (9.0 * y))) / (z * 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[Or[LessEqual[t, -2.7e+68], N[Not[LessEqual[t, 5.9e-15]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+68} \lor \neg \left(t \leq 5.9 \cdot 10^{-15}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\end{array}
\end{array}
if t < -2.69999999999999991e68 or 5.89999999999999963e-15 < t Initial program 61.7%
associate-+l-61.7%
*-commutative61.7%
associate-*r*67.7%
*-commutative67.7%
associate-+l-67.7%
associate-*l*68.6%
associate-*l*66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in z around inf 60.3%
associate-/l*67.0%
associate-*r*67.0%
*-commutative67.0%
associate-*r*67.0%
*-commutative67.0%
associate-*l/67.0%
Simplified67.0%
if -2.69999999999999991e68 < t < 5.89999999999999963e-15Initial program 85.5%
associate-+l-85.5%
*-commutative85.5%
associate-*r*84.3%
*-commutative84.3%
associate-+l-84.3%
associate-*l*84.3%
associate-*l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 72.6%
associate-*r*72.6%
*-commutative72.6%
associate-*r*72.6%
Simplified72.6%
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 (or (<= z -1.85e-55) (not (<= z 9e-106)))
(* a (/ (* t -4.0) c_m))
(/ b (* z 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 ((z <= -1.85e-55) || !(z <= 9e-106)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (z * 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 ((z <= (-1.85d-55)) .or. (.not. (z <= 9d-106))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b / (z * 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 ((z <= -1.85e-55) || !(z <= 9e-106)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (z * 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 (z <= -1.85e-55) or not (z <= 9e-106): tmp = a * ((t * -4.0) / c_m) else: tmp = b / (z * 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 ((z <= -1.85e-55) || !(z <= 9e-106)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b / Float64(z * 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 ((z <= -1.85e-55) || ~((z <= 9e-106)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b / (z * 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[Or[LessEqual[z, -1.85e-55], N[Not[LessEqual[z, 9e-106]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-55} \lor \neg \left(z \leq 9 \cdot 10^{-106}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -1.84999999999999993e-55 or 8.99999999999999911e-106 < z Initial program 66.4%
associate-+l-66.4%
*-commutative66.4%
associate-*r*68.7%
*-commutative68.7%
associate-+l-68.7%
associate-*l*69.3%
associate-*l*70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in z around inf 55.3%
associate-/l*54.2%
associate-*r*54.2%
*-commutative54.2%
associate-*r*54.2%
*-commutative54.2%
associate-*l/54.3%
Simplified54.3%
if -1.84999999999999993e-55 < z < 8.99999999999999911e-106Initial program 96.1%
associate-+l-96.1%
*-commutative96.1%
associate-*r*96.1%
*-commutative96.1%
associate-+l-96.1%
associate-*l*96.1%
associate-*l*93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in b around inf 68.7%
*-commutative68.7%
Simplified68.7%
Final simplification59.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 (<= z -9.5e-51)
(* -4.0 (/ (* t a) c_m))
(if (<= z 2.55e-104) (/ b (* z c_m)) (* 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 tmp;
if (z <= -9.5e-51) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 2.55e-104) {
tmp = b / (z * c_m);
} 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) :: tmp
if (z <= (-9.5d-51)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (z <= 2.55d-104) then
tmp = b / (z * c_m)
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 tmp;
if (z <= -9.5e-51) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 2.55e-104) {
tmp = b / (z * c_m);
} 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): tmp = 0 if z <= -9.5e-51: tmp = -4.0 * ((t * a) / c_m) elif z <= 2.55e-104: tmp = b / (z * c_m) 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) tmp = 0.0 if (z <= -9.5e-51) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (z <= 2.55e-104) tmp = Float64(b / Float64(z * c_m)); 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)
tmp = 0.0;
if (z <= -9.5e-51)
tmp = -4.0 * ((t * a) / c_m);
elseif (z <= 2.55e-104)
tmp = b / (z * c_m);
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_] := N[(c$95$s * If[LessEqual[z, -9.5e-51], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-104], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-51}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-104}:\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if z < -9.4999999999999998e-51Initial program 61.5%
associate-+l-61.5%
*-commutative61.5%
associate-*r*67.2%
*-commutative67.2%
associate-+l-67.2%
associate-*l*68.3%
associate-*l*69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 58.7%
*-commutative58.7%
Simplified58.7%
if -9.4999999999999998e-51 < z < 2.54999999999999996e-104Initial program 96.2%
associate-+l-96.2%
*-commutative96.2%
associate-*r*96.2%
*-commutative96.2%
associate-+l-96.2%
associate-*l*96.1%
associate-*l*92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in b around inf 68.0%
*-commutative68.0%
Simplified68.0%
if 2.54999999999999996e-104 < z Initial program 71.0%
associate-+l-71.0%
*-commutative71.0%
associate-*r*69.9%
*-commutative69.9%
associate-+l-69.9%
associate-*l*69.9%
associate-*l*73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in z around inf 52.5%
associate-/l*52.2%
associate-*r*52.2%
*-commutative52.2%
associate-*r*52.2%
*-commutative52.2%
associate-*l/52.3%
Simplified52.3%
Final simplification59.7%
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 (* z 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) {
return c_s * (b / (z * c_m));
}
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 / (z * c_m))
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 / (z * c_m));
}
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 / (z * c_m))
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(z * c_m))) 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 / (z * c_m));
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[(z * 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])\\
\\
c\_s \cdot \frac{b}{z \cdot c\_m}
\end{array}
Initial program 76.2%
associate-+l-76.2%
*-commutative76.2%
associate-*r*77.8%
*-commutative77.8%
associate-+l-77.8%
associate-*l*78.2%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in b around inf 37.7%
*-commutative37.7%
Simplified37.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024110
(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)))