
(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 21 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 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 1.06e+61)
(/ (+ (* a (* -4.0 t)) (/ (- b (* y (* x -9.0))) z)) c_m)
(fma
-4.0
(* a (/ t c_m))
(fma 9.0 (* (/ x c_m) (/ y z)) (/ (/ b c_m) z))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1.06e+61) {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
} else {
tmp = fma(-4.0, (a * (t / c_m)), fma(9.0, ((x / c_m) * (y / z)), ((b / c_m) / z)));
}
return c_s * tmp;
}
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 1.06e+61) tmp = Float64(Float64(Float64(a * Float64(-4.0 * t)) + Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z)) / c_m); else tmp = fma(-4.0, Float64(a * Float64(t / c_m)), fma(9.0, Float64(Float64(x / c_m) * Float64(y / z)), Float64(Float64(b / c_m) / z))); end return Float64(c_s * tmp) end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 1.06e+61], N[(N[(N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 1.06 \cdot 10^{+61}:\\
\;\;\;\;\frac{a \cdot \left(-4 \cdot t\right) + \frac{b - y \cdot \left(x \cdot -9\right)}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot \frac{t}{c\_m}, \mathsf{fma}\left(9, \frac{x}{c\_m} \cdot \frac{y}{z}, \frac{\frac{b}{c\_m}}{z}\right)\right)\\
\end{array}
\end{array}
if c < 1.0599999999999999e61Initial program 82.4%
associate-+l-82.4%
*-commutative82.4%
associate-*r*82.3%
*-commutative82.3%
associate-+l-82.3%
associate-*l*82.3%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
+-commutative81.1%
fma-define81.1%
associate-/l*76.8%
fma-define76.8%
times-frac78.6%
associate-/r*78.6%
Simplified78.6%
Taylor expanded in c around 0 86.2%
Taylor expanded in c around 0 93.0%
Taylor expanded in z around -inf 93.6%
mul-1-neg93.6%
unsub-neg93.6%
*-commutative93.6%
associate-*l*93.6%
*-commutative93.6%
mul-1-neg93.6%
sub-neg93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*93.5%
Simplified93.5%
if 1.0599999999999999e61 < c Initial program 63.6%
associate-+l-63.6%
*-commutative63.6%
associate-*r*65.7%
*-commutative65.7%
associate-+l-65.7%
associate-*l*65.7%
associate-*l*67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in x around 0 79.4%
cancel-sign-sub-inv79.4%
metadata-eval79.4%
+-commutative79.4%
fma-define79.4%
associate-/l*86.7%
fma-define86.7%
times-frac77.2%
associate-/r*79.0%
Simplified79.0%
Final simplification90.6%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* t (/ a c_m))))
(t_2 (* 9.0 (* x (/ y (* c_m z)))))
(t_3 (/ (/ b c_m) z))
(t_4 (/ b (* c_m z))))
(*
c_s
(if (<= t -2.5e+206)
(* -4.0 (* a (/ t c_m)))
(if (<= t -1e+173)
t_2
(if (<= t -1.9e+89)
t_1
(if (<= t -4.5e+73)
t_3
(if (<= t -2.1e-98)
(/ (* t (* a -4.0)) c_m)
(if (<= t -2e-276)
t_3
(if (<= t 6.8e-281)
t_2
(if (<= t 1.9e-121)
t_4
(if (<= t 2.95e-77)
t_2
(if (<= t 0.12) t_4 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);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double t_2 = 9.0 * (x * (y / (c_m * z)));
double t_3 = (b / c_m) / z;
double t_4 = b / (c_m * z);
double tmp;
if (t <= -2.5e+206) {
tmp = -4.0 * (a * (t / c_m));
} else if (t <= -1e+173) {
tmp = t_2;
} else if (t <= -1.9e+89) {
tmp = t_1;
} else if (t <= -4.5e+73) {
tmp = t_3;
} else if (t <= -2.1e-98) {
tmp = (t * (a * -4.0)) / c_m;
} else if (t <= -2e-276) {
tmp = t_3;
} else if (t <= 6.8e-281) {
tmp = t_2;
} else if (t <= 1.9e-121) {
tmp = t_4;
} else if (t <= 2.95e-77) {
tmp = t_2;
} else if (t <= 0.12) {
tmp = t_4;
} 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.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c_m))
t_2 = 9.0d0 * (x * (y / (c_m * z)))
t_3 = (b / c_m) / z
t_4 = b / (c_m * z)
if (t <= (-2.5d+206)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (t <= (-1d+173)) then
tmp = t_2
else if (t <= (-1.9d+89)) then
tmp = t_1
else if (t <= (-4.5d+73)) then
tmp = t_3
else if (t <= (-2.1d-98)) then
tmp = (t * (a * (-4.0d0))) / c_m
else if (t <= (-2d-276)) then
tmp = t_3
else if (t <= 6.8d-281) then
tmp = t_2
else if (t <= 1.9d-121) then
tmp = t_4
else if (t <= 2.95d-77) then
tmp = t_2
else if (t <= 0.12d0) then
tmp = t_4
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;
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 = -4.0 * (t * (a / c_m));
double t_2 = 9.0 * (x * (y / (c_m * z)));
double t_3 = (b / c_m) / z;
double t_4 = b / (c_m * z);
double tmp;
if (t <= -2.5e+206) {
tmp = -4.0 * (a * (t / c_m));
} else if (t <= -1e+173) {
tmp = t_2;
} else if (t <= -1.9e+89) {
tmp = t_1;
} else if (t <= -4.5e+73) {
tmp = t_3;
} else if (t <= -2.1e-98) {
tmp = (t * (a * -4.0)) / c_m;
} else if (t <= -2e-276) {
tmp = t_3;
} else if (t <= 6.8e-281) {
tmp = t_2;
} else if (t <= 1.9e-121) {
tmp = t_4;
} else if (t <= 2.95e-77) {
tmp = t_2;
} else if (t <= 0.12) {
tmp = t_4;
} 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]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (t * (a / c_m)) t_2 = 9.0 * (x * (y / (c_m * z))) t_3 = (b / c_m) / z t_4 = b / (c_m * z) tmp = 0 if t <= -2.5e+206: tmp = -4.0 * (a * (t / c_m)) elif t <= -1e+173: tmp = t_2 elif t <= -1.9e+89: tmp = t_1 elif t <= -4.5e+73: tmp = t_3 elif t <= -2.1e-98: tmp = (t * (a * -4.0)) / c_m elif t <= -2e-276: tmp = t_3 elif t <= 6.8e-281: tmp = t_2 elif t <= 1.9e-121: tmp = t_4 elif t <= 2.95e-77: tmp = t_2 elif t <= 0.12: tmp = t_4 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]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(t * Float64(a / c_m))) t_2 = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))) t_3 = Float64(Float64(b / c_m) / z) t_4 = Float64(b / Float64(c_m * z)) tmp = 0.0 if (t <= -2.5e+206) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (t <= -1e+173) tmp = t_2; elseif (t <= -1.9e+89) tmp = t_1; elseif (t <= -4.5e+73) tmp = t_3; elseif (t <= -2.1e-98) tmp = Float64(Float64(t * Float64(a * -4.0)) / c_m); elseif (t <= -2e-276) tmp = t_3; elseif (t <= 6.8e-281) tmp = t_2; elseif (t <= 1.9e-121) tmp = t_4; elseif (t <= 2.95e-77) tmp = t_2; elseif (t <= 0.12) tmp = t_4; 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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (t * (a / c_m));
t_2 = 9.0 * (x * (y / (c_m * z)));
t_3 = (b / c_m) / z;
t_4 = b / (c_m * z);
tmp = 0.0;
if (t <= -2.5e+206)
tmp = -4.0 * (a * (t / c_m));
elseif (t <= -1e+173)
tmp = t_2;
elseif (t <= -1.9e+89)
tmp = t_1;
elseif (t <= -4.5e+73)
tmp = t_3;
elseif (t <= -2.1e-98)
tmp = (t * (a * -4.0)) / c_m;
elseif (t <= -2e-276)
tmp = t_3;
elseif (t <= 6.8e-281)
tmp = t_2;
elseif (t <= 1.9e-121)
tmp = t_4;
elseif (t <= 2.95e-77)
tmp = t_2;
elseif (t <= 0.12)
tmp = t_4;
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.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$4 = N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -2.5e+206], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1e+173], t$95$2, If[LessEqual[t, -1.9e+89], t$95$1, If[LessEqual[t, -4.5e+73], t$95$3, If[LessEqual[t, -2.1e-98], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t, -2e-276], t$95$3, If[LessEqual[t, 6.8e-281], t$95$2, If[LessEqual[t, 1.9e-121], t$95$4, If[LessEqual[t, 2.95e-77], t$95$2, If[LessEqual[t, 0.12], t$95$4, 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])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
t_2 := 9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
t_3 := \frac{\frac{b}{c\_m}}{z}\\
t_4 := \frac{b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+206}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;t \leq -1 \cdot 10^{+173}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{+73}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-98}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c\_m}\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-276}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-281}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-121}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t \leq 2.95 \cdot 10^{-77}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 0.12:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -2.5000000000000001e206Initial program 56.5%
associate-+l-56.5%
*-commutative56.5%
associate-*r*61.4%
*-commutative61.4%
associate-+l-61.4%
associate-*l*61.4%
associate-*l*61.4%
*-commutative61.4%
Simplified61.4%
Taylor expanded in z around inf 74.8%
*-commutative74.8%
associate-/l*78.8%
Simplified78.8%
if -2.5000000000000001e206 < t < -1e173 or -2e-276 < t < 6.8e-281 or 1.9e-121 < t < 2.94999999999999982e-77Initial program 80.5%
associate-+l-80.5%
*-commutative80.5%
associate-*r*73.9%
*-commutative73.9%
associate-+l-73.9%
associate-*l*73.9%
associate-*l*83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in x around inf 54.9%
associate-/l*54.6%
Applied egg-rr54.6%
if -1e173 < t < -1.90000000000000012e89 or 0.12 < t Initial program 77.4%
associate-+l-77.4%
*-commutative77.4%
associate-*r*83.3%
*-commutative83.3%
associate-+l-83.3%
associate-*l*83.3%
associate-*l*82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in x around 0 80.6%
cancel-sign-sub-inv80.6%
metadata-eval80.6%
+-commutative80.6%
fma-define80.6%
associate-/l*75.8%
fma-define75.8%
times-frac68.5%
associate-/r*65.1%
Simplified65.1%
Taylor expanded in c around 0 76.2%
Taylor expanded in a around inf 49.8%
*-commutative49.8%
associate-/l*53.4%
Simplified53.4%
if -1.90000000000000012e89 < t < -4.49999999999999985e73 or -2.09999999999999992e-98 < t < -2e-276Initial program 81.4%
associate-+l-81.4%
*-commutative81.4%
associate-*r*76.3%
*-commutative76.3%
associate-+l-76.3%
associate-*l*76.4%
associate-*l*81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in b around inf 42.4%
associate-/r*53.5%
Simplified53.5%
if -4.49999999999999985e73 < t < -2.09999999999999992e-98Initial program 78.4%
associate-+l-78.4%
*-commutative78.4%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
associate-*l*78.2%
associate-*l*78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x around 0 81.5%
cancel-sign-sub-inv81.5%
metadata-eval81.5%
+-commutative81.5%
fma-define81.5%
associate-/l*81.3%
fma-define81.3%
times-frac81.5%
associate-/r*80.4%
Simplified80.4%
Taylor expanded in c around 0 83.1%
Taylor expanded in c around 0 84.4%
Taylor expanded in a around inf 54.7%
associate-*r*54.7%
Simplified54.7%
if 6.8e-281 < t < 1.9e-121 or 2.94999999999999982e-77 < t < 0.12Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*85.9%
*-commutative85.9%
associate-+l-85.9%
associate-*l*85.9%
associate-*l*87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in b around inf 51.8%
*-commutative51.8%
Simplified51.8%
Final simplification55.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (* (/ x c_m) (/ y z)))))
(*
c_s
(if (<= a -1.5e-119)
(* -4.0 (* a (/ t c_m)))
(if (<= a -1.25e-208)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= a -5.6e-307)
(/ (/ b c_m) z)
(if (<= a 2.15e-212)
t_1
(if (<= a 1.2e-46)
(* b (/ 1.0 (* c_m z)))
(if (<= a 2.25e-12) t_1 (* -4.0 (* t (/ a c_m))))))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * ((x / c_m) * (y / z));
double tmp;
if (a <= -1.5e-119) {
tmp = -4.0 * (a * (t / c_m));
} else if (a <= -1.25e-208) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (a <= -5.6e-307) {
tmp = (b / c_m) / z;
} else if (a <= 2.15e-212) {
tmp = t_1;
} else if (a <= 1.2e-46) {
tmp = b * (1.0 / (c_m * z));
} else if (a <= 2.25e-12) {
tmp = t_1;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * ((x / c_m) * (y / z))
if (a <= (-1.5d-119)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (a <= (-1.25d-208)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (a <= (-5.6d-307)) then
tmp = (b / c_m) / z
else if (a <= 2.15d-212) then
tmp = t_1
else if (a <= 1.2d-46) then
tmp = b * (1.0d0 / (c_m * z))
else if (a <= 2.25d-12) then
tmp = t_1
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * ((x / c_m) * (y / z));
double tmp;
if (a <= -1.5e-119) {
tmp = -4.0 * (a * (t / c_m));
} else if (a <= -1.25e-208) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (a <= -5.6e-307) {
tmp = (b / c_m) / z;
} else if (a <= 2.15e-212) {
tmp = t_1;
} else if (a <= 1.2e-46) {
tmp = b * (1.0 / (c_m * z));
} else if (a <= 2.25e-12) {
tmp = t_1;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 9.0 * ((x / c_m) * (y / z)) tmp = 0 if a <= -1.5e-119: tmp = -4.0 * (a * (t / c_m)) elif a <= -1.25e-208: tmp = 9.0 * (x * (y / (c_m * z))) elif a <= -5.6e-307: tmp = (b / c_m) / z elif a <= 2.15e-212: tmp = t_1 elif a <= 1.2e-46: tmp = b * (1.0 / (c_m * z)) elif a <= 2.25e-12: tmp = t_1 else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))) tmp = 0.0 if (a <= -1.5e-119) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (a <= -1.25e-208) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (a <= -5.6e-307) tmp = Float64(Float64(b / c_m) / z); elseif (a <= 2.15e-212) tmp = t_1; elseif (a <= 1.2e-46) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); elseif (a <= 2.25e-12) tmp = t_1; else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 9.0 * ((x / c_m) * (y / z));
tmp = 0.0;
if (a <= -1.5e-119)
tmp = -4.0 * (a * (t / c_m));
elseif (a <= -1.25e-208)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (a <= -5.6e-307)
tmp = (b / c_m) / z;
elseif (a <= 2.15e-212)
tmp = t_1;
elseif (a <= 1.2e-46)
tmp = b * (1.0 / (c_m * z));
elseif (a <= 2.25e-12)
tmp = t_1;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -1.5e-119], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.25e-208], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.6e-307], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 2.15e-212], t$95$1, If[LessEqual[a, 1.2e-46], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.25e-12], t$95$1, N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]), $MachinePrecision]]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-119}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-208}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;a \leq -5.6 \cdot 10^{-307}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;a \leq 2.15 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-46}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if a < -1.5000000000000001e-119Initial program 78.2%
associate-+l-78.2%
*-commutative78.2%
associate-*r*76.2%
*-commutative76.2%
associate-+l-76.2%
associate-*l*76.2%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
associate-/l*54.7%
Simplified54.7%
if -1.5000000000000001e-119 < a < -1.24999999999999991e-208Initial program 88.3%
associate-+l-88.3%
*-commutative88.3%
associate-*r*93.8%
*-commutative93.8%
associate-+l-93.8%
associate-*l*93.8%
associate-*l*93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in x around inf 48.2%
associate-/l*42.8%
Applied egg-rr42.8%
if -1.24999999999999991e-208 < a < -5.6e-307Initial program 85.0%
associate-+l-85.0%
*-commutative85.0%
associate-*r*99.6%
*-commutative99.6%
associate-+l-99.6%
associate-*l*99.6%
associate-*l*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in b around inf 59.5%
associate-/r*50.1%
Simplified50.1%
if -5.6e-307 < a < 2.14999999999999987e-212 or 1.20000000000000007e-46 < a < 2.2499999999999999e-12Initial program 69.5%
associate-+l-69.5%
*-commutative69.5%
associate-*r*78.9%
*-commutative78.9%
associate-+l-78.9%
associate-*l*79.0%
associate-*l*79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in x around inf 46.4%
times-frac49.4%
Simplified49.4%
if 2.14999999999999987e-212 < a < 1.20000000000000007e-46Initial program 82.5%
associate-+l-82.5%
*-commutative82.5%
associate-*r*82.6%
*-commutative82.6%
associate-+l-82.6%
associate-*l*82.5%
associate-*l*82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in b around inf 54.9%
associate-/r*58.7%
Simplified58.7%
associate-/l/54.9%
div-inv55.0%
*-commutative55.0%
Applied egg-rr55.0%
if 2.2499999999999999e-12 < a Initial program 77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
associate-*l*70.8%
associate-*l*77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in x around 0 74.0%
cancel-sign-sub-inv74.0%
metadata-eval74.0%
+-commutative74.0%
fma-define74.0%
associate-/l*78.6%
fma-define78.6%
times-frac78.9%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in c around 0 84.6%
Taylor expanded in a around inf 43.5%
*-commutative43.5%
associate-/l*56.0%
Simplified56.0%
Final simplification53.2%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (/ (* y x) (* c_m z)))))
(*
c_s
(if (<= a -5.5e-120)
(* -4.0 (* a (/ t c_m)))
(if (<= a -5.2e-206)
t_1
(if (<= a 1.3e-303)
(/ (/ b c_m) z)
(if (<= a 1.75e-177)
t_1
(if (<= a 3e-47)
(* b (/ 1.0 (* c_m z)))
(if (<= a 2.25e-12)
(* 9.0 (* (/ x c_m) (/ y z)))
(* -4.0 (* t (/ a c_m))))))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * ((y * x) / (c_m * z));
double tmp;
if (a <= -5.5e-120) {
tmp = -4.0 * (a * (t / c_m));
} else if (a <= -5.2e-206) {
tmp = t_1;
} else if (a <= 1.3e-303) {
tmp = (b / c_m) / z;
} else if (a <= 1.75e-177) {
tmp = t_1;
} else if (a <= 3e-47) {
tmp = b * (1.0 / (c_m * z));
} else if (a <= 2.25e-12) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * ((y * x) / (c_m * z))
if (a <= (-5.5d-120)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (a <= (-5.2d-206)) then
tmp = t_1
else if (a <= 1.3d-303) then
tmp = (b / c_m) / z
else if (a <= 1.75d-177) then
tmp = t_1
else if (a <= 3d-47) then
tmp = b * (1.0d0 / (c_m * z))
else if (a <= 2.25d-12) then
tmp = 9.0d0 * ((x / c_m) * (y / z))
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * ((y * x) / (c_m * z));
double tmp;
if (a <= -5.5e-120) {
tmp = -4.0 * (a * (t / c_m));
} else if (a <= -5.2e-206) {
tmp = t_1;
} else if (a <= 1.3e-303) {
tmp = (b / c_m) / z;
} else if (a <= 1.75e-177) {
tmp = t_1;
} else if (a <= 3e-47) {
tmp = b * (1.0 / (c_m * z));
} else if (a <= 2.25e-12) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 9.0 * ((y * x) / (c_m * z)) tmp = 0 if a <= -5.5e-120: tmp = -4.0 * (a * (t / c_m)) elif a <= -5.2e-206: tmp = t_1 elif a <= 1.3e-303: tmp = (b / c_m) / z elif a <= 1.75e-177: tmp = t_1 elif a <= 3e-47: tmp = b * (1.0 / (c_m * z)) elif a <= 2.25e-12: tmp = 9.0 * ((x / c_m) * (y / z)) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(9.0 * Float64(Float64(y * x) / Float64(c_m * z))) tmp = 0.0 if (a <= -5.5e-120) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (a <= -5.2e-206) tmp = t_1; elseif (a <= 1.3e-303) tmp = Float64(Float64(b / c_m) / z); elseif (a <= 1.75e-177) tmp = t_1; elseif (a <= 3e-47) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); elseif (a <= 2.25e-12) tmp = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 9.0 * ((y * x) / (c_m * z));
tmp = 0.0;
if (a <= -5.5e-120)
tmp = -4.0 * (a * (t / c_m));
elseif (a <= -5.2e-206)
tmp = t_1;
elseif (a <= 1.3e-303)
tmp = (b / c_m) / z;
elseif (a <= 1.75e-177)
tmp = t_1;
elseif (a <= 3e-47)
tmp = b * (1.0 / (c_m * z));
elseif (a <= 2.25e-12)
tmp = 9.0 * ((x / c_m) * (y / z));
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(9.0 * N[(N[(y * x), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -5.5e-120], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.2e-206], t$95$1, If[LessEqual[a, 1.3e-303], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 1.75e-177], t$95$1, If[LessEqual[a, 3e-47], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.25e-12], N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]), $MachinePrecision]]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{y \cdot x}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{-120}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;a \leq -5.2 \cdot 10^{-206}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-303}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-47}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-12}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if a < -5.5000000000000001e-120Initial program 78.2%
associate-+l-78.2%
*-commutative78.2%
associate-*r*76.2%
*-commutative76.2%
associate-+l-76.2%
associate-*l*76.2%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
associate-/l*54.7%
Simplified54.7%
if -5.5000000000000001e-120 < a < -5.2000000000000001e-206 or 1.30000000000000002e-303 < a < 1.7500000000000001e-177Initial program 82.9%
associate-+l-82.9%
*-commutative82.9%
associate-*r*92.5%
*-commutative92.5%
associate-+l-92.5%
associate-*l*92.6%
associate-*l*92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in x around inf 54.9%
if -5.2000000000000001e-206 < a < 1.30000000000000002e-303Initial program 85.7%
associate-+l-85.7%
*-commutative85.7%
associate-*r*99.7%
*-commutative99.7%
associate-+l-99.7%
associate-*l*99.7%
associate-*l*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in b around inf 61.5%
associate-/r*52.5%
Simplified52.5%
if 1.7500000000000001e-177 < a < 3.00000000000000017e-47Initial program 79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*80.0%
*-commutative80.0%
associate-+l-80.0%
associate-*l*79.9%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in b around inf 51.6%
associate-/r*56.0%
Simplified56.0%
associate-/l/51.6%
div-inv51.8%
*-commutative51.8%
Applied egg-rr51.8%
if 3.00000000000000017e-47 < a < 2.2499999999999999e-12Initial program 56.4%
associate-+l-56.4%
*-commutative56.4%
associate-*r*56.4%
*-commutative56.4%
associate-+l-56.4%
associate-*l*56.4%
associate-*l*56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in x around inf 23.5%
times-frac32.1%
Simplified32.1%
if 2.2499999999999999e-12 < a Initial program 77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
associate-*l*70.8%
associate-*l*77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in x around 0 74.0%
cancel-sign-sub-inv74.0%
metadata-eval74.0%
+-commutative74.0%
fma-define74.0%
associate-/l*78.6%
fma-define78.6%
times-frac78.9%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in c around 0 84.6%
Taylor expanded in a around inf 43.5%
*-commutative43.5%
associate-/l*56.0%
Simplified56.0%
Final simplification53.6%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -9.2e-120)
(* -4.0 (* a (/ t c_m)))
(if (<= a -6.3e-220)
(* 9.0 (/ (* y x) (* c_m z)))
(if (<= a -6e-307)
(/ (/ b c_m) z)
(if (<= a 5.4e-182)
(* (/ y c_m) (/ (* x 9.0) z))
(if (<= a 1.5e-47)
(* b (/ 1.0 (* c_m z)))
(if (<= a 2.4e-12)
(* 9.0 (* (/ x c_m) (/ y z)))
(* -4.0 (* t (/ a c_m)))))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= -9.2e-120) {
tmp = -4.0 * (a * (t / c_m));
} else if (a <= -6.3e-220) {
tmp = 9.0 * ((y * x) / (c_m * z));
} else if (a <= -6e-307) {
tmp = (b / c_m) / z;
} else if (a <= 5.4e-182) {
tmp = (y / c_m) * ((x * 9.0) / z);
} else if (a <= 1.5e-47) {
tmp = b * (1.0 / (c_m * z));
} else if (a <= 2.4e-12) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (a <= (-9.2d-120)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (a <= (-6.3d-220)) then
tmp = 9.0d0 * ((y * x) / (c_m * z))
else if (a <= (-6d-307)) then
tmp = (b / c_m) / z
else if (a <= 5.4d-182) then
tmp = (y / c_m) * ((x * 9.0d0) / z)
else if (a <= 1.5d-47) then
tmp = b * (1.0d0 / (c_m * z))
else if (a <= 2.4d-12) then
tmp = 9.0d0 * ((x / c_m) * (y / z))
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (a <= -9.2e-120) {
tmp = -4.0 * (a * (t / c_m));
} else if (a <= -6.3e-220) {
tmp = 9.0 * ((y * x) / (c_m * z));
} else if (a <= -6e-307) {
tmp = (b / c_m) / z;
} else if (a <= 5.4e-182) {
tmp = (y / c_m) * ((x * 9.0) / z);
} else if (a <= 1.5e-47) {
tmp = b * (1.0 / (c_m * z));
} else if (a <= 2.4e-12) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if a <= -9.2e-120: tmp = -4.0 * (a * (t / c_m)) elif a <= -6.3e-220: tmp = 9.0 * ((y * x) / (c_m * z)) elif a <= -6e-307: tmp = (b / c_m) / z elif a <= 5.4e-182: tmp = (y / c_m) * ((x * 9.0) / z) elif a <= 1.5e-47: tmp = b * (1.0 / (c_m * z)) elif a <= 2.4e-12: tmp = 9.0 * ((x / c_m) * (y / z)) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (a <= -9.2e-120) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (a <= -6.3e-220) tmp = Float64(9.0 * Float64(Float64(y * x) / Float64(c_m * z))); elseif (a <= -6e-307) tmp = Float64(Float64(b / c_m) / z); elseif (a <= 5.4e-182) tmp = Float64(Float64(y / c_m) * Float64(Float64(x * 9.0) / z)); elseif (a <= 1.5e-47) tmp = Float64(b * Float64(1.0 / Float64(c_m * z))); elseif (a <= 2.4e-12) tmp = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -9.2e-120)
tmp = -4.0 * (a * (t / c_m));
elseif (a <= -6.3e-220)
tmp = 9.0 * ((y * x) / (c_m * z));
elseif (a <= -6e-307)
tmp = (b / c_m) / z;
elseif (a <= 5.4e-182)
tmp = (y / c_m) * ((x * 9.0) / z);
elseif (a <= 1.5e-47)
tmp = b * (1.0 / (c_m * z));
elseif (a <= 2.4e-12)
tmp = 9.0 * ((x / c_m) * (y / z));
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -9.2e-120], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -6.3e-220], N[(9.0 * N[(N[(y * x), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -6e-307], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 5.4e-182], N[(N[(y / c$95$m), $MachinePrecision] * N[(N[(x * 9.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e-47], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e-12], N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{-120}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;a \leq -6.3 \cdot 10^{-220}:\\
\;\;\;\;9 \cdot \frac{y \cdot x}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq -6 \cdot 10^{-307}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{-182}:\\
\;\;\;\;\frac{y}{c\_m} \cdot \frac{x \cdot 9}{z}\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-47}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-12}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < -9.19999999999999946e-120Initial program 78.2%
associate-+l-78.2%
*-commutative78.2%
associate-*r*76.2%
*-commutative76.2%
associate-+l-76.2%
associate-*l*76.2%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
associate-/l*54.7%
Simplified54.7%
if -9.19999999999999946e-120 < a < -6.30000000000000017e-220Initial program 89.5%
associate-+l-89.5%
*-commutative89.5%
associate-*r*94.5%
*-commutative94.5%
associate-+l-94.5%
associate-*l*94.5%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x around inf 48.5%
if -6.30000000000000017e-220 < a < -5.9999999999999999e-307Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*99.6%
*-commutative99.6%
associate-+l-99.6%
associate-*l*99.6%
associate-*l*99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in b around inf 60.4%
associate-/r*55.1%
Simplified55.1%
if -5.9999999999999999e-307 < a < 5.39999999999999999e-182Initial program 79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*91.9%
*-commutative91.9%
associate-+l-91.9%
associate-*l*92.0%
associate-*l*92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in x around inf 57.3%
associate-*r/57.3%
associate-*r*57.1%
*-commutative57.1%
Simplified57.1%
times-frac53.5%
*-commutative53.5%
Applied egg-rr53.5%
if 5.39999999999999999e-182 < a < 1.50000000000000008e-47Initial program 79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*80.0%
*-commutative80.0%
associate-+l-80.0%
associate-*l*79.9%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in b around inf 51.6%
associate-/r*56.0%
Simplified56.0%
associate-/l/51.6%
div-inv51.8%
*-commutative51.8%
Applied egg-rr51.8%
if 1.50000000000000008e-47 < a < 2.39999999999999987e-12Initial program 56.4%
associate-+l-56.4%
*-commutative56.4%
associate-*r*56.4%
*-commutative56.4%
associate-+l-56.4%
associate-*l*56.4%
associate-*l*56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in x around inf 23.5%
times-frac32.1%
Simplified32.1%
if 2.39999999999999987e-12 < a Initial program 77.5%
associate-+l-77.5%
*-commutative77.5%
associate-*r*70.8%
*-commutative70.8%
associate-+l-70.8%
associate-*l*70.8%
associate-*l*77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in x around 0 74.0%
cancel-sign-sub-inv74.0%
metadata-eval74.0%
+-commutative74.0%
fma-define74.0%
associate-/l*78.6%
fma-define78.6%
times-frac78.9%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in c around 0 84.6%
Taylor expanded in a around inf 43.5%
*-commutative43.5%
associate-/l*56.0%
Simplified56.0%
Final simplification53.2%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= (* x 9.0) -1e+141)
(and (not (<= (* x 9.0) -1e+59))
(or (<= (* x 9.0) -1e+25)
(not (<= (* x 9.0) 5000000000000.0)))))
(/ (+ b (* y (* x 9.0))) (* c_m z))
(/ (+ (* -4.0 (* a t)) (/ b z)) c_m))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (((x * 9.0) <= -1e+141) || (!((x * 9.0) <= -1e+59) && (((x * 9.0) <= -1e+25) || !((x * 9.0) <= 5000000000000.0)))) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else {
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 * 9.0d0) <= (-1d+141)) .or. (.not. ((x * 9.0d0) <= (-1d+59))) .and. ((x * 9.0d0) <= (-1d+25)) .or. (.not. ((x * 9.0d0) <= 5000000000000.0d0))) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 * 9.0) <= -1e+141) || (!((x * 9.0) <= -1e+59) && (((x * 9.0) <= -1e+25) || !((x * 9.0) <= 5000000000000.0)))) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else {
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if ((x * 9.0) <= -1e+141) or (not ((x * 9.0) <= -1e+59) and (((x * 9.0) <= -1e+25) or not ((x * 9.0) <= 5000000000000.0))): tmp = (b + (y * (x * 9.0))) / (c_m * z) else: tmp = ((-4.0 * (a * t)) + (b / z)) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((Float64(x * 9.0) <= -1e+141) || (!(Float64(x * 9.0) <= -1e+59) && ((Float64(x * 9.0) <= -1e+25) || !(Float64(x * 9.0) <= 5000000000000.0)))) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (((x * 9.0) <= -1e+141) || (~(((x * 9.0) <= -1e+59)) && (((x * 9.0) <= -1e+25) || ~(((x * 9.0) <= 5000000000000.0)))))
tmp = (b + (y * (x * 9.0))) / (c_m * z);
else
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+141], And[N[Not[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+59]], $MachinePrecision], Or[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+25], N[Not[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0]], $MachinePrecision]]]], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+141} \lor \neg \left(x \cdot 9 \leq -1 \cdot 10^{+59}\right) \land \left(x \cdot 9 \leq -1 \cdot 10^{+25} \lor \neg \left(x \cdot 9 \leq 5000000000000\right)\right):\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
\end{array}
\end{array}
if (*.f64 x 9) < -1.00000000000000002e141 or -9.99999999999999972e58 < (*.f64 x 9) < -1.00000000000000009e25 or 5e12 < (*.f64 x 9) Initial program 71.9%
associate-+l-71.9%
*-commutative71.9%
associate-*r*71.8%
*-commutative71.8%
associate-+l-71.8%
associate-*l*71.9%
associate-*l*74.8%
*-commutative74.8%
Simplified74.8%
Taylor expanded in x around inf 62.2%
associate-*r*62.1%
Simplified62.1%
if -1.00000000000000002e141 < (*.f64 x 9) < -9.99999999999999972e58 or -1.00000000000000009e25 < (*.f64 x 9) < 5e12Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*83.9%
*-commutative83.9%
associate-+l-83.9%
associate-*l*83.9%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-define83.1%
associate-/l*81.1%
fma-define81.1%
times-frac77.9%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 87.0%
Taylor expanded in c around 0 91.0%
Taylor expanded in x around 0 78.2%
Final simplification71.6%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (* y (* x 9.0))) (* c_m z)))
(t_2 (/ (+ (* -4.0 (* a t)) (/ b z)) c_m)))
(*
c_s
(if (<= (* x 9.0) -1e+141)
t_1
(if (<= (* x 9.0) -1e+59)
t_2
(if (<= (* x 9.0) -1e+25)
t_1
(if (<= (* x 9.0) 5000000000000.0)
t_2
(/ (/ (+ b (* 9.0 (* y x))) z) c_m))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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))) / (c_m * z);
double t_2 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+59) {
tmp = t_2;
} else if ((x * 9.0) <= -1e+25) {
tmp = t_1;
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_2;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b + (y * (x * 9.0d0))) / (c_m * z)
t_2 = (((-4.0d0) * (a * t)) + (b / z)) / c_m
if ((x * 9.0d0) <= (-1d+141)) then
tmp = t_1
else if ((x * 9.0d0) <= (-1d+59)) then
tmp = t_2
else if ((x * 9.0d0) <= (-1d+25)) then
tmp = t_1
else if ((x * 9.0d0) <= 5000000000000.0d0) then
tmp = t_2
else
tmp = ((b + (9.0d0 * (y * x))) / z) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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))) / (c_m * z);
double t_2 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+59) {
tmp = t_2;
} else if ((x * 9.0) <= -1e+25) {
tmp = t_1;
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_2;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + (y * (x * 9.0))) / (c_m * z) t_2 = ((-4.0 * (a * t)) + (b / z)) / c_m tmp = 0 if (x * 9.0) <= -1e+141: tmp = t_1 elif (x * 9.0) <= -1e+59: tmp = t_2 elif (x * 9.0) <= -1e+25: tmp = t_1 elif (x * 9.0) <= 5000000000000.0: tmp = t_2 else: tmp = ((b + (9.0 * (y * x))) / z) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)) t_2 = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m) tmp = 0.0 if (Float64(x * 9.0) <= -1e+141) tmp = t_1; elseif (Float64(x * 9.0) <= -1e+59) tmp = t_2; elseif (Float64(x * 9.0) <= -1e+25) tmp = t_1; elseif (Float64(x * 9.0) <= 5000000000000.0) tmp = t_2; else tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(y * x))) / z) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + (y * (x * 9.0))) / (c_m * z);
t_2 = ((-4.0 * (a * t)) + (b / z)) / c_m;
tmp = 0.0;
if ((x * 9.0) <= -1e+141)
tmp = t_1;
elseif ((x * 9.0) <= -1e+59)
tmp = t_2;
elseif ((x * 9.0) <= -1e+25)
tmp = t_1;
elseif ((x * 9.0) <= 5000000000000.0)
tmp = t_2;
else
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]}, N[(c$95$s * If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+141], t$95$1, If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+59], t$95$2, If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+25], t$95$1, If[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0], t$95$2, N[(N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
t_2 := \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot 9 \leq 5000000000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + 9 \cdot \left(y \cdot x\right)}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x 9) < -1.00000000000000002e141 or -9.99999999999999972e58 < (*.f64 x 9) < -1.00000000000000009e25Initial program 67.3%
associate-+l-67.3%
*-commutative67.3%
associate-*r*71.8%
*-commutative71.8%
associate-+l-71.8%
associate-*l*71.8%
associate-*l*69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in x around inf 66.0%
associate-*r*66.0%
Simplified66.0%
if -1.00000000000000002e141 < (*.f64 x 9) < -9.99999999999999972e58 or -1.00000000000000009e25 < (*.f64 x 9) < 5e12Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*83.9%
*-commutative83.9%
associate-+l-83.9%
associate-*l*83.9%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-define83.1%
associate-/l*81.1%
fma-define81.1%
times-frac77.9%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 87.0%
Taylor expanded in c around 0 91.0%
Taylor expanded in x around 0 78.2%
if 5e12 < (*.f64 x 9) Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around 0 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
+-commutative82.7%
fma-define82.7%
associate-/l*79.6%
fma-define79.6%
times-frac82.6%
associate-/r*83.5%
Simplified83.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in c around 0 88.8%
Taylor expanded in z around 0 60.6%
Final simplification71.9%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (* -4.0 (* a t)) (/ b z)) c_m)))
(*
c_s
(if (<= (* x 9.0) -1e+141)
(/ (+ (/ b c_m) (* 9.0 (/ (* y x) c_m))) z)
(if (<= (* x 9.0) -1e+59)
t_1
(if (<= (* x 9.0) -1e+25)
(/ (+ b (* y (* x 9.0))) (* c_m z))
(if (<= (* x 9.0) 5000000000000.0)
t_1
(/ (/ (+ b (* 9.0 (* y x))) z) c_m))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = ((b / c_m) + (9.0 * ((y * x) / c_m))) / z;
} else if ((x * 9.0) <= -1e+59) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_1;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 = (((-4.0d0) * (a * t)) + (b / z)) / c_m
if ((x * 9.0d0) <= (-1d+141)) then
tmp = ((b / c_m) + (9.0d0 * ((y * x) / c_m))) / z
else if ((x * 9.0d0) <= (-1d+59)) then
tmp = t_1
else if ((x * 9.0d0) <= (-1d+25)) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else if ((x * 9.0d0) <= 5000000000000.0d0) then
tmp = t_1
else
tmp = ((b + (9.0d0 * (y * x))) / z) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = ((b / c_m) + (9.0 * ((y * x) / c_m))) / z;
} else if ((x * 9.0) <= -1e+59) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_1;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m tmp = 0 if (x * 9.0) <= -1e+141: tmp = ((b / c_m) + (9.0 * ((y * x) / c_m))) / z elif (x * 9.0) <= -1e+59: tmp = t_1 elif (x * 9.0) <= -1e+25: tmp = (b + (y * (x * 9.0))) / (c_m * z) elif (x * 9.0) <= 5000000000000.0: tmp = t_1 else: tmp = ((b + (9.0 * (y * x))) / z) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m) tmp = 0.0 if (Float64(x * 9.0) <= -1e+141) tmp = Float64(Float64(Float64(b / c_m) + Float64(9.0 * Float64(Float64(y * x) / c_m))) / z); elseif (Float64(x * 9.0) <= -1e+59) tmp = t_1; elseif (Float64(x * 9.0) <= -1e+25) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); elseif (Float64(x * 9.0) <= 5000000000000.0) tmp = t_1; else tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(y * x))) / z) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m;
tmp = 0.0;
if ((x * 9.0) <= -1e+141)
tmp = ((b / c_m) + (9.0 * ((y * x) / c_m))) / z;
elseif ((x * 9.0) <= -1e+59)
tmp = t_1;
elseif ((x * 9.0) <= -1e+25)
tmp = (b + (y * (x * 9.0))) / (c_m * z);
elseif ((x * 9.0) <= 5000000000000.0)
tmp = t_1;
else
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]}, N[(c$95$s * If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+141], N[(N[(N[(b / c$95$m), $MachinePrecision] + N[(9.0 * N[(N[(y * x), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+59], t$95$1, If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+25], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0], t$95$1, N[(N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;\frac{\frac{b}{c\_m} + 9 \cdot \frac{y \cdot x}{c\_m}}{z}\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+25}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{elif}\;x \cdot 9 \leq 5000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + 9 \cdot \left(y \cdot x\right)}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x 9) < -1.00000000000000002e141Initial program 69.4%
associate-+l-69.4%
*-commutative69.4%
associate-*r*75.3%
*-commutative75.3%
associate-+l-75.3%
associate-*l*75.3%
associate-*l*75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x around 0 75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
+-commutative75.4%
fma-define75.4%
associate-/l*75.5%
fma-define75.5%
times-frac75.6%
associate-/r*78.5%
Simplified78.5%
Taylor expanded in c around 0 84.6%
Taylor expanded in z around 0 70.4%
if -1.00000000000000002e141 < (*.f64 x 9) < -9.99999999999999972e58 or -1.00000000000000009e25 < (*.f64 x 9) < 5e12Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*83.9%
*-commutative83.9%
associate-+l-83.9%
associate-*l*83.9%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-define83.1%
associate-/l*81.1%
fma-define81.1%
times-frac77.9%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 87.0%
Taylor expanded in c around 0 91.0%
Taylor expanded in x around 0 78.2%
if -9.99999999999999972e58 < (*.f64 x 9) < -1.00000000000000009e25Initial program 60.6%
associate-+l-60.6%
*-commutative60.6%
associate-*r*60.6%
*-commutative60.6%
associate-+l-60.6%
associate-*l*60.6%
associate-*l*50.6%
*-commutative50.6%
Simplified50.6%
Taylor expanded in x around inf 60.6%
associate-*r*60.6%
Simplified60.6%
if 5e12 < (*.f64 x 9) Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around 0 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
+-commutative82.7%
fma-define82.7%
associate-/l*79.6%
fma-define79.6%
times-frac82.6%
associate-/r*83.5%
Simplified83.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in c around 0 88.8%
Taylor expanded in z around 0 60.6%
Final simplification72.2%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* a t))) (t_2 (/ (+ t_1 (/ b z)) c_m)))
(*
c_s
(if (<= (* x 9.0) -1e+141)
(/ (+ t_1 (* 9.0 (/ (* y x) z))) c_m)
(if (<= (* x 9.0) -1e+59)
t_2
(if (<= (* x 9.0) -1e+25)
(/ (+ b (* y (* x 9.0))) (* c_m z))
(if (<= (* x 9.0) 5000000000000.0)
t_2
(/ (/ (+ b (* 9.0 (* y x))) z) c_m))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (a * t);
double t_2 = (t_1 + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c_m;
} else if ((x * 9.0) <= -1e+59) {
tmp = t_2;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_2;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (a * t)
t_2 = (t_1 + (b / z)) / c_m
if ((x * 9.0d0) <= (-1d+141)) then
tmp = (t_1 + (9.0d0 * ((y * x) / z))) / c_m
else if ((x * 9.0d0) <= (-1d+59)) then
tmp = t_2
else if ((x * 9.0d0) <= (-1d+25)) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else if ((x * 9.0d0) <= 5000000000000.0d0) then
tmp = t_2
else
tmp = ((b + (9.0d0 * (y * x))) / z) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 = -4.0 * (a * t);
double t_2 = (t_1 + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = (t_1 + (9.0 * ((y * x) / z))) / c_m;
} else if ((x * 9.0) <= -1e+59) {
tmp = t_2;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_2;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (a * t) t_2 = (t_1 + (b / z)) / c_m tmp = 0 if (x * 9.0) <= -1e+141: tmp = (t_1 + (9.0 * ((y * x) / z))) / c_m elif (x * 9.0) <= -1e+59: tmp = t_2 elif (x * 9.0) <= -1e+25: tmp = (b + (y * (x * 9.0))) / (c_m * z) elif (x * 9.0) <= 5000000000000.0: tmp = t_2 else: tmp = ((b + (9.0 * (y * x))) / z) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(a * t)) t_2 = Float64(Float64(t_1 + Float64(b / z)) / c_m) tmp = 0.0 if (Float64(x * 9.0) <= -1e+141) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(y * x) / z))) / c_m); elseif (Float64(x * 9.0) <= -1e+59) tmp = t_2; elseif (Float64(x * 9.0) <= -1e+25) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); elseif (Float64(x * 9.0) <= 5000000000000.0) tmp = t_2; else tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(y * x))) / z) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (a * t);
t_2 = (t_1 + (b / z)) / c_m;
tmp = 0.0;
if ((x * 9.0) <= -1e+141)
tmp = (t_1 + (9.0 * ((y * x) / z))) / c_m;
elseif ((x * 9.0) <= -1e+59)
tmp = t_2;
elseif ((x * 9.0) <= -1e+25)
tmp = (b + (y * (x * 9.0))) / (c_m * z);
elseif ((x * 9.0) <= 5000000000000.0)
tmp = t_2;
else
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]}, N[(c$95$s * If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+141], N[(N[(t$95$1 + N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+59], t$95$2, If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+25], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0], t$95$2, N[(N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
t_2 := \frac{t\_1 + \frac{b}{z}}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;\frac{t\_1 + 9 \cdot \frac{y \cdot x}{z}}{c\_m}\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+25}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{elif}\;x \cdot 9 \leq 5000000000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + 9 \cdot \left(y \cdot x\right)}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x 9) < -1.00000000000000002e141Initial program 69.4%
associate-+l-69.4%
*-commutative69.4%
associate-*r*75.3%
*-commutative75.3%
associate-+l-75.3%
associate-*l*75.3%
associate-*l*75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x around 0 75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
+-commutative75.4%
fma-define75.4%
associate-/l*75.5%
fma-define75.5%
times-frac75.6%
associate-/r*78.5%
Simplified78.5%
Taylor expanded in c around 0 84.6%
Taylor expanded in c around 0 87.7%
Taylor expanded in b around 0 82.1%
if -1.00000000000000002e141 < (*.f64 x 9) < -9.99999999999999972e58 or -1.00000000000000009e25 < (*.f64 x 9) < 5e12Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*83.9%
*-commutative83.9%
associate-+l-83.9%
associate-*l*83.9%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-define83.1%
associate-/l*81.1%
fma-define81.1%
times-frac77.9%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 87.0%
Taylor expanded in c around 0 91.0%
Taylor expanded in x around 0 78.2%
if -9.99999999999999972e58 < (*.f64 x 9) < -1.00000000000000009e25Initial program 60.6%
associate-+l-60.6%
*-commutative60.6%
associate-*r*60.6%
*-commutative60.6%
associate-+l-60.6%
associate-*l*60.6%
associate-*l*50.6%
*-commutative50.6%
Simplified50.6%
Taylor expanded in x around inf 60.6%
associate-*r*60.6%
Simplified60.6%
if 5e12 < (*.f64 x 9) Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around 0 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
+-commutative82.7%
fma-define82.7%
associate-/l*79.6%
fma-define79.6%
times-frac82.6%
associate-/r*83.5%
Simplified83.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in c around 0 88.8%
Taylor expanded in z around 0 60.6%
Final simplification73.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (* -4.0 (* a t)) (/ b z)) c_m)))
(*
c_s
(if (<= (* x 9.0) -1e+141)
(+ (* -4.0 (/ (* a t) c_m)) (* 9.0 (/ (* y x) (* c_m z))))
(if (<= (* x 9.0) -1e+59)
t_1
(if (<= (* x 9.0) -1e+25)
(/ (+ b (* y (* x 9.0))) (* c_m z))
(if (<= (* x 9.0) 5000000000000.0)
t_1
(/ (/ (+ b (* 9.0 (* y x))) z) c_m))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = (-4.0 * ((a * t) / c_m)) + (9.0 * ((y * x) / (c_m * z)));
} else if ((x * 9.0) <= -1e+59) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_1;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 = (((-4.0d0) * (a * t)) + (b / z)) / c_m
if ((x * 9.0d0) <= (-1d+141)) then
tmp = ((-4.0d0) * ((a * t) / c_m)) + (9.0d0 * ((y * x) / (c_m * z)))
else if ((x * 9.0d0) <= (-1d+59)) then
tmp = t_1
else if ((x * 9.0d0) <= (-1d+25)) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else if ((x * 9.0d0) <= 5000000000000.0d0) then
tmp = t_1
else
tmp = ((b + (9.0d0 * (y * x))) / z) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = (-4.0 * ((a * t) / c_m)) + (9.0 * ((y * x) / (c_m * z)));
} else if ((x * 9.0) <= -1e+59) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_1;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m tmp = 0 if (x * 9.0) <= -1e+141: tmp = (-4.0 * ((a * t) / c_m)) + (9.0 * ((y * x) / (c_m * z))) elif (x * 9.0) <= -1e+59: tmp = t_1 elif (x * 9.0) <= -1e+25: tmp = (b + (y * (x * 9.0))) / (c_m * z) elif (x * 9.0) <= 5000000000000.0: tmp = t_1 else: tmp = ((b + (9.0 * (y * x))) / z) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m) tmp = 0.0 if (Float64(x * 9.0) <= -1e+141) tmp = Float64(Float64(-4.0 * Float64(Float64(a * t) / c_m)) + Float64(9.0 * Float64(Float64(y * x) / Float64(c_m * z)))); elseif (Float64(x * 9.0) <= -1e+59) tmp = t_1; elseif (Float64(x * 9.0) <= -1e+25) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); elseif (Float64(x * 9.0) <= 5000000000000.0) tmp = t_1; else tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(y * x))) / z) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m;
tmp = 0.0;
if ((x * 9.0) <= -1e+141)
tmp = (-4.0 * ((a * t) / c_m)) + (9.0 * ((y * x) / (c_m * z)));
elseif ((x * 9.0) <= -1e+59)
tmp = t_1;
elseif ((x * 9.0) <= -1e+25)
tmp = (b + (y * (x * 9.0))) / (c_m * z);
elseif ((x * 9.0) <= 5000000000000.0)
tmp = t_1;
else
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]}, N[(c$95$s * If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+141], N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(y * x), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+59], t$95$1, If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+25], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0], t$95$1, N[(N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c\_m} + 9 \cdot \frac{y \cdot x}{c\_m \cdot z}\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+25}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{elif}\;x \cdot 9 \leq 5000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + 9 \cdot \left(y \cdot x\right)}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x 9) < -1.00000000000000002e141Initial program 69.4%
associate-+l-69.4%
*-commutative69.4%
associate-*r*75.3%
*-commutative75.3%
associate-+l-75.3%
associate-*l*75.3%
associate-*l*75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in b around 0 66.5%
Taylor expanded in x around 0 79.0%
if -1.00000000000000002e141 < (*.f64 x 9) < -9.99999999999999972e58 or -1.00000000000000009e25 < (*.f64 x 9) < 5e12Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*83.9%
*-commutative83.9%
associate-+l-83.9%
associate-*l*83.9%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-define83.1%
associate-/l*81.1%
fma-define81.1%
times-frac77.9%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 87.0%
Taylor expanded in c around 0 91.0%
Taylor expanded in x around 0 78.2%
if -9.99999999999999972e58 < (*.f64 x 9) < -1.00000000000000009e25Initial program 60.6%
associate-+l-60.6%
*-commutative60.6%
associate-*r*60.6%
*-commutative60.6%
associate-+l-60.6%
associate-*l*60.6%
associate-*l*50.6%
*-commutative50.6%
Simplified50.6%
Taylor expanded in x around inf 60.6%
associate-*r*60.6%
Simplified60.6%
if 5e12 < (*.f64 x 9) Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around 0 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
+-commutative82.7%
fma-define82.7%
associate-/l*79.6%
fma-define79.6%
times-frac82.6%
associate-/r*83.5%
Simplified83.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in c around 0 88.8%
Taylor expanded in z around 0 60.6%
Final simplification73.3%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (* -4.0 (* a t)) (/ b z)) c_m)))
(*
c_s
(if (<= (* x 9.0) -1e+141)
(- (/ (/ (* x (* y 9.0)) c_m) z) (* (* a (/ t c_m)) 4.0))
(if (<= (* x 9.0) -1e+59)
t_1
(if (<= (* x 9.0) -1e+25)
(/ (+ b (* y (* x 9.0))) (* c_m z))
(if (<= (* x 9.0) 5000000000000.0)
t_1
(/ (/ (+ b (* 9.0 (* y x))) z) c_m))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0);
} else if ((x * 9.0) <= -1e+59) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_1;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 = (((-4.0d0) * (a * t)) + (b / z)) / c_m
if ((x * 9.0d0) <= (-1d+141)) then
tmp = (((x * (y * 9.0d0)) / c_m) / z) - ((a * (t / c_m)) * 4.0d0)
else if ((x * 9.0d0) <= (-1d+59)) then
tmp = t_1
else if ((x * 9.0d0) <= (-1d+25)) then
tmp = (b + (y * (x * 9.0d0))) / (c_m * z)
else if ((x * 9.0d0) <= 5000000000000.0d0) then
tmp = t_1
else
tmp = ((b + (9.0d0 * (y * x))) / z) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 = ((-4.0 * (a * t)) + (b / z)) / c_m;
double tmp;
if ((x * 9.0) <= -1e+141) {
tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0);
} else if ((x * 9.0) <= -1e+59) {
tmp = t_1;
} else if ((x * 9.0) <= -1e+25) {
tmp = (b + (y * (x * 9.0))) / (c_m * z);
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = t_1;
} else {
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m tmp = 0 if (x * 9.0) <= -1e+141: tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0) elif (x * 9.0) <= -1e+59: tmp = t_1 elif (x * 9.0) <= -1e+25: tmp = (b + (y * (x * 9.0))) / (c_m * z) elif (x * 9.0) <= 5000000000000.0: tmp = t_1 else: tmp = ((b + (9.0 * (y * x))) / z) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m) tmp = 0.0 if (Float64(x * 9.0) <= -1e+141) tmp = Float64(Float64(Float64(Float64(x * Float64(y * 9.0)) / c_m) / z) - Float64(Float64(a * Float64(t / c_m)) * 4.0)); elseif (Float64(x * 9.0) <= -1e+59) tmp = t_1; elseif (Float64(x * 9.0) <= -1e+25) tmp = Float64(Float64(b + Float64(y * Float64(x * 9.0))) / Float64(c_m * z)); elseif (Float64(x * 9.0) <= 5000000000000.0) tmp = t_1; else tmp = Float64(Float64(Float64(b + Float64(9.0 * Float64(y * x))) / z) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((-4.0 * (a * t)) + (b / z)) / c_m;
tmp = 0.0;
if ((x * 9.0) <= -1e+141)
tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0);
elseif ((x * 9.0) <= -1e+59)
tmp = t_1;
elseif ((x * 9.0) <= -1e+25)
tmp = (b + (y * (x * 9.0))) / (c_m * z);
elseif ((x * 9.0) <= 5000000000000.0)
tmp = t_1;
else
tmp = ((b + (9.0 * (y * x))) / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]}, N[(c$95$s * If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+141], N[(N[(N[(N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] / z), $MachinePrecision] - N[(N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+59], t$95$1, If[LessEqual[N[(x * 9.0), $MachinePrecision], -1e+25], N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0], t$95$1, N[(N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -1 \cdot 10^{+141}:\\
\;\;\;\;\frac{\frac{x \cdot \left(y \cdot 9\right)}{c\_m}}{z} - \left(a \cdot \frac{t}{c\_m}\right) \cdot 4\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot 9 \leq -1 \cdot 10^{+25}:\\
\;\;\;\;\frac{b + y \cdot \left(x \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{elif}\;x \cdot 9 \leq 5000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + 9 \cdot \left(y \cdot x\right)}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 x 9) < -1.00000000000000002e141Initial program 69.4%
associate-+l-69.4%
*-commutative69.4%
associate-*r*75.3%
*-commutative75.3%
associate-+l-75.3%
associate-*l*75.3%
associate-*l*75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in b around 0 66.5%
div-sub60.2%
associate-*r/60.3%
frac-times57.4%
*-commutative57.4%
frac-times60.3%
associate-/l*55.3%
*-commutative55.3%
*-commutative55.3%
associate-*r*58.7%
associate-*r*58.7%
*-commutative58.7%
Applied egg-rr58.7%
associate-/l*61.6%
*-commutative61.6%
associate-*r/66.7%
associate-*r/66.6%
associate-/r*69.6%
*-commutative69.6%
associate-*r*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in z around 0 82.1%
associate-*r/82.2%
Simplified82.2%
if -1.00000000000000002e141 < (*.f64 x 9) < -9.99999999999999972e58 or -1.00000000000000009e25 < (*.f64 x 9) < 5e12Initial program 83.3%
associate-+l-83.3%
*-commutative83.3%
associate-*r*83.9%
*-commutative83.9%
associate-+l-83.9%
associate-*l*83.9%
associate-*l*85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-define83.1%
associate-/l*81.1%
fma-define81.1%
times-frac77.9%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 87.0%
Taylor expanded in c around 0 91.0%
Taylor expanded in x around 0 78.2%
if -9.99999999999999972e58 < (*.f64 x 9) < -1.00000000000000009e25Initial program 60.6%
associate-+l-60.6%
*-commutative60.6%
associate-*r*60.6%
*-commutative60.6%
associate-+l-60.6%
associate-*l*60.6%
associate-*l*50.6%
*-commutative50.6%
Simplified50.6%
Taylor expanded in x around inf 60.6%
associate-*r*60.6%
Simplified60.6%
if 5e12 < (*.f64 x 9) Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around 0 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
+-commutative82.7%
fma-define82.7%
associate-/l*79.6%
fma-define79.6%
times-frac82.6%
associate-/r*83.5%
Simplified83.5%
Taylor expanded in c around 0 83.7%
Taylor expanded in c around 0 88.8%
Taylor expanded in z around 0 60.6%
Final simplification73.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -1.95e+48)
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* y x) z)) (/ b z))) c_m)
(if (<= z 2e-153)
(/ (+ b (- (* x (* y 9.0)) (* (* z 4.0) (* a t)))) (* c_m z))
(/ (+ (* a (* -4.0 t)) (/ (- b (* y (* x -9.0))) z)) c_m)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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.95e+48) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m;
} else if (z <= 2e-153) {
tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (c_m * z);
} else {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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.95d+48)) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((y * x) / z)) + (b / z))) / c_m
else if (z <= 2d-153) then
tmp = (b + ((x * (y * 9.0d0)) - ((z * 4.0d0) * (a * t)))) / (c_m * z)
else
tmp = ((a * ((-4.0d0) * t)) + ((b - (y * (x * (-9.0d0)))) / z)) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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.95e+48) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m;
} else if (z <= 2e-153) {
tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (c_m * z);
} else {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -1.95e+48: tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m elif z <= 2e-153: tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (c_m * z) else: tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -1.95e+48) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + Float64(b / z))) / c_m); elseif (z <= 2e-153) tmp = Float64(Float64(b + Float64(Float64(x * Float64(y * 9.0)) - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(a * Float64(-4.0 * t)) + Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z)) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -1.95e+48)
tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m;
elseif (z <= 2e-153)
tmp = (b + ((x * (y * 9.0)) - ((z * 4.0) * (a * t)))) / (c_m * z);
else
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -1.95e+48], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[z, 2e-153], N[(N[(b + N[(N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+48}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{y \cdot x}{z} + \frac{b}{z}\right)}{c\_m}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-153}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(y \cdot 9\right) - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(-4 \cdot t\right) + \frac{b - y \cdot \left(x \cdot -9\right)}{z}}{c\_m}\\
\end{array}
\end{array}
if z < -1.95e48Initial program 61.0%
associate-+l-61.0%
*-commutative61.0%
associate-*r*62.5%
*-commutative62.5%
associate-+l-62.5%
associate-*l*62.5%
associate-*l*68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in x around 0 76.9%
cancel-sign-sub-inv76.9%
metadata-eval76.9%
+-commutative76.9%
fma-define76.9%
associate-/l*76.7%
fma-define76.7%
times-frac83.0%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in c around 0 87.2%
Taylor expanded in c around 0 87.3%
if -1.95e48 < z < 2.00000000000000008e-153Initial program 94.6%
associate-+l-94.6%
*-commutative94.6%
associate-*r*94.6%
*-commutative94.6%
associate-+l-94.6%
associate-*l*94.6%
associate-*l*93.7%
*-commutative93.7%
Simplified93.7%
if 2.00000000000000008e-153 < z Initial program 71.6%
associate-+l-71.6%
*-commutative71.6%
associate-*r*71.5%
*-commutative71.5%
associate-+l-71.5%
associate-*l*71.5%
associate-*l*74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in x around 0 82.9%
cancel-sign-sub-inv82.9%
metadata-eval82.9%
+-commutative82.9%
fma-define82.9%
associate-/l*80.7%
fma-define80.7%
times-frac82.5%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in c around 0 86.9%
Taylor expanded in c around 0 94.1%
Taylor expanded in z around -inf 94.2%
mul-1-neg94.2%
unsub-neg94.2%
*-commutative94.2%
associate-*l*94.2%
*-commutative94.2%
mul-1-neg94.2%
sub-neg94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
Simplified94.2%
Final simplification92.3%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -1.95e+48)
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* y x) z)) (/ b z))) c_m)
(if (<= z 1.9e-149)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))
(/ (+ (* a (* -4.0 t)) (/ (- b (* y (* x -9.0))) z)) c_m)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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.95e+48) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m;
} else if (z <= 1.9e-149) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
} else {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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.95d+48)) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((y * x) / z)) + (b / z))) / c_m
else if (z <= 1.9d-149) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c_m * z)
else
tmp = ((a * ((-4.0d0) * t)) + ((b - (y * (x * (-9.0d0)))) / z)) / c_m
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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.95e+48) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m;
} else if (z <= 1.9e-149) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
} else {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -1.95e+48: tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m elif z <= 1.9e-149: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z) else: tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -1.95e+48) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + Float64(b / z))) / c_m); elseif (z <= 1.9e-149) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(a * Float64(-4.0 * t)) + Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z)) / c_m); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -1.95e+48)
tmp = ((-4.0 * (a * t)) + ((9.0 * ((y * x) / z)) + (b / z))) / c_m;
elseif (z <= 1.9e-149)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
else
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -1.95e+48], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[z, 1.9e-149], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+48}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{y \cdot x}{z} + \frac{b}{z}\right)}{c\_m}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-149}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(-4 \cdot t\right) + \frac{b - y \cdot \left(x \cdot -9\right)}{z}}{c\_m}\\
\end{array}
\end{array}
if z < -1.95e48Initial program 61.0%
associate-+l-61.0%
*-commutative61.0%
associate-*r*62.5%
*-commutative62.5%
associate-+l-62.5%
associate-*l*62.5%
associate-*l*68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in x around 0 76.9%
cancel-sign-sub-inv76.9%
metadata-eval76.9%
+-commutative76.9%
fma-define76.9%
associate-/l*76.7%
fma-define76.7%
times-frac83.0%
associate-/r*81.3%
Simplified81.3%
Taylor expanded in c around 0 87.2%
Taylor expanded in c around 0 87.3%
if -1.95e48 < z < 1.90000000000000003e-149Initial program 94.6%
if 1.90000000000000003e-149 < z Initial program 71.6%
associate-+l-71.6%
*-commutative71.6%
associate-*r*71.5%
*-commutative71.5%
associate-+l-71.5%
associate-*l*71.5%
associate-*l*74.0%
*-commutative74.0%
Simplified74.0%
Taylor expanded in x around 0 82.9%
cancel-sign-sub-inv82.9%
metadata-eval82.9%
+-commutative82.9%
fma-define82.9%
associate-/l*80.7%
fma-define80.7%
times-frac82.5%
associate-/r*82.4%
Simplified82.4%
Taylor expanded in c around 0 86.9%
Taylor expanded in c around 0 94.1%
Taylor expanded in z around -inf 94.2%
mul-1-neg94.2%
unsub-neg94.2%
*-commutative94.2%
associate-*l*94.2%
*-commutative94.2%
mul-1-neg94.2%
sub-neg94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
Simplified94.2%
Final simplification92.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* t (/ a c_m)))))
(*
c_s
(if (<= t -1.95e+89)
t_1
(if (<= t -1.3e+74)
(/ (/ b c_m) z)
(if (or (<= t -4.8e-5) (not (<= t 0.215))) t_1 (/ b (* c_m z))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double tmp;
if (t <= -1.95e+89) {
tmp = t_1;
} else if (t <= -1.3e+74) {
tmp = (b / c_m) / z;
} else if ((t <= -4.8e-5) || !(t <= 0.215)) {
tmp = t_1;
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c_m))
if (t <= (-1.95d+89)) then
tmp = t_1
else if (t <= (-1.3d+74)) then
tmp = (b / c_m) / z
else if ((t <= (-4.8d-5)) .or. (.not. (t <= 0.215d0))) then
tmp = t_1
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double tmp;
if (t <= -1.95e+89) {
tmp = t_1;
} else if (t <= -1.3e+74) {
tmp = (b / c_m) / z;
} else if ((t <= -4.8e-5) || !(t <= 0.215)) {
tmp = t_1;
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (t * (a / c_m)) tmp = 0 if t <= -1.95e+89: tmp = t_1 elif t <= -1.3e+74: tmp = (b / c_m) / z elif (t <= -4.8e-5) or not (t <= 0.215): tmp = t_1 else: tmp = b / (c_m * z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(t * Float64(a / c_m))) tmp = 0.0 if (t <= -1.95e+89) tmp = t_1; elseif (t <= -1.3e+74) tmp = Float64(Float64(b / c_m) / z); elseif ((t <= -4.8e-5) || !(t <= 0.215)) tmp = t_1; 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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (t * (a / c_m));
tmp = 0.0;
if (t <= -1.95e+89)
tmp = t_1;
elseif (t <= -1.3e+74)
tmp = (b / c_m) / z;
elseif ((t <= -4.8e-5) || ~((t <= 0.215)))
tmp = t_1;
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -1.95e+89], t$95$1, If[LessEqual[t, -1.3e+74], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t, -4.8e-5], N[Not[LessEqual[t, 0.215]], $MachinePrecision]], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-5} \lor \neg \left(t \leq 0.215\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
\end{array}
if t < -1.95000000000000005e89 or -1.3e74 < t < -4.8000000000000001e-5 or 0.214999999999999997 < t Initial program 72.1%
associate-+l-72.1%
*-commutative72.1%
associate-*r*77.6%
*-commutative77.6%
associate-+l-77.6%
associate-*l*77.6%
associate-*l*76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in x around 0 78.7%
cancel-sign-sub-inv78.7%
metadata-eval78.7%
+-commutative78.7%
fma-define78.7%
associate-/l*76.4%
fma-define76.4%
times-frac74.0%
associate-/r*72.6%
Simplified72.6%
Taylor expanded in c around 0 77.4%
Taylor expanded in a around inf 55.8%
*-commutative55.8%
associate-/l*58.1%
Simplified58.1%
if -1.95000000000000005e89 < t < -1.3e74Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 35.0%
associate-/r*35.0%
Simplified35.0%
if -4.8000000000000001e-5 < t < 0.214999999999999997Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
associate-*r*80.0%
*-commutative80.0%
associate-+l-80.0%
associate-*l*80.0%
associate-*l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
Final simplification51.5%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.9e+89)
(* -4.0 (* a (/ t c_m)))
(if (<= t -2.15e+74)
(/ (/ b c_m) z)
(if (or (<= t -0.00032) (not (<= t 4.7)))
(* -4.0 (* t (/ a c_m)))
(/ b (* c_m z)))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.9e+89) {
tmp = -4.0 * (a * (t / c_m));
} else if (t <= -2.15e+74) {
tmp = (b / c_m) / z;
} else if ((t <= -0.00032) || !(t <= 4.7)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (t <= (-1.9d+89)) then
tmp = (-4.0d0) * (a * (t / c_m))
else if (t <= (-2.15d+74)) then
tmp = (b / c_m) / z
else if ((t <= (-0.00032d0)) .or. (.not. (t <= 4.7d0))) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.9e+89) {
tmp = -4.0 * (a * (t / c_m));
} else if (t <= -2.15e+74) {
tmp = (b / c_m) / z;
} else if ((t <= -0.00032) || !(t <= 4.7)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.9e+89: tmp = -4.0 * (a * (t / c_m)) elif t <= -2.15e+74: tmp = (b / c_m) / z elif (t <= -0.00032) or not (t <= 4.7): tmp = -4.0 * (t * (a / c_m)) else: tmp = b / (c_m * z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.9e+89) tmp = Float64(-4.0 * Float64(a * Float64(t / c_m))); elseif (t <= -2.15e+74) tmp = Float64(Float64(b / c_m) / z); elseif ((t <= -0.00032) || !(t <= 4.7)) 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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1.9e+89)
tmp = -4.0 * (a * (t / c_m));
elseif (t <= -2.15e+74)
tmp = (b / c_m) / z;
elseif ((t <= -0.00032) || ~((t <= 4.7)))
tmp = -4.0 * (t * (a / c_m));
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.9e+89], N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.15e+74], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[t, -0.00032], N[Not[LessEqual[t, 4.7]], $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+89}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;t \leq -2.15 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;t \leq -0.00032 \lor \neg \left(t \leq 4.7\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -1.90000000000000012e89Initial program 62.2%
associate-+l-62.2%
*-commutative62.2%
associate-*r*68.7%
*-commutative68.7%
associate-+l-68.7%
associate-*l*68.7%
associate-*l*68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in z around inf 60.6%
*-commutative60.6%
associate-/l*65.6%
Simplified65.6%
if -1.90000000000000012e89 < t < -2.15e74Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
associate-*r*100.0%
*-commutative100.0%
associate-+l-100.0%
associate-*l*100.0%
associate-*l*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 35.0%
associate-/r*35.0%
Simplified35.0%
if -2.15e74 < t < -3.20000000000000026e-4 or 4.70000000000000018 < t Initial program 77.9%
associate-+l-77.9%
*-commutative77.9%
associate-*r*82.8%
*-commutative82.8%
associate-+l-82.8%
associate-*l*82.8%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in x around 0 78.7%
cancel-sign-sub-inv78.7%
metadata-eval78.7%
+-commutative78.7%
fma-define78.7%
associate-/l*76.0%
fma-define76.0%
times-frac72.4%
associate-/r*70.1%
Simplified70.1%
Taylor expanded in c around 0 78.8%
Taylor expanded in a around inf 52.9%
*-commutative52.9%
associate-/l*55.4%
Simplified55.4%
if -3.20000000000000026e-4 < t < 4.70000000000000018Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
associate-*r*80.0%
*-commutative80.0%
associate-+l-80.0%
associate-*l*80.0%
associate-*l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in b around inf 45.2%
*-commutative45.2%
Simplified45.2%
Final simplification52.0%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 1.06e+61)
(/ (+ (* a (* -4.0 t)) (/ (- b (* y (* x -9.0))) z)) c_m)
(+
(* -4.0 (* t (/ a c_m)))
(/ (- (/ b c_m) (* (* x (/ y c_m)) -9.0)) z)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1.06e+61) {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
} else {
tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (c_m <= 1.06d+61) then
tmp = ((a * ((-4.0d0) * t)) + ((b - (y * (x * (-9.0d0)))) / z)) / c_m
else
tmp = ((-4.0d0) * (t * (a / c_m))) + (((b / c_m) - ((x * (y / c_m)) * (-9.0d0))) / z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1.06e+61) {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
} else {
tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if c_m <= 1.06e+61: tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m else: tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 1.06e+61) tmp = Float64(Float64(Float64(a * Float64(-4.0 * t)) + Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z)) / c_m); else tmp = Float64(Float64(-4.0 * Float64(t * Float64(a / c_m))) + Float64(Float64(Float64(b / c_m) - Float64(Float64(x * Float64(y / c_m)) * -9.0)) / z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (c_m <= 1.06e+61)
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
else
tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 1.06e+61], N[(N[(N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c$95$m), $MachinePrecision] - N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 1.06 \cdot 10^{+61}:\\
\;\;\;\;\frac{a \cdot \left(-4 \cdot t\right) + \frac{b - y \cdot \left(x \cdot -9\right)}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right) + \frac{\frac{b}{c\_m} - \left(x \cdot \frac{y}{c\_m}\right) \cdot -9}{z}\\
\end{array}
\end{array}
if c < 1.0599999999999999e61Initial program 82.4%
associate-+l-82.4%
*-commutative82.4%
associate-*r*82.3%
*-commutative82.3%
associate-+l-82.3%
associate-*l*82.3%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
+-commutative81.1%
fma-define81.1%
associate-/l*76.8%
fma-define76.8%
times-frac78.6%
associate-/r*78.6%
Simplified78.6%
Taylor expanded in c around 0 86.2%
Taylor expanded in c around 0 93.0%
Taylor expanded in z around -inf 93.6%
mul-1-neg93.6%
unsub-neg93.6%
*-commutative93.6%
associate-*l*93.6%
*-commutative93.6%
mul-1-neg93.6%
sub-neg93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*93.5%
Simplified93.5%
if 1.0599999999999999e61 < c Initial program 63.6%
associate-+l-63.6%
*-commutative63.6%
associate-*r*65.7%
*-commutative65.7%
associate-+l-65.7%
associate-*l*65.7%
associate-*l*67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in x around 0 79.4%
cancel-sign-sub-inv79.4%
metadata-eval79.4%
+-commutative79.4%
fma-define79.4%
associate-/l*86.7%
fma-define86.7%
times-frac77.2%
associate-/r*79.0%
Simplified79.0%
Taylor expanded in c around 0 75.5%
Taylor expanded in z around -inf 84.8%
mul-1-neg84.8%
unsub-neg84.8%
*-commutative84.8%
associate-/l*90.4%
mul-1-neg90.4%
unsub-neg90.4%
associate-/l*88.6%
Simplified88.6%
Final simplification92.5%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= (* x 9.0) -5e+175)
(* 9.0 (* (/ x c_m) (/ y z)))
(if (<= (* x 9.0) 5000000000000.0)
(/ (+ (* -4.0 (* a t)) (/ b z)) c_m)
(* 9.0 (* x (/ y (* c_m z))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((x * 9.0) <= -5e+175) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = ((-4.0 * (a * t)) + (b / z)) / 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.
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 * 9.0d0) <= (-5d+175)) then
tmp = 9.0d0 * ((x / c_m) * (y / z))
else if ((x * 9.0d0) <= 5000000000000.0d0) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / 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;
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 * 9.0) <= -5e+175) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else if ((x * 9.0) <= 5000000000000.0) {
tmp = ((-4.0 * (a * t)) + (b / z)) / 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]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (x * 9.0) <= -5e+175: tmp = 9.0 * ((x / c_m) * (y / z)) elif (x * 9.0) <= 5000000000000.0: tmp = ((-4.0 * (a * t)) + (b / z)) / 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]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (Float64(x * 9.0) <= -5e+175) tmp = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))); elseif (Float64(x * 9.0) <= 5000000000000.0) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / 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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((x * 9.0) <= -5e+175)
tmp = 9.0 * ((x / c_m) * (y / z));
elseif ((x * 9.0) <= 5000000000000.0)
tmp = ((-4.0 * (a * t)) + (b / z)) / 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.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[N[(x * 9.0), $MachinePrecision], -5e+175], N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], 5000000000000.0], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \cdot 9 \leq -5 \cdot 10^{+175}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;x \cdot 9 \leq 5000000000000:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\end{array}
\end{array}
if (*.f64 x 9) < -5e175Initial program 69.7%
associate-+l-69.7%
*-commutative69.7%
associate-*r*72.8%
*-commutative72.8%
associate-+l-72.8%
associate-*l*72.8%
associate-*l*73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in x around inf 63.7%
times-frac60.5%
Simplified60.5%
if -5e175 < (*.f64 x 9) < 5e12Initial program 81.6%
associate-+l-81.6%
*-commutative81.6%
associate-*r*82.8%
*-commutative82.8%
associate-+l-82.8%
associate-*l*82.8%
associate-*l*83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 81.4%
cancel-sign-sub-inv81.4%
metadata-eval81.4%
+-commutative81.4%
fma-define81.4%
associate-/l*79.5%
fma-define79.5%
times-frac77.6%
associate-/r*77.2%
Simplified77.2%
Taylor expanded in c around 0 84.4%
Taylor expanded in c around 0 88.7%
Taylor expanded in x around 0 75.3%
if 5e12 < (*.f64 x 9) Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*78.2%
*-commutative78.2%
Simplified78.2%
Taylor expanded in x around inf 43.2%
associate-/l*44.8%
Applied egg-rr44.8%
Final simplification66.1%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 1.6e+272)
(/ (+ (* a (* -4.0 t)) (/ (- b (* y (* x -9.0))) z)) c_m)
(- (/ (/ (* x (* y 9.0)) c_m) z) (* (* a (/ t c_m)) 4.0)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1.6e+272) {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
} else {
tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (c_m <= 1.6d+272) then
tmp = ((a * ((-4.0d0) * t)) + ((b - (y * (x * (-9.0d0)))) / z)) / c_m
else
tmp = (((x * (y * 9.0d0)) / c_m) / z) - ((a * (t / c_m)) * 4.0d0)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1.6e+272) {
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
} else {
tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if c_m <= 1.6e+272: tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m else: tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 1.6e+272) tmp = Float64(Float64(Float64(a * Float64(-4.0 * t)) + Float64(Float64(b - Float64(y * Float64(x * -9.0))) / z)) / c_m); else tmp = Float64(Float64(Float64(Float64(x * Float64(y * 9.0)) / c_m) / z) - Float64(Float64(a * Float64(t / c_m)) * 4.0)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (c_m <= 1.6e+272)
tmp = ((a * (-4.0 * t)) + ((b - (y * (x * -9.0))) / z)) / c_m;
else
tmp = (((x * (y * 9.0)) / c_m) / z) - ((a * (t / c_m)) * 4.0);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 1.6e+272], N[(N[(N[(a * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(y * N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(N[(N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] / z), $MachinePrecision] - N[(N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 1.6 \cdot 10^{+272}:\\
\;\;\;\;\frac{a \cdot \left(-4 \cdot t\right) + \frac{b - y \cdot \left(x \cdot -9\right)}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(y \cdot 9\right)}{c\_m}}{z} - \left(a \cdot \frac{t}{c\_m}\right) \cdot 4\\
\end{array}
\end{array}
if c < 1.59999999999999992e272Initial program 79.4%
associate-+l-79.4%
*-commutative79.4%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*79.8%
associate-*l*81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in x around 0 81.2%
cancel-sign-sub-inv81.2%
metadata-eval81.2%
+-commutative81.2%
fma-define81.2%
associate-/l*78.4%
fma-define78.4%
times-frac78.7%
associate-/r*79.1%
Simplified79.1%
Taylor expanded in c around 0 85.1%
Taylor expanded in c around 0 90.4%
Taylor expanded in z around -inf 90.8%
mul-1-neg90.8%
unsub-neg90.8%
*-commutative90.8%
associate-*l*90.8%
*-commutative90.8%
mul-1-neg90.8%
sub-neg90.8%
*-commutative90.8%
*-commutative90.8%
associate-*l*90.8%
Simplified90.8%
if 1.59999999999999992e272 < c Initial program 56.2%
associate-+l-56.2%
*-commutative56.2%
associate-*r*56.2%
*-commutative56.2%
associate-+l-56.2%
associate-*l*56.2%
associate-*l*56.2%
*-commutative56.2%
Simplified56.2%
Taylor expanded in b around 0 45.2%
div-sub45.2%
associate-*r/45.4%
frac-times34.3%
*-commutative34.3%
frac-times45.4%
associate-/l*45.2%
*-commutative45.2%
*-commutative45.2%
associate-*r*45.2%
associate-*r*45.2%
*-commutative45.2%
Applied egg-rr45.2%
associate-/l*45.6%
*-commutative45.6%
associate-*r/45.8%
associate-*r/45.6%
associate-/r*56.4%
*-commutative56.4%
associate-*r*56.4%
*-commutative56.4%
Simplified56.4%
Taylor expanded in z around 0 67.7%
associate-*r/88.3%
Simplified88.3%
Final simplification90.7%
c_m = (fabs.f64 c) c_s = (copysign.f64 1 c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (if (<= c_m 5e+60) (/ (/ b z) c_m) (/ (/ b c_m) z))))
c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 5e+60) {
tmp = (b / z) / c_m;
} else {
tmp = (b / c_m) / z;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (c_m <= 5d+60) then
tmp = (b / z) / c_m
else
tmp = (b / c_m) / z
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 5e+60) {
tmp = (b / z) / c_m;
} else {
tmp = (b / c_m) / z;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if c_m <= 5e+60: tmp = (b / z) / c_m else: tmp = (b / c_m) / z return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 5e+60) tmp = Float64(Float64(b / z) / c_m); else tmp = Float64(Float64(b / c_m) / z); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (c_m <= 5e+60)
tmp = (b / z) / c_m;
else
tmp = (b / c_m) / z;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 5e+60], N[(N[(b / z), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 5 \cdot 10^{+60}:\\
\;\;\;\;\frac{\frac{b}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\end{array}
\end{array}
if c < 4.99999999999999975e60Initial program 82.4%
associate-+l-82.4%
*-commutative82.4%
associate-*r*82.3%
*-commutative82.3%
associate-+l-82.3%
associate-*l*82.3%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
+-commutative81.1%
fma-define81.1%
associate-/l*76.8%
fma-define76.8%
times-frac78.6%
associate-/r*78.6%
Simplified78.6%
Taylor expanded in c around 0 86.2%
Taylor expanded in c around 0 93.0%
Taylor expanded in b around inf 37.2%
if 4.99999999999999975e60 < c Initial program 63.6%
associate-+l-63.6%
*-commutative63.6%
associate-*r*65.7%
*-commutative65.7%
associate-+l-65.7%
associate-*l*65.7%
associate-*l*67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in b around inf 28.1%
associate-/r*29.8%
Simplified29.8%
Final simplification35.7%
c_m = (fabs.f64 c) c_s = (copysign.f64 1 c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* c_m z))))
c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (c_m * z))
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (c_m * z));
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*79.0%
*-commutative79.0%
associate-+l-79.0%
associate-*l*79.0%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in b around inf 34.1%
*-commutative34.1%
Simplified34.1%
Final simplification34.1%
c_m = (fabs.f64 c) c_s = (copysign.f64 1 c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ (/ b c_m) z)))
c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * ((b / c_m) / z);
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * ((b / c_m) / z)
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * ((b / c_m) / z);
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * ((b / c_m) / z)
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(Float64(b / c_m) / z)) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * ((b / c_m) / z);
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{\frac{b}{c\_m}}{z}
\end{array}
Initial program 78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*79.0%
*-commutative79.0%
associate-+l-79.0%
associate-*l*79.0%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in b around inf 34.1%
associate-/r*34.8%
Simplified34.8%
Final simplification34.8%
(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 2024039
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))