
(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 20 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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (+ (/ b c_m) (* 9.0 (/ (* x y) c_m)))))
(*
c_s
(if (<= c_m 6e-41)
(/ (+ (fma x (* 9.0 y) (* t (* a (* z -4.0)))) b) (* c_m z))
(if (<= c_m 1.3e+150)
(/ (+ t_1 (* -4.0 (* (/ z c_m) (* t a)))) z)
(if (or (<= c_m 5e+216) (not (<= c_m 2.85e+263)))
(*
b
(+
(/ 1.0 (* c_m z))
(/ (fma 9.0 (/ (* x (/ y c_m)) z) (* a (/ (* t -4.0) c_m))) b)))
(/ (+ (* -4.0 (* (* t z) (/ a c_m))) t_1) z)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b / c_m) + (9.0 * ((x * y) / c_m));
double tmp;
if (c_m <= 6e-41) {
tmp = (fma(x, (9.0 * y), (t * (a * (z * -4.0)))) + b) / (c_m * z);
} else if (c_m <= 1.3e+150) {
tmp = (t_1 + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else if ((c_m <= 5e+216) || !(c_m <= 2.85e+263)) {
tmp = b * ((1.0 / (c_m * z)) + (fma(9.0, ((x * (y / c_m)) / z), (a * ((t * -4.0) / c_m))) / b));
} else {
tmp = ((-4.0 * ((t * z) * (a / c_m))) + t_1) / z;
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) tmp = 0.0 if (c_m <= 6e-41) tmp = Float64(Float64(fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0)))) + b) / Float64(c_m * z)); elseif (c_m <= 1.3e+150) tmp = Float64(Float64(t_1 + Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a)))) / z); elseif ((c_m <= 5e+216) || !(c_m <= 2.85e+263)) tmp = Float64(b * Float64(Float64(1.0 / Float64(c_m * z)) + Float64(fma(9.0, Float64(Float64(x * Float64(y / c_m)) / z), Float64(a * Float64(Float64(t * -4.0) / c_m))) / b))); else tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(t * z) * Float64(a / c_m))) + t_1) / z); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[c$95$m, 6e-41], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c$95$m, 1.3e+150], N[(N[(t$95$1 + N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[c$95$m, 5e+216], N[Not[LessEqual[c$95$m, 2.85e+263]], $MachinePrecision]], N[(b * N[(N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(N[(t * z), $MachinePrecision] * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 6 \cdot 10^{-41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;c\_m \leq 1.3 \cdot 10^{+150}:\\
\;\;\;\;\frac{t\_1 + -4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right)}{z}\\
\mathbf{elif}\;c\_m \leq 5 \cdot 10^{+216} \lor \neg \left(c\_m \leq 2.85 \cdot 10^{+263}\right):\\
\;\;\;\;b \cdot \left(\frac{1}{c\_m \cdot z} + \frac{\mathsf{fma}\left(9, \frac{x \cdot \frac{y}{c\_m}}{z}, a \cdot \frac{t \cdot -4}{c\_m}\right)}{b}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(\left(t \cdot z\right) \cdot \frac{a}{c\_m}\right) + t\_1}{z}\\
\end{array}
\end{array}
\end{array}
if c < 5.99999999999999978e-41Initial program 80.5%
Simplified82.9%
if 5.99999999999999978e-41 < c < 1.30000000000000003e150Initial program 75.3%
associate-+l-75.3%
*-commutative75.3%
associate-*r*82.6%
*-commutative82.6%
associate-+l-82.6%
associate-*l*82.6%
associate-*l*85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in z around 0 82.8%
associate-/l*82.8%
associate-*r/87.6%
associate-*r*95.0%
Applied egg-rr95.0%
if 1.30000000000000003e150 < c < 4.9999999999999998e216 or 2.85000000000000022e263 < c Initial program 74.3%
associate-+l-74.3%
*-commutative74.3%
associate-*r*76.2%
*-commutative76.2%
associate-+l-76.2%
associate-*l*76.1%
associate-*l*67.1%
*-commutative67.1%
Simplified67.1%
Taylor expanded in b around inf 59.1%
+-commutative59.1%
associate--l+59.1%
*-commutative59.1%
times-frac67.2%
associate-*l/71.7%
associate-/l*67.0%
associate-/l*67.1%
associate-*r/67.1%
associate-/l/67.5%
associate-*r/67.5%
div-sub67.5%
Simplified93.7%
if 4.9999999999999998e216 < c < 2.85000000000000022e263Initial program 28.2%
associate-+l-28.2%
*-commutative28.2%
associate-*r*20.1%
*-commutative20.1%
associate-+l-20.1%
associate-*l*20.0%
associate-*l*19.8%
*-commutative19.8%
Simplified19.8%
Taylor expanded in z around 0 72.8%
*-commutative72.8%
*-un-lft-identity72.8%
times-frac81.6%
Applied egg-rr81.6%
Final simplification85.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 1.9e-41)
(/ (+ (fma x (* 9.0 y) (* t (* a (* z -4.0)))) b) (* c_m z))
(if (or (<= c_m 1.05e+216) (not (<= c_m 9.2e+259)))
(/
(fma -4.0 (* a (* t (/ z c_m))) (fma 9.0 (* x (/ y c_m)) (/ b c_m)))
z)
(/
(+ (* -4.0 (* (* t z) (/ a c_m))) (+ (/ b c_m) (* 9.0 (/ (* x y) c_m))))
z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1.9e-41) {
tmp = (fma(x, (9.0 * y), (t * (a * (z * -4.0)))) + b) / (c_m * z);
} else if ((c_m <= 1.05e+216) || !(c_m <= 9.2e+259)) {
tmp = fma(-4.0, (a * (t * (z / c_m))), fma(9.0, (x * (y / c_m)), (b / c_m))) / z;
} else {
tmp = ((-4.0 * ((t * z) * (a / c_m))) + ((b / c_m) + (9.0 * ((x * y) / c_m)))) / z;
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 1.9e-41) tmp = Float64(Float64(fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0)))) + b) / Float64(c_m * z)); elseif ((c_m <= 1.05e+216) || !(c_m <= 9.2e+259)) tmp = Float64(fma(-4.0, Float64(a * Float64(t * Float64(z / c_m))), fma(9.0, Float64(x * Float64(y / c_m)), Float64(b / c_m))) / z); else tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(t * z) * Float64(a / c_m))) + Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m)))) / z); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 1.9e-41], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c$95$m, 1.05e+216], N[Not[LessEqual[c$95$m, 9.2e+259]], $MachinePrecision]], N[(N[(-4.0 * N[(a * N[(t * N[(z / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(-4.0 * N[(N[(t * z), $MachinePrecision] * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 1.9 \cdot 10^{-41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;c\_m \leq 1.05 \cdot 10^{+216} \lor \neg \left(c\_m \leq 9.2 \cdot 10^{+259}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot \left(t \cdot \frac{z}{c\_m}\right), \mathsf{fma}\left(9, x \cdot \frac{y}{c\_m}, \frac{b}{c\_m}\right)\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(\left(t \cdot z\right) \cdot \frac{a}{c\_m}\right) + \left(\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}\right)}{z}\\
\end{array}
\end{array}
if c < 1.8999999999999999e-41Initial program 80.5%
Simplified82.9%
if 1.8999999999999999e-41 < c < 1.05000000000000001e216 or 9.2000000000000004e259 < c Initial program 73.4%
associate-+l-73.4%
*-commutative73.4%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
associate-*l*78.8%
associate-*l*78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in z around 0 79.7%
fma-define79.7%
associate-/l*79.6%
associate-/l*84.2%
fma-define84.2%
associate-/l*88.9%
Simplified88.9%
if 1.05000000000000001e216 < c < 9.2000000000000004e259Initial program 36.8%
associate-+l-36.8%
*-commutative36.8%
associate-*r*28.7%
*-commutative28.7%
associate-+l-28.7%
associate-*l*28.6%
associate-*l*19.9%
*-commutative19.9%
Simplified19.9%
Taylor expanded in z around 0 73.0%
*-commutative73.0%
*-un-lft-identity73.0%
times-frac81.7%
Applied egg-rr81.7%
Final simplification84.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -5e-263)
(/ (+ b (- (* x (* 9.0 y)) (* (* t a) (* z 4.0)))) (* c_m z))
(if (<= t_1 2e+229)
(/
(+
(+ (/ b c_m) (* 9.0 (/ (* x y) c_m)))
(* -4.0 (/ (* a (* t z)) c_m)))
z)
(if (<= t_1 INFINITY)
(/ (+ (fma x (* 9.0 y) (* t (* a (* z -4.0)))) b) (* c_m z))
(* 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);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -5e-263) {
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 2e+229) {
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * ((a * (t * z)) / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (fma(x, (9.0 * y), (t * (a * (z * -4.0)))) + b) / (c_m * z);
} 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]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -5e-263) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(t * a) * Float64(z * 4.0)))) / Float64(c_m * z)); elseif (t_1 <= 2e+229) tmp = Float64(Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) + Float64(-4.0 * Float64(Float64(a * Float64(t * z)) / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0)))) + b) / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(t * -4.0) / 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.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -5e-263], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(t * a), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+229], N[(N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-263}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(t \cdot a\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+229}:\\
\;\;\;\;\frac{\left(\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}\right) + -4 \cdot \frac{a \cdot \left(t \cdot z\right)}{c\_m}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\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)) < -5.00000000000000006e-263Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*85.0%
*-commutative85.0%
associate-+l-85.0%
associate-*l*85.0%
associate-*l*85.0%
*-commutative85.0%
Simplified85.0%
if -5.00000000000000006e-263 < (/.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)) < 2e229Initial program 82.8%
associate-+l-82.8%
*-commutative82.8%
associate-*r*81.3%
*-commutative81.3%
associate-+l-81.3%
associate-*l*81.3%
associate-*l*78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in z around 0 98.1%
if 2e229 < (/.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 82.3%
Simplified88.8%
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%
associate-+l-0.0%
*-commutative0.0%
associate-*r*15.5%
*-commutative15.5%
associate-+l-15.5%
associate-*l*15.5%
associate-*l*15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in z around inf 63.5%
*-commutative63.5%
associate-/l*81.3%
associate-*r*81.3%
associate-*l/81.3%
Simplified81.3%
Final simplification89.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -5e-263)
(/ (+ b (- (* x (* 9.0 y)) (* (* t a) (* z 4.0)))) (* c_m z))
(if (<= t_1 5e-222)
(/ (+ (/ b c_m) (* -4.0 (* (/ z c_m) (* t a)))) z)
(if (<= t_1 INFINITY) t_1 (* a (/ (* t -4.0) c_m))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -5e-263) {
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 5e-222) {
tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / 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;
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 + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -5e-263) {
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 5e-222) {
tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_1 <= -5e-263: tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z) elif t_1 <= 5e-222: tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z elif t_1 <= math.inf: tmp = t_1 else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -5e-263) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(t * a) * Float64(z * 4.0)))) / Float64(c_m * z)); elseif (t_1 <= 5e-222) tmp = Float64(Float64(Float64(b / c_m) + Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a)))) / z); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -5e-263)
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
elseif (t_1 <= 5e-222)
tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = a * ((t * -4.0) / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -5e-263], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(t * a), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-222], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-263}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(t \cdot a\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-222}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + -4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\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)) < -5.00000000000000006e-263Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*85.0%
*-commutative85.0%
associate-+l-85.0%
associate-*l*85.0%
associate-*l*85.0%
*-commutative85.0%
Simplified85.0%
if -5.00000000000000006e-263 < (/.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)) < 5.00000000000000008e-222Initial program 40.9%
associate-+l-40.9%
*-commutative40.9%
associate-*r*35.2%
*-commutative35.2%
associate-+l-35.2%
associate-*l*35.2%
associate-*l*40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in z around 0 99.6%
associate-/l*94.4%
associate-*r/94.5%
associate-*r*99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 88.9%
if 5.00000000000000008e-222 < (/.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.4%
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%
associate-+l-0.0%
*-commutative0.0%
associate-*r*15.5%
*-commutative15.5%
associate-+l-15.5%
associate-*l*15.5%
associate-*l*15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in z around inf 63.5%
*-commutative63.5%
associate-/l*81.3%
associate-*r*81.3%
associate-*l/81.3%
Simplified81.3%
Final simplification86.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -5e-263)
(/ (+ b (- (* x (* 9.0 y)) (* (* t a) (* z 4.0)))) (* c_m z))
(if (<= t_1 5e-222)
(/
(+
(+ (/ b c_m) (* 9.0 (/ (* x y) c_m)))
(* -4.0 (* (/ z c_m) (* t a))))
z)
(if (<= t_1 INFINITY) t_1 (* a (/ (* t -4.0) c_m))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -5e-263) {
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 5e-222) {
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / 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;
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 + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -5e-263) {
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
} else if (t_1 <= 5e-222) {
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_1 <= -5e-263: tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z) elif t_1 <= 5e-222: tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * ((z / c_m) * (t * a)))) / z elif t_1 <= math.inf: tmp = t_1 else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -5e-263) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(t * a) * Float64(z * 4.0)))) / Float64(c_m * z)); elseif (t_1 <= 5e-222) tmp = Float64(Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) + Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a)))) / z); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -5e-263)
tmp = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
elseif (t_1 <= 5e-222)
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * ((z / c_m) * (t * a)))) / z;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = a * ((t * -4.0) / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -5e-263], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(t * a), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-222], N[(N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-263}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(t \cdot a\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-222}:\\
\;\;\;\;\frac{\left(\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}\right) + -4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\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)) < -5.00000000000000006e-263Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*85.0%
*-commutative85.0%
associate-+l-85.0%
associate-*l*85.0%
associate-*l*85.0%
*-commutative85.0%
Simplified85.0%
if -5.00000000000000006e-263 < (/.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)) < 5.00000000000000008e-222Initial program 40.9%
associate-+l-40.9%
*-commutative40.9%
associate-*r*35.2%
*-commutative35.2%
associate-+l-35.2%
associate-*l*35.2%
associate-*l*40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in z around 0 99.6%
associate-/l*94.4%
associate-*r/94.5%
associate-*r*99.7%
Applied egg-rr99.7%
if 5.00000000000000008e-222 < (/.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.4%
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%
associate-+l-0.0%
*-commutative0.0%
associate-*r*15.5%
*-commutative15.5%
associate-+l-15.5%
associate-*l*15.5%
associate-*l*15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in z around inf 63.5%
*-commutative63.5%
associate-/l*81.3%
associate-*r*81.3%
associate-*l/81.3%
Simplified81.3%
Final simplification87.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (- b (* 4.0 (* a (* t z)))) (* c_m z)))
(t_2 (* -4.0 (* (/ z c_m) (* t a))))
(t_3 (/ (+ t_2 (* x (* 9.0 (/ y c_m)))) z)))
(*
c_s
(if (<= b -2.7e+52)
t_1
(if (<= b 2.3e-96)
t_3
(if (<= b 7.9e-59)
t_1
(if (<= b 3.8e-25)
t_3
(if (<= b 5.5e+75)
(/ (+ b (* x (* 9.0 y))) (* c_m z))
(if (<= b 6.7e+168)
(/ (+ (/ b c_m) t_2) z)
(/ (+ b (* 9.0 (* x y))) (* c_m z)))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b - (4.0 * (a * (t * z)))) / (c_m * z);
double t_2 = -4.0 * ((z / c_m) * (t * a));
double t_3 = (t_2 + (x * (9.0 * (y / c_m)))) / z;
double tmp;
if (b <= -2.7e+52) {
tmp = t_1;
} else if (b <= 2.3e-96) {
tmp = t_3;
} else if (b <= 7.9e-59) {
tmp = t_1;
} else if (b <= 3.8e-25) {
tmp = t_3;
} else if (b <= 5.5e+75) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if (b <= 6.7e+168) {
tmp = ((b / c_m) + t_2) / z;
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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) :: t_3
real(8) :: tmp
t_1 = (b - (4.0d0 * (a * (t * z)))) / (c_m * z)
t_2 = (-4.0d0) * ((z / c_m) * (t * a))
t_3 = (t_2 + (x * (9.0d0 * (y / c_m)))) / z
if (b <= (-2.7d+52)) then
tmp = t_1
else if (b <= 2.3d-96) then
tmp = t_3
else if (b <= 7.9d-59) then
tmp = t_1
else if (b <= 3.8d-25) then
tmp = t_3
else if (b <= 5.5d+75) then
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
else if (b <= 6.7d+168) then
tmp = ((b / c_m) + t_2) / z
else
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 - (4.0 * (a * (t * z)))) / (c_m * z);
double t_2 = -4.0 * ((z / c_m) * (t * a));
double t_3 = (t_2 + (x * (9.0 * (y / c_m)))) / z;
double tmp;
if (b <= -2.7e+52) {
tmp = t_1;
} else if (b <= 2.3e-96) {
tmp = t_3;
} else if (b <= 7.9e-59) {
tmp = t_1;
} else if (b <= 3.8e-25) {
tmp = t_3;
} else if (b <= 5.5e+75) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if (b <= 6.7e+168) {
tmp = ((b / c_m) + t_2) / z;
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b - (4.0 * (a * (t * z)))) / (c_m * z) t_2 = -4.0 * ((z / c_m) * (t * a)) t_3 = (t_2 + (x * (9.0 * (y / c_m)))) / z tmp = 0 if b <= -2.7e+52: tmp = t_1 elif b <= 2.3e-96: tmp = t_3 elif b <= 7.9e-59: tmp = t_1 elif b <= 3.8e-25: tmp = t_3 elif b <= 5.5e+75: tmp = (b + (x * (9.0 * y))) / (c_m * z) elif b <= 6.7e+168: tmp = ((b / c_m) + t_2) / z else: tmp = (b + (9.0 * (x * y))) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(t * z)))) / Float64(c_m * z)) t_2 = Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a))) t_3 = Float64(Float64(t_2 + Float64(x * Float64(9.0 * Float64(y / c_m)))) / z) tmp = 0.0 if (b <= -2.7e+52) tmp = t_1; elseif (b <= 2.3e-96) tmp = t_3; elseif (b <= 7.9e-59) tmp = t_1; elseif (b <= 3.8e-25) tmp = t_3; elseif (b <= 5.5e+75) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); elseif (b <= 6.7e+168) tmp = Float64(Float64(Float64(b / c_m) + t_2) / z); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b - (4.0 * (a * (t * z)))) / (c_m * z);
t_2 = -4.0 * ((z / c_m) * (t * a));
t_3 = (t_2 + (x * (9.0 * (y / c_m)))) / z;
tmp = 0.0;
if (b <= -2.7e+52)
tmp = t_1;
elseif (b <= 2.3e-96)
tmp = t_3;
elseif (b <= 7.9e-59)
tmp = t_1;
elseif (b <= 3.8e-25)
tmp = t_3;
elseif (b <= 5.5e+75)
tmp = (b + (x * (9.0 * y))) / (c_m * z);
elseif (b <= 6.7e+168)
tmp = ((b / c_m) + t_2) / z;
else
tmp = (b + (9.0 * (x * y))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b - N[(4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 + N[(x * N[(9.0 * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, N[(c$95$s * If[LessEqual[b, -2.7e+52], t$95$1, If[LessEqual[b, 2.3e-96], t$95$3, If[LessEqual[b, 7.9e-59], t$95$1, If[LessEqual[b, 3.8e-25], t$95$3, If[LessEqual[b, 5.5e+75], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.7e+168], N[(N[(N[(b / c$95$m), $MachinePrecision] + t$95$2), $MachinePrecision] / z), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]]]]]]), $MachinePrecision]]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c\_m \cdot z}\\
t_2 := -4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right)\\
t_3 := \frac{t\_2 + x \cdot \left(9 \cdot \frac{y}{c\_m}\right)}{z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-96}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 7.9 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-25}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+75}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq 6.7 \cdot 10^{+168}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + t\_2}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
\end{array}
if b < -2.7e52 or 2.3e-96 < b < 7.89999999999999985e-59Initial program 78.1%
associate-+l-78.1%
*-commutative78.1%
associate-*r*80.9%
*-commutative80.9%
associate-+l-80.9%
associate-*l*80.9%
associate-*l*79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in x around 0 70.0%
if -2.7e52 < b < 2.3e-96 or 7.89999999999999985e-59 < b < 3.7999999999999998e-25Initial program 76.9%
associate-+l-76.9%
*-commutative76.9%
associate-*r*77.7%
*-commutative77.7%
associate-+l-77.7%
associate-*l*77.7%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in z around 0 82.3%
associate-/l*81.0%
associate-*r/82.5%
associate-*r*84.7%
Applied egg-rr84.7%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
associate-/l*80.9%
associate-*r*80.9%
*-commutative80.9%
Simplified80.9%
if 3.7999999999999998e-25 < b < 5.5000000000000001e75Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*90.3%
*-commutative90.3%
associate-+l-90.3%
associate-*l*90.3%
associate-*l*90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in x around inf 85.1%
associate-*r*85.3%
*-commutative85.3%
associate-*r*85.3%
Simplified85.3%
if 5.5000000000000001e75 < b < 6.7000000000000003e168Initial program 49.1%
associate-+l-49.1%
*-commutative49.1%
associate-*r*54.7%
*-commutative54.7%
associate-+l-54.7%
associate-*l*54.7%
associate-*l*54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in z around 0 61.0%
associate-/l*61.2%
associate-*r/78.0%
associate-*r*83.9%
Applied egg-rr83.9%
Taylor expanded in x around 0 78.5%
if 6.7000000000000003e168 < b Initial program 85.3%
associate-+l-85.3%
*-commutative85.3%
associate-*r*89.2%
*-commutative89.2%
associate-+l-89.2%
associate-*l*89.2%
associate-*l*82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 85.8%
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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* x (* 9.0 y)) (* (* t a) (* z 4.0)))) (* c_m z))))
(*
c_s
(if (<= c_m 1.55e+83)
t_1
(if (<= c_m 1.7e+104)
(/ (+ (/ b c_m) (* 9.0 (/ (* x y) c_m))) z)
(if (<= c_m 1.15e+166)
t_1
(if (<= c_m 2.7e+179)
(* -4.0 (* t (/ a c_m)))
(if (<= c_m 2.15e+209)
t_1
(/
(+ (* -4.0 (* (/ z c_m) (* t a))) (* x (* 9.0 (/ y c_m))))
z)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
double tmp;
if (c_m <= 1.55e+83) {
tmp = t_1;
} else if (c_m <= 1.7e+104) {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
} else if (c_m <= 1.15e+166) {
tmp = t_1;
} else if (c_m <= 2.7e+179) {
tmp = -4.0 * (t * (a / c_m));
} else if (c_m <= 2.15e+209) {
tmp = t_1;
} else {
tmp = ((-4.0 * ((z / c_m) * (t * a))) + (x * (9.0 * (y / c_m)))) / z;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 + ((x * (9.0d0 * y)) - ((t * a) * (z * 4.0d0)))) / (c_m * z)
if (c_m <= 1.55d+83) then
tmp = t_1
else if (c_m <= 1.7d+104) then
tmp = ((b / c_m) + (9.0d0 * ((x * y) / c_m))) / z
else if (c_m <= 1.15d+166) then
tmp = t_1
else if (c_m <= 2.7d+179) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (c_m <= 2.15d+209) then
tmp = t_1
else
tmp = (((-4.0d0) * ((z / c_m) * (t * a))) + (x * (9.0d0 * (y / c_m)))) / z
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
double tmp;
if (c_m <= 1.55e+83) {
tmp = t_1;
} else if (c_m <= 1.7e+104) {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
} else if (c_m <= 1.15e+166) {
tmp = t_1;
} else if (c_m <= 2.7e+179) {
tmp = -4.0 * (t * (a / c_m));
} else if (c_m <= 2.15e+209) {
tmp = t_1;
} else {
tmp = ((-4.0 * ((z / c_m) * (t * a))) + (x * (9.0 * (y / c_m)))) / z;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z) tmp = 0 if c_m <= 1.55e+83: tmp = t_1 elif c_m <= 1.7e+104: tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z elif c_m <= 1.15e+166: tmp = t_1 elif c_m <= 2.7e+179: tmp = -4.0 * (t * (a / c_m)) elif c_m <= 2.15e+209: tmp = t_1 else: tmp = ((-4.0 * ((z / c_m) * (t * a))) + (x * (9.0 * (y / c_m)))) / z return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(t * a) * Float64(z * 4.0)))) / Float64(c_m * z)) tmp = 0.0 if (c_m <= 1.55e+83) tmp = t_1; elseif (c_m <= 1.7e+104) tmp = Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) / z); elseif (c_m <= 1.15e+166) tmp = t_1; elseif (c_m <= 2.7e+179) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (c_m <= 2.15e+209) tmp = t_1; else tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a))) + Float64(x * Float64(9.0 * Float64(y / c_m)))) / z); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((x * (9.0 * y)) - ((t * a) * (z * 4.0)))) / (c_m * z);
tmp = 0.0;
if (c_m <= 1.55e+83)
tmp = t_1;
elseif (c_m <= 1.7e+104)
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
elseif (c_m <= 1.15e+166)
tmp = t_1;
elseif (c_m <= 2.7e+179)
tmp = -4.0 * (t * (a / c_m));
elseif (c_m <= 2.15e+209)
tmp = t_1;
else
tmp = ((-4.0 * ((z / c_m) * (t * a))) + (x * (9.0 * (y / c_m)))) / z;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(t * a), $MachinePrecision] * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[c$95$m, 1.55e+83], t$95$1, If[LessEqual[c$95$m, 1.7e+104], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[c$95$m, 1.15e+166], t$95$1, If[LessEqual[c$95$m, 2.7e+179], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c$95$m, 2.15e+209], t$95$1, N[(N[(N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(9.0 * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(t \cdot a\right) \cdot \left(z \cdot 4\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 1.55 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c\_m \leq 1.7 \cdot 10^{+104}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}}{z}\\
\mathbf{elif}\;c\_m \leq 1.15 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c\_m \leq 2.7 \cdot 10^{+179}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;c\_m \leq 2.15 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right) + x \cdot \left(9 \cdot \frac{y}{c\_m}\right)}{z}\\
\end{array}
\end{array}
\end{array}
if c < 1.54999999999999996e83 or 1.6999999999999998e104 < c < 1.15000000000000004e166 or 2.69999999999999982e179 < c < 2.14999999999999994e209Initial program 79.8%
associate-+l-79.8%
*-commutative79.8%
associate-*r*82.7%
*-commutative82.7%
associate-+l-82.7%
associate-*l*82.7%
associate-*l*82.7%
*-commutative82.7%
Simplified82.7%
if 1.54999999999999996e83 < c < 1.6999999999999998e104Initial program 81.0%
associate-+l-81.0%
*-commutative81.0%
associate-*r*81.0%
*-commutative81.0%
associate-+l-81.0%
associate-*l*81.0%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in z around 0 100.0%
fma-define100.0%
associate-/l*100.0%
associate-/l*100.0%
fma-define100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
if 1.15000000000000004e166 < c < 2.69999999999999982e179Initial program 66.1%
associate-+l-66.1%
*-commutative66.1%
associate-*r*66.1%
*-commutative66.1%
associate-+l-66.1%
associate-*l*65.6%
associate-*l*34.4%
*-commutative34.4%
Simplified34.4%
Taylor expanded in z around 0 68.3%
associate-*r/68.3%
*-commutative68.3%
Applied egg-rr68.3%
Taylor expanded in a around inf 5.2%
associate-*r/5.2%
associate-*r*5.2%
associate-*l/68.1%
associate-*r/68.1%
associate-*l*68.1%
Simplified68.1%
if 2.14999999999999994e209 < c Initial program 45.3%
associate-+l-45.3%
*-commutative45.3%
associate-*r*40.9%
*-commutative40.9%
associate-+l-40.9%
associate-*l*40.8%
associate-*l*36.0%
*-commutative36.0%
Simplified36.0%
Taylor expanded in z around 0 69.6%
associate-/l*74.4%
associate-*r/79.3%
associate-*r*69.1%
Applied egg-rr69.1%
Taylor expanded in x around inf 54.9%
*-commutative54.9%
associate-/l*64.7%
associate-*r*64.8%
*-commutative64.8%
Simplified64.8%
Final simplification81.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (/ b c_m) (* -4.0 (* (/ z c_m) (* t a)))) z)))
(*
c_s
(if (<= z -2.6e+67)
t_1
(if (<= z 6e-136)
(/ (+ b (* x (* 9.0 y))) (* c_m z))
(if (<= z 215000000.0)
(/ (- (* 9.0 (* x y)) (* 4.0 (* a (* t z)))) (* c_m z))
(if (<= z 1.7e+142) t_1 (* a (/ (* t -4.0) c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
double tmp;
if (z <= -2.6e+67) {
tmp = t_1;
} else if (z <= 6e-136) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if (z <= 215000000.0) {
tmp = ((9.0 * (x * y)) - (4.0 * (a * (t * z)))) / (c_m * z);
} else if (z <= 1.7e+142) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 / c_m) + ((-4.0d0) * ((z / c_m) * (t * a)))) / z
if (z <= (-2.6d+67)) then
tmp = t_1
else if (z <= 6d-136) then
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
else if (z <= 215000000.0d0) then
tmp = ((9.0d0 * (x * y)) - (4.0d0 * (a * (t * z)))) / (c_m * z)
else if (z <= 1.7d+142) then
tmp = t_1
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
double tmp;
if (z <= -2.6e+67) {
tmp = t_1;
} else if (z <= 6e-136) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if (z <= 215000000.0) {
tmp = ((9.0 * (x * y)) - (4.0 * (a * (t * z)))) / (c_m * z);
} else if (z <= 1.7e+142) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z tmp = 0 if z <= -2.6e+67: tmp = t_1 elif z <= 6e-136: tmp = (b + (x * (9.0 * y))) / (c_m * z) elif z <= 215000000.0: tmp = ((9.0 * (x * y)) - (4.0 * (a * (t * z)))) / (c_m * z) elif z <= 1.7e+142: tmp = t_1 else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(b / c_m) + Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a)))) / z) tmp = 0.0 if (z <= -2.6e+67) tmp = t_1; elseif (z <= 6e-136) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); elseif (z <= 215000000.0) tmp = Float64(Float64(Float64(9.0 * Float64(x * y)) - Float64(4.0 * Float64(a * Float64(t * z)))) / Float64(c_m * z)); elseif (z <= 1.7e+142) tmp = t_1; else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
tmp = 0.0;
if (z <= -2.6e+67)
tmp = t_1;
elseif (z <= 6e-136)
tmp = (b + (x * (9.0 * y))) / (c_m * z);
elseif (z <= 215000000.0)
tmp = ((9.0 * (x * y)) - (4.0 * (a * (t * z)))) / (c_m * z);
elseif (z <= 1.7e+142)
tmp = t_1;
else
tmp = a * ((t * -4.0) / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, N[(c$95$s * If[LessEqual[z, -2.6e+67], t$95$1, If[LessEqual[z, 6e-136], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 215000000.0], N[(N[(N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+142], t$95$1, N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{b}{c\_m} + -4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right)}{z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-136}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;z \leq 215000000:\\
\;\;\;\;\frac{9 \cdot \left(x \cdot y\right) - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c\_m \cdot z}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
\end{array}
if z < -2.6e67 or 2.15e8 < z < 1.6999999999999999e142Initial program 63.1%
associate-+l-63.1%
*-commutative63.1%
associate-*r*66.8%
*-commutative66.8%
associate-+l-66.8%
associate-*l*66.7%
associate-*l*69.5%
*-commutative69.5%
Simplified69.5%
Taylor expanded in z around 0 66.6%
associate-/l*64.4%
associate-*r/70.4%
associate-*r*75.2%
Applied egg-rr75.2%
Taylor expanded in x around 0 68.1%
if -2.6e67 < z < 5.9999999999999996e-136Initial program 91.4%
associate-+l-91.4%
*-commutative91.4%
associate-*r*93.0%
*-commutative93.0%
associate-+l-93.0%
associate-*l*93.0%
associate-*l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in x around inf 82.5%
associate-*r*82.5%
*-commutative82.5%
associate-*r*82.5%
Simplified82.5%
if 5.9999999999999996e-136 < z < 2.15e8Initial program 94.3%
associate-+l-94.3%
*-commutative94.3%
associate-*r*94.2%
*-commutative94.2%
associate-+l-94.2%
associate-*l*94.2%
associate-*l*91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in b around 0 77.5%
if 1.6999999999999999e142 < z Initial program 45.3%
associate-+l-45.3%
*-commutative45.3%
associate-*r*49.0%
*-commutative49.0%
associate-+l-49.0%
associate-*l*49.0%
associate-*l*51.3%
*-commutative51.3%
Simplified51.3%
Taylor expanded in z around inf 61.1%
*-commutative61.1%
associate-/l*63.4%
associate-*r*63.4%
associate-*l/63.4%
Simplified63.4%
Final simplification74.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (/ (* x (/ y c_m)) z))))
(*
c_s
(if (<= a -1.1e-111)
(* -4.0 (/ (* t a) c_m))
(if (<= a 6.5e-235)
t_1
(if (<= a 8.6e-82)
(/ (/ b c_m) z)
(if (<= a 1.6e-25)
t_1
(if (<= a 7.2e-20) (/ b (* c_m z)) (* -4.0 (* t (/ a c_m)))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * ((x * (y / c_m)) / z);
double tmp;
if (a <= -1.1e-111) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 6.5e-235) {
tmp = t_1;
} else if (a <= 8.6e-82) {
tmp = (b / c_m) / z;
} else if (a <= 1.6e-25) {
tmp = t_1;
} else if (a <= 7.2e-20) {
tmp = b / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * ((x * (y / c_m)) / z)
if (a <= (-1.1d-111)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (a <= 6.5d-235) then
tmp = t_1
else if (a <= 8.6d-82) then
tmp = (b / c_m) / z
else if (a <= 1.6d-25) then
tmp = t_1
else if (a <= 7.2d-20) then
tmp = b / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * ((x * (y / c_m)) / z);
double tmp;
if (a <= -1.1e-111) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 6.5e-235) {
tmp = t_1;
} else if (a <= 8.6e-82) {
tmp = (b / c_m) / z;
} else if (a <= 1.6e-25) {
tmp = t_1;
} else if (a <= 7.2e-20) {
tmp = b / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 9.0 * ((x * (y / c_m)) / z) tmp = 0 if a <= -1.1e-111: tmp = -4.0 * ((t * a) / c_m) elif a <= 6.5e-235: tmp = t_1 elif a <= 8.6e-82: tmp = (b / c_m) / z elif a <= 1.6e-25: tmp = t_1 elif a <= 7.2e-20: tmp = b / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(9.0 * Float64(Float64(x * Float64(y / c_m)) / z)) tmp = 0.0 if (a <= -1.1e-111) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (a <= 6.5e-235) tmp = t_1; elseif (a <= 8.6e-82) tmp = Float64(Float64(b / c_m) / z); elseif (a <= 1.6e-25) tmp = t_1; elseif (a <= 7.2e-20) tmp = Float64(b / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 9.0 * ((x * (y / c_m)) / z);
tmp = 0.0;
if (a <= -1.1e-111)
tmp = -4.0 * ((t * a) / c_m);
elseif (a <= 6.5e-235)
tmp = t_1;
elseif (a <= 8.6e-82)
tmp = (b / c_m) / z;
elseif (a <= 1.6e-25)
tmp = t_1;
elseif (a <= 7.2e-20)
tmp = b / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(9.0 * N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -1.1e-111], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-235], t$95$1, If[LessEqual[a, 8.6e-82], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 1.6e-25], t$95$1, If[LessEqual[a, 7.2e-20], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{x \cdot \frac{y}{c\_m}}{z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-111}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if a < -1.1e-111Initial program 78.9%
associate-+l-78.9%
*-commutative78.9%
associate-*r*80.7%
*-commutative80.7%
associate-+l-80.7%
associate-*l*80.7%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in z around inf 45.8%
*-commutative45.8%
Simplified45.8%
if -1.1e-111 < a < 6.49999999999999973e-235 or 8.60000000000000037e-82 < a < 1.6000000000000001e-25Initial program 79.2%
associate-+l-79.2%
*-commutative79.2%
associate-*r*87.3%
*-commutative87.3%
associate-+l-87.3%
associate-*l*87.3%
associate-*l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in x around inf 47.9%
associate-/r*46.8%
associate-/l*49.3%
Simplified49.3%
if 6.49999999999999973e-235 < a < 8.60000000000000037e-82Initial program 75.9%
associate-+l-75.9%
*-commutative75.9%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
associate-*l*78.7%
associate-*l*78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in b around inf 38.0%
associate-/r*49.9%
Simplified49.9%
if 1.6000000000000001e-25 < a < 7.19999999999999948e-20Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
*-commutative100.0%
Simplified100.0%
if 7.19999999999999948e-20 < a Initial program 70.2%
associate-+l-70.2%
*-commutative70.2%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.5%
associate-*l*68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 77.6%
associate-*r/75.6%
*-commutative75.6%
Applied egg-rr75.6%
Taylor expanded in a around inf 51.6%
associate-*r/51.6%
associate-*r*51.6%
associate-*l/66.1%
associate-*r/66.1%
associate-*l*66.1%
Simplified66.1%
Final simplification51.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -1.7e-116)
(* -4.0 (/ (* t a) c_m))
(if (<= a 5.1e-235)
(* 9.0 (/ (* x (/ y c_m)) z))
(if (<= a 1.1e-81)
(/ (/ b c_m) z)
(if (<= a 4.5e-30)
(* (* 9.0 (/ y c_m)) (/ x z))
(if (<= a 5.8e-17) (/ b (* c_m z)) (* -4.0 (* t (/ a c_m))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= -1.7e-116) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 5.1e-235) {
tmp = 9.0 * ((x * (y / c_m)) / z);
} else if (a <= 1.1e-81) {
tmp = (b / c_m) / z;
} else if (a <= 4.5e-30) {
tmp = (9.0 * (y / c_m)) * (x / z);
} else if (a <= 5.8e-17) {
tmp = b / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= (-1.7d-116)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (a <= 5.1d-235) then
tmp = 9.0d0 * ((x * (y / c_m)) / z)
else if (a <= 1.1d-81) then
tmp = (b / c_m) / z
else if (a <= 4.5d-30) then
tmp = (9.0d0 * (y / c_m)) * (x / z)
else if (a <= 5.8d-17) then
tmp = b / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= -1.7e-116) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 5.1e-235) {
tmp = 9.0 * ((x * (y / c_m)) / z);
} else if (a <= 1.1e-81) {
tmp = (b / c_m) / z;
} else if (a <= 4.5e-30) {
tmp = (9.0 * (y / c_m)) * (x / z);
} else if (a <= 5.8e-17) {
tmp = b / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= -1.7e-116: tmp = -4.0 * ((t * a) / c_m) elif a <= 5.1e-235: tmp = 9.0 * ((x * (y / c_m)) / z) elif a <= 1.1e-81: tmp = (b / c_m) / z elif a <= 4.5e-30: tmp = (9.0 * (y / c_m)) * (x / z) elif a <= 5.8e-17: tmp = b / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= -1.7e-116) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (a <= 5.1e-235) tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c_m)) / z)); elseif (a <= 1.1e-81) tmp = Float64(Float64(b / c_m) / z); elseif (a <= 4.5e-30) tmp = Float64(Float64(9.0 * Float64(y / c_m)) * Float64(x / z)); elseif (a <= 5.8e-17) tmp = Float64(b / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -1.7e-116)
tmp = -4.0 * ((t * a) / c_m);
elseif (a <= 5.1e-235)
tmp = 9.0 * ((x * (y / c_m)) / z);
elseif (a <= 1.1e-81)
tmp = (b / c_m) / z;
elseif (a <= 4.5e-30)
tmp = (9.0 * (y / c_m)) * (x / z);
elseif (a <= 5.8e-17)
tmp = b / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -1.7e-116], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.1e-235], N[(9.0 * N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.1e-81], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 4.5e-30], N[(N[(9.0 * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.8e-17], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{-116}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{-235}:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c\_m}}{z}\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{-81}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{-30}:\\
\;\;\;\;\left(9 \cdot \frac{y}{c\_m}\right) \cdot \frac{x}{z}\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < -1.69999999999999996e-116Initial program 79.1%
associate-+l-79.1%
*-commutative79.1%
associate-*r*80.9%
*-commutative80.9%
associate-+l-80.9%
associate-*l*80.9%
associate-*l*77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in z around inf 46.3%
*-commutative46.3%
Simplified46.3%
if -1.69999999999999996e-116 < a < 5.09999999999999993e-235Initial program 78.5%
associate-+l-78.5%
*-commutative78.5%
associate-*r*88.7%
*-commutative88.7%
associate-+l-88.7%
associate-*l*88.7%
associate-*l*88.6%
*-commutative88.6%
Simplified88.6%
Taylor expanded in x around inf 50.2%
associate-/r*48.7%
associate-/l*50.3%
Simplified50.3%
if 5.09999999999999993e-235 < a < 1.1e-81Initial program 75.9%
associate-+l-75.9%
*-commutative75.9%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
associate-*l*78.7%
associate-*l*78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in b around inf 38.0%
associate-/r*49.9%
Simplified49.9%
if 1.1e-81 < a < 4.49999999999999967e-30Initial program 78.1%
associate-+l-78.1%
*-commutative78.1%
associate-*r*78.1%
*-commutative78.1%
associate-+l-78.1%
associate-*l*78.2%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around inf 70.2%
associate-*r*70.1%
*-commutative70.1%
associate-*r*70.2%
Simplified70.2%
Taylor expanded in x around inf 47.8%
*-commutative47.8%
associate-*r*47.8%
Simplified47.8%
times-frac55.2%
*-commutative55.2%
*-un-lft-identity55.2%
times-frac55.3%
metadata-eval55.3%
Applied egg-rr55.3%
if 4.49999999999999967e-30 < a < 5.8000000000000006e-17Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 66.8%
*-commutative66.8%
Simplified66.8%
if 5.8000000000000006e-17 < a Initial program 70.2%
associate-+l-70.2%
*-commutative70.2%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.5%
associate-*l*68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 77.6%
associate-*r/75.6%
*-commutative75.6%
Applied egg-rr75.6%
Taylor expanded in a around inf 51.6%
associate-*r/51.6%
associate-*r*51.6%
associate-*l/66.1%
associate-*r/66.1%
associate-*l*66.1%
Simplified66.1%
Final simplification52.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a 1.4e-6)
(/ (+ b (* x (* 9.0 y))) (* c_m z))
(if (or (<= a 5.1e+185) (not (<= a 1.2e+279)))
(/ (+ (/ b c_m) (* -4.0 (* (/ z c_m) (* t a)))) z)
(* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= 1.4e-6) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if ((a <= 5.1e+185) || !(a <= 1.2e+279)) {
tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= 1.4d-6) then
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
else if ((a <= 5.1d+185) .or. (.not. (a <= 1.2d+279))) then
tmp = ((b / c_m) + ((-4.0d0) * ((z / c_m) * (t * a)))) / z
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= 1.4e-6) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if ((a <= 5.1e+185) || !(a <= 1.2e+279)) {
tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= 1.4e-6: tmp = (b + (x * (9.0 * y))) / (c_m * z) elif (a <= 5.1e+185) or not (a <= 1.2e+279): tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= 1.4e-6) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); elseif ((a <= 5.1e+185) || !(a <= 1.2e+279)) tmp = Float64(Float64(Float64(b / c_m) + Float64(-4.0 * Float64(Float64(z / c_m) * Float64(t * a)))) / z); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= 1.4e-6)
tmp = (b + (x * (9.0 * y))) / (c_m * z);
elseif ((a <= 5.1e+185) || ~((a <= 1.2e+279)))
tmp = ((b / c_m) + (-4.0 * ((z / c_m) * (t * a)))) / z;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, 1.4e-6], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 5.1e+185], N[Not[LessEqual[a, 1.2e+279]], $MachinePrecision]], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(-4.0 * N[(N[(z / c$95$m), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 1.4 \cdot 10^{-6}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{+185} \lor \neg \left(a \leq 1.2 \cdot 10^{+279}\right):\\
\;\;\;\;\frac{\frac{b}{c\_m} + -4 \cdot \left(\frac{z}{c\_m} \cdot \left(t \cdot a\right)\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < 1.39999999999999994e-6Initial program 78.9%
associate-+l-78.9%
*-commutative78.9%
associate-*r*83.1%
*-commutative83.1%
associate-+l-83.1%
associate-*l*83.1%
associate-*l*81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in x around inf 65.6%
associate-*r*65.6%
*-commutative65.6%
associate-*r*65.6%
Simplified65.6%
if 1.39999999999999994e-6 < a < 5.09999999999999996e185 or 1.2e279 < a Initial program 67.7%
associate-+l-67.7%
*-commutative67.7%
associate-*r*62.4%
*-commutative62.4%
associate-+l-62.4%
associate-*l*62.4%
associate-*l*65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in z around 0 78.4%
associate-/l*78.5%
associate-*r/78.4%
associate-*r*75.7%
Applied egg-rr75.7%
Taylor expanded in x around 0 70.9%
if 5.09999999999999996e185 < a < 1.2e279Initial program 72.4%
associate-+l-72.4%
*-commutative72.4%
associate-*r*65.1%
*-commutative65.1%
associate-+l-65.1%
associate-*l*65.1%
associate-*l*72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in z around 0 72.3%
associate-*r/72.2%
*-commutative72.2%
Applied egg-rr72.2%
Taylor expanded in a around inf 66.1%
associate-*r/66.1%
associate-*r*66.1%
associate-*l/86.3%
associate-*r/86.3%
associate-*l*86.3%
Simplified86.3%
Final simplification67.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a 9.6e-120)
(/ (+ b (* x (* 9.0 y))) (* c_m z))
(if (<= a 2.9e+24)
(/ (+ (/ b c_m) (* 9.0 (/ (* x y) c_m))) z)
(* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= 9.6e-120) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if (a <= 2.9e+24) {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= 9.6d-120) then
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
else if (a <= 2.9d+24) then
tmp = ((b / c_m) + (9.0d0 * ((x * y) / c_m))) / z
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= 9.6e-120) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else if (a <= 2.9e+24) {
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= 9.6e-120: tmp = (b + (x * (9.0 * y))) / (c_m * z) elif a <= 2.9e+24: tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= 9.6e-120) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); elseif (a <= 2.9e+24) tmp = Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) / z); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= 9.6e-120)
tmp = (b + (x * (9.0 * y))) / (c_m * z);
elseif (a <= 2.9e+24)
tmp = ((b / c_m) + (9.0 * ((x * y) / c_m))) / z;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, 9.6e-120], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e+24], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 9.6 \cdot 10^{-120}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+24}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < 9.5999999999999998e-120Initial program 78.9%
associate-+l-78.9%
*-commutative78.9%
associate-*r*83.8%
*-commutative83.8%
associate-+l-83.8%
associate-*l*83.8%
associate-*l*81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in x around inf 65.9%
associate-*r*65.9%
*-commutative65.9%
associate-*r*65.9%
Simplified65.9%
if 9.5999999999999998e-120 < a < 2.89999999999999979e24Initial program 79.4%
associate-+l-79.4%
*-commutative79.4%
associate-*r*79.3%
*-commutative79.3%
associate-+l-79.3%
associate-*l*79.4%
associate-*l*79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in z around 0 78.4%
fma-define78.4%
associate-/l*72.3%
associate-/l*75.5%
fma-define75.5%
associate-/l*75.4%
Simplified75.4%
Taylor expanded in a around 0 72.5%
if 2.89999999999999979e24 < a Initial program 67.3%
associate-+l-67.3%
*-commutative67.3%
associate-*r*60.8%
*-commutative60.8%
associate-+l-60.8%
associate-*l*60.8%
associate-*l*65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in z around 0 74.1%
associate-*r/74.1%
*-commutative74.1%
Applied egg-rr74.1%
Taylor expanded in a around inf 57.0%
associate-*r/57.0%
associate-*r*57.0%
associate-*l/73.8%
associate-*r/73.8%
associate-*l*73.7%
Simplified73.7%
Final simplification68.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -9.2e-70)
(* -4.0 (/ (* t a) c_m))
(if (<= a 9e-235)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= a 1.2e-19) (/ (/ b c_m) z) (* -4.0 (* t (/ a c_m))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= -9.2e-70) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 9e-235) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (a <= 1.2e-19) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= (-9.2d-70)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (a <= 9d-235) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (a <= 1.2d-19) then
tmp = (b / c_m) / z
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= -9.2e-70) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 9e-235) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (a <= 1.2e-19) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= -9.2e-70: tmp = -4.0 * ((t * a) / c_m) elif a <= 9e-235: tmp = 9.0 * (x * (y / (c_m * z))) elif a <= 1.2e-19: tmp = (b / c_m) / z else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= -9.2e-70) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (a <= 9e-235) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (a <= 1.2e-19) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -9.2e-70)
tmp = -4.0 * ((t * a) / c_m);
elseif (a <= 9e-235)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (a <= 1.2e-19)
tmp = (b / c_m) / z;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -9.2e-70], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e-235], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-19], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{-70}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-235}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < -9.20000000000000002e-70Initial program 80.6%
associate-+l-80.6%
*-commutative80.6%
associate-*r*82.6%
*-commutative82.6%
associate-+l-82.6%
associate-*l*82.6%
associate-*l*78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in z around inf 46.9%
*-commutative46.9%
Simplified46.9%
if -9.20000000000000002e-70 < a < 8.9999999999999996e-235Initial program 76.9%
associate-+l-76.9%
*-commutative76.9%
associate-*r*85.4%
*-commutative85.4%
associate-+l-85.4%
associate-*l*85.4%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around inf 46.5%
associate-/l*49.2%
associate-/r*47.7%
Simplified47.7%
Taylor expanded in x around 0 46.5%
associate-/l*49.2%
Simplified49.2%
if 8.9999999999999996e-235 < a < 1.20000000000000011e-19Initial program 78.0%
associate-+l-78.0%
*-commutative78.0%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
associate-*l*79.9%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in b around inf 38.4%
associate-/r*46.5%
Simplified46.5%
if 1.20000000000000011e-19 < a Initial program 70.2%
associate-+l-70.2%
*-commutative70.2%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.5%
associate-*l*68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 77.6%
associate-*r/75.6%
*-commutative75.6%
Applied egg-rr75.6%
Taylor expanded in a around inf 51.6%
associate-*r/51.6%
associate-*r*51.6%
associate-*l/66.1%
associate-*r/66.1%
associate-*l*66.1%
Simplified66.1%
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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= a -4.8e-162) (not (<= a 7.5e-17)))
(* -4.0 (* t (/ a c_m)))
(/ (/ b c_m) z))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((a <= -4.8e-162) || !(a <= 7.5e-17)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = (b / c_m) / z;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 ((a <= (-4.8d-162)) .or. (.not. (a <= 7.5d-17))) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = (b / c_m) / z
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 ((a <= -4.8e-162) || !(a <= 7.5e-17)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = (b / c_m) / z;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (a <= -4.8e-162) or not (a <= 7.5e-17): tmp = -4.0 * (t * (a / c_m)) else: tmp = (b / c_m) / z return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((a <= -4.8e-162) || !(a <= 7.5e-17)) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(Float64(b / c_m) / z); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((a <= -4.8e-162) || ~((a <= 7.5e-17)))
tmp = -4.0 * (t * (a / c_m));
else
tmp = (b / c_m) / z;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[a, -4.8e-162], N[Not[LessEqual[a, 7.5e-17]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c$95$m), $MachinePrecision] / z), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-162} \lor \neg \left(a \leq 7.5 \cdot 10^{-17}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\end{array}
\end{array}
if a < -4.8000000000000004e-162 or 7.49999999999999984e-17 < a Initial program 76.4%
associate-+l-76.4%
*-commutative76.4%
associate-*r*76.2%
*-commutative76.2%
associate-+l-76.2%
associate-*l*76.2%
associate-*l*75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in z around 0 76.3%
associate-*r/77.4%
*-commutative77.4%
Applied egg-rr77.4%
Taylor expanded in a around inf 48.7%
associate-*r/48.7%
associate-*r*48.7%
associate-*l/54.7%
associate-*r/54.7%
associate-*l*54.6%
Simplified54.6%
if -4.8000000000000004e-162 < a < 7.49999999999999984e-17Initial program 77.9%
associate-+l-77.9%
*-commutative77.9%
associate-*r*84.1%
*-commutative84.1%
associate-+l-84.1%
associate-*l*84.1%
associate-*l*84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in b around inf 42.8%
associate-/r*44.9%
Simplified44.9%
Final simplification50.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -4.4e-162)
(* a (/ (* t -4.0) c_m))
(if (<= a 5.4e-16) (/ (/ b c_m) z) (* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= -4.4e-162) {
tmp = a * ((t * -4.0) / c_m);
} else if (a <= 5.4e-16) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= (-4.4d-162)) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (a <= 5.4d-16) then
tmp = (b / c_m) / z
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= -4.4e-162) {
tmp = a * ((t * -4.0) / c_m);
} else if (a <= 5.4e-16) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= -4.4e-162: tmp = a * ((t * -4.0) / c_m) elif a <= 5.4e-16: tmp = (b / c_m) / z else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= -4.4e-162) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (a <= 5.4e-16) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -4.4e-162)
tmp = a * ((t * -4.0) / c_m);
elseif (a <= 5.4e-16)
tmp = (b / c_m) / z;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -4.4e-162], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e-16], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{-162}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < -4.3999999999999998e-162Initial program 79.4%
associate-+l-79.4%
*-commutative79.4%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
associate-*l*81.9%
associate-*l*78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in z around inf 47.3%
*-commutative47.3%
associate-/l*46.4%
associate-*r*46.4%
associate-*l/46.4%
Simplified46.4%
if -4.3999999999999998e-162 < a < 5.39999999999999999e-16Initial program 77.9%
associate-+l-77.9%
*-commutative77.9%
associate-*r*84.1%
*-commutative84.1%
associate-+l-84.1%
associate-*l*84.1%
associate-*l*84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in b around inf 42.8%
associate-/r*44.9%
Simplified44.9%
if 5.39999999999999999e-16 < a Initial program 70.2%
associate-+l-70.2%
*-commutative70.2%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.5%
associate-*l*68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 77.6%
associate-*r/75.6%
*-commutative75.6%
Applied egg-rr75.6%
Taylor expanded in a around inf 51.6%
associate-*r/51.6%
associate-*r*51.6%
associate-*l/66.1%
associate-*r/66.1%
associate-*l*66.1%
Simplified66.1%
Final simplification49.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -4.8e-162)
(* -4.0 (/ (* t a) c_m))
(if (<= a 6e-19) (/ (/ b c_m) z) (* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= -4.8e-162) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 6e-19) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= (-4.8d-162)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (a <= 6d-19) then
tmp = (b / c_m) / z
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= -4.8e-162) {
tmp = -4.0 * ((t * a) / c_m);
} else if (a <= 6e-19) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= -4.8e-162: tmp = -4.0 * ((t * a) / c_m) elif a <= 6e-19: tmp = (b / c_m) / z else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= -4.8e-162) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (a <= 6e-19) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -4.8e-162)
tmp = -4.0 * ((t * a) / c_m);
elseif (a <= 6e-19)
tmp = (b / c_m) / z;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -4.8e-162], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-19], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-162}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < -4.8000000000000004e-162Initial program 79.4%
associate-+l-79.4%
*-commutative79.4%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
associate-*l*81.9%
associate-*l*78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in z around inf 47.3%
*-commutative47.3%
Simplified47.3%
if -4.8000000000000004e-162 < a < 5.99999999999999985e-19Initial program 77.9%
associate-+l-77.9%
*-commutative77.9%
associate-*r*84.1%
*-commutative84.1%
associate-+l-84.1%
associate-*l*84.1%
associate-*l*84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in b around inf 42.8%
associate-/r*44.9%
Simplified44.9%
if 5.99999999999999985e-19 < a Initial program 70.2%
associate-+l-70.2%
*-commutative70.2%
associate-*r*64.5%
*-commutative64.5%
associate-+l-64.5%
associate-*l*64.5%
associate-*l*68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 77.6%
associate-*r/75.6%
*-commutative75.6%
Applied egg-rr75.6%
Taylor expanded in a around inf 51.6%
associate-*r/51.6%
associate-*r*51.6%
associate-*l/66.1%
associate-*r/66.1%
associate-*l*66.1%
Simplified66.1%
Final simplification50.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a 2.9e+24)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(* -4.0 (* t (/ a c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= 2.9e+24) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= 2.9d+24) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= 2.9e+24) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= 2.9e+24: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= 2.9e+24) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= 2.9e+24)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, 2.9e+24], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+24}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < 2.89999999999999979e24Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*83.1%
*-commutative83.1%
associate-+l-83.1%
associate-*l*83.1%
associate-*l*81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x around inf 66.1%
if 2.89999999999999979e24 < a Initial program 67.3%
associate-+l-67.3%
*-commutative67.3%
associate-*r*60.8%
*-commutative60.8%
associate-+l-60.8%
associate-*l*60.8%
associate-*l*65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in z around 0 74.1%
associate-*r/74.1%
*-commutative74.1%
Applied egg-rr74.1%
Taylor expanded in a around inf 57.0%
associate-*r/57.0%
associate-*r*57.0%
associate-*l/73.8%
associate-*r/73.8%
associate-*l*73.7%
Simplified73.7%
Final simplification67.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a 2.9e+24)
(/ (+ b (* x (* 9.0 y))) (* c_m z))
(* -4.0 (* t (/ a c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= 2.9e+24) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (a <= 2.9d+24) then
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (a <= 2.9e+24) {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= 2.9e+24: tmp = (b + (x * (9.0 * y))) / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= 2.9e+24) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= 2.9e+24)
tmp = (b + (x * (9.0 * y))) / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, 2.9e+24], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+24}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < 2.89999999999999979e24Initial program 79.0%
associate-+l-79.0%
*-commutative79.0%
associate-*r*83.1%
*-commutative83.1%
associate-+l-83.1%
associate-*l*83.1%
associate-*l*81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in x around inf 66.1%
associate-*r*66.1%
*-commutative66.1%
associate-*r*66.1%
Simplified66.1%
if 2.89999999999999979e24 < a Initial program 67.3%
associate-+l-67.3%
*-commutative67.3%
associate-*r*60.8%
*-commutative60.8%
associate-+l-60.8%
associate-*l*60.8%
associate-*l*65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in z around 0 74.1%
associate-*r/74.1%
*-commutative74.1%
Applied egg-rr74.1%
Taylor expanded in a around inf 57.0%
associate-*r/57.0%
associate-*r*57.0%
associate-*l/73.8%
associate-*r/73.8%
associate-*l*73.7%
Simplified73.7%
Final simplification67.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. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* c_m z))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (c_m * z))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (c_m * z));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 76.9%
associate-+l-76.9%
*-commutative76.9%
associate-*r*79.2%
*-commutative79.2%
associate-+l-79.2%
associate-*l*79.2%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in b around inf 36.1%
*-commutative36.1%
Simplified36.1%
Final simplification36.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. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ (/ b c_m) z)))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * ((b / c_m) / z);
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * ((b / c_m) / z)
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * ((b / c_m) / z);
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * ((b / c_m) / z)
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(Float64(b / c_m) / z)) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * ((b / c_m) / z);
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(N[(b / c$95$m), $MachinePrecision] / z), $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])\\
\\
c\_s \cdot \frac{\frac{b}{c\_m}}{z}
\end{array}
Initial program 76.9%
associate-+l-76.9%
*-commutative76.9%
associate-*r*79.2%
*-commutative79.2%
associate-+l-79.2%
associate-*l*79.2%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in b around inf 36.1%
associate-/r*37.2%
Simplified37.2%
Final simplification37.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024071
(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)))