
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 5.6e+53)
(/ (/ (+ (- (* x (* 9.0 y)) (* z (* 4.0 (* t a)))) b) z) c_m)
(/
(fma -4.0 (* a (/ (* z t) c_m)) (fma 9.0 (* x (/ y 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 <= 5.6e+53) {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + b) / z) / c_m;
} else {
tmp = fma(-4.0, (a * ((z * t) / c_m)), fma(9.0, (x * (y / c_m)), (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 <= 5.6e+53) tmp = Float64(Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(z * Float64(4.0 * Float64(t * a)))) + b) / z) / c_m); else tmp = Float64(fma(-4.0, Float64(a * Float64(Float64(z * t) / c_m)), fma(9.0, Float64(x * Float64(y / c_m)), 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, 5.6e+53], N[(N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(-4.0 * N[(a * N[(N[(z * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 5.6 \cdot 10^{+53}:\\
\;\;\;\;\frac{\frac{\left(x \cdot \left(9 \cdot y\right) - z \cdot \left(4 \cdot \left(t \cdot a\right)\right)\right) + b}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-4, a \cdot \frac{z \cdot t}{c\_m}, \mathsf{fma}\left(9, x \cdot \frac{y}{c\_m}, \frac{b}{c\_m}\right)\right)}{z}\\
\end{array}
\end{array}
if c < 5.6e53Initial program 84.1%
associate-/r*85.5%
associate-*l*85.9%
associate-*l*89.4%
associate-*l*89.4%
Applied egg-rr89.4%
if 5.6e53 < c Initial program 71.0%
associate-/r*71.6%
associate-*l*71.5%
associate-*l*73.7%
associate-*l*73.7%
Applied egg-rr73.7%
Taylor expanded in z around 0 80.2%
fma-define80.2%
associate-/l*82.3%
fma-define82.3%
associate-/l*90.7%
Simplified90.7%
Final simplification89.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -9.2e+95) (not (<= z 1e+108)))
(/ (* x (- (+ (* 9.0 (/ y z)) (/ b (* x z))) (* 4.0 (/ (* t a) x)))) c_m)
(/ (+ b (fma x (* 9.0 y) (* z (* a (* t -4.0))))) (* 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 ((z <= -9.2e+95) || !(z <= 1e+108)) {
tmp = (x * (((9.0 * (y / z)) + (b / (x * z))) - (4.0 * ((t * a) / x)))) / c_m;
} else {
tmp = (b + fma(x, (9.0 * y), (z * (a * (t * -4.0))))) / (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 ((z <= -9.2e+95) || !(z <= 1e+108)) tmp = Float64(Float64(x * Float64(Float64(Float64(9.0 * Float64(y / z)) + Float64(b / Float64(x * z))) - Float64(4.0 * Float64(Float64(t * a) / x)))) / c_m); else tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(z * Float64(a * Float64(t * -4.0))))) / Float64(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[Or[LessEqual[z, -9.2e+95], N[Not[LessEqual[z, 1e+108]], $MachinePrecision]], N[(N[(x * N[(N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(z * N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+95} \lor \neg \left(z \leq 10^{+108}\right):\\
\;\;\;\;\frac{x \cdot \left(\left(9 \cdot \frac{y}{z} + \frac{b}{x \cdot z}\right) - 4 \cdot \frac{t \cdot a}{x}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, z \cdot \left(a \cdot \left(t \cdot -4\right)\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -9.19999999999999989e95 or 1e108 < z Initial program 55.5%
associate-/r*67.3%
associate-*l*67.3%
associate-*l*76.0%
associate-*l*76.0%
Applied egg-rr76.0%
Taylor expanded in x around inf 79.7%
if -9.19999999999999989e95 < z < 1e108Initial program 93.2%
Simplified95.3%
Final simplification90.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -2e-246)
t_1
(if (<= t_1 0.0)
(/ (/ (- b (* 4.0 (* a (* z t)))) c_m) z)
(if (<= t_1 INFINITY) t_1 (* a (* -4.0 (/ t c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -2e-246) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((b - (4.0 * (a * (z * t)))) / c_m) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (-4.0 * (t / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -2e-246) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((b - (4.0 * (a * (z * t)))) / c_m) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (-4.0 * (t / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_1 <= -2e-246: tmp = t_1 elif t_1 <= 0.0: tmp = ((b - (4.0 * (a * (z * t)))) / c_m) / z elif t_1 <= math.inf: tmp = t_1 else: tmp = a * (-4.0 * (t / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -2e-246) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / c_m) / z); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -2e-246)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = ((b - (4.0 * (a * (z * t)))) / c_m) / z;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = a * (-4.0 * (t / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -2e-246], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-246}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{c\_m}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.99999999999999991e-246 or -0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 90.5%
if -1.99999999999999991e-246 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -0.0Initial program 39.0%
*-commutative39.0%
associate-/r*99.5%
associate-*l*99.6%
associate-*l*99.8%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 92.2%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
*-commutative0.0%
associate-/r*14.2%
associate-*l*14.2%
associate-*l*19.9%
associate-*l*19.9%
Applied egg-rr19.9%
div-inv19.9%
associate-*r*19.9%
Applied egg-rr19.9%
Taylor expanded in z around inf 48.5%
associate-*r/48.5%
*-commutative48.5%
associate-*r*48.5%
associate-*l/65.3%
associate-*r/65.3%
Simplified65.3%
Final simplification88.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (+ (- (* x (* 9.0 y)) (* z (* 4.0 (* t a)))) b))
(t_2 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_2 5e+25)
(/ (/ t_1 z) c_m)
(if (<= t_2 INFINITY)
(* t_1 (/ 1.0 (* c_m z)))
(* a (* -4.0 (/ t c_m))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + b;
double t_2 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_2 <= 5e+25) {
tmp = (t_1 / z) / c_m;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1 * (1.0 / (c_m * z));
} else {
tmp = a * (-4.0 * (t / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = ((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + b;
double t_2 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_2 <= 5e+25) {
tmp = (t_1 / z) / c_m;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * (1.0 / (c_m * z));
} else {
tmp = a * (-4.0 * (t / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = ((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + b t_2 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_2 <= 5e+25: tmp = (t_1 / z) / c_m elif t_2 <= math.inf: tmp = t_1 * (1.0 / (c_m * z)) else: tmp = a * (-4.0 * (t / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(z * Float64(4.0 * Float64(t * a)))) + b) t_2 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_2 <= 5e+25) tmp = Float64(Float64(t_1 / z) / c_m); elseif (t_2 <= Inf) tmp = Float64(t_1 * Float64(1.0 / Float64(c_m * z))); else tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = ((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + b;
t_2 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_2 <= 5e+25)
tmp = (t_1 / z) / c_m;
elseif (t_2 <= Inf)
tmp = t_1 * (1.0 / (c_m * z));
else
tmp = a * (-4.0 * (t / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$2, 5e+25], N[(N[(t$95$1 / z), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$1 * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(9 \cdot y\right) - z \cdot \left(4 \cdot \left(t \cdot a\right)\right)\right) + b\\
t_2 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\frac{\frac{t\_1}{z}}{c\_m}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1 \cdot \frac{1}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 5.00000000000000024e25Initial program 86.5%
associate-/r*89.3%
associate-*l*89.9%
associate-*l*92.9%
associate-*l*92.9%
Applied egg-rr92.9%
if 5.00000000000000024e25 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.7%
clear-num89.7%
associate-/r/88.8%
associate-*l*88.9%
associate-*l*92.2%
associate-*l*92.2%
Applied egg-rr92.2%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
*-commutative0.0%
associate-/r*14.2%
associate-*l*14.2%
associate-*l*19.9%
associate-*l*19.9%
Applied egg-rr19.9%
div-inv19.9%
associate-*r*19.9%
Applied egg-rr19.9%
Taylor expanded in z around inf 48.5%
associate-*r/48.5%
*-commutative48.5%
associate-*r*48.5%
associate-*l/65.3%
associate-*r/65.3%
Simplified65.3%
Final simplification90.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(*
c_s
(if (<= t_1 -0.04)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(if (<= t_1 5e+80)
(+ (* -4.0 (/ (* t a) c_m)) (/ b (* c_m z)))
(if (<= t_1 5e+211)
(/ (+ b t_1) (* c_m z))
(*
y
(+ (* -4.0 (/ (* t a) (* c_m y))) (* 9.0 (/ x (* 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 5e+80) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else if (t_1 <= 5e+211) {
tmp = (b + t_1) / (c_m * z);
} else {
tmp = y * ((-4.0 * ((t * a) / (c_m * y))) + (9.0 * (x / (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 = y * (x * 9.0d0)
if (t_1 <= (-0.04d0)) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else if (t_1 <= 5d+80) then
tmp = ((-4.0d0) * ((t * a) / c_m)) + (b / (c_m * z))
else if (t_1 <= 5d+211) then
tmp = (b + t_1) / (c_m * z)
else
tmp = y * (((-4.0d0) * ((t * a) / (c_m * y))) + (9.0d0 * (x / (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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 5e+80) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else if (t_1 <= 5e+211) {
tmp = (b + t_1) / (c_m * z);
} else {
tmp = y * ((-4.0 * ((t * a) / (c_m * y))) + (9.0 * (x / (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 = y * (x * 9.0) tmp = 0 if t_1 <= -0.04: tmp = (b + (9.0 * (x * y))) / (c_m * z) elif t_1 <= 5e+80: tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z)) elif t_1 <= 5e+211: tmp = (b + t_1) / (c_m * z) else: tmp = y * ((-4.0 * ((t * a) / (c_m * y))) + (9.0 * (x / (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(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= -0.04) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); elseif (t_1 <= 5e+80) tmp = Float64(Float64(-4.0 * Float64(Float64(t * a) / c_m)) + Float64(b / Float64(c_m * z))); elseif (t_1 <= 5e+211) tmp = Float64(Float64(b + t_1) / Float64(c_m * z)); else tmp = Float64(y * Float64(Float64(-4.0 * Float64(Float64(t * a) / Float64(c_m * y))) + Float64(9.0 * Float64(x / 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 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -0.04)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
elseif (t_1 <= 5e+80)
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
elseif (t_1 <= 5e+211)
tmp = (b + t_1) / (c_m * z);
else
tmp = y * ((-4.0 * ((t * a) / (c_m * y))) + (9.0 * (x / (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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -0.04], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+80], N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+211], N[(N[(b + t$95$1), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -0.04:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+80}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m} + \frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+211}:\\
\;\;\;\;\frac{b + t\_1}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-4 \cdot \frac{t \cdot a}{c\_m \cdot y} + 9 \cdot \frac{x}{c\_m \cdot z}\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0400000000000000008Initial program 79.4%
Taylor expanded in x around inf 71.8%
if -0.0400000000000000008 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999961e80Initial program 83.2%
Taylor expanded in x around 0 79.1%
*-commutative79.1%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*81.1%
associate-*r*81.1%
*-commutative81.1%
associate-*l*81.1%
*-commutative81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in t around 0 88.6%
if 4.99999999999999961e80 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.9999999999999995e211Initial program 93.6%
Taylor expanded in x around inf 93.5%
*-commutative93.5%
*-commutative93.5%
associate-*r*93.8%
*-commutative93.8%
Simplified93.8%
if 4.9999999999999995e211 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 76.1%
Taylor expanded in b around 0 76.1%
Taylor expanded in y around inf 88.9%
Final simplification85.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(*
c_s
(if (<= t_1 -0.04)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(if (<= t_1 1e+57)
(+ (* -4.0 (/ (* t a) c_m)) (/ b (* c_m z)))
(if (<= t_1 1e+261)
(* a (+ (* -4.0 (/ t c_m)) (* 9.0 (/ (* x y) (* a (* c_m z))))))
(* y (* 9.0 (/ (/ 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 1e+57) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else if (t_1 <= 1e+261) {
tmp = a * ((-4.0 * (t / c_m)) + (9.0 * ((x * y) / (a * (c_m * z)))));
} else {
tmp = y * (9.0 * ((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 = y * (x * 9.0d0)
if (t_1 <= (-0.04d0)) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else if (t_1 <= 1d+57) then
tmp = ((-4.0d0) * ((t * a) / c_m)) + (b / (c_m * z))
else if (t_1 <= 1d+261) then
tmp = a * (((-4.0d0) * (t / c_m)) + (9.0d0 * ((x * y) / (a * (c_m * z)))))
else
tmp = y * (9.0d0 * ((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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 1e+57) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else if (t_1 <= 1e+261) {
tmp = a * ((-4.0 * (t / c_m)) + (9.0 * ((x * y) / (a * (c_m * z)))));
} else {
tmp = y * (9.0 * ((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 = y * (x * 9.0) tmp = 0 if t_1 <= -0.04: tmp = (b + (9.0 * (x * y))) / (c_m * z) elif t_1 <= 1e+57: tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z)) elif t_1 <= 1e+261: tmp = a * ((-4.0 * (t / c_m)) + (9.0 * ((x * y) / (a * (c_m * z))))) else: tmp = y * (9.0 * ((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(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= -0.04) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); elseif (t_1 <= 1e+57) tmp = Float64(Float64(-4.0 * Float64(Float64(t * a) / c_m)) + Float64(b / Float64(c_m * z))); elseif (t_1 <= 1e+261) tmp = Float64(a * Float64(Float64(-4.0 * Float64(t / c_m)) + Float64(9.0 * Float64(Float64(x * y) / Float64(a * Float64(c_m * z)))))); else tmp = Float64(y * Float64(9.0 * Float64(Float64(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 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -0.04)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
elseif (t_1 <= 1e+57)
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
elseif (t_1 <= 1e+261)
tmp = a * ((-4.0 * (t / c_m)) + (9.0 * ((x * y) / (a * (c_m * z)))));
else
tmp = y * (9.0 * ((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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -0.04], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+57], N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+261], N[(a * N[(N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(a * N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(9.0 * N[(N[(x / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -0.04:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{+57}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m} + \frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 10^{+261}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m} + 9 \cdot \frac{x \cdot y}{a \cdot \left(c\_m \cdot z\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(9 \cdot \frac{\frac{x}{z}}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0400000000000000008Initial program 79.4%
Taylor expanded in x around inf 71.8%
if -0.0400000000000000008 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 1.00000000000000005e57Initial program 82.7%
Taylor expanded in x around 0 79.5%
*-commutative79.5%
associate-*r*85.0%
*-commutative85.0%
*-commutative85.0%
*-commutative85.0%
associate-*l*81.5%
associate-*r*81.5%
*-commutative81.5%
associate-*l*81.5%
*-commutative81.5%
associate-*l*81.5%
Simplified81.5%
Taylor expanded in t around 0 89.2%
if 1.00000000000000005e57 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 9.9999999999999993e260Initial program 93.0%
Taylor expanded in b around 0 74.1%
Taylor expanded in a around inf 77.3%
if 9.9999999999999993e260 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 72.9%
Taylor expanded in b around 0 72.9%
Taylor expanded in y around inf 91.7%
Taylor expanded in a around 0 86.2%
associate-/l/91.6%
Simplified91.6%
Final simplification84.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(*
c_s
(if (or (<= t_1 -2e+294) (not (<= t_1 2e+301)))
(* y (* 9.0 (/ (/ x z) c_m)))
(/ (/ (+ (- (* x (* 9.0 y)) (* z (* 4.0 (* t a)))) 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 t_1 = y * (x * 9.0);
double tmp;
if ((t_1 <= -2e+294) || !(t_1 <= 2e+301)) {
tmp = y * (9.0 * ((x / z) / c_m));
} else {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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) :: t_1
real(8) :: tmp
t_1 = y * (x * 9.0d0)
if ((t_1 <= (-2d+294)) .or. (.not. (t_1 <= 2d+301))) then
tmp = y * (9.0d0 * ((x / z) / c_m))
else
tmp = ((((x * (9.0d0 * y)) - (z * (4.0d0 * (t * a)))) + 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 t_1 = y * (x * 9.0);
double tmp;
if ((t_1 <= -2e+294) || !(t_1 <= 2e+301)) {
tmp = y * (9.0 * ((x / z) / c_m));
} else {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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): t_1 = y * (x * 9.0) tmp = 0 if (t_1 <= -2e+294) or not (t_1 <= 2e+301): tmp = y * (9.0 * ((x / z) / c_m)) else: tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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) t_1 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if ((t_1 <= -2e+294) || !(t_1 <= 2e+301)) tmp = Float64(y * Float64(9.0 * Float64(Float64(x / z) / c_m))); else tmp = Float64(Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(z * Float64(4.0 * Float64(t * a)))) + 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)
t_1 = y * (x * 9.0);
tmp = 0.0;
if ((t_1 <= -2e+294) || ~((t_1 <= 2e+301)))
tmp = y * (9.0 * ((x / z) / c_m));
else
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[Or[LessEqual[t$95$1, -2e+294], N[Not[LessEqual[t$95$1, 2e+301]], $MachinePrecision]], N[(y * N[(9.0 * N[(N[(x / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $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 := y \cdot \left(x \cdot 9\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+294} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+301}\right):\\
\;\;\;\;y \cdot \left(9 \cdot \frac{\frac{x}{z}}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot \left(9 \cdot y\right) - z \cdot \left(4 \cdot \left(t \cdot a\right)\right)\right) + b}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -2.00000000000000013e294 or 2.00000000000000011e301 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 59.7%
Taylor expanded in b around 0 60.5%
Taylor expanded in y around inf 84.1%
Taylor expanded in a around 0 81.7%
associate-/l/88.9%
Simplified88.9%
if -2.00000000000000013e294 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 2.00000000000000011e301Initial program 86.1%
associate-/r*87.4%
associate-*l*87.4%
associate-*l*91.4%
associate-*l*91.4%
Applied egg-rr91.4%
Final simplification91.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1e+35) (not (<= z 3e+155)))
(/ (* x (- (+ (* 9.0 (/ y z)) (/ b (* x z))) (* 4.0 (/ (* t a) x)))) c_m)
(/ (/ (+ (- (* x (* 9.0 y)) (* z (* 4.0 (* t a)))) 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 ((z <= -1e+35) || !(z <= 3e+155)) {
tmp = (x * (((9.0 * (y / z)) + (b / (x * z))) - (4.0 * ((t * a) / x)))) / c_m;
} else {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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 ((z <= (-1d+35)) .or. (.not. (z <= 3d+155))) then
tmp = (x * (((9.0d0 * (y / z)) + (b / (x * z))) - (4.0d0 * ((t * a) / x)))) / c_m
else
tmp = ((((x * (9.0d0 * y)) - (z * (4.0d0 * (t * a)))) + 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 ((z <= -1e+35) || !(z <= 3e+155)) {
tmp = (x * (((9.0 * (y / z)) + (b / (x * z))) - (4.0 * ((t * a) / x)))) / c_m;
} else {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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 (z <= -1e+35) or not (z <= 3e+155): tmp = (x * (((9.0 * (y / z)) + (b / (x * z))) - (4.0 * ((t * a) / x)))) / c_m else: tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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 ((z <= -1e+35) || !(z <= 3e+155)) tmp = Float64(Float64(x * Float64(Float64(Float64(9.0 * Float64(y / z)) + Float64(b / Float64(x * z))) - Float64(4.0 * Float64(Float64(t * a) / x)))) / c_m); else tmp = Float64(Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(z * Float64(4.0 * Float64(t * a)))) + 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 ((z <= -1e+35) || ~((z <= 3e+155)))
tmp = (x * (((9.0 * (y / z)) + (b / (x * z))) - (4.0 * ((t * a) / x)))) / c_m;
else
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + b) / c_m) / z;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -1e+35], N[Not[LessEqual[z, 3e+155]], $MachinePrecision]], N[(N[(x * N[(N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / 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}\;z \leq -1 \cdot 10^{+35} \lor \neg \left(z \leq 3 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{x \cdot \left(\left(9 \cdot \frac{y}{z} + \frac{b}{x \cdot z}\right) - 4 \cdot \frac{t \cdot a}{x}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(x \cdot \left(9 \cdot y\right) - z \cdot \left(4 \cdot \left(t \cdot a\right)\right)\right) + b}{c\_m}}{z}\\
\end{array}
\end{array}
if z < -9.9999999999999997e34 or 3.0000000000000001e155 < z Initial program 62.4%
associate-/r*70.1%
associate-*l*70.1%
associate-*l*77.2%
associate-*l*77.2%
Applied egg-rr77.2%
Taylor expanded in x around inf 80.8%
if -9.9999999999999997e34 < z < 3.0000000000000001e155Initial program 90.9%
*-commutative90.9%
associate-/r*91.8%
associate-*l*92.4%
associate-*l*93.9%
associate-*l*93.9%
Applied egg-rr93.9%
Final simplification89.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(*
c_s
(if (<= t_1 -0.04)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(if (<= t_1 5e+80)
(+ (* -4.0 (/ (* t a) c_m)) (/ b (* c_m z)))
(/ (* x (+ (* 9.0 (/ y z)) (/ b (* 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 5e+80) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else {
tmp = (x * ((9.0 * (y / z)) + (b / (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 = y * (x * 9.0d0)
if (t_1 <= (-0.04d0)) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else if (t_1 <= 5d+80) then
tmp = ((-4.0d0) * ((t * a) / c_m)) + (b / (c_m * z))
else
tmp = (x * ((9.0d0 * (y / z)) + (b / (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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 5e+80) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else {
tmp = (x * ((9.0 * (y / z)) + (b / (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 = y * (x * 9.0) tmp = 0 if t_1 <= -0.04: tmp = (b + (9.0 * (x * y))) / (c_m * z) elif t_1 <= 5e+80: tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z)) else: tmp = (x * ((9.0 * (y / z)) + (b / (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(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= -0.04) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); elseif (t_1 <= 5e+80) tmp = Float64(Float64(-4.0 * Float64(Float64(t * a) / c_m)) + Float64(b / Float64(c_m * z))); else tmp = Float64(Float64(x * Float64(Float64(9.0 * Float64(y / z)) + Float64(b / Float64(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 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -0.04)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
elseif (t_1 <= 5e+80)
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
else
tmp = (x * ((9.0 * (y / z)) + (b / (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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -0.04], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+80], N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -0.04:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+80}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m} + \frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot \frac{y}{z} + \frac{b}{x \cdot z}\right)}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0400000000000000008Initial program 79.4%
Taylor expanded in x around inf 71.8%
if -0.0400000000000000008 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999961e80Initial program 83.2%
Taylor expanded in x around 0 79.1%
*-commutative79.1%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*81.1%
associate-*r*81.1%
*-commutative81.1%
associate-*l*81.1%
*-commutative81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in t around 0 88.6%
if 4.99999999999999961e80 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.9%
associate-/r*82.7%
associate-*l*82.7%
associate-*l*82.7%
associate-*l*82.7%
Applied egg-rr82.7%
Taylor expanded in x around inf 78.0%
Taylor expanded in x around inf 77.8%
Final simplification82.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(*
c_s
(if (<= t_1 -0.04)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(if (<= t_1 5e+80)
(+ (* -4.0 (/ (* t a) c_m)) (/ b (* c_m z)))
(/ (/ (+ b t_1) 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 5e+80) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else {
tmp = ((b + t_1) / 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 = y * (x * 9.0d0)
if (t_1 <= (-0.04d0)) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else if (t_1 <= 5d+80) then
tmp = ((-4.0d0) * ((t * a) / c_m)) + (b / (c_m * z))
else
tmp = ((b + t_1) / 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -0.04) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else if (t_1 <= 5e+80) {
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
} else {
tmp = ((b + t_1) / 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 = y * (x * 9.0) tmp = 0 if t_1 <= -0.04: tmp = (b + (9.0 * (x * y))) / (c_m * z) elif t_1 <= 5e+80: tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z)) else: tmp = ((b + t_1) / 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(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= -0.04) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); elseif (t_1 <= 5e+80) tmp = Float64(Float64(-4.0 * Float64(Float64(t * a) / c_m)) + Float64(b / Float64(c_m * z))); else tmp = Float64(Float64(Float64(b + t_1) / 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 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -0.04)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
elseif (t_1 <= 5e+80)
tmp = (-4.0 * ((t * a) / c_m)) + (b / (c_m * z));
else
tmp = ((b + t_1) / 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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -0.04], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+80], N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + t$95$1), $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 := y \cdot \left(x \cdot 9\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -0.04:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+80}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m} + \frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b + t\_1}{z}}{c\_m}\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -0.0400000000000000008Initial program 79.4%
Taylor expanded in x around inf 71.8%
if -0.0400000000000000008 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 4.99999999999999961e80Initial program 83.2%
Taylor expanded in x around 0 79.1%
*-commutative79.1%
associate-*r*84.5%
*-commutative84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*81.1%
associate-*r*81.1%
*-commutative81.1%
associate-*l*81.1%
*-commutative81.1%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in t around 0 88.6%
if 4.99999999999999961e80 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 80.9%
associate-/r*82.7%
associate-*l*82.7%
associate-*l*82.7%
associate-*l*82.7%
Applied egg-rr82.7%
Taylor expanded in x around inf 78.0%
associate-*r*78.1%
*-commutative78.1%
Applied egg-rr78.1%
Final simplification82.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -1.4e+120)
(/ b (* c_m z))
(if (<= b -3.5e-54)
(* x (/ (* 9.0 y) (* c_m z)))
(if (<= b -7.2e-250)
(/ (* t (* a -4.0)) c_m)
(if (<= b 6.1e+22) (* a (* -4.0 (/ t c_m))) (/ (/ b z) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1.4e+120) {
tmp = b / (c_m * z);
} else if (b <= -3.5e-54) {
tmp = x * ((9.0 * y) / (c_m * z));
} else if (b <= -7.2e-250) {
tmp = (t * (a * -4.0)) / c_m;
} else if (b <= 6.1e+22) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (b <= (-1.4d+120)) then
tmp = b / (c_m * z)
else if (b <= (-3.5d-54)) then
tmp = x * ((9.0d0 * y) / (c_m * z))
else if (b <= (-7.2d-250)) then
tmp = (t * (a * (-4.0d0))) / c_m
else if (b <= 6.1d+22) then
tmp = a * ((-4.0d0) * (t / c_m))
else
tmp = (b / z) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1.4e+120) {
tmp = b / (c_m * z);
} else if (b <= -3.5e-54) {
tmp = x * ((9.0 * y) / (c_m * z));
} else if (b <= -7.2e-250) {
tmp = (t * (a * -4.0)) / c_m;
} else if (b <= 6.1e+22) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -1.4e+120: tmp = b / (c_m * z) elif b <= -3.5e-54: tmp = x * ((9.0 * y) / (c_m * z)) elif b <= -7.2e-250: tmp = (t * (a * -4.0)) / c_m elif b <= 6.1e+22: tmp = a * (-4.0 * (t / c_m)) else: tmp = (b / z) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -1.4e+120) tmp = Float64(b / Float64(c_m * z)); elseif (b <= -3.5e-54) tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(c_m * z))); elseif (b <= -7.2e-250) tmp = Float64(Float64(t * Float64(a * -4.0)) / c_m); elseif (b <= 6.1e+22) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); else tmp = Float64(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 (b <= -1.4e+120)
tmp = b / (c_m * z);
elseif (b <= -3.5e-54)
tmp = x * ((9.0 * y) / (c_m * z));
elseif (b <= -7.2e-250)
tmp = (t * (a * -4.0)) / c_m;
elseif (b <= 6.1e+22)
tmp = a * (-4.0 * (t / c_m));
else
tmp = (b / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -1.4e+120], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.5e-54], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.2e-250], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[b, 6.1e+22], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{+120}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq -3.5 \cdot 10^{-54}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-250}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c\_m}\\
\mathbf{elif}\;b \leq 6.1 \cdot 10^{+22}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c\_m}\\
\end{array}
\end{array}
if b < -1.4e120Initial program 85.1%
Simplified87.3%
Taylor expanded in b around inf 59.4%
if -1.4e120 < b < -3.49999999999999982e-54Initial program 77.6%
associate-/r*81.8%
associate-*l*81.8%
associate-*l*85.4%
associate-*l*85.4%
Applied egg-rr85.4%
Taylor expanded in x around inf 48.7%
associate-*r/48.8%
*-commutative48.8%
associate-*l*48.8%
*-commutative48.8%
*-commutative48.8%
associate-/l*52.3%
Simplified52.3%
if -3.49999999999999982e-54 < b < -7.19999999999999964e-250Initial program 72.2%
Taylor expanded in z around inf 69.8%
associate-*r/69.8%
associate-*r*69.8%
*-commutative69.8%
*-commutative69.8%
Simplified69.8%
if -7.19999999999999964e-250 < b < 6.0999999999999998e22Initial program 87.5%
*-commutative87.5%
associate-/r*82.4%
associate-*l*82.4%
associate-*l*85.7%
associate-*l*85.7%
Applied egg-rr85.7%
div-inv85.6%
associate-*r*85.6%
Applied egg-rr85.6%
Taylor expanded in z around inf 54.4%
associate-*r/54.4%
*-commutative54.4%
associate-*r*54.4%
associate-*l/58.8%
associate-*r/58.8%
Simplified58.8%
if 6.0999999999999998e22 < b Initial program 80.4%
associate-/r*80.5%
associate-*l*82.1%
associate-*l*85.3%
associate-*l*85.3%
Applied egg-rr85.3%
Taylor expanded in b around inf 60.3%
Final simplification60.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -1e+122)
(/ b (* c_m z))
(if (<= b -2.7e-55)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= b -2.1e-248)
(/ (* t (* a -4.0)) c_m)
(if (<= b 2.75e+19) (* a (* -4.0 (/ t c_m))) (/ (/ b z) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1e+122) {
tmp = b / (c_m * z);
} else if (b <= -2.7e-55) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= -2.1e-248) {
tmp = (t * (a * -4.0)) / c_m;
} else if (b <= 2.75e+19) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (b <= (-1d+122)) then
tmp = b / (c_m * z)
else if (b <= (-2.7d-55)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (b <= (-2.1d-248)) then
tmp = (t * (a * (-4.0d0))) / c_m
else if (b <= 2.75d+19) then
tmp = a * ((-4.0d0) * (t / c_m))
else
tmp = (b / z) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1e+122) {
tmp = b / (c_m * z);
} else if (b <= -2.7e-55) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= -2.1e-248) {
tmp = (t * (a * -4.0)) / c_m;
} else if (b <= 2.75e+19) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -1e+122: tmp = b / (c_m * z) elif b <= -2.7e-55: tmp = 9.0 * (x * (y / (c_m * z))) elif b <= -2.1e-248: tmp = (t * (a * -4.0)) / c_m elif b <= 2.75e+19: tmp = a * (-4.0 * (t / c_m)) else: tmp = (b / z) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -1e+122) tmp = Float64(b / Float64(c_m * z)); elseif (b <= -2.7e-55) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (b <= -2.1e-248) tmp = Float64(Float64(t * Float64(a * -4.0)) / c_m); elseif (b <= 2.75e+19) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); else tmp = Float64(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 (b <= -1e+122)
tmp = b / (c_m * z);
elseif (b <= -2.7e-55)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (b <= -2.1e-248)
tmp = (t * (a * -4.0)) / c_m;
elseif (b <= 2.75e+19)
tmp = a * (-4.0 * (t / c_m));
else
tmp = (b / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -1e+122], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.7e-55], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.1e-248], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[b, 2.75e+19], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+122}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq -2.7 \cdot 10^{-55}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;b \leq -2.1 \cdot 10^{-248}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c\_m}\\
\mathbf{elif}\;b \leq 2.75 \cdot 10^{+19}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c\_m}\\
\end{array}
\end{array}
if b < -1.00000000000000001e122Initial program 85.1%
Simplified87.3%
Taylor expanded in b around inf 59.4%
if -1.00000000000000001e122 < b < -2.70000000000000004e-55Initial program 77.6%
*-commutative77.6%
associate-/r*85.5%
associate-*l*85.5%
associate-*l*89.1%
associate-*l*89.1%
Applied egg-rr89.1%
Taylor expanded in x around inf 48.7%
associate-/l*52.2%
*-commutative52.2%
Simplified52.2%
if -2.70000000000000004e-55 < b < -2.1e-248Initial program 72.2%
Taylor expanded in z around inf 69.8%
associate-*r/69.8%
associate-*r*69.8%
*-commutative69.8%
*-commutative69.8%
Simplified69.8%
if -2.1e-248 < b < 2.75e19Initial program 87.5%
*-commutative87.5%
associate-/r*82.4%
associate-*l*82.4%
associate-*l*85.7%
associate-*l*85.7%
Applied egg-rr85.7%
div-inv85.6%
associate-*r*85.6%
Applied egg-rr85.6%
Taylor expanded in z around inf 54.4%
associate-*r/54.4%
*-commutative54.4%
associate-*r*54.4%
associate-*l/58.8%
associate-*r/58.8%
Simplified58.8%
if 2.75e19 < b Initial program 80.4%
associate-/r*80.5%
associate-*l*82.1%
associate-*l*85.3%
associate-*l*85.3%
Applied egg-rr85.3%
Taylor expanded in b around inf 60.3%
Final simplification60.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 8e-119)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* c_m z))
(/ (/ (+ (- (* x (* 9.0 y)) (* z (* 4.0 (* t a)))) 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 <= 8e-119) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
} else {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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 <= 8d-119) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (c_m * z)
else
tmp = ((((x * (9.0d0 * y)) - (z * (4.0d0 * (t * a)))) + 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 <= 8e-119) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
} else {
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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 <= 8e-119: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z) else: tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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 <= 8e-119) 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(Float64(Float64(x * Float64(9.0 * y)) - Float64(z * Float64(4.0 * Float64(t * a)))) + 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 <= 8e-119)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c_m * z);
else
tmp = ((((x * (9.0 * y)) - (z * (4.0 * (t * a)))) + 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, 8e-119], 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[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(z * N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / 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 8 \cdot 10^{-119}:\\
\;\;\;\;\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{\frac{\left(x \cdot \left(9 \cdot y\right) - z \cdot \left(4 \cdot \left(t \cdot a\right)\right)\right) + b}{c\_m}}{z}\\
\end{array}
\end{array}
if c < 8.0000000000000001e-119Initial program 83.5%
if 8.0000000000000001e-119 < c Initial program 78.8%
*-commutative78.8%
associate-/r*81.3%
associate-*l*81.3%
associate-*l*84.7%
associate-*l*84.7%
Applied egg-rr84.7%
Final simplification83.9%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -5500000000000.0)
(/ (/ b c_m) z)
(if (<= b -8.5e-51)
(* y (* 9.0 (/ (/ x z) c_m)))
(if (<= b 8e+21) (* a (* -4.0 (/ t c_m))) (/ (/ b z) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -5500000000000.0) {
tmp = (b / c_m) / z;
} else if (b <= -8.5e-51) {
tmp = y * (9.0 * ((x / z) / c_m));
} else if (b <= 8e+21) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (b <= (-5500000000000.0d0)) then
tmp = (b / c_m) / z
else if (b <= (-8.5d-51)) then
tmp = y * (9.0d0 * ((x / z) / c_m))
else if (b <= 8d+21) then
tmp = a * ((-4.0d0) * (t / c_m))
else
tmp = (b / z) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -5500000000000.0) {
tmp = (b / c_m) / z;
} else if (b <= -8.5e-51) {
tmp = y * (9.0 * ((x / z) / c_m));
} else if (b <= 8e+21) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -5500000000000.0: tmp = (b / c_m) / z elif b <= -8.5e-51: tmp = y * (9.0 * ((x / z) / c_m)) elif b <= 8e+21: tmp = a * (-4.0 * (t / c_m)) else: tmp = (b / z) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -5500000000000.0) tmp = Float64(Float64(b / c_m) / z); elseif (b <= -8.5e-51) tmp = Float64(y * Float64(9.0 * Float64(Float64(x / z) / c_m))); elseif (b <= 8e+21) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); else tmp = Float64(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 (b <= -5500000000000.0)
tmp = (b / c_m) / z;
elseif (b <= -8.5e-51)
tmp = y * (9.0 * ((x / z) / c_m));
elseif (b <= 8e+21)
tmp = a * (-4.0 * (t / c_m));
else
tmp = (b / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -5500000000000.0], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, -8.5e-51], N[(y * N[(9.0 * N[(N[(x / z), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e+21], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -5500000000000:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;b \leq -8.5 \cdot 10^{-51}:\\
\;\;\;\;y \cdot \left(9 \cdot \frac{\frac{x}{z}}{c\_m}\right)\\
\mathbf{elif}\;b \leq 8 \cdot 10^{+21}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c\_m}\\
\end{array}
\end{array}
if b < -5.5e12Initial program 82.5%
*-commutative82.5%
associate-/r*85.8%
associate-*l*85.8%
associate-*l*89.1%
associate-*l*89.1%
Applied egg-rr89.1%
Taylor expanded in b around inf 54.7%
if -5.5e12 < b < -8.50000000000000036e-51Initial program 81.7%
Taylor expanded in b around 0 73.8%
Taylor expanded in y around inf 67.8%
Taylor expanded in a around 0 51.5%
associate-/l/51.5%
Simplified51.5%
if -8.50000000000000036e-51 < b < 8e21Initial program 82.3%
*-commutative82.3%
associate-/r*77.6%
associate-*l*77.6%
associate-*l*80.6%
associate-*l*80.6%
Applied egg-rr80.6%
div-inv80.5%
associate-*r*80.5%
Applied egg-rr80.5%
Taylor expanded in z around inf 59.6%
associate-*r/59.6%
*-commutative59.6%
associate-*r*59.6%
associate-*l/61.8%
associate-*r/61.8%
Simplified61.8%
if 8e21 < b Initial program 80.4%
associate-/r*80.5%
associate-*l*82.1%
associate-*l*85.3%
associate-*l*85.3%
Applied egg-rr85.3%
Taylor expanded in b around inf 60.3%
Final simplification59.3%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= t -6.6e+103) (not (<= t 9.6e-52)))
(* a (* -4.0 (/ t c_m)))
(/ (+ b (* 9.0 (* x y))) (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -6.6e+103) || !(t <= 9.6e-52)) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((t <= (-6.6d+103)) .or. (.not. (t <= 9.6d-52))) then
tmp = a * ((-4.0d0) * (t / c_m))
else
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((t <= -6.6e+103) || !(t <= 9.6e-52)) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (t <= -6.6e+103) or not (t <= 9.6e-52): tmp = a * (-4.0 * (t / c_m)) else: tmp = (b + (9.0 * (x * y))) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((t <= -6.6e+103) || !(t <= 9.6e-52)) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((t <= -6.6e+103) || ~((t <= 9.6e-52)))
tmp = a * (-4.0 * (t / c_m));
else
tmp = (b + (9.0 * (x * y))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[t, -6.6e+103], N[Not[LessEqual[t, 9.6e-52]], $MachinePrecision]], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{+103} \lor \neg \left(t \leq 9.6 \cdot 10^{-52}\right):\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -6.60000000000000017e103 or 9.6000000000000007e-52 < t Initial program 77.3%
*-commutative77.3%
associate-/r*77.6%
associate-*l*77.7%
associate-*l*82.7%
associate-*l*82.7%
Applied egg-rr82.7%
div-inv82.6%
associate-*r*82.6%
Applied egg-rr82.6%
Taylor expanded in z around inf 52.2%
associate-*r/52.2%
*-commutative52.2%
associate-*r*52.2%
associate-*l/56.9%
associate-*r/56.9%
Simplified56.9%
if -6.60000000000000017e103 < t < 9.6000000000000007e-52Initial program 85.7%
Taylor expanded in x around inf 70.1%
Final simplification64.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -5.5e+127)
(/ b (* c_m z))
(if (<= b 7.8e+23) (* a (* -4.0 (/ t c_m))) (/ (/ b z) c_m)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -5.5e+127) {
tmp = b / (c_m * z);
} else if (b <= 7.8e+23) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (b <= (-5.5d+127)) then
tmp = b / (c_m * z)
else if (b <= 7.8d+23) then
tmp = a * ((-4.0d0) * (t / c_m))
else
tmp = (b / z) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -5.5e+127) {
tmp = b / (c_m * z);
} else if (b <= 7.8e+23) {
tmp = a * (-4.0 * (t / c_m));
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -5.5e+127: tmp = b / (c_m * z) elif b <= 7.8e+23: tmp = a * (-4.0 * (t / c_m)) else: tmp = (b / z) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -5.5e+127) tmp = Float64(b / Float64(c_m * z)); elseif (b <= 7.8e+23) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); else tmp = Float64(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 (b <= -5.5e+127)
tmp = b / (c_m * z);
elseif (b <= 7.8e+23)
tmp = a * (-4.0 * (t / c_m));
else
tmp = (b / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -5.5e+127], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e+23], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / 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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+127}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{+23}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c\_m}\\
\end{array}
\end{array}
if b < -5.50000000000000041e127Initial program 84.1%
Simplified86.5%
Taylor expanded in b around inf 61.1%
if -5.50000000000000041e127 < b < 7.8000000000000001e23Initial program 81.8%
*-commutative81.8%
associate-/r*79.5%
associate-*l*79.5%
associate-*l*82.5%
associate-*l*82.5%
Applied egg-rr82.5%
div-inv82.3%
associate-*r*82.3%
Applied egg-rr82.3%
Taylor expanded in z around inf 54.3%
associate-*r/54.3%
*-commutative54.3%
associate-*r*54.3%
associate-*l/56.6%
associate-*r/56.6%
Simplified56.6%
if 7.8000000000000001e23 < b Initial program 80.4%
associate-/r*80.5%
associate-*l*82.1%
associate-*l*85.3%
associate-*l*85.3%
Applied egg-rr85.3%
Taylor expanded in b around inf 60.3%
Final simplification58.2%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ 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 81.9%
Simplified85.6%
Taylor expanded in b around inf 34.9%
Final simplification34.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024097
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))