
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))))
(*
c_s
(if (<= t_1 -4e-241)
t_1
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (* (* x y) (/ 1.0 c_m))) (/ b c_m)))
z)
(if (<= t_1 INFINITY)
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* y 9.0)))) (* z c_m))
(*
y
(-
(* t (+ (* -4.0 (/ a (* c_m y))) (/ b (* c_m (* t (* z y))))))
(/ (/ (* x -9.0) z) c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((t * ((-4.0 * (a / (c_m * y))) + (b / (c_m * (t * (z * y)))))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((t * ((-4.0 * (a / (c_m * y))) + (b / (c_m * (t * (z * y)))))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) tmp = 0 if t_1 <= -4e-241: tmp = t_1 elif t_1 <= 0.0: tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z elif t_1 <= math.inf: tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m) else: tmp = y * ((t * ((-4.0 * (a / (c_m * y))) + (b / (c_m * (t * (z * y)))))) - (((x * -9.0) / z) / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -4e-241) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) * Float64(1.0 / c_m))) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(y * 9.0)))) / Float64(z * c_m)); else tmp = Float64(y * Float64(Float64(t * Float64(Float64(-4.0 * Float64(a / Float64(c_m * y))) + Float64(b / Float64(c_m * Float64(t * Float64(z * y)))))) - Float64(Float64(Float64(x * -9.0) / z) / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -4e-241)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z;
elseif (t_1 <= Inf)
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
else
tmp = y * ((t * ((-4.0 * (a / (c_m * y))) + (b / (c_m * (t * (z * y)))))) - (((x * -9.0) / z) / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -4e-241], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t * N[(N[(-4.0 * N[(a / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * -9.0), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-241}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \left(\left(x \cdot y\right) \cdot \frac{1}{c\_m}\right) + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - x \cdot \left(y \cdot 9\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot \left(-4 \cdot \frac{a}{c\_m \cdot y} + \frac{b}{c\_m \cdot \left(t \cdot \left(z \cdot y\right)\right)}\right) - \frac{\frac{x \cdot -9}{z}}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -3.9999999999999999e-241Initial program 91.2%
if -3.9999999999999999e-241 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 50.3%
Simplified52.3%
Taylor expanded in z around 0 94.6%
div-inv94.6%
Applied egg-rr94.6%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*93.6%
*-commutative93.6%
associate-+l-93.6%
associate-*l*93.6%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
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%
Simplified5.7%
Taylor expanded in y around -inf 48.3%
Simplified84.8%
Taylor expanded in t around inf 64.5%
Final simplification90.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1.35e-23) (not (<= z 1.25e+15)))
(*
y
(-
(/ (fma -4.0 (* a (/ t c_m)) (/ b (* z c_m))) y)
(/ (/ (* x -9.0) z) c_m)))
(/ (+ b (fma x (* y 9.0) (* t (* a (* z -4.0))))) (* z c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.35e-23) || !(z <= 1.25e+15)) {
tmp = y * ((fma(-4.0, (a * (t / c_m)), (b / (z * c_m))) / y) - (((x * -9.0) / z) / c_m));
} else {
tmp = (b + fma(x, (y * 9.0), (t * (a * (z * -4.0))))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -1.35e-23) || !(z <= 1.25e+15)) tmp = Float64(y * Float64(Float64(fma(-4.0, Float64(a * Float64(t / c_m)), Float64(b / Float64(z * c_m))) / y) - Float64(Float64(Float64(x * -9.0) / z) / c_m))); else tmp = Float64(Float64(b + fma(x, Float64(y * 9.0), Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -1.35e-23], N[Not[LessEqual[z, 1.25e+15]], $MachinePrecision]], N[(y * N[(N[(N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] - N[(N[(N[(x * -9.0), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-23} \lor \neg \left(z \leq 1.25 \cdot 10^{+15}\right):\\
\;\;\;\;y \cdot \left(\frac{\mathsf{fma}\left(-4, a \cdot \frac{t}{c\_m}, \frac{b}{z \cdot c\_m}\right)}{y} - \frac{\frac{x \cdot -9}{z}}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, y \cdot 9, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -1.34999999999999992e-23 or 1.25e15 < z Initial program 65.5%
Simplified67.4%
Taylor expanded in y around -inf 78.7%
Simplified79.3%
if -1.34999999999999992e-23 < z < 1.25e15Initial program 97.0%
Simplified97.7%
Final simplification88.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))))
(*
c_s
(if (<= t_1 -4e-241)
t_1
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (* (* x y) (/ 1.0 c_m))) (/ b c_m)))
z)
(if (<= t_1 INFINITY)
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* y 9.0)))) (* z c_m))
(*
y
(- (* -4.0 (/ (* a t) (* c_m y))) (/ (/ (* x -9.0) z) c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) tmp = 0 if t_1 <= -4e-241: tmp = t_1 elif t_1 <= 0.0: tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z elif t_1 <= math.inf: tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m) else: tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -4e-241) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) * Float64(1.0 / c_m))) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(y * 9.0)))) / Float64(z * c_m)); else tmp = Float64(y * Float64(Float64(-4.0 * Float64(Float64(a * t) / Float64(c_m * y))) - Float64(Float64(Float64(x * -9.0) / z) / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -4e-241)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) * (1.0 / c_m))) + (b / c_m))) / z;
elseif (t_1 <= Inf)
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
else
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -4e-241], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * -9.0), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-241}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \left(\left(x \cdot y\right) \cdot \frac{1}{c\_m}\right) + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - x \cdot \left(y \cdot 9\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-4 \cdot \frac{a \cdot t}{c\_m \cdot y} - \frac{\frac{x \cdot -9}{z}}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -3.9999999999999999e-241Initial program 91.2%
if -3.9999999999999999e-241 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 50.3%
Simplified52.3%
Taylor expanded in z around 0 94.6%
div-inv94.6%
Applied egg-rr94.6%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*93.6%
*-commutative93.6%
associate-+l-93.6%
associate-*l*93.6%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
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%
Simplified5.7%
Taylor expanded in y around -inf 48.3%
Simplified84.8%
Taylor expanded in a around inf 54.6%
Final simplification90.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))))
(*
c_s
(if (<= t_1 -4e-241)
t_1
(if (<= t_1 0.0)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (/ b c_m) (* 9.0 (/ (* x y) c_m))))
z)
(if (<= t_1 INFINITY)
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* y 9.0)))) (* z c_m))
(*
y
(- (* -4.0 (/ (* a t) (* c_m y))) (/ (/ (* x -9.0) z) c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((b / c_m) + (9.0 * ((x * y) / c_m)))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((b / c_m) + (9.0 * ((x * y) / c_m)))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) tmp = 0 if t_1 <= -4e-241: tmp = t_1 elif t_1 <= 0.0: tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((b / c_m) + (9.0 * ((x * y) / c_m)))) / z elif t_1 <= math.inf: tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m) else: tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -4e-241) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m)))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(y * 9.0)))) / Float64(z * c_m)); else tmp = Float64(y * Float64(Float64(-4.0 * Float64(Float64(a * t) / Float64(c_m * y))) - Float64(Float64(Float64(x * -9.0) / z) / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -4e-241)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((b / c_m) + (9.0 * ((x * y) / c_m)))) / z;
elseif (t_1 <= Inf)
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
else
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -4e-241], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * -9.0), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-241}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - x \cdot \left(y \cdot 9\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-4 \cdot \frac{a \cdot t}{c\_m \cdot y} - \frac{\frac{x \cdot -9}{z}}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -3.9999999999999999e-241Initial program 91.2%
if -3.9999999999999999e-241 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 50.3%
Simplified52.3%
Taylor expanded in z around 0 94.6%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*93.6%
*-commutative93.6%
associate-+l-93.6%
associate-*l*93.6%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
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%
Simplified5.7%
Taylor expanded in y around -inf 48.3%
Simplified84.8%
Taylor expanded in a around inf 54.6%
Final simplification90.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))))
(*
c_s
(if (<= t_1 -4e-241)
t_1
(if (<= t_1 0.0)
(/
(+
(+ (/ b c_m) (* 9.0 (/ (* x y) c_m)))
(* -4.0 (* a (/ (* z t) c_m))))
z)
(if (<= t_1 INFINITY)
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* y 9.0)))) (* z c_m))
(*
y
(- (* -4.0 (/ (* a t) (* c_m y))) (/ (/ (* x -9.0) z) c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * (a * ((z * t) / c_m)))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= -4e-241) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * (a * ((z * t) / c_m)))) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) tmp = 0 if t_1 <= -4e-241: tmp = t_1 elif t_1 <= 0.0: tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * (a * ((z * t) / c_m)))) / z elif t_1 <= math.inf: tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m) else: tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -4e-241) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(x * y) / c_m))) + Float64(-4.0 * Float64(a * Float64(Float64(z * t) / c_m)))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(y * 9.0)))) / Float64(z * c_m)); else tmp = Float64(y * Float64(Float64(-4.0 * Float64(Float64(a * t) / Float64(c_m * y))) - Float64(Float64(Float64(x * -9.0) / z) / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -4e-241)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = (((b / c_m) + (9.0 * ((x * y) / c_m))) + (-4.0 * (a * ((z * t) / c_m)))) / z;
elseif (t_1 <= Inf)
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
else
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -4e-241], t$95$1, If[LessEqual[t$95$1, 0.0], 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[(a * N[(N[(z * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * -9.0), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-241}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\left(\frac{b}{c\_m} + 9 \cdot \frac{x \cdot y}{c\_m}\right) + -4 \cdot \left(a \cdot \frac{z \cdot t}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - x \cdot \left(y \cdot 9\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-4 \cdot \frac{a \cdot t}{c\_m \cdot y} - \frac{\frac{x \cdot -9}{z}}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -3.9999999999999999e-241Initial program 91.2%
if -3.9999999999999999e-241 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 50.3%
Simplified52.3%
Taylor expanded in z around 0 94.6%
associate-/l*94.5%
Applied egg-rr94.5%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.9%
associate-+l-91.9%
*-commutative91.9%
associate-*r*93.6%
*-commutative93.6%
associate-+l-93.6%
associate-*l*93.6%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
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%
Simplified5.7%
Taylor expanded in y around -inf 48.3%
Simplified84.8%
Taylor expanded in a around inf 54.6%
Final simplification90.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))))
(*
c_s
(if (<= t_1 INFINITY)
t_1
(* y (- (* -4.0 (/ (* a t) (* c_m y))) (/ (/ (* x -9.0) z) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(y * Float64(Float64(-4.0 * Float64(Float64(a * t) / Float64(c_m * y))) - Float64(Float64(Float64(x * -9.0) / z) / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = y * ((-4.0 * ((a * t) / (c_m * y))) - (((x * -9.0) / z) / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * -9.0), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-4 \cdot \frac{a \cdot t}{c\_m \cdot y} - \frac{\frac{x \cdot -9}{z}}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 88.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%
Simplified5.7%
Taylor expanded in y around -inf 48.3%
Simplified84.8%
Taylor expanded in a around inf 54.6%
Final simplification85.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))))
(*
c_s
(if (<= t_1 INFINITY)
t_1
(* a (+ (* -4.0 (/ t c_m)) (/ b (* a (* z c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m)))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(Float64(-4.0 * Float64(t / c_m)) + Float64(b / Float64(a * Float64(z * c_m))))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(a * N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\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)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m} + \frac{b}{a \cdot \left(z \cdot c\_m\right)}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 88.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%
Simplified5.7%
Taylor expanded in a around inf 63.3%
Taylor expanded in x around 0 72.6%
Final simplification87.3%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* a (* z c_m))) (t_2 (* c_m (* z t))))
(*
c_s
(if (<= z -1.05e+67)
(* t (+ (* -4.0 (/ a c_m)) (+ (* 9.0 (/ (* x y) t_2)) (/ b t_2))))
(if (<= z 2.9e+212)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c_m))
(* a (+ (* -4.0 (/ t c_m)) (+ (* 9.0 (/ (* x y) t_1)) (/ b t_1)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = a * (z * c_m);
double t_2 = c_m * (z * t);
double tmp;
if (z <= -1.05e+67) {
tmp = t * ((-4.0 * (a / c_m)) + ((9.0 * ((x * y) / t_2)) + (b / t_2)));
} else if (z <= 2.9e+212) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
} else {
tmp = a * ((-4.0 * (t / c_m)) + ((9.0 * ((x * y) / t_1)) + (b / t_1)));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (z * c_m)
t_2 = c_m * (z * t)
if (z <= (-1.05d+67)) then
tmp = t * (((-4.0d0) * (a / c_m)) + ((9.0d0 * ((x * y) / t_2)) + (b / t_2)))
else if (z <= 2.9d+212) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c_m)
else
tmp = a * (((-4.0d0) * (t / c_m)) + ((9.0d0 * ((x * y) / t_1)) + (b / t_1)))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = a * (z * c_m);
double t_2 = c_m * (z * t);
double tmp;
if (z <= -1.05e+67) {
tmp = t * ((-4.0 * (a / c_m)) + ((9.0 * ((x * y) / t_2)) + (b / t_2)));
} else if (z <= 2.9e+212) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
} else {
tmp = a * ((-4.0 * (t / c_m)) + ((9.0 * ((x * y) / t_1)) + (b / t_1)));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = a * (z * c_m) t_2 = c_m * (z * t) tmp = 0 if z <= -1.05e+67: tmp = t * ((-4.0 * (a / c_m)) + ((9.0 * ((x * y) / t_2)) + (b / t_2))) elif z <= 2.9e+212: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m) else: tmp = a * ((-4.0 * (t / c_m)) + ((9.0 * ((x * y) / t_1)) + (b / t_1))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(a * Float64(z * c_m)) t_2 = Float64(c_m * Float64(z * t)) tmp = 0.0 if (z <= -1.05e+67) tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / t_2)) + Float64(b / t_2)))); elseif (z <= 2.9e+212) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c_m)); else tmp = Float64(a * Float64(Float64(-4.0 * Float64(t / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / t_1)) + Float64(b / t_1)))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = a * (z * c_m);
t_2 = c_m * (z * t);
tmp = 0.0;
if (z <= -1.05e+67)
tmp = t * ((-4.0 * (a / c_m)) + ((9.0 * ((x * y) / t_2)) + (b / t_2)));
elseif (z <= 2.9e+212)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c_m);
else
tmp = a * ((-4.0 * (t / c_m)) + ((9.0 * ((x * y) / t_1)) + (b / t_1)));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(a * N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[z, -1.05e+67], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(b / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+212], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot c\_m\right)\\
t_2 := c\_m \cdot \left(z \cdot t\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+67}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \left(9 \cdot \frac{x \cdot y}{t\_2} + \frac{b}{t\_2}\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+212}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m} + \left(9 \cdot \frac{x \cdot y}{t\_1} + \frac{b}{t\_1}\right)\right)\\
\end{array}
\end{array}
\end{array}
if z < -1.0500000000000001e67Initial program 51.1%
Simplified54.3%
Taylor expanded in t around inf 71.9%
if -1.0500000000000001e67 < z < 2.8999999999999998e212Initial program 92.8%
if 2.8999999999999998e212 < z Initial program 47.6%
Simplified51.6%
Taylor expanded in a around inf 76.5%
Final simplification87.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.3e+107) (not (<= z 3.7e+258)))
(* a (+ (* -4.0 (/ t c_m)) (/ b (* a (* z c_m)))))
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* y 9.0)))) (* z c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.3e+107) || !(z <= 3.7e+258)) {
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
} else {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-2.3d+107)) .or. (.not. (z <= 3.7d+258))) then
tmp = a * (((-4.0d0) * (t / c_m)) + (b / (a * (z * c_m))))
else
tmp = (b - (((z * 4.0d0) * (a * t)) - (x * (y * 9.0d0)))) / (z * c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.3e+107) || !(z <= 3.7e+258)) {
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
} else {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.3e+107) or not (z <= 3.7e+258): tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m)))) else: tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.3e+107) || !(z <= 3.7e+258)) tmp = Float64(a * Float64(Float64(-4.0 * Float64(t / c_m)) + Float64(b / Float64(a * Float64(z * c_m))))); else tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(y * 9.0)))) / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.3e+107) || ~((z <= 3.7e+258)))
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
else
tmp = (b - (((z * 4.0) * (a * t)) - (x * (y * 9.0)))) / (z * c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.3e+107], N[Not[LessEqual[z, 3.7e+258]], $MachinePrecision]], N[(a * N[(N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(a * N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+107} \lor \neg \left(z \leq 3.7 \cdot 10^{+258}\right):\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m} + \frac{b}{a \cdot \left(z \cdot c\_m\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - x \cdot \left(y \cdot 9\right)\right)}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -2.3e107 or 3.6999999999999998e258 < z Initial program 42.9%
Simplified45.9%
Taylor expanded in a around inf 76.2%
Taylor expanded in x around 0 78.1%
if -2.3e107 < z < 3.6999999999999998e258Initial program 90.6%
associate-+l-90.6%
*-commutative90.6%
associate-*r*91.5%
*-commutative91.5%
associate-+l-91.5%
associate-*l*91.5%
associate-*l*91.5%
*-commutative91.5%
Simplified91.5%
Final simplification89.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -9e+114)
(* -4.0 (* t (/ a c_m)))
(if (<= z 3.6e-13)
(/ (+ b (* 9.0 (* x y))) (* z c_m))
(if (<= z 3e+216)
(/ (- b (* (* z t) (* a 4.0))) (* z c_m))
(* -4.0 (* a (/ t c_m))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -9e+114) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 3.6e-13) {
tmp = (b + (9.0 * (x * y))) / (z * c_m);
} else if (z <= 3e+216) {
tmp = (b - ((z * t) * (a * 4.0))) / (z * c_m);
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (z <= (-9d+114)) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (z <= 3.6d-13) then
tmp = (b + (9.0d0 * (x * y))) / (z * c_m)
else if (z <= 3d+216) then
tmp = (b - ((z * t) * (a * 4.0d0))) / (z * c_m)
else
tmp = (-4.0d0) * (a * (t / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -9e+114) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 3.6e-13) {
tmp = (b + (9.0 * (x * y))) / (z * c_m);
} else if (z <= 3e+216) {
tmp = (b - ((z * t) * (a * 4.0))) / (z * c_m);
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -9e+114: tmp = -4.0 * (t * (a / c_m)) elif z <= 3.6e-13: tmp = (b + (9.0 * (x * y))) / (z * c_m) elif z <= 3e+216: tmp = (b - ((z * t) * (a * 4.0))) / (z * c_m) else: tmp = -4.0 * (a * (t / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -9e+114) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (z <= 3.6e-13) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c_m)); elseif (z <= 3e+216) tmp = Float64(Float64(b - Float64(Float64(z * t) * Float64(a * 4.0))) / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -9e+114)
tmp = -4.0 * (t * (a / c_m));
elseif (z <= 3.6e-13)
tmp = (b + (9.0 * (x * y))) / (z * c_m);
elseif (z <= 3e+216)
tmp = (b - ((z * t) * (a * 4.0))) / (z * c_m);
else
tmp = -4.0 * (a * (t / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -9e+114], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-13], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+216], N[(N[(b - N[(N[(z * t), $MachinePrecision] * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+114}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c\_m}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+216}:\\
\;\;\;\;\frac{b - \left(z \cdot t\right) \cdot \left(a \cdot 4\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
if z < -9.0000000000000001e114Initial program 46.0%
Simplified50.7%
Taylor expanded in y around -inf 65.1%
Simplified82.5%
Taylor expanded in z around inf 71.4%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in a around 0 71.4%
*-commutative71.4%
associate-/l*71.4%
Simplified71.4%
if -9.0000000000000001e114 < z < 3.5999999999999998e-13Initial program 93.2%
Simplified93.0%
Taylor expanded in t around 0 78.4%
if 3.5999999999999998e-13 < z < 2.9999999999999998e216Initial program 84.7%
Simplified87.0%
Taylor expanded in x around 0 76.0%
metadata-eval76.0%
cancel-sign-sub-inv76.0%
associate-*r*76.0%
*-commutative76.0%
Simplified76.0%
if 2.9999999999999998e216 < z Initial program 47.6%
Simplified51.6%
Taylor expanded in y around -inf 78.9%
Simplified68.2%
Taylor expanded in z around inf 66.8%
associate-*r/55.9%
Simplified55.9%
Final simplification75.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ b (* z c_m))))
(*
c_s
(if (<= b -1.3e+73)
t_1
(if (<= b -9e-155)
(* -4.0 (* a (/ t c_m)))
(if (<= b 1.6e-281)
(* y (/ (* x (/ -9.0 (- c_m))) z))
(if (<= b 1.1e+14) (/ (* t (* -4.0 a)) c_m) t_1)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (z * c_m);
double tmp;
if (b <= -1.3e+73) {
tmp = t_1;
} else if (b <= -9e-155) {
tmp = -4.0 * (a * (t / c_m));
} else if (b <= 1.6e-281) {
tmp = y * ((x * (-9.0 / -c_m)) / z);
} else if (b <= 1.1e+14) {
tmp = (t * (-4.0 * a)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = b / (z * c_m)
if (b <= (-1.3d+73)) then
tmp = t_1
else if (b <= (-9d-155)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (b <= 1.6d-281) then
tmp = y * ((x * ((-9.0d0) / -c_m)) / z)
else if (b <= 1.1d+14) then
tmp = (t * ((-4.0d0) * a)) / c_m
else
tmp = t_1
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (z * c_m);
double tmp;
if (b <= -1.3e+73) {
tmp = t_1;
} else if (b <= -9e-155) {
tmp = -4.0 * (a * (t / c_m));
} else if (b <= 1.6e-281) {
tmp = y * ((x * (-9.0 / -c_m)) / z);
} else if (b <= 1.1e+14) {
tmp = (t * (-4.0 * a)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = b / (z * c_m) tmp = 0 if b <= -1.3e+73: tmp = t_1 elif b <= -9e-155: tmp = -4.0 * (a * (t / c_m)) elif b <= 1.6e-281: tmp = y * ((x * (-9.0 / -c_m)) / z) elif b <= 1.1e+14: tmp = (t * (-4.0 * a)) / c_m else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(b / Float64(z * c_m)) tmp = 0.0 if (b <= -1.3e+73) tmp = t_1; elseif (b <= -9e-155) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (b <= 1.6e-281) tmp = Float64(y * Float64(Float64(x * Float64(-9.0 / Float64(-c_m))) / z)); elseif (b <= 1.1e+14) tmp = Float64(Float64(t * Float64(-4.0 * a)) / c_m); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = b / (z * c_m);
tmp = 0.0;
if (b <= -1.3e+73)
tmp = t_1;
elseif (b <= -9e-155)
tmp = -4.0 * (a * (t / c_m));
elseif (b <= 1.6e-281)
tmp = y * ((x * (-9.0 / -c_m)) / z);
elseif (b <= 1.1e+14)
tmp = (t * (-4.0 * a)) / c_m;
else
tmp = t_1;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[b, -1.3e+73], t$95$1, If[LessEqual[b, -9e-155], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e-281], N[(y * N[(N[(x * N[(-9.0 / (-c$95$m)), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+14], N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -9 \cdot 10^{-155}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-281}:\\
\;\;\;\;y \cdot \frac{x \cdot \frac{-9}{-c\_m}}{z}\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+14}:\\
\;\;\;\;\frac{t \cdot \left(-4 \cdot a\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if b < -1.3e73 or 1.1e14 < b Initial program 87.4%
Simplified87.4%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -1.3e73 < b < -9.0000000000000007e-155Initial program 73.6%
Simplified72.3%
Taylor expanded in y around -inf 63.0%
Simplified66.6%
Taylor expanded in z around inf 51.4%
associate-*r/52.3%
Simplified52.3%
if -9.0000000000000007e-155 < b < 1.6e-281Initial program 83.8%
Simplified88.5%
Taylor expanded in y around -inf 77.0%
Simplified75.1%
Taylor expanded in x around inf 54.9%
associate-*r/55.0%
*-commutative55.0%
*-commutative55.0%
times-frac57.3%
Simplified57.3%
associate-*l/59.5%
Applied egg-rr59.5%
if 1.6e-281 < b < 1.1e14Initial program 77.5%
Simplified80.1%
Taylor expanded in t around inf 59.0%
associate-*r/59.0%
associate-*r*59.0%
*-commutative59.0%
Simplified59.0%
Final simplification62.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ b (* z c_m))))
(*
c_s
(if (<= b -1.32e+76)
t_1
(if (<= b -2.7e-152)
(* -4.0 (* a (/ t c_m)))
(if (<= b 1.36e-282)
(* (/ (* x y) c_m) (/ 9.0 z))
(if (<= b 1.1e+15) (/ (* t (* -4.0 a)) c_m) t_1)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (z * c_m);
double tmp;
if (b <= -1.32e+76) {
tmp = t_1;
} else if (b <= -2.7e-152) {
tmp = -4.0 * (a * (t / c_m));
} else if (b <= 1.36e-282) {
tmp = ((x * y) / c_m) * (9.0 / z);
} else if (b <= 1.1e+15) {
tmp = (t * (-4.0 * a)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = b / (z * c_m)
if (b <= (-1.32d+76)) then
tmp = t_1
else if (b <= (-2.7d-152)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (b <= 1.36d-282) then
tmp = ((x * y) / c_m) * (9.0d0 / z)
else if (b <= 1.1d+15) then
tmp = (t * ((-4.0d0) * a)) / c_m
else
tmp = t_1
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (z * c_m);
double tmp;
if (b <= -1.32e+76) {
tmp = t_1;
} else if (b <= -2.7e-152) {
tmp = -4.0 * (a * (t / c_m));
} else if (b <= 1.36e-282) {
tmp = ((x * y) / c_m) * (9.0 / z);
} else if (b <= 1.1e+15) {
tmp = (t * (-4.0 * a)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = b / (z * c_m) tmp = 0 if b <= -1.32e+76: tmp = t_1 elif b <= -2.7e-152: tmp = -4.0 * (a * (t / c_m)) elif b <= 1.36e-282: tmp = ((x * y) / c_m) * (9.0 / z) elif b <= 1.1e+15: tmp = (t * (-4.0 * a)) / c_m else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(b / Float64(z * c_m)) tmp = 0.0 if (b <= -1.32e+76) tmp = t_1; elseif (b <= -2.7e-152) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (b <= 1.36e-282) tmp = Float64(Float64(Float64(x * y) / c_m) * Float64(9.0 / z)); elseif (b <= 1.1e+15) tmp = Float64(Float64(t * Float64(-4.0 * a)) / c_m); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = b / (z * c_m);
tmp = 0.0;
if (b <= -1.32e+76)
tmp = t_1;
elseif (b <= -2.7e-152)
tmp = -4.0 * (a * (t / c_m));
elseif (b <= 1.36e-282)
tmp = ((x * y) / c_m) * (9.0 / z);
elseif (b <= 1.1e+15)
tmp = (t * (-4.0 * a)) / c_m;
else
tmp = t_1;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[b, -1.32e+76], t$95$1, If[LessEqual[b, -2.7e-152], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.36e-282], N[(N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+15], N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -1.32 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.7 \cdot 10^{-152}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;b \leq 1.36 \cdot 10^{-282}:\\
\;\;\;\;\frac{x \cdot y}{c\_m} \cdot \frac{9}{z}\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+15}:\\
\;\;\;\;\frac{t \cdot \left(-4 \cdot a\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if b < -1.31999999999999999e76 or 1.1e15 < b Initial program 87.4%
Simplified87.4%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -1.31999999999999999e76 < b < -2.69999999999999999e-152Initial program 73.6%
Simplified72.3%
Taylor expanded in y around -inf 63.0%
Simplified66.6%
Taylor expanded in z around inf 51.4%
associate-*r/52.3%
Simplified52.3%
if -2.69999999999999999e-152 < b < 1.3599999999999999e-282Initial program 83.8%
Simplified88.5%
Taylor expanded in x around inf 59.4%
associate-*r/59.4%
*-commutative59.4%
times-frac63.8%
associate-/l*61.6%
Simplified61.6%
Taylor expanded in x around 0 63.8%
if 1.3599999999999999e-282 < b < 1.1e15Initial program 77.5%
Simplified80.1%
Taylor expanded in t around inf 59.0%
associate-*r/59.0%
associate-*r*59.0%
*-commutative59.0%
Simplified59.0%
Final simplification62.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ b (* z c_m))))
(*
c_s
(if (<= b -7e+75)
t_1
(if (<= b -6e-153)
(* -4.0 (* a (/ t c_m)))
(if (<= b 1.16e-281)
(* 9.0 (* (/ y z) (/ x c_m)))
(if (<= b 5.5e+14) (/ (* t (* -4.0 a)) c_m) t_1)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (z * c_m);
double tmp;
if (b <= -7e+75) {
tmp = t_1;
} else if (b <= -6e-153) {
tmp = -4.0 * (a * (t / c_m));
} else if (b <= 1.16e-281) {
tmp = 9.0 * ((y / z) * (x / c_m));
} else if (b <= 5.5e+14) {
tmp = (t * (-4.0 * a)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = b / (z * c_m)
if (b <= (-7d+75)) then
tmp = t_1
else if (b <= (-6d-153)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (b <= 1.16d-281) then
tmp = 9.0d0 * ((y / z) * (x / c_m))
else if (b <= 5.5d+14) then
tmp = (t * ((-4.0d0) * a)) / c_m
else
tmp = t_1
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (z * c_m);
double tmp;
if (b <= -7e+75) {
tmp = t_1;
} else if (b <= -6e-153) {
tmp = -4.0 * (a * (t / c_m));
} else if (b <= 1.16e-281) {
tmp = 9.0 * ((y / z) * (x / c_m));
} else if (b <= 5.5e+14) {
tmp = (t * (-4.0 * a)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = b / (z * c_m) tmp = 0 if b <= -7e+75: tmp = t_1 elif b <= -6e-153: tmp = -4.0 * (a * (t / c_m)) elif b <= 1.16e-281: tmp = 9.0 * ((y / z) * (x / c_m)) elif b <= 5.5e+14: tmp = (t * (-4.0 * a)) / c_m else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(b / Float64(z * c_m)) tmp = 0.0 if (b <= -7e+75) tmp = t_1; elseif (b <= -6e-153) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (b <= 1.16e-281) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c_m))); elseif (b <= 5.5e+14) tmp = Float64(Float64(t * Float64(-4.0 * a)) / c_m); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = b / (z * c_m);
tmp = 0.0;
if (b <= -7e+75)
tmp = t_1;
elseif (b <= -6e-153)
tmp = -4.0 * (a * (t / c_m));
elseif (b <= 1.16e-281)
tmp = 9.0 * ((y / z) * (x / c_m));
elseif (b <= 5.5e+14)
tmp = (t * (-4.0 * a)) / c_m;
else
tmp = t_1;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[b, -7e+75], t$95$1, If[LessEqual[b, -6e-153], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.16e-281], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e+14], N[(N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -6 \cdot 10^{-153}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;b \leq 1.16 \cdot 10^{-281}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c\_m}\right)\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{t \cdot \left(-4 \cdot a\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if b < -6.9999999999999997e75 or 5.5e14 < b Initial program 87.4%
Simplified87.4%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -6.9999999999999997e75 < b < -6e-153Initial program 73.6%
Simplified72.3%
Taylor expanded in y around -inf 63.0%
Simplified66.6%
Taylor expanded in z around inf 51.4%
associate-*r/52.3%
Simplified52.3%
if -6e-153 < b < 1.15999999999999999e-281Initial program 83.8%
Simplified88.5%
Taylor expanded in x around inf 59.4%
*-commutative59.4%
Simplified59.4%
*-commutative59.4%
times-frac57.1%
Applied egg-rr57.1%
if 1.15999999999999999e-281 < b < 5.5e14Initial program 77.5%
Simplified80.1%
Taylor expanded in t around inf 59.0%
associate-*r/59.0%
associate-*r*59.0%
*-commutative59.0%
Simplified59.0%
Final simplification61.7%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1.56e+38) (not (<= z 3.9e-13)))
(* a (+ (* -4.0 (/ t c_m)) (/ b (* a (* z c_m)))))
(/ (+ b (* 9.0 (* x y))) (* z c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.56e+38) || !(z <= 3.9e-13)) {
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-1.56d+38)) .or. (.not. (z <= 3.9d-13))) then
tmp = a * (((-4.0d0) * (t / c_m)) + (b / (a * (z * c_m))))
else
tmp = (b + (9.0d0 * (x * y))) / (z * c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.56e+38) || !(z <= 3.9e-13)) {
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -1.56e+38) or not (z <= 3.9e-13): tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m)))) else: tmp = (b + (9.0 * (x * y))) / (z * c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -1.56e+38) || !(z <= 3.9e-13)) tmp = Float64(a * Float64(Float64(-4.0 * Float64(t / c_m)) + Float64(b / Float64(a * Float64(z * c_m))))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -1.56e+38) || ~((z <= 3.9e-13)))
tmp = a * ((-4.0 * (t / c_m)) + (b / (a * (z * c_m))));
else
tmp = (b + (9.0 * (x * y))) / (z * c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -1.56e+38], N[Not[LessEqual[z, 3.9e-13]], $MachinePrecision]], N[(a * N[(N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(a * N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.56 \cdot 10^{+38} \lor \neg \left(z \leq 3.9 \cdot 10^{-13}\right):\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m} + \frac{b}{a \cdot \left(z \cdot c\_m\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c\_m}\\
\end{array}
\end{array}
if z < -1.5599999999999999e38 or 3.90000000000000004e-13 < z Initial program 65.1%
Simplified67.1%
Taylor expanded in a around inf 77.6%
Taylor expanded in x around 0 71.0%
if -1.5599999999999999e38 < z < 3.90000000000000004e-13Initial program 95.8%
Simplified96.4%
Taylor expanded in t around 0 81.3%
Final simplification76.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -1.85e+114)
(* -4.0 (* t (/ a c_m)))
(if (<= z 3.5e+22)
(/ (+ b (* 9.0 (* x y))) (* z c_m))
(* -4.0 (* a (/ t c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.85e+114) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 3.5e+22) {
tmp = (b + (9.0 * (x * y))) / (z * c_m);
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (z <= (-1.85d+114)) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (z <= 3.5d+22) then
tmp = (b + (9.0d0 * (x * y))) / (z * c_m)
else
tmp = (-4.0d0) * (a * (t / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.85e+114) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 3.5e+22) {
tmp = (b + (9.0 * (x * y))) / (z * c_m);
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -1.85e+114: tmp = -4.0 * (t * (a / c_m)) elif z <= 3.5e+22: tmp = (b + (9.0 * (x * y))) / (z * c_m) else: tmp = -4.0 * (a * (t / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -1.85e+114) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (z <= 3.5e+22) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -1.85e+114)
tmp = -4.0 * (t * (a / c_m));
elseif (z <= 3.5e+22)
tmp = (b + (9.0 * (x * y))) / (z * c_m);
else
tmp = -4.0 * (a * (t / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -1.85e+114], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+22], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+114}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+22}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
if z < -1.85e114Initial program 46.0%
Simplified50.7%
Taylor expanded in y around -inf 65.1%
Simplified82.5%
Taylor expanded in z around inf 71.4%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in a around 0 71.4%
*-commutative71.4%
associate-/l*71.4%
Simplified71.4%
if -1.85e114 < z < 3.5e22Initial program 93.5%
Simplified93.4%
Taylor expanded in t around 0 77.7%
if 3.5e22 < z Initial program 68.1%
Simplified71.4%
Taylor expanded in y around -inf 82.3%
Simplified74.9%
Taylor expanded in z around inf 62.9%
associate-*r/56.5%
Simplified56.5%
Final simplification71.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= b -7e+70) (not (<= b 1.7e+14)))
(/ b (* z c_m))
(* -4.0 (* a (/ t c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -7e+70) || !(b <= 1.7e+14)) {
tmp = b / (z * c_m);
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((b <= (-7d+70)) .or. (.not. (b <= 1.7d+14))) then
tmp = b / (z * c_m)
else
tmp = (-4.0d0) * (a * (t / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -7e+70) || !(b <= 1.7e+14)) {
tmp = b / (z * c_m);
} else {
tmp = -4.0 * (a * (t / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (b <= -7e+70) or not (b <= 1.7e+14): tmp = b / (z * c_m) else: tmp = -4.0 * (a * (t / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((b <= -7e+70) || !(b <= 1.7e+14)) tmp = Float64(b / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((b <= -7e+70) || ~((b <= 1.7e+14)))
tmp = b / (z * c_m);
else
tmp = -4.0 * (a * (t / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[b, -7e+70], N[Not[LessEqual[b, 1.7e+14]], $MachinePrecision]], N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+70} \lor \neg \left(b \leq 1.7 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
if b < -7.00000000000000005e70 or 1.7e14 < b Initial program 87.4%
Simplified87.4%
Taylor expanded in b around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -7.00000000000000005e70 < b < 1.7e14Initial program 78.2%
Simplified80.3%
Taylor expanded in y around -inf 72.6%
Simplified71.9%
Taylor expanded in z around inf 52.1%
associate-*r/50.5%
Simplified50.5%
Final simplification58.0%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* z c_m))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (z * c_m));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (z * c_m))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (z * c_m));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (z * c_m))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(z * c_m))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (z * c_m));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{z \cdot c\_m}
\end{array}
Initial program 81.9%
Simplified83.1%
Taylor expanded in b around inf 37.9%
*-commutative37.9%
Simplified37.9%
(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 2024185
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -220031348160821/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 365902434742109/31250000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 28768236795461370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 138385150424563190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c)))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))