
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
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 (* (* z 4.0) t)))) (* c_m z)))
(t_2 (/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-153)
t_2
(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)
t_2
(*
t
(-
(/ (fma (/ 9.0 z) (* x (/ y c_m)) (/ b (* c_m z))) t)
(* 4.0 (/ a c_m))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
double t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
double tmp;
if (t_1 <= -1e-153) {
tmp = t_2;
} 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 = t_2;
} else {
tmp = t * ((fma((9.0 / z), (x * (y / c_m)), (b / (c_m * z))) / t) - (4.0 * (a / c_m)));
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c_m * z)) t_2 = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-153) tmp = t_2; 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 = t_2; else tmp = Float64(t * Float64(Float64(fma(Float64(9.0 / z), Float64(x * Float64(y / c_m)), Float64(b / Float64(c_m * z))) / t) - Float64(4.0 * Float64(a / c_m)))); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-153], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(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], t$95$2, N[(t * N[(N[(N[(N[(9.0 / z), $MachinePrecision] * N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
t_2 := \frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-153}:\\
\;\;\;\;t\_2\\
\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:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{\mathsf{fma}\left(\frac{9}{z}, x \cdot \frac{y}{c\_m}, \frac{b}{c\_m \cdot z}\right)}{t} - 4 \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.00000000000000004e-153 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.1%
associate-+l-91.1%
*-commutative91.1%
associate-*r*90.6%
*-commutative90.6%
associate-+l-90.6%
associate-*l*90.6%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
if -1.00000000000000004e-153 < (/.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 70.6%
associate-+l-70.6%
*-commutative70.6%
associate-*r*70.4%
*-commutative70.4%
associate-+l-70.4%
Simplified70.4%
Taylor expanded in z around 0 97.4%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*1.3%
*-commutative1.3%
associate-+l-1.3%
Simplified6.6%
Taylor expanded in t around -inf 55.9%
mul-1-neg55.9%
*-commutative55.9%
distribute-rgt-neg-in55.9%
Simplified77.7%
Final simplification92.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
(let* ((t_1 (* c_m (* z t))))
(*
c_s
(if (<= c_m 1.5e+65)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(if (<= c_m 9.2e+283)
(/
(fma -4.0 (* a (* t (/ z c_m))) (fma 9.0 (* x (/ y c_m)) (/ b c_m)))
z)
(* t (+ (* -4.0 (/ a 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 = c_m * (z * t);
double tmp;
if (c_m <= 1.5e+65) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else if (c_m <= 9.2e+283) {
tmp = fma(-4.0, (a * (t * (z / c_m))), fma(9.0, (x * (y / c_m)), (b / c_m))) / z;
} else {
tmp = t * ((-4.0 * (a / 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(c_m * Float64(z * t)) tmp = 0.0 if (c_m <= 1.5e+65) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); elseif (c_m <= 9.2e+283) tmp = Float64(fma(-4.0, Float64(a * Float64(t * Float64(z / c_m))), fma(9.0, Float64(x * Float64(y / c_m)), Float64(b / c_m))) / z); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / 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 = 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[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[c$95$m, 1.5e+65], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c$95$m, 9.2e+283], N[(N[(-4.0 * N[(a * N[(t * N[(z / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / 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 := c\_m \cdot \left(z \cdot t\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 1.5 \cdot 10^{+65}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;c\_m \leq 9.2 \cdot 10^{+283}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot \left(t \cdot \frac{z}{c\_m}\right), \mathsf{fma}\left(9, x \cdot \frac{y}{c\_m}, \frac{b}{c\_m}\right)\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \left(9 \cdot \frac{x \cdot y}{t\_1} + \frac{b}{t\_1}\right)\right)\\
\end{array}
\end{array}
\end{array}
if c < 1.5000000000000001e65Initial program 86.7%
associate-+l-86.7%
*-commutative86.7%
associate-*r*86.6%
*-commutative86.6%
associate-+l-86.6%
associate-*l*86.6%
associate-*l*88.5%
*-commutative88.5%
Simplified88.5%
if 1.5000000000000001e65 < c < 9.2000000000000007e283Initial program 67.4%
associate-+l-67.4%
*-commutative67.4%
associate-*r*66.0%
*-commutative66.0%
associate-+l-66.0%
Simplified65.9%
Taylor expanded in z around 0 75.2%
fma-define75.2%
associate-/l*75.4%
associate-/l*88.5%
fma-define88.5%
associate-/l*89.1%
Simplified89.1%
if 9.2000000000000007e283 < c Initial program 57.1%
associate-+l-57.1%
*-commutative57.1%
associate-*r*56.9%
*-commutative56.9%
associate-+l-56.9%
Simplified56.9%
Taylor expanded in t around inf 92.5%
Final simplification88.7%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c_m z)))
(t_2 (/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-153)
t_2
(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) t_2 (* -4.0 (* t (/ a c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 * ((z * 4.0) * t)))) / (c_m * z);
double t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
double tmp;
if (t_1 <= -1e-153) {
tmp = t_2;
} 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 = t_2;
} else {
tmp = -4.0 * (t * (a / 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 * ((z * 4.0) * t)))) / (c_m * z);
double t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
double tmp;
if (t_1 <= -1e-153) {
tmp = t_2;
} 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 = t_2;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 * ((z * 4.0) * t)))) / (c_m * z) t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) tmp = 0 if t_1 <= -1e-153: tmp = t_2 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 = t_2 else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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(Float64(z * 4.0) * t)))) / Float64(c_m * z)) t_2 = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-153) tmp = t_2; 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 = t_2; else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 * ((z * 4.0) * t)))) / (c_m * z);
t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
tmp = 0.0;
if (t_1 <= -1e-153)
tmp = t_2;
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 = t_2;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-153], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(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], t$95$2, N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
t_2 := \frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-153}:\\
\;\;\;\;t\_2\\
\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:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.00000000000000004e-153 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.1%
associate-+l-91.1%
*-commutative91.1%
associate-*r*90.6%
*-commutative90.6%
associate-+l-90.6%
associate-*l*90.6%
associate-*l*93.3%
*-commutative93.3%
Simplified93.3%
if -1.00000000000000004e-153 < (/.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 70.6%
associate-+l-70.6%
*-commutative70.6%
associate-*r*70.4%
*-commutative70.4%
associate-+l-70.4%
Simplified70.4%
Taylor expanded in z around 0 97.4%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*1.3%
*-commutative1.3%
associate-+l-1.3%
Simplified6.6%
Taylor expanded in z around 0 2.7%
Taylor expanded in a around inf 41.5%
associate-*l/71.3%
Simplified71.3%
Final simplification92.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 (* (* z 4.0) t)))) (* c_m z)))
(t_2 (/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-286)
t_2
(if (<= t_1 0.0)
(/
(* y (- (+ (* 9.0 (/ x z)) (/ b (* y z))) (* 4.0 (/ (* t a) y))))
c_m)
(if (<= t_1 INFINITY) t_2 (* -4.0 (* t (/ a c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 * ((z * 4.0) * t)))) / (c_m * z);
double t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
double tmp;
if (t_1 <= -1e-286) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (y * (((9.0 * (x / z)) + (b / (y * z))) - (4.0 * ((t * a) / y)))) / c_m;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * (t * (a / 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 * ((z * 4.0) * t)))) / (c_m * z);
double t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
double tmp;
if (t_1 <= -1e-286) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (y * (((9.0 * (x / z)) + (b / (y * z))) - (4.0 * ((t * a) / y)))) / c_m;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 * ((z * 4.0) * t)))) / (c_m * z) t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) tmp = 0 if t_1 <= -1e-286: tmp = t_2 elif t_1 <= 0.0: tmp = (y * (((9.0 * (x / z)) + (b / (y * z))) - (4.0 * ((t * a) / y)))) / c_m elif t_1 <= math.inf: tmp = t_2 else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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(Float64(z * 4.0) * t)))) / Float64(c_m * z)) t_2 = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-286) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(y * Float64(Float64(Float64(9.0 * Float64(x / z)) + Float64(b / Float64(y * z))) - Float64(4.0 * Float64(Float64(t * a) / y)))) / c_m); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 * ((z * 4.0) * t)))) / (c_m * z);
t_2 = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
tmp = 0.0;
if (t_1 <= -1e-286)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = (y * (((9.0 * (x / z)) + (b / (y * z))) - (4.0 * ((t * a) / y)))) / c_m;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-286], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(y * N[(N[(N[(9.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
t_2 := \frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-286}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{y \cdot \left(\left(9 \cdot \frac{x}{z} + \frac{b}{y \cdot z}\right) - 4 \cdot \frac{t \cdot a}{y}\right)}{c\_m}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.00000000000000005e-286 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 91.4%
associate-+l-91.4%
*-commutative91.4%
associate-*r*90.9%
*-commutative90.9%
associate-+l-90.9%
associate-*l*90.9%
associate-*l*93.1%
*-commutative93.1%
Simplified93.1%
if -1.00000000000000005e-286 < (/.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 61.4%
associate-+l-61.4%
*-commutative61.4%
associate-*r*61.2%
*-commutative61.2%
associate-+l-61.2%
associate-*l*61.2%
associate-*l*61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in y around inf 78.6%
Taylor expanded in c around 0 91.0%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*1.3%
*-commutative1.3%
associate-+l-1.3%
Simplified6.6%
Taylor expanded in z around 0 2.7%
Taylor expanded in a around inf 41.5%
associate-*l/71.3%
Simplified71.3%
Final simplification91.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
(*
c_s
(if (<=
(/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c_m z))
INFINITY)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(* -4.0 (* t (/ a c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= ((double) INFINITY)) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / 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 tmp;
if (((b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= Double.POSITIVE_INFINITY) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= math.inf: tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 (Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c_m * z)) <= Inf) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z)) <= Inf)
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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[N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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}\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z} \leq \infty:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\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.6%
associate-+l-88.6%
*-commutative88.6%
associate-*r*88.1%
*-commutative88.1%
associate-+l-88.1%
associate-*l*88.1%
associate-*l*90.1%
*-commutative90.1%
Simplified90.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*1.3%
*-commutative1.3%
associate-+l-1.3%
Simplified6.6%
Taylor expanded in z around 0 2.7%
Taylor expanded in a around inf 41.5%
associate-*l/71.3%
Simplified71.3%
Final simplification88.7%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (* x (/ y (* c_m z))))))
(*
c_s
(if (<= y -1.55e-23)
t_1
(if (<= y -1.8e-188)
(* -4.0 (* t (/ a c_m)))
(if (<= y 5.4e-104)
(/ (/ b c_m) z)
(if (<= y 6e-26) (/ (* t (* a -4.0)) c_m) t_1)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * (x * (y / (c_m * z)));
double tmp;
if (y <= -1.55e-23) {
tmp = t_1;
} else if (y <= -1.8e-188) {
tmp = -4.0 * (t * (a / c_m));
} else if (y <= 5.4e-104) {
tmp = (b / c_m) / z;
} else if (y <= 6e-26) {
tmp = (t * (a * -4.0)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * (x * (y / (c_m * z)))
if (y <= (-1.55d-23)) then
tmp = t_1
else if (y <= (-1.8d-188)) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (y <= 5.4d-104) then
tmp = (b / c_m) / z
else if (y <= 6d-26) then
tmp = (t * (a * (-4.0d0))) / c_m
else
tmp = t_1
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * (x * (y / (c_m * z)));
double tmp;
if (y <= -1.55e-23) {
tmp = t_1;
} else if (y <= -1.8e-188) {
tmp = -4.0 * (t * (a / c_m));
} else if (y <= 5.4e-104) {
tmp = (b / c_m) / z;
} else if (y <= 6e-26) {
tmp = (t * (a * -4.0)) / c_m;
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 9.0 * (x * (y / (c_m * z))) tmp = 0 if y <= -1.55e-23: tmp = t_1 elif y <= -1.8e-188: tmp = -4.0 * (t * (a / c_m)) elif y <= 5.4e-104: tmp = (b / c_m) / z elif y <= 6e-26: tmp = (t * (a * -4.0)) / c_m else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))) tmp = 0.0 if (y <= -1.55e-23) tmp = t_1; elseif (y <= -1.8e-188) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (y <= 5.4e-104) tmp = Float64(Float64(b / c_m) / z); elseif (y <= 6e-26) tmp = Float64(Float64(t * Float64(a * -4.0)) / c_m); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 9.0 * (x * (y / (c_m * z)));
tmp = 0.0;
if (y <= -1.55e-23)
tmp = t_1;
elseif (y <= -1.8e-188)
tmp = -4.0 * (t * (a / c_m));
elseif (y <= 5.4e-104)
tmp = (b / c_m) / z;
elseif (y <= 6e-26)
tmp = (t * (a * -4.0)) / c_m;
else
tmp = t_1;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -1.55e-23], t$95$1, If[LessEqual[y, -1.8e-188], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-104], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 6e-26], N[(N[(t * N[(a * -4.0), $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 := 9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-188}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-26}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -1.5499999999999999e-23 or 6.00000000000000023e-26 < y Initial program 79.6%
associate-+l-79.6%
*-commutative79.6%
associate-*r*76.9%
*-commutative76.9%
associate-+l-76.9%
Simplified77.6%
Taylor expanded in x around inf 55.9%
associate-/l*58.6%
*-commutative58.6%
Simplified58.6%
if -1.5499999999999999e-23 < y < -1.7999999999999998e-188Initial program 82.1%
associate-+l-82.1%
*-commutative82.1%
associate-*r*82.2%
*-commutative82.2%
associate-+l-82.2%
Simplified82.2%
Taylor expanded in z around 0 77.3%
Taylor expanded in a around inf 39.4%
associate-*l/47.7%
Simplified47.7%
if -1.7999999999999998e-188 < y < 5.3999999999999997e-104Initial program 88.0%
associate-+l-88.0%
*-commutative88.0%
associate-*r*92.0%
*-commutative92.0%
associate-+l-92.0%
Simplified92.0%
Taylor expanded in z around 0 85.9%
Taylor expanded in a around 0 67.9%
Taylor expanded in x around 0 56.6%
if 5.3999999999999997e-104 < y < 6.00000000000000023e-26Initial program 71.7%
associate-+l-71.7%
*-commutative71.7%
associate-*r*71.7%
*-commutative71.7%
associate-+l-71.7%
Simplified71.7%
Taylor expanded in z around 0 72.1%
Taylor expanded in a around inf 70.7%
associate-*r/70.8%
associate-*r*70.8%
Simplified70.8%
Final simplification57.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 -1.8e+93)
(/ (- (/ b z) (* 4.0 (* t a))) c_m)
(if (<= z 115000.0)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(/ (* y (- (* 9.0 (/ x z)) (* 4.0 (/ (* t a) y)))) 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.8e+93) {
tmp = ((b / z) - (4.0 * (t * a))) / c_m;
} else if (z <= 115000.0) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (y * ((9.0 * (x / z)) - (4.0 * ((t * a) / y)))) / 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.8d+93)) then
tmp = ((b / z) - (4.0d0 * (t * a))) / c_m
else if (z <= 115000.0d0) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (y * ((9.0d0 * (x / z)) - (4.0d0 * ((t * a) / y)))) / 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.8e+93) {
tmp = ((b / z) - (4.0 * (t * a))) / c_m;
} else if (z <= 115000.0) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (y * ((9.0 * (x / z)) - (4.0 * ((t * a) / y)))) / 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.8e+93: tmp = ((b / z) - (4.0 * (t * a))) / c_m elif z <= 115000.0: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = (y * ((9.0 * (x / z)) - (4.0 * ((t * a) / y)))) / 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.8e+93) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(t * a))) / c_m); elseif (z <= 115000.0) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(y * Float64(Float64(9.0 * Float64(x / z)) - Float64(4.0 * Float64(Float64(t * a) / y)))) / 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.8e+93)
tmp = ((b / z) - (4.0 * (t * a))) / c_m;
elseif (z <= 115000.0)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = (y * ((9.0 * (x / z)) - (4.0 * ((t * a) / y)))) / 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.8e+93], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[z, 115000.0], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(N[(9.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $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.8 \cdot 10^{+93}:\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(t \cdot a\right)}{c\_m}\\
\mathbf{elif}\;z \leq 115000:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(9 \cdot \frac{x}{z} - 4 \cdot \frac{t \cdot a}{y}\right)}{c\_m}\\
\end{array}
\end{array}
if z < -1.8e93Initial program 57.7%
associate-+l-57.7%
*-commutative57.7%
associate-*r*55.3%
*-commutative55.3%
associate-+l-55.3%
associate-*l*55.3%
associate-*l*62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in y around inf 65.9%
Taylor expanded in c around 0 75.9%
Taylor expanded in y around 0 73.5%
if -1.8e93 < z < 115000Initial program 95.2%
associate-+l-95.2%
*-commutative95.2%
associate-*r*94.6%
*-commutative94.6%
associate-+l-94.6%
Simplified94.5%
Taylor expanded in t around 0 85.4%
+-commutative85.4%
*-commutative85.4%
Simplified85.4%
if 115000 < z Initial program 69.3%
associate-+l-69.3%
*-commutative69.3%
associate-*r*71.1%
*-commutative71.1%
associate-+l-71.1%
associate-*l*71.2%
associate-*l*74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in y around inf 67.2%
Taylor expanded in c around 0 84.2%
Taylor expanded in b around 0 72.2%
Final simplification79.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 (<= x -3.5e+77)
(* 9.0 (* (/ y z) (/ x c_m)))
(if (<= x -1.42e-233)
(* b (/ 1.0 (* c_m z)))
(if (<= x 1.62e-83)
(/ (* t (* a -4.0)) c_m)
(* 9.0 (* x (/ y (* c_m z)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (x <= -3.5e+77) {
tmp = 9.0 * ((y / z) * (x / c_m));
} else if (x <= -1.42e-233) {
tmp = b * (1.0 / (c_m * z));
} else if (x <= 1.62e-83) {
tmp = (t * (a * -4.0)) / c_m;
} else {
tmp = 9.0 * (x * (y / (c_m * z)));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (x <= (-3.5d+77)) then
tmp = 9.0d0 * ((y / z) * (x / c_m))
else if (x <= (-1.42d-233)) then
tmp = b * (1.0d0 / (c_m * z))
else if (x <= 1.62d-83) then
tmp = (t * (a * (-4.0d0))) / c_m
else
tmp = 9.0d0 * (x * (y / (c_m * z)))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (x <= -3.5e+77) {
tmp = 9.0 * ((y / z) * (x / c_m));
} else if (x <= -1.42e-233) {
tmp = b * (1.0 / (c_m * z));
} else if (x <= 1.62e-83) {
tmp = (t * (a * -4.0)) / c_m;
} else {
tmp = 9.0 * (x * (y / (c_m * z)));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if x <= -3.5e+77: tmp = 9.0 * ((y / z) * (x / c_m)) elif x <= -1.42e-233: tmp = b * (1.0 / (c_m * z)) elif x <= 1.62e-83: tmp = (t * (a * -4.0)) / c_m else: tmp = 9.0 * (x * (y / (c_m * z))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (x <= -3.5e+77) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c_m))); elseif (x <= -1.42e-233) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); elseif (x <= 1.62e-83) tmp = Float64(Float64(t * Float64(a * -4.0)) / c_m); else tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 (x <= -3.5e+77)
tmp = 9.0 * ((y / z) * (x / c_m));
elseif (x <= -1.42e-233)
tmp = b * (1.0 / (c_m * z));
elseif (x <= 1.62e-83)
tmp = (t * (a * -4.0)) / c_m;
else
tmp = 9.0 * (x * (y / (c_m * z)));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[x, -3.5e+77], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.42e-233], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.62e-83], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+77}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c\_m}\right)\\
\mathbf{elif}\;x \leq -1.42 \cdot 10^{-233}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{elif}\;x \leq 1.62 \cdot 10^{-83}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\end{array}
\end{array}
if x < -3.5000000000000001e77Initial program 88.6%
associate-+l-88.6%
*-commutative88.6%
associate-*r*88.5%
*-commutative88.5%
associate-+l-88.5%
Simplified88.4%
Taylor expanded in x around inf 73.2%
*-commutative73.2%
*-commutative73.2%
times-frac76.4%
Applied egg-rr76.4%
if -3.5000000000000001e77 < x < -1.42e-233Initial program 87.6%
associate-+l-87.6%
*-commutative87.6%
associate-*r*84.5%
*-commutative84.5%
associate-+l-84.5%
Simplified84.4%
Taylor expanded in b around inf 45.4%
*-commutative45.4%
Simplified45.4%
div-inv45.3%
Applied egg-rr45.3%
if -1.42e-233 < x < 1.6199999999999999e-83Initial program 80.3%
associate-+l-80.3%
*-commutative80.3%
associate-*r*81.8%
*-commutative81.8%
associate-+l-81.8%
Simplified81.8%
Taylor expanded in z around 0 81.3%
Taylor expanded in a around inf 45.2%
associate-*r/45.2%
associate-*r*45.2%
Simplified45.2%
if 1.6199999999999999e-83 < x Initial program 75.3%
associate-+l-75.3%
*-commutative75.3%
associate-*r*75.4%
*-commutative75.4%
associate-+l-75.4%
Simplified76.7%
Taylor expanded in x around inf 44.5%
associate-/l*47.3%
*-commutative47.3%
Simplified47.3%
Final simplification52.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
(*
c_s
(if (or (<= z -3.3e+92) (not (<= z 1.9e+62)))
(/ (- (/ b z) (* 4.0 (* t a))) c_m)
(/ (+ (* x (* 9.0 y)) b) (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -3.3e+92) || !(z <= 1.9e+62)) {
tmp = ((b / z) - (4.0 * (t * a))) / c_m;
} else {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-3.3d+92)) .or. (.not. (z <= 1.9d+62))) then
tmp = ((b / z) - (4.0d0 * (t * a))) / c_m
else
tmp = ((x * (9.0d0 * y)) + b) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -3.3e+92) || !(z <= 1.9e+62)) {
tmp = ((b / z) - (4.0 * (t * a))) / c_m;
} else {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -3.3e+92) or not (z <= 1.9e+62): tmp = ((b / z) - (4.0 * (t * a))) / c_m else: tmp = ((x * (9.0 * y)) + b) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -3.3e+92) || !(z <= 1.9e+62)) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(t * a))) / c_m); else tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -3.3e+92) || ~((z <= 1.9e+62)))
tmp = ((b / z) - (4.0 * (t * a))) / c_m;
else
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -3.3e+92], N[Not[LessEqual[z, 1.9e+62]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+92} \lor \neg \left(z \leq 1.9 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(t \cdot a\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -3.29999999999999974e92 or 1.89999999999999992e62 < z Initial program 60.9%
associate-+l-60.9%
*-commutative60.9%
associate-*r*61.1%
*-commutative61.1%
associate-+l-61.1%
associate-*l*61.1%
associate-*l*66.2%
*-commutative66.2%
Simplified66.2%
Taylor expanded in y around inf 65.1%
Taylor expanded in c around 0 81.7%
Taylor expanded in y around 0 73.8%
if -3.29999999999999974e92 < z < 1.89999999999999992e62Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
associate-*r*93.9%
*-commutative93.9%
associate-+l-93.9%
associate-*l*93.8%
associate-*l*93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in t around inf 88.6%
Taylor expanded in t around 0 83.2%
associate-*r*83.2%
*-commutative83.2%
associate-*r*83.2%
Simplified83.2%
Final simplification79.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 (<= z -1.4e+157)
(* -4.0 (/ (* t a) c_m))
(if (<= z 2e+63)
(/ (+ (* x (* 9.0 y)) b) (* c_m z))
(* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.4e+157) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 2e+63) {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (z <= (-1.4d+157)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (z <= 2d+63) then
tmp = ((x * (9.0d0 * y)) + b) / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -1.4e+157) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 2e+63) {
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -1.4e+157: tmp = -4.0 * ((t * a) / c_m) elif z <= 2e+63: tmp = ((x * (9.0 * y)) + b) / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -1.4e+157) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (z <= 2e+63) tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -1.4e+157)
tmp = -4.0 * ((t * a) / c_m);
elseif (z <= 2e+63)
tmp = ((x * (9.0 * y)) + b) / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -1.4e+157], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+63], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+157}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+63}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if z < -1.4000000000000001e157Initial program 49.2%
associate-+l-49.2%
*-commutative49.2%
associate-*r*48.9%
*-commutative48.9%
associate-+l-48.9%
Simplified52.9%
Taylor expanded in t around inf 73.1%
if -1.4000000000000001e157 < z < 2.00000000000000012e63Initial program 91.8%
associate-+l-91.8%
*-commutative91.8%
associate-*r*90.7%
*-commutative90.7%
associate-+l-90.7%
associate-*l*90.7%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 85.5%
Taylor expanded in t around 0 79.6%
associate-*r*79.6%
*-commutative79.6%
associate-*r*79.6%
Simplified79.6%
if 2.00000000000000012e63 < z Initial program 63.7%
associate-+l-63.7%
*-commutative63.7%
associate-*r*66.0%
*-commutative66.0%
associate-+l-66.0%
Simplified66.0%
Taylor expanded in z around 0 58.0%
Taylor expanded in a around inf 59.0%
associate-*l/62.7%
Simplified62.7%
Final simplification75.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 -5.2e+154)
(* -4.0 (/ (* t a) c_m))
(if (<= z 1.4e+63)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= -5.2e+154) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 1.4e+63) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= (-5.2d+154)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (z <= 1.4d+63) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= -5.2e+154) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 1.4e+63) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= -5.2e+154: tmp = -4.0 * ((t * a) / c_m) elif z <= 1.4e+63: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= -5.2e+154) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (z <= 1.4e+63) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 <= -5.2e+154)
tmp = -4.0 * ((t * a) / c_m);
elseif (z <= 1.4e+63)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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, -5.2e+154], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+63], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 -5.2 \cdot 10^{+154}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+63}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if z < -5.19999999999999978e154Initial program 49.2%
associate-+l-49.2%
*-commutative49.2%
associate-*r*48.9%
*-commutative48.9%
associate-+l-48.9%
Simplified52.9%
Taylor expanded in t around inf 73.1%
if -5.19999999999999978e154 < z < 1.39999999999999993e63Initial program 91.8%
associate-+l-91.8%
*-commutative91.8%
associate-*r*90.7%
*-commutative90.7%
associate-+l-90.7%
Simplified90.7%
Taylor expanded in t around 0 79.6%
+-commutative79.6%
*-commutative79.6%
Simplified79.6%
if 1.39999999999999993e63 < z Initial program 63.7%
associate-+l-63.7%
*-commutative63.7%
associate-*r*66.0%
*-commutative66.0%
associate-+l-66.0%
Simplified66.0%
Taylor expanded in z around 0 58.0%
Taylor expanded in a around inf 59.0%
associate-*l/62.7%
Simplified62.7%
Final simplification75.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 (or (<= z -8e-37) (not (<= z 20500.0)))
(* -4.0 (* t (/ a c_m)))
(/ b (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= -8e-37) || !(z <= 20500.0)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= (-8d-37)) .or. (.not. (z <= 20500.0d0))) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= -8e-37) || !(z <= 20500.0)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= -8e-37) or not (z <= 20500.0): tmp = -4.0 * (t * (a / c_m)) else: tmp = b / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= -8e-37) || !(z <= 20500.0)) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(b / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -8e-37) || ~((z <= 20500.0)))
tmp = -4.0 * (t * (a / c_m));
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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, -8e-37], N[Not[LessEqual[z, 20500.0]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-37} \lor \neg \left(z \leq 20500\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -8.00000000000000053e-37 or 20500 < z Initial program 68.9%
associate-+l-68.9%
*-commutative68.9%
associate-*r*69.0%
*-commutative69.0%
associate-+l-69.0%
Simplified69.7%
Taylor expanded in z around 0 65.5%
Taylor expanded in a around inf 51.0%
associate-*l/55.9%
Simplified55.9%
if -8.00000000000000053e-37 < z < 20500Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
associate-*r*95.9%
*-commutative95.9%
associate-+l-95.9%
Simplified95.9%
Taylor expanded in b around inf 52.2%
*-commutative52.2%
Simplified52.2%
Final simplification54.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 -2.8e-40)
(* -4.0 (* t (/ a c_m)))
(if (<= z 55000.0) (* b (/ 1.0 (* c_m z))) (* a (/ (* t -4.0) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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.8e-40) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 55000.0) {
tmp = b * (1.0 / (c_m * z));
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (z <= (-2.8d-40)) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (z <= 55000.0d0) then
tmp = b * (1.0d0 / (c_m * z))
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -2.8e-40) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 55000.0) {
tmp = b * (1.0 / (c_m * z));
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -2.8e-40: tmp = -4.0 * (t * (a / c_m)) elif z <= 55000.0: tmp = b * (1.0 / (c_m * z)) else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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.8e-40) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (z <= 55000.0) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -2.8e-40)
tmp = -4.0 * (t * (a / c_m));
elseif (z <= 55000.0)
tmp = b * (1.0 / (c_m * z));
else
tmp = a * ((t * -4.0) / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -2.8e-40], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 55000.0], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-40}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;z \leq 55000:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if z < -2.8e-40Initial program 68.4%
associate-+l-68.4%
*-commutative68.4%
associate-*r*66.8%
*-commutative66.8%
associate-+l-66.8%
Simplified68.3%
Taylor expanded in z around 0 68.6%
Taylor expanded in a around inf 49.8%
associate-*l/53.9%
Simplified53.9%
if -2.8e-40 < z < 55000Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
associate-*r*95.9%
*-commutative95.9%
associate-+l-95.9%
Simplified95.9%
Taylor expanded in b around inf 52.2%
*-commutative52.2%
Simplified52.2%
div-inv53.0%
Applied egg-rr53.0%
if 55000 < z Initial program 69.3%
associate-+l-69.3%
*-commutative69.3%
associate-*r*71.1%
*-commutative71.1%
associate-+l-71.1%
Simplified71.2%
Taylor expanded in t around inf 52.2%
*-commutative52.2%
associate-/l*55.9%
associate-*r*55.9%
*-commutative55.9%
*-commutative55.9%
associate-*l/55.9%
Simplified55.9%
Final simplification54.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -2e-42)
(* -4.0 (* t (/ a c_m)))
(if (<= z 52000.0) (/ b (* c_m z)) (* a (/ (* t -4.0) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= -2e-42) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 52000.0) {
tmp = b / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (z <= (-2d-42)) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (z <= 52000.0d0) then
tmp = b / (c_m * z)
else
tmp = a * ((t * (-4.0d0)) / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -2e-42) {
tmp = -4.0 * (t * (a / c_m));
} else if (z <= 52000.0) {
tmp = b / (c_m * z);
} else {
tmp = a * ((t * -4.0) / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -2e-42: tmp = -4.0 * (t * (a / c_m)) elif z <= 52000.0: tmp = b / (c_m * z) else: tmp = a * ((t * -4.0) / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= -2e-42) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (z <= 52000.0) tmp = Float64(b / Float64(c_m * z)); else tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); end return Float64(c_s * tmp) end
c\_m = 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 <= -2e-42)
tmp = -4.0 * (t * (a / c_m));
elseif (z <= 52000.0)
tmp = b / (c_m * z);
else
tmp = a * ((t * -4.0) / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -2e-42], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 52000.0], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 \cdot 10^{-42}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;z \leq 52000:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\end{array}
\end{array}
if z < -2.00000000000000008e-42Initial program 68.4%
associate-+l-68.4%
*-commutative68.4%
associate-*r*66.8%
*-commutative66.8%
associate-+l-66.8%
Simplified68.3%
Taylor expanded in z around 0 68.6%
Taylor expanded in a around inf 49.8%
associate-*l/53.9%
Simplified53.9%
if -2.00000000000000008e-42 < z < 52000Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
associate-*r*95.9%
*-commutative95.9%
associate-+l-95.9%
Simplified95.9%
Taylor expanded in b around inf 52.2%
*-commutative52.2%
Simplified52.2%
if 52000 < z Initial program 69.3%
associate-+l-69.3%
*-commutative69.3%
associate-*r*71.1%
*-commutative71.1%
associate-+l-71.1%
Simplified71.2%
Taylor expanded in t around inf 52.2%
*-commutative52.2%
associate-/l*55.9%
associate-*r*55.9%
*-commutative55.9%
*-commutative55.9%
associate-*l/55.9%
Simplified55.9%
Final simplification53.6%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* c_m z))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (c_m * z))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (c_m * z));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 82.0%
associate-+l-82.0%
*-commutative82.0%
associate-*r*81.7%
*-commutative81.7%
associate-+l-81.7%
Simplified82.1%
Taylor expanded in b around inf 37.2%
*-commutative37.2%
Simplified37.2%
Final simplification37.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024165
(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)))