
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (- (* y (* x 9.0)) (* (* (* z 4.0) t) a)) b) (* z c_m))))
(*
c_s
(if (<= t_1 -2e+271)
(*
x
(-
(+ (* 9.0 (/ y (* z c_m))) (/ b (* c_m (* x z))))
(* 4.0 (/ (* t a) (* x c_m)))))
(if (<= t_1 4e-219)
(/
(+
(* -4.0 (/ (* a (* z t)) c_m))
(+ (* 9.0 (/ (* x y) c_m)) (/ b c_m)))
z)
(if (<= t_1 INFINITY)
(/ (+ b (fma x (* 9.0 y) (* t (* a (* z -4.0))))) (* z c_m))
(* -4.0 (* t (/ a c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double tmp;
if (t_1 <= -2e+271) {
tmp = x * (((9.0 * (y / (z * c_m))) + (b / (c_m * (x * z)))) - (4.0 * ((t * a) / (x * c_m))));
} else if (t_1 <= 4e-219) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + ((9.0 * ((x * y) / c_m)) + (b / c_m))) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b + fma(x, (9.0 * y), (t * (a * (z * -4.0))))) / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(Float64(y * Float64(x * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -2e+271) tmp = Float64(x * Float64(Float64(Float64(9.0 * Float64(y / Float64(z * c_m))) + Float64(b / Float64(c_m * Float64(x * z)))) - Float64(4.0 * Float64(Float64(t * a) / Float64(x * c_m))))); elseif (t_1 <= 4e-219) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(Float64(9.0 * Float64(Float64(x * y) / c_m)) + Float64(b / c_m))) / z); elseif (t_1 <= Inf) tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -2e+271], N[(x * N[(N[(N[(9.0 * N[(y / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / N[(x * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e-219], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{\left(y \cdot \left(x \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+271}:\\
\;\;\;\;x \cdot \left(\left(9 \cdot \frac{y}{z \cdot c\_m} + \frac{b}{c\_m \cdot \left(x \cdot z\right)}\right) - 4 \cdot \frac{t \cdot a}{x \cdot c\_m}\right)\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-219}:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \left(9 \cdot \frac{x \cdot y}{c\_m} + \frac{b}{c\_m}\right)}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{b + \mathsf{fma}\left(x, 9 \cdot y, t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -1.99999999999999991e271Initial program 84.4%
+-commutative84.4%
associate-+r-84.4%
*-commutative84.4%
associate-*r*91.4%
*-commutative91.4%
associate-+r-91.4%
+-commutative91.4%
associate-*l*91.4%
associate-*l*87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in x around inf 58.7%
if -1.99999999999999991e271 < (/.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)) < 4.0000000000000001e-219Initial program 85.5%
+-commutative85.5%
associate-+r-85.5%
*-commutative85.5%
associate-*r*85.2%
*-commutative85.2%
associate-+r-85.2%
+-commutative85.2%
associate-*l*85.2%
associate-*l*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 97.0%
if 4.0000000000000001e-219 < (/.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.0%
Simplified88.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
+-commutative0.0%
associate-+r-0.0%
*-commutative0.0%
associate-*r*0.4%
*-commutative0.4%
associate-+r-0.4%
+-commutative0.4%
associate-*l*0.4%
associate-*l*0.4%
*-commutative0.4%
Simplified0.4%
Taylor expanded in z around 0 3.3%
Taylor expanded in a around inf 40.0%
*-commutative40.0%
associate-/l*69.6%
Simplified69.6%
Final simplification83.3%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ (- (* y (* x 9.0)) (* (* (* z 4.0) t) a)) b) (* z c_m)))
(t_2 (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m))))
(*
c_s
(if (<= t_1 -1e-124)
t_2
(if (<= t_1 2e-264)
(/ (+ (* -4.0 (/ (* a (* z t)) c_m)) (/ b c_m)) z)
(if (<= t_1 INFINITY) t_2 (* -4.0 (* t (/ a c_m)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -1e-124) {
tmp = t_2;
} else if (t_1 <= 2e-264) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + (b / c_m)) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
double t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
double tmp;
if (t_1 <= -1e-124) {
tmp = t_2;
} else if (t_1 <= 2e-264) {
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + (b / c_m)) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m) t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m) tmp = 0 if t_1 <= -1e-124: tmp = t_2 elif t_1 <= 2e-264: tmp = ((-4.0 * ((a * (z * t)) / c_m)) + (b / c_m)) / z elif t_1 <= math.inf: tmp = t_2 else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(Float64(Float64(y * Float64(x * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)) t_2 = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)) tmp = 0.0 if (t_1 <= -1e-124) tmp = t_2; elseif (t_1 <= 2e-264) tmp = Float64(Float64(Float64(-4.0 * Float64(Float64(a * Float64(z * t)) / c_m)) + Float64(b / c_m)) / z); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
tmp = 0.0;
if (t_1 <= -1e-124)
tmp = t_2;
elseif (t_1 <= 2e-264)
tmp = ((-4.0 * ((a * (z * t)) / c_m)) + (b / c_m)) / z;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-124], t$95$2, If[LessEqual[t$95$1, 2e-264], N[(N[(N[(-4.0 * N[(N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / c$95$m), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{\left(y \cdot \left(x \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c\_m}\\
t_2 := \frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-264}:\\
\;\;\;\;\frac{-4 \cdot \frac{a \cdot \left(z \cdot t\right)}{c\_m} + \frac{b}{c\_m}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -9.99999999999999933e-125 or 2e-264 < (/.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.4%
+-commutative90.4%
associate-+r-90.4%
*-commutative90.4%
associate-*r*90.8%
*-commutative90.8%
associate-+r-90.8%
+-commutative90.8%
associate-*l*90.8%
associate-*l*90.9%
*-commutative90.9%
Simplified90.9%
if -9.99999999999999933e-125 < (/.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)) < 2e-264Initial program 68.8%
+-commutative68.8%
associate-+r-68.8%
*-commutative68.8%
associate-*r*70.9%
*-commutative70.9%
associate-+r-70.9%
+-commutative70.9%
associate-*l*71.0%
associate-*l*71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in z around 0 97.0%
Taylor expanded in x around 0 81.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
+-commutative0.0%
associate-+r-0.0%
*-commutative0.0%
associate-*r*0.4%
*-commutative0.4%
associate-+r-0.4%
+-commutative0.4%
associate-*l*0.4%
associate-*l*0.4%
*-commutative0.4%
Simplified0.4%
Taylor expanded in z around 0 3.3%
Taylor expanded in a around inf 40.0%
*-commutative40.0%
associate-/l*69.6%
Simplified69.6%
Final simplification88.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.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* t (/ a c_m)))) (t_2 (* 9.0 (* (/ x c_m) (/ y z)))))
(*
c_s
(if (<= y -1.25e-99)
t_2
(if (<= y -9e-297)
t_1
(if (<= y 2.15e-209)
(* (/ b z) (/ 1.0 c_m))
(if (<= y 4.5e-183)
(* -4.0 (/ (* t a) c_m))
(if (<= y 1.12e-32)
(* b (/ 1.0 (* z c_m)))
(if (or (<= y 3.6e+60)
(and (not (<= y 4.5e+113)) (<= y 4.8e+132)))
t_1
t_2)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double t_2 = 9.0 * ((x / c_m) * (y / z));
double tmp;
if (y <= -1.25e-99) {
tmp = t_2;
} else if (y <= -9e-297) {
tmp = t_1;
} else if (y <= 2.15e-209) {
tmp = (b / z) * (1.0 / c_m);
} else if (y <= 4.5e-183) {
tmp = -4.0 * ((t * a) / c_m);
} else if (y <= 1.12e-32) {
tmp = b * (1.0 / (z * c_m));
} else if ((y <= 3.6e+60) || (!(y <= 4.5e+113) && (y <= 4.8e+132))) {
tmp = t_1;
} else {
tmp = t_2;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c_m))
t_2 = 9.0d0 * ((x / c_m) * (y / z))
if (y <= (-1.25d-99)) then
tmp = t_2
else if (y <= (-9d-297)) then
tmp = t_1
else if (y <= 2.15d-209) then
tmp = (b / z) * (1.0d0 / c_m)
else if (y <= 4.5d-183) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (y <= 1.12d-32) then
tmp = b * (1.0d0 / (z * c_m))
else if ((y <= 3.6d+60) .or. (.not. (y <= 4.5d+113)) .and. (y <= 4.8d+132)) then
tmp = t_1
else
tmp = t_2
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double t_2 = 9.0 * ((x / c_m) * (y / z));
double tmp;
if (y <= -1.25e-99) {
tmp = t_2;
} else if (y <= -9e-297) {
tmp = t_1;
} else if (y <= 2.15e-209) {
tmp = (b / z) * (1.0 / c_m);
} else if (y <= 4.5e-183) {
tmp = -4.0 * ((t * a) / c_m);
} else if (y <= 1.12e-32) {
tmp = b * (1.0 / (z * c_m));
} else if ((y <= 3.6e+60) || (!(y <= 4.5e+113) && (y <= 4.8e+132))) {
tmp = t_1;
} else {
tmp = t_2;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (t * (a / c_m)) t_2 = 9.0 * ((x / c_m) * (y / z)) tmp = 0 if y <= -1.25e-99: tmp = t_2 elif y <= -9e-297: tmp = t_1 elif y <= 2.15e-209: tmp = (b / z) * (1.0 / c_m) elif y <= 4.5e-183: tmp = -4.0 * ((t * a) / c_m) elif y <= 1.12e-32: tmp = b * (1.0 / (z * c_m)) elif (y <= 3.6e+60) or (not (y <= 4.5e+113) and (y <= 4.8e+132)): tmp = t_1 else: tmp = t_2 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(t * Float64(a / c_m))) t_2 = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))) tmp = 0.0 if (y <= -1.25e-99) tmp = t_2; elseif (y <= -9e-297) tmp = t_1; elseif (y <= 2.15e-209) tmp = Float64(Float64(b / z) * Float64(1.0 / c_m)); elseif (y <= 4.5e-183) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (y <= 1.12e-32) tmp = Float64(b * Float64(1.0 / Float64(z * c_m))); elseif ((y <= 3.6e+60) || (!(y <= 4.5e+113) && (y <= 4.8e+132))) tmp = t_1; else tmp = t_2; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (t * (a / c_m));
t_2 = 9.0 * ((x / c_m) * (y / z));
tmp = 0.0;
if (y <= -1.25e-99)
tmp = t_2;
elseif (y <= -9e-297)
tmp = t_1;
elseif (y <= 2.15e-209)
tmp = (b / z) * (1.0 / c_m);
elseif (y <= 4.5e-183)
tmp = -4.0 * ((t * a) / c_m);
elseif (y <= 1.12e-32)
tmp = b * (1.0 / (z * c_m));
elseif ((y <= 3.6e+60) || (~((y <= 4.5e+113)) && (y <= 4.8e+132)))
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -1.25e-99], t$95$2, If[LessEqual[y, -9e-297], t$95$1, If[LessEqual[y, 2.15e-209], N[(N[(b / z), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-183], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e-32], N[(b * N[(1.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 3.6e+60], And[N[Not[LessEqual[y, 4.5e+113]], $MachinePrecision], LessEqual[y, 4.8e+132]]], t$95$1, t$95$2]]]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
t_2 := 9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-297}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-209}:\\
\;\;\;\;\frac{b}{z} \cdot \frac{1}{c\_m}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-183}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-32}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+60} \lor \neg \left(y \leq 4.5 \cdot 10^{+113}\right) \land y \leq 4.8 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if y < -1.24999999999999992e-99 or 3.59999999999999968e60 < y < 4.5000000000000001e113 or 4.8000000000000002e132 < y Initial program 85.8%
+-commutative85.8%
associate-+r-85.8%
*-commutative85.8%
associate-*r*84.2%
*-commutative84.2%
associate-+r-84.2%
+-commutative84.2%
associate-*l*84.2%
associate-*l*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around 0 80.2%
Taylor expanded in x around inf 55.9%
times-frac53.2%
Simplified53.2%
if -1.24999999999999992e-99 < y < -8.99999999999999951e-297 or 1.12e-32 < y < 3.59999999999999968e60 or 4.5000000000000001e113 < y < 4.8000000000000002e132Initial program 72.2%
+-commutative72.2%
associate-+r-72.2%
*-commutative72.2%
associate-*r*73.4%
*-commutative73.4%
associate-+r-73.4%
+-commutative73.4%
associate-*l*73.5%
associate-*l*77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in z around 0 74.5%
Taylor expanded in a around inf 58.3%
*-commutative58.3%
associate-/l*63.2%
Simplified63.2%
if -8.99999999999999951e-297 < y < 2.15000000000000003e-209Initial program 79.0%
+-commutative79.0%
associate-+r-79.0%
*-commutative79.0%
associate-*r*89.1%
*-commutative89.1%
associate-+r-89.1%
+-commutative89.1%
associate-*l*89.1%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Applied egg-rr76.4%
Taylor expanded in b around inf 77.0%
if 2.15000000000000003e-209 < y < 4.49999999999999971e-183Initial program 83.5%
+-commutative83.5%
associate-+r-83.5%
*-commutative83.5%
associate-*r*83.2%
*-commutative83.2%
associate-+r-83.2%
+-commutative83.2%
associate-*l*83.2%
associate-*l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in z around inf 67.8%
if 4.49999999999999971e-183 < y < 1.12e-32Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
associate-*r*92.8%
*-commutative92.8%
associate-+r-92.8%
+-commutative92.8%
associate-*l*92.9%
associate-*l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in b around inf 54.1%
*-commutative54.1%
Simplified54.1%
div-inv54.2%
Applied egg-rr54.2%
Final simplification58.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* a (/ t c_m)))) (t_2 (* 9.0 (/ y (* z (/ c_m x))))))
(*
c_s
(if (<= x -1.15e+139)
t_2
(if (<= x -5.4e+91)
t_1
(if (<= x -4.5e-12)
(* b (/ 1.0 (* z c_m)))
(if (<= x -2.4e-30)
(* -4.0 (* (* t a) (/ 1.0 c_m)))
(if (<= x -6.2e-82)
(/ 1.0 (/ (* z c_m) b))
(if (<= x -4.2e-294)
(* -4.0 (* t (/ a c_m)))
(if (<= x 2.9e-200)
(/ (/ b c_m) z)
(if (<= x 9e-91) t_1 t_2)))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (a * (t / c_m));
double t_2 = 9.0 * (y / (z * (c_m / x)));
double tmp;
if (x <= -1.15e+139) {
tmp = t_2;
} else if (x <= -5.4e+91) {
tmp = t_1;
} else if (x <= -4.5e-12) {
tmp = b * (1.0 / (z * c_m));
} else if (x <= -2.4e-30) {
tmp = -4.0 * ((t * a) * (1.0 / c_m));
} else if (x <= -6.2e-82) {
tmp = 1.0 / ((z * c_m) / b);
} else if (x <= -4.2e-294) {
tmp = -4.0 * (t * (a / c_m));
} else if (x <= 2.9e-200) {
tmp = (b / c_m) / z;
} else if (x <= 9e-91) {
tmp = t_1;
} else {
tmp = t_2;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (a * (t / c_m))
t_2 = 9.0d0 * (y / (z * (c_m / x)))
if (x <= (-1.15d+139)) then
tmp = t_2
else if (x <= (-5.4d+91)) then
tmp = t_1
else if (x <= (-4.5d-12)) then
tmp = b * (1.0d0 / (z * c_m))
else if (x <= (-2.4d-30)) then
tmp = (-4.0d0) * ((t * a) * (1.0d0 / c_m))
else if (x <= (-6.2d-82)) then
tmp = 1.0d0 / ((z * c_m) / b)
else if (x <= (-4.2d-294)) then
tmp = (-4.0d0) * (t * (a / c_m))
else if (x <= 2.9d-200) then
tmp = (b / c_m) / z
else if (x <= 9d-91) then
tmp = t_1
else
tmp = t_2
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (a * (t / c_m));
double t_2 = 9.0 * (y / (z * (c_m / x)));
double tmp;
if (x <= -1.15e+139) {
tmp = t_2;
} else if (x <= -5.4e+91) {
tmp = t_1;
} else if (x <= -4.5e-12) {
tmp = b * (1.0 / (z * c_m));
} else if (x <= -2.4e-30) {
tmp = -4.0 * ((t * a) * (1.0 / c_m));
} else if (x <= -6.2e-82) {
tmp = 1.0 / ((z * c_m) / b);
} else if (x <= -4.2e-294) {
tmp = -4.0 * (t * (a / c_m));
} else if (x <= 2.9e-200) {
tmp = (b / c_m) / z;
} else if (x <= 9e-91) {
tmp = t_1;
} else {
tmp = t_2;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (a * (t / c_m)) t_2 = 9.0 * (y / (z * (c_m / x))) tmp = 0 if x <= -1.15e+139: tmp = t_2 elif x <= -5.4e+91: tmp = t_1 elif x <= -4.5e-12: tmp = b * (1.0 / (z * c_m)) elif x <= -2.4e-30: tmp = -4.0 * ((t * a) * (1.0 / c_m)) elif x <= -6.2e-82: tmp = 1.0 / ((z * c_m) / b) elif x <= -4.2e-294: tmp = -4.0 * (t * (a / c_m)) elif x <= 2.9e-200: tmp = (b / c_m) / z elif x <= 9e-91: tmp = t_1 else: tmp = t_2 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(a * Float64(t / c_m))) t_2 = Float64(9.0 * Float64(y / Float64(z * Float64(c_m / x)))) tmp = 0.0 if (x <= -1.15e+139) tmp = t_2; elseif (x <= -5.4e+91) tmp = t_1; elseif (x <= -4.5e-12) tmp = Float64(b * Float64(1.0 / Float64(z * c_m))); elseif (x <= -2.4e-30) tmp = Float64(-4.0 * Float64(Float64(t * a) * Float64(1.0 / c_m))); elseif (x <= -6.2e-82) tmp = Float64(1.0 / Float64(Float64(z * c_m) / b)); elseif (x <= -4.2e-294) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); elseif (x <= 2.9e-200) tmp = Float64(Float64(b / c_m) / z); elseif (x <= 9e-91) tmp = t_1; else tmp = t_2; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (a * (t / c_m));
t_2 = 9.0 * (y / (z * (c_m / x)));
tmp = 0.0;
if (x <= -1.15e+139)
tmp = t_2;
elseif (x <= -5.4e+91)
tmp = t_1;
elseif (x <= -4.5e-12)
tmp = b * (1.0 / (z * c_m));
elseif (x <= -2.4e-30)
tmp = -4.0 * ((t * a) * (1.0 / c_m));
elseif (x <= -6.2e-82)
tmp = 1.0 / ((z * c_m) / b);
elseif (x <= -4.2e-294)
tmp = -4.0 * (t * (a / c_m));
elseif (x <= 2.9e-200)
tmp = (b / c_m) / z;
elseif (x <= 9e-91)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(y / N[(z * N[(c$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -1.15e+139], t$95$2, If[LessEqual[x, -5.4e+91], t$95$1, If[LessEqual[x, -4.5e-12], N[(b * N[(1.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e-30], N[(-4.0 * N[(N[(t * a), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.2e-82], N[(1.0 / N[(N[(z * c$95$m), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.2e-294], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-200], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 9e-91], t$95$1, t$95$2]]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
t_2 := 9 \cdot \frac{y}{z \cdot \frac{c\_m}{x}}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+139}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-12}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c\_m}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-30}:\\
\;\;\;\;-4 \cdot \left(\left(t \cdot a\right) \cdot \frac{1}{c\_m}\right)\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{1}{\frac{z \cdot c\_m}{b}}\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-294}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if x < -1.15e139 or 8.99999999999999952e-91 < x Initial program 81.8%
+-commutative81.8%
associate-+r-81.8%
*-commutative81.8%
associate-*r*80.8%
*-commutative80.8%
associate-+r-80.8%
+-commutative80.8%
associate-*l*80.8%
associate-*l*80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in z around 0 78.8%
Taylor expanded in x around inf 59.8%
times-frac59.2%
Simplified59.2%
clear-num59.2%
frac-times66.8%
*-un-lft-identity66.8%
Applied egg-rr66.8%
if -1.15e139 < x < -5.4e91 or 2.9e-200 < x < 8.99999999999999952e-91Initial program 97.0%
+-commutative97.0%
associate-+r-97.0%
*-commutative97.0%
associate-*r*94.4%
*-commutative94.4%
associate-+r-94.4%
+-commutative94.4%
associate-*l*94.3%
associate-*l*94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in z around inf 53.8%
*-commutative53.8%
associate-/l*53.5%
Simplified53.5%
if -5.4e91 < x < -4.49999999999999981e-12Initial program 86.4%
+-commutative86.4%
associate-+r-86.4%
*-commutative86.4%
associate-*r*85.5%
*-commutative85.5%
associate-+r-85.5%
+-commutative85.5%
associate-*l*85.4%
associate-*l*86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in b around inf 54.3%
*-commutative54.3%
Simplified54.3%
div-inv54.3%
Applied egg-rr54.3%
if -4.49999999999999981e-12 < x < -2.39999999999999985e-30Initial program 75.6%
+-commutative75.6%
associate-+r-75.6%
*-commutative75.6%
associate-*r*87.5%
*-commutative87.5%
associate-+r-87.5%
+-commutative87.5%
associate-*l*87.5%
associate-*l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in z around inf 46.3%
div-inv46.5%
Applied egg-rr46.5%
if -2.39999999999999985e-30 < x < -6.19999999999999999e-82Initial program 88.4%
+-commutative88.4%
associate-+r-88.4%
*-commutative88.4%
associate-*r*88.4%
*-commutative88.4%
associate-+r-88.4%
+-commutative88.4%
associate-*l*88.8%
associate-*l*88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in b around inf 46.3%
*-commutative46.3%
Simplified46.3%
clear-num46.5%
inv-pow46.5%
Applied egg-rr46.5%
unpow-146.5%
associate-/l*46.9%
Simplified46.9%
associate-*r/46.5%
Applied egg-rr46.5%
if -6.19999999999999999e-82 < x < -4.19999999999999969e-294Initial program 72.1%
+-commutative72.1%
associate-+r-72.1%
*-commutative72.1%
associate-*r*76.7%
*-commutative76.7%
associate-+r-76.7%
+-commutative76.7%
associate-*l*76.7%
associate-*l*79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in z around 0 74.7%
Taylor expanded in a around inf 58.5%
*-commutative58.5%
associate-/l*60.6%
Simplified60.6%
if -4.19999999999999969e-294 < x < 2.9e-200Initial program 74.0%
+-commutative74.0%
associate-+r-74.0%
*-commutative74.0%
associate-*r*77.1%
*-commutative77.1%
associate-+r-77.1%
+-commutative77.1%
associate-*l*77.1%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in z around 0 74.3%
Taylor expanded in b around inf 54.5%
associate-/r*54.5%
Simplified54.5%
Final simplification60.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* t (/ a c_m)))))
(*
c_s
(if (<= y -1.25e-99)
(* 9.0 (/ y (* z (/ c_m x))))
(if (<= y -8.2e-297)
t_1
(if (<= y 3.6e-209)
(* (/ b z) (/ 1.0 c_m))
(if (<= y 2.4e-186)
(* -4.0 (/ (* t a) c_m))
(if (<= y 2.6e-8)
(* b (/ 1.0 (* z c_m)))
(if (or (<= y 1.3e+113) (not (<= y 3e+167)))
(* x (* y (/ 9.0 (* z c_m))))
t_1)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double tmp;
if (y <= -1.25e-99) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= -8.2e-297) {
tmp = t_1;
} else if (y <= 3.6e-209) {
tmp = (b / z) * (1.0 / c_m);
} else if (y <= 2.4e-186) {
tmp = -4.0 * ((t * a) / c_m);
} else if (y <= 2.6e-8) {
tmp = b * (1.0 / (z * c_m));
} else if ((y <= 1.3e+113) || !(y <= 3e+167)) {
tmp = x * (y * (9.0 / (z * c_m)));
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c_m))
if (y <= (-1.25d-99)) then
tmp = 9.0d0 * (y / (z * (c_m / x)))
else if (y <= (-8.2d-297)) then
tmp = t_1
else if (y <= 3.6d-209) then
tmp = (b / z) * (1.0d0 / c_m)
else if (y <= 2.4d-186) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (y <= 2.6d-8) then
tmp = b * (1.0d0 / (z * c_m))
else if ((y <= 1.3d+113) .or. (.not. (y <= 3d+167))) then
tmp = x * (y * (9.0d0 / (z * c_m)))
else
tmp = t_1
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double tmp;
if (y <= -1.25e-99) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= -8.2e-297) {
tmp = t_1;
} else if (y <= 3.6e-209) {
tmp = (b / z) * (1.0 / c_m);
} else if (y <= 2.4e-186) {
tmp = -4.0 * ((t * a) / c_m);
} else if (y <= 2.6e-8) {
tmp = b * (1.0 / (z * c_m));
} else if ((y <= 1.3e+113) || !(y <= 3e+167)) {
tmp = x * (y * (9.0 / (z * c_m)));
} else {
tmp = t_1;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (t * (a / c_m)) tmp = 0 if y <= -1.25e-99: tmp = 9.0 * (y / (z * (c_m / x))) elif y <= -8.2e-297: tmp = t_1 elif y <= 3.6e-209: tmp = (b / z) * (1.0 / c_m) elif y <= 2.4e-186: tmp = -4.0 * ((t * a) / c_m) elif y <= 2.6e-8: tmp = b * (1.0 / (z * c_m)) elif (y <= 1.3e+113) or not (y <= 3e+167): tmp = x * (y * (9.0 / (z * c_m))) else: tmp = t_1 return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(t * Float64(a / c_m))) tmp = 0.0 if (y <= -1.25e-99) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c_m / x)))); elseif (y <= -8.2e-297) tmp = t_1; elseif (y <= 3.6e-209) tmp = Float64(Float64(b / z) * Float64(1.0 / c_m)); elseif (y <= 2.4e-186) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (y <= 2.6e-8) tmp = Float64(b * Float64(1.0 / Float64(z * c_m))); elseif ((y <= 1.3e+113) || !(y <= 3e+167)) tmp = Float64(x * Float64(y * Float64(9.0 / Float64(z * c_m)))); else tmp = t_1; end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (t * (a / c_m));
tmp = 0.0;
if (y <= -1.25e-99)
tmp = 9.0 * (y / (z * (c_m / x)));
elseif (y <= -8.2e-297)
tmp = t_1;
elseif (y <= 3.6e-209)
tmp = (b / z) * (1.0 / c_m);
elseif (y <= 2.4e-186)
tmp = -4.0 * ((t * a) / c_m);
elseif (y <= 2.6e-8)
tmp = b * (1.0 / (z * c_m));
elseif ((y <= 1.3e+113) || ~((y <= 3e+167)))
tmp = x * (y * (9.0 / (z * c_m)));
else
tmp = t_1;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -1.25e-99], N[(9.0 * N[(y / N[(z * N[(c$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.2e-297], t$95$1, If[LessEqual[y, 3.6e-209], N[(N[(b / z), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-186], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-8], N[(b * N[(1.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.3e+113], N[Not[LessEqual[y, 3e+167]], $MachinePrecision]], N[(x * N[(y * N[(9.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-99}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c\_m}{x}}\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-297}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-209}:\\
\;\;\;\;\frac{b}{z} \cdot \frac{1}{c\_m}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-186}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-8}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+113} \lor \neg \left(y \leq 3 \cdot 10^{+167}\right):\\
\;\;\;\;x \cdot \left(y \cdot \frac{9}{z \cdot c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if y < -1.24999999999999992e-99Initial program 85.3%
+-commutative85.3%
associate-+r-85.3%
*-commutative85.3%
associate-*r*84.1%
*-commutative84.1%
associate-+r-84.1%
+-commutative84.1%
associate-*l*84.1%
associate-*l*85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in z around 0 79.3%
Taylor expanded in x around inf 53.4%
times-frac49.6%
Simplified49.6%
clear-num49.6%
frac-times54.3%
*-un-lft-identity54.3%
Applied egg-rr54.3%
if -1.24999999999999992e-99 < y < -8.2000000000000004e-297 or 1.3e113 < y < 3.00000000000000012e167Initial program 72.7%
+-commutative72.7%
associate-+r-72.7%
*-commutative72.7%
associate-*r*75.6%
*-commutative75.6%
associate-+r-75.6%
+-commutative75.6%
associate-*l*75.7%
associate-*l*77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in z around 0 72.5%
Taylor expanded in a around inf 55.3%
*-commutative55.3%
associate-/l*59.3%
Simplified59.3%
if -8.2000000000000004e-297 < y < 3.60000000000000016e-209Initial program 79.0%
+-commutative79.0%
associate-+r-79.0%
*-commutative79.0%
associate-*r*89.1%
*-commutative89.1%
associate-+r-89.1%
+-commutative89.1%
associate-*l*89.1%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Applied egg-rr76.4%
Taylor expanded in b around inf 77.0%
if 3.60000000000000016e-209 < y < 2.40000000000000003e-186Initial program 83.5%
+-commutative83.5%
associate-+r-83.5%
*-commutative83.5%
associate-*r*83.2%
*-commutative83.2%
associate-+r-83.2%
+-commutative83.2%
associate-*l*83.2%
associate-*l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in z around inf 67.8%
if 2.40000000000000003e-186 < y < 2.6000000000000001e-8Initial program 90.2%
+-commutative90.2%
associate-+r-90.2%
*-commutative90.2%
associate-*r*93.5%
*-commutative93.5%
associate-+r-93.5%
+-commutative93.5%
associate-*l*93.6%
associate-*l*87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in b around inf 52.3%
*-commutative52.3%
Simplified52.3%
div-inv52.4%
Applied egg-rr52.4%
if 2.6000000000000001e-8 < y < 1.3e113 or 3.00000000000000012e167 < y Initial program 82.6%
+-commutative82.6%
associate-+r-82.6%
*-commutative82.6%
associate-*r*78.0%
*-commutative78.0%
associate-+r-78.0%
+-commutative78.0%
associate-*l*78.1%
associate-*l*80.3%
*-commutative80.3%
Simplified80.3%
add-cube-cbrt80.0%
pow380.0%
associate-*r*79.9%
*-commutative79.9%
associate-*l*79.9%
Applied egg-rr79.9%
Taylor expanded in x around inf 58.5%
associate-/l*64.8%
rem-cube-cbrt64.8%
associate-/l*64.8%
*-commutative64.8%
Simplified64.8%
Final simplification59.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* -4.0 (* t (/ a c_m)))))
(*
c_s
(if (<= y -1.1e-107)
(* 9.0 (/ y (* z (/ c_m x))))
(if (<= y -1.1e-296)
t_1
(if (<= y 1.1e-209)
(* (/ b z) (/ 1.0 c_m))
(if (<= y 3.7e-183)
(* -4.0 (/ (* t a) c_m))
(if (<= y 1.25e-19)
(* b (/ 1.0 (* z c_m)))
(if (<= y 4.8e+113)
(* x (* y (/ 9.0 (* z c_m))))
(if (<= y 2.3e+168) t_1 (* x (* (/ y c_m) (/ 9.0 z)))))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double tmp;
if (y <= -1.1e-107) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= -1.1e-296) {
tmp = t_1;
} else if (y <= 1.1e-209) {
tmp = (b / z) * (1.0 / c_m);
} else if (y <= 3.7e-183) {
tmp = -4.0 * ((t * a) / c_m);
} else if (y <= 1.25e-19) {
tmp = b * (1.0 / (z * c_m));
} else if (y <= 4.8e+113) {
tmp = x * (y * (9.0 / (z * c_m)));
} else if (y <= 2.3e+168) {
tmp = t_1;
} else {
tmp = x * ((y / c_m) * (9.0 / z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * (t * (a / c_m))
if (y <= (-1.1d-107)) then
tmp = 9.0d0 * (y / (z * (c_m / x)))
else if (y <= (-1.1d-296)) then
tmp = t_1
else if (y <= 1.1d-209) then
tmp = (b / z) * (1.0d0 / c_m)
else if (y <= 3.7d-183) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (y <= 1.25d-19) then
tmp = b * (1.0d0 / (z * c_m))
else if (y <= 4.8d+113) then
tmp = x * (y * (9.0d0 / (z * c_m)))
else if (y <= 2.3d+168) then
tmp = t_1
else
tmp = x * ((y / c_m) * (9.0d0 / z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = -4.0 * (t * (a / c_m));
double tmp;
if (y <= -1.1e-107) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= -1.1e-296) {
tmp = t_1;
} else if (y <= 1.1e-209) {
tmp = (b / z) * (1.0 / c_m);
} else if (y <= 3.7e-183) {
tmp = -4.0 * ((t * a) / c_m);
} else if (y <= 1.25e-19) {
tmp = b * (1.0 / (z * c_m));
} else if (y <= 4.8e+113) {
tmp = x * (y * (9.0 / (z * c_m)));
} else if (y <= 2.3e+168) {
tmp = t_1;
} else {
tmp = x * ((y / c_m) * (9.0 / z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = -4.0 * (t * (a / c_m)) tmp = 0 if y <= -1.1e-107: tmp = 9.0 * (y / (z * (c_m / x))) elif y <= -1.1e-296: tmp = t_1 elif y <= 1.1e-209: tmp = (b / z) * (1.0 / c_m) elif y <= 3.7e-183: tmp = -4.0 * ((t * a) / c_m) elif y <= 1.25e-19: tmp = b * (1.0 / (z * c_m)) elif y <= 4.8e+113: tmp = x * (y * (9.0 / (z * c_m))) elif y <= 2.3e+168: tmp = t_1 else: tmp = x * ((y / c_m) * (9.0 / z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(-4.0 * Float64(t * Float64(a / c_m))) tmp = 0.0 if (y <= -1.1e-107) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c_m / x)))); elseif (y <= -1.1e-296) tmp = t_1; elseif (y <= 1.1e-209) tmp = Float64(Float64(b / z) * Float64(1.0 / c_m)); elseif (y <= 3.7e-183) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (y <= 1.25e-19) tmp = Float64(b * Float64(1.0 / Float64(z * c_m))); elseif (y <= 4.8e+113) tmp = Float64(x * Float64(y * Float64(9.0 / Float64(z * c_m)))); elseif (y <= 2.3e+168) tmp = t_1; else tmp = Float64(x * Float64(Float64(y / c_m) * Float64(9.0 / z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = -4.0 * (t * (a / c_m));
tmp = 0.0;
if (y <= -1.1e-107)
tmp = 9.0 * (y / (z * (c_m / x)));
elseif (y <= -1.1e-296)
tmp = t_1;
elseif (y <= 1.1e-209)
tmp = (b / z) * (1.0 / c_m);
elseif (y <= 3.7e-183)
tmp = -4.0 * ((t * a) / c_m);
elseif (y <= 1.25e-19)
tmp = b * (1.0 / (z * c_m));
elseif (y <= 4.8e+113)
tmp = x * (y * (9.0 / (z * c_m)));
elseif (y <= 2.3e+168)
tmp = t_1;
else
tmp = x * ((y / c_m) * (9.0 / z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[y, -1.1e-107], N[(9.0 * N[(y / N[(z * N[(c$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.1e-296], t$95$1, If[LessEqual[y, 1.1e-209], N[(N[(b / z), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e-183], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-19], N[(b * N[(1.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+113], N[(x * N[(y * N[(9.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+168], t$95$1, N[(x * N[(N[(y / c$95$m), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-107}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c\_m}{x}}\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-209}:\\
\;\;\;\;\frac{b}{z} \cdot \frac{1}{c\_m}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-183}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-19}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+113}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{9}{z \cdot c\_m}\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{c\_m} \cdot \frac{9}{z}\right)\\
\end{array}
\end{array}
\end{array}
if y < -1.10000000000000006e-107Initial program 84.9%
+-commutative84.9%
associate-+r-84.9%
*-commutative84.9%
associate-*r*82.8%
*-commutative82.8%
associate-+r-82.8%
+-commutative82.8%
associate-*l*82.8%
associate-*l*84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in z around 0 80.2%
Taylor expanded in x around inf 52.3%
times-frac47.7%
Simplified47.7%
clear-num47.7%
frac-times52.2%
*-un-lft-identity52.2%
Applied egg-rr52.2%
if -1.10000000000000006e-107 < y < -1.10000000000000006e-296 or 4.79999999999999966e113 < y < 2.2999999999999999e168Initial program 72.5%
+-commutative72.5%
associate-+r-72.5%
*-commutative72.5%
associate-*r*77.3%
*-commutative77.3%
associate-+r-77.3%
+-commutative77.3%
associate-*l*77.3%
associate-*l*77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in z around 0 70.7%
Taylor expanded in a around inf 55.5%
*-commutative55.5%
associate-/l*60.3%
Simplified60.3%
if -1.10000000000000006e-296 < y < 1.10000000000000005e-209Initial program 79.0%
+-commutative79.0%
associate-+r-79.0%
*-commutative79.0%
associate-*r*89.1%
*-commutative89.1%
associate-+r-89.1%
+-commutative89.1%
associate-*l*89.1%
associate-*l*84.2%
*-commutative84.2%
Simplified84.2%
Applied egg-rr76.4%
Taylor expanded in b around inf 77.0%
if 1.10000000000000005e-209 < y < 3.6999999999999999e-183Initial program 83.5%
+-commutative83.5%
associate-+r-83.5%
*-commutative83.5%
associate-*r*83.2%
*-commutative83.2%
associate-+r-83.2%
+-commutative83.2%
associate-*l*83.2%
associate-*l*83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in z around inf 67.8%
if 3.6999999999999999e-183 < y < 1.2500000000000001e-19Initial program 90.2%
+-commutative90.2%
associate-+r-90.2%
*-commutative90.2%
associate-*r*93.5%
*-commutative93.5%
associate-+r-93.5%
+-commutative93.5%
associate-*l*93.6%
associate-*l*87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in b around inf 52.3%
*-commutative52.3%
Simplified52.3%
div-inv52.4%
Applied egg-rr52.4%
if 1.2500000000000001e-19 < y < 4.79999999999999966e113Initial program 79.2%
+-commutative79.2%
associate-+r-79.2%
*-commutative79.2%
associate-*r*74.9%
*-commutative74.9%
associate-+r-74.9%
+-commutative74.9%
associate-*l*74.9%
associate-*l*79.0%
*-commutative79.0%
Simplified79.0%
add-cube-cbrt78.8%
pow378.8%
associate-*r*78.8%
*-commutative78.8%
associate-*l*78.8%
Applied egg-rr78.8%
Taylor expanded in x around inf 53.9%
associate-/l*58.0%
rem-cube-cbrt58.0%
associate-/l*58.0%
*-commutative58.0%
Simplified58.0%
if 2.2999999999999999e168 < y Initial program 86.3%
+-commutative86.3%
associate-+r-86.3%
*-commutative86.3%
associate-*r*81.4%
*-commutative81.4%
associate-+r-81.4%
+-commutative81.4%
associate-*l*81.5%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
add-cube-cbrt81.4%
pow381.4%
associate-*r*81.2%
*-commutative81.2%
associate-*l*81.2%
Applied egg-rr81.2%
Taylor expanded in x around inf 63.5%
associate-/l*72.2%
rem-cube-cbrt72.2%
times-frac85.8%
Simplified85.8%
Final simplification59.5%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 2.7e+65)
(/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c_m))
(/
(+
(* t (+ (* -4.0 (/ (* z a) c_m)) (/ b (* t c_m))))
(* (/ y c_m) (* x 9.0)))
z))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= 2.7e+65) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else {
tmp = ((t * ((-4.0 * ((z * a) / c_m)) + (b / (t * c_m)))) + ((y / c_m) * (x * 9.0))) / z;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= 2.7d+65) then
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (z * c_m)
else
tmp = ((t * (((-4.0d0) * ((z * a) / c_m)) + (b / (t * c_m)))) + ((y / c_m) * (x * 9.0d0))) / z
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= 2.7e+65) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
} else {
tmp = ((t * ((-4.0 * ((z * a) / c_m)) + (b / (t * c_m)))) + ((y / c_m) * (x * 9.0))) / z;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= 2.7e+65: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m) else: tmp = ((t * ((-4.0 * ((z * a) / c_m)) + (b / (t * c_m)))) + ((y / c_m) * (x * 9.0))) / z return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= 2.7e+65) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c_m)); else tmp = Float64(Float64(Float64(t * Float64(Float64(-4.0 * Float64(Float64(z * a) / c_m)) + Float64(b / Float64(t * c_m)))) + Float64(Float64(y / c_m) * Float64(x * 9.0))) / z); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 <= 2.7e+65)
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c_m);
else
tmp = ((t * ((-4.0 * ((z * a) / c_m)) + (b / (t * c_m)))) + ((y / c_m) * (x * 9.0))) / z;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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, 2.7e+65], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * N[(N[(-4.0 * N[(N[(z * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(t * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / c$95$m), $MachinePrecision] * N[(x * 9.0), $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])\\\\
[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 2.7 \cdot 10^{+65}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(-4 \cdot \frac{z \cdot a}{c\_m} + \frac{b}{t \cdot c\_m}\right) + \frac{y}{c\_m} \cdot \left(x \cdot 9\right)}{z}\\
\end{array}
\end{array}
if c < 2.70000000000000019e65Initial program 84.4%
+-commutative84.4%
associate-+r-84.4%
*-commutative84.4%
associate-*r*84.7%
*-commutative84.7%
associate-+r-84.7%
+-commutative84.7%
associate-*l*84.7%
associate-*l*85.7%
*-commutative85.7%
Simplified85.7%
if 2.70000000000000019e65 < c Initial program 70.3%
+-commutative70.3%
associate-+r-70.3%
*-commutative70.3%
associate-*r*72.1%
*-commutative72.1%
associate-+r-72.1%
+-commutative72.1%
associate-*l*72.1%
associate-*l*68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in z around 0 79.0%
div-inv78.9%
fma-define78.9%
associate-/l*83.1%
fma-define83.1%
associate-/l*85.1%
Applied egg-rr85.1%
Simplified78.8%
Taylor expanded in t around inf 78.6%
Final simplification84.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.
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 (<= y -2.4e-27)
(* 9.0 (/ y (* z (/ c_m x))))
(if (<= y 115000000.0)
(/ (- b (* z (* 4.0 (* t a)))) (* z c_m))
(if (<= y 4.8e+113)
(/ (+ b (* x (* 9.0 y))) (* z c_m))
(if (<= y 1.5e+167)
(* -4.0 (* t (/ a c_m)))
(* x (* (/ y c_m) (/ 9.0 z)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 (y <= -2.4e-27) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= 115000000.0) {
tmp = (b - (z * (4.0 * (t * a)))) / (z * c_m);
} else if (y <= 4.8e+113) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else if (y <= 1.5e+167) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = x * ((y / c_m) * (9.0 / z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (y <= (-2.4d-27)) then
tmp = 9.0d0 * (y / (z * (c_m / x)))
else if (y <= 115000000.0d0) then
tmp = (b - (z * (4.0d0 * (t * a)))) / (z * c_m)
else if (y <= 4.8d+113) then
tmp = (b + (x * (9.0d0 * y))) / (z * c_m)
else if (y <= 1.5d+167) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = x * ((y / c_m) * (9.0d0 / z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (y <= -2.4e-27) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= 115000000.0) {
tmp = (b - (z * (4.0 * (t * a)))) / (z * c_m);
} else if (y <= 4.8e+113) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else if (y <= 1.5e+167) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = x * ((y / c_m) * (9.0 / z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 y <= -2.4e-27: tmp = 9.0 * (y / (z * (c_m / x))) elif y <= 115000000.0: tmp = (b - (z * (4.0 * (t * a)))) / (z * c_m) elif y <= 4.8e+113: tmp = (b + (x * (9.0 * y))) / (z * c_m) elif y <= 1.5e+167: tmp = -4.0 * (t * (a / c_m)) else: tmp = x * ((y / c_m) * (9.0 / z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 (y <= -2.4e-27) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c_m / x)))); elseif (y <= 115000000.0) tmp = Float64(Float64(b - Float64(z * Float64(4.0 * Float64(t * a)))) / Float64(z * c_m)); elseif (y <= 4.8e+113) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c_m)); elseif (y <= 1.5e+167) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(x * Float64(Float64(y / c_m) * Float64(9.0 / z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 (y <= -2.4e-27)
tmp = 9.0 * (y / (z * (c_m / x)));
elseif (y <= 115000000.0)
tmp = (b - (z * (4.0 * (t * a)))) / (z * c_m);
elseif (y <= 4.8e+113)
tmp = (b + (x * (9.0 * y))) / (z * c_m);
elseif (y <= 1.5e+167)
tmp = -4.0 * (t * (a / c_m));
else
tmp = x * ((y / c_m) * (9.0 / z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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[y, -2.4e-27], N[(9.0 * N[(y / N[(z * N[(c$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 115000000.0], N[(N[(b - N[(z * N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+113], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+167], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / c$95$m), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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}\;y \leq -2.4 \cdot 10^{-27}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c\_m}{x}}\\
\mathbf{elif}\;y \leq 115000000:\\
\;\;\;\;\frac{b - z \cdot \left(4 \cdot \left(t \cdot a\right)\right)}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+113}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+167}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{c\_m} \cdot \frac{9}{z}\right)\\
\end{array}
\end{array}
if y < -2.40000000000000002e-27Initial program 83.4%
+-commutative83.4%
associate-+r-83.4%
*-commutative83.4%
associate-*r*82.0%
*-commutative82.0%
associate-+r-82.0%
+-commutative82.0%
associate-*l*81.9%
associate-*l*83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in z around 0 77.4%
Taylor expanded in x around inf 59.4%
times-frac57.2%
Simplified57.2%
clear-num57.2%
frac-times62.0%
*-un-lft-identity62.0%
Applied egg-rr62.0%
if -2.40000000000000002e-27 < y < 1.15e8Initial program 81.4%
+-commutative81.4%
associate-+r-81.4%
*-commutative81.4%
associate-*r*84.4%
*-commutative84.4%
associate-+r-84.4%
+-commutative84.4%
associate-*l*84.4%
associate-*l*84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in x around 0 72.2%
*-commutative72.2%
associate-*r*72.2%
Simplified72.2%
Taylor expanded in a around 0 72.2%
associate-*r*75.3%
*-commutative75.3%
*-commutative75.3%
associate-*l*75.3%
Simplified75.3%
if 1.15e8 < y < 4.79999999999999966e113Initial program 80.8%
+-commutative80.8%
associate-+r-80.8%
*-commutative80.8%
associate-*r*80.8%
*-commutative80.8%
associate-+r-80.8%
+-commutative80.8%
associate-*l*80.8%
associate-*l*80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
associate-*r*61.9%
Simplified61.9%
if 4.79999999999999966e113 < y < 1.50000000000000006e167Initial program 71.8%
+-commutative71.8%
associate-+r-71.8%
*-commutative71.8%
associate-*r*71.8%
*-commutative71.8%
associate-+r-71.8%
+-commutative71.8%
associate-*l*71.8%
associate-*l*65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in z around 0 59.5%
Taylor expanded in a around inf 57.6%
*-commutative57.6%
associate-/l*57.8%
Simplified57.8%
if 1.50000000000000006e167 < y Initial program 86.3%
+-commutative86.3%
associate-+r-86.3%
*-commutative86.3%
associate-*r*81.4%
*-commutative81.4%
associate-+r-81.4%
+-commutative81.4%
associate-*l*81.5%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
add-cube-cbrt81.4%
pow381.4%
associate-*r*81.2%
*-commutative81.2%
associate-*l*81.2%
Applied egg-rr81.2%
Taylor expanded in x around inf 63.5%
associate-/l*72.2%
rem-cube-cbrt72.2%
times-frac85.8%
Simplified85.8%
Final simplification70.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.
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 (<= y -2.4e-27)
(* 9.0 (/ y (* z (/ c_m x))))
(if (<= y 72000000000.0)
(/ (+ b (* t (* a (* z -4.0)))) (* z c_m))
(if (<= y 4.8e+113)
(/ (+ b (* x (* 9.0 y))) (* z c_m))
(if (<= y 2.9e+167)
(* -4.0 (* t (/ a c_m)))
(* x (* (/ y c_m) (/ 9.0 z)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 (y <= -2.4e-27) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= 72000000000.0) {
tmp = (b + (t * (a * (z * -4.0)))) / (z * c_m);
} else if (y <= 4.8e+113) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else if (y <= 2.9e+167) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = x * ((y / c_m) * (9.0 / z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 (y <= (-2.4d-27)) then
tmp = 9.0d0 * (y / (z * (c_m / x)))
else if (y <= 72000000000.0d0) then
tmp = (b + (t * (a * (z * (-4.0d0))))) / (z * c_m)
else if (y <= 4.8d+113) then
tmp = (b + (x * (9.0d0 * y))) / (z * c_m)
else if (y <= 2.9d+167) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = x * ((y / c_m) * (9.0d0 / z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 (y <= -2.4e-27) {
tmp = 9.0 * (y / (z * (c_m / x)));
} else if (y <= 72000000000.0) {
tmp = (b + (t * (a * (z * -4.0)))) / (z * c_m);
} else if (y <= 4.8e+113) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else if (y <= 2.9e+167) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = x * ((y / c_m) * (9.0 / z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 y <= -2.4e-27: tmp = 9.0 * (y / (z * (c_m / x))) elif y <= 72000000000.0: tmp = (b + (t * (a * (z * -4.0)))) / (z * c_m) elif y <= 4.8e+113: tmp = (b + (x * (9.0 * y))) / (z * c_m) elif y <= 2.9e+167: tmp = -4.0 * (t * (a / c_m)) else: tmp = x * ((y / c_m) * (9.0 / z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 (y <= -2.4e-27) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c_m / x)))); elseif (y <= 72000000000.0) tmp = Float64(Float64(b + Float64(t * Float64(a * Float64(z * -4.0)))) / Float64(z * c_m)); elseif (y <= 4.8e+113) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c_m)); elseif (y <= 2.9e+167) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(x * Float64(Float64(y / c_m) * Float64(9.0 / z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 (y <= -2.4e-27)
tmp = 9.0 * (y / (z * (c_m / x)));
elseif (y <= 72000000000.0)
tmp = (b + (t * (a * (z * -4.0)))) / (z * c_m);
elseif (y <= 4.8e+113)
tmp = (b + (x * (9.0 * y))) / (z * c_m);
elseif (y <= 2.9e+167)
tmp = -4.0 * (t * (a / c_m));
else
tmp = x * ((y / c_m) * (9.0 / z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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[y, -2.4e-27], N[(9.0 * N[(y / N[(z * N[(c$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 72000000000.0], N[(N[(b + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+113], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+167], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / c$95$m), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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}\;y \leq -2.4 \cdot 10^{-27}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c\_m}{x}}\\
\mathbf{elif}\;y \leq 72000000000:\\
\;\;\;\;\frac{b + t \cdot \left(a \cdot \left(z \cdot -4\right)\right)}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+113}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+167}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{c\_m} \cdot \frac{9}{z}\right)\\
\end{array}
\end{array}
if y < -2.40000000000000002e-27Initial program 83.4%
+-commutative83.4%
associate-+r-83.4%
*-commutative83.4%
associate-*r*82.0%
*-commutative82.0%
associate-+r-82.0%
+-commutative82.0%
associate-*l*81.9%
associate-*l*83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in z around 0 77.4%
Taylor expanded in x around inf 59.4%
times-frac57.2%
Simplified57.2%
clear-num57.2%
frac-times62.0%
*-un-lft-identity62.0%
Applied egg-rr62.0%
if -2.40000000000000002e-27 < y < 7.2e10Initial program 81.4%
+-commutative81.4%
associate-+r-81.4%
*-commutative81.4%
associate-*r*84.4%
*-commutative84.4%
associate-+r-84.4%
+-commutative84.4%
associate-*l*84.4%
associate-*l*84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 82.1%
Taylor expanded in x around 0 75.1%
*-commutative75.1%
associate-*r*75.1%
*-commutative75.1%
Simplified75.1%
if 7.2e10 < y < 4.79999999999999966e113Initial program 80.8%
+-commutative80.8%
associate-+r-80.8%
*-commutative80.8%
associate-*r*80.8%
*-commutative80.8%
associate-+r-80.8%
+-commutative80.8%
associate-*l*80.8%
associate-*l*80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
associate-*r*61.9%
Simplified61.9%
if 4.79999999999999966e113 < y < 2.89999999999999975e167Initial program 71.8%
+-commutative71.8%
associate-+r-71.8%
*-commutative71.8%
associate-*r*71.8%
*-commutative71.8%
associate-+r-71.8%
+-commutative71.8%
associate-*l*71.8%
associate-*l*65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in z around 0 59.5%
Taylor expanded in a around inf 57.6%
*-commutative57.6%
associate-/l*57.8%
Simplified57.8%
if 2.89999999999999975e167 < y Initial program 86.3%
+-commutative86.3%
associate-+r-86.3%
*-commutative86.3%
associate-*r*81.4%
*-commutative81.4%
associate-+r-81.4%
+-commutative81.4%
associate-*l*81.5%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
add-cube-cbrt81.4%
pow381.4%
associate-*r*81.2%
*-commutative81.2%
associate-*l*81.2%
Applied egg-rr81.2%
Taylor expanded in x around inf 63.5%
associate-/l*72.2%
rem-cube-cbrt72.2%
times-frac85.8%
Simplified85.8%
Final simplification70.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 1e-8)
(/ (+ (- (* y (* x 9.0)) (* (* (* z 4.0) t) a)) b) (* z c_m))
(/ (+ (* (/ y c_m) (* x 9.0)) (/ (+ b (* 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);
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 <= 1e-8) {
tmp = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
} else {
tmp = (((y / c_m) * (x * 9.0)) + ((b + (z * (a * (t * -4.0)))) / c_m)) / z;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (c_m <= 1d-8) then
tmp = (((y * (x * 9.0d0)) - (((z * 4.0d0) * t) * a)) + b) / (z * c_m)
else
tmp = (((y / c_m) * (x * 9.0d0)) + ((b + (z * (a * (t * (-4.0d0))))) / c_m)) / z
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1e-8) {
tmp = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
} else {
tmp = (((y / c_m) * (x * 9.0)) + ((b + (z * (a * (t * -4.0)))) / c_m)) / z;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if c_m <= 1e-8: tmp = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m) else: tmp = (((y / c_m) * (x * 9.0)) + ((b + (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]) 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 <= 1e-8) tmp = Float64(Float64(Float64(Float64(y * Float64(x * 9.0)) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c_m)); else tmp = Float64(Float64(Float64(Float64(y / c_m) * Float64(x * 9.0)) + Float64(Float64(b + Float64(z * Float64(a * Float64(t * -4.0)))) / c_m)) / z); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (c_m <= 1e-8)
tmp = (((y * (x * 9.0)) - (((z * 4.0) * t) * a)) + b) / (z * c_m);
else
tmp = (((y / c_m) * (x * 9.0)) + ((b + (z * (a * (t * -4.0)))) / c_m)) / z;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 1e-8], N[(N[(N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / c$95$m), $MachinePrecision] * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(z * N[(a * N[(t * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $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])\\\\
[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 10^{-8}:\\
\;\;\;\;\frac{\left(y \cdot \left(x \cdot 9\right) - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{c\_m} \cdot \left(x \cdot 9\right) + \frac{b + z \cdot \left(a \cdot \left(t \cdot -4\right)\right)}{c\_m}}{z}\\
\end{array}
\end{array}
if c < 1e-8Initial program 83.8%
if 1e-8 < c Initial program 75.2%
+-commutative75.2%
associate-+r-75.2%
*-commutative75.2%
associate-*r*76.6%
*-commutative76.6%
associate-+r-76.6%
+-commutative76.6%
associate-*l*76.6%
associate-*l*73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in z around 0 82.0%
div-inv81.9%
fma-define81.9%
associate-/l*85.1%
fma-define85.1%
associate-/l*86.7%
Applied egg-rr86.7%
Simplified81.9%
Final simplification83.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.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= z -3.7e+93)
(* -4.0 (/ (* t a) c_m))
(if (<= z 2e+63)
(/ (+ b (* x (* 9.0 y))) (* z c_m))
(* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -3.7e+93) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 2e+63) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (z <= (-3.7d+93)) then
tmp = (-4.0d0) * ((t * a) / c_m)
else if (z <= 2d+63) then
tmp = (b + (x * (9.0d0 * y))) / (z * c_m)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (z <= -3.7e+93) {
tmp = -4.0 * ((t * a) / c_m);
} else if (z <= 2e+63) {
tmp = (b + (x * (9.0 * y))) / (z * c_m);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if z <= -3.7e+93: tmp = -4.0 * ((t * a) / c_m) elif z <= 2e+63: tmp = (b + (x * (9.0 * y))) / (z * c_m) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (z <= -3.7e+93) tmp = Float64(-4.0 * Float64(Float64(t * a) / c_m)); elseif (z <= 2e+63) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c_m)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (z <= -3.7e+93)
tmp = -4.0 * ((t * a) / c_m);
elseif (z <= 2e+63)
tmp = (b + (x * (9.0 * y))) / (z * c_m);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[z, -3.7e+93], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+63], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+93}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+63}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if z < -3.69999999999999987e93Initial program 66.7%
+-commutative66.7%
associate-+r-66.7%
*-commutative66.7%
associate-*r*71.6%
*-commutative71.6%
associate-+r-71.6%
+-commutative71.6%
associate-*l*71.6%
associate-*l*77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in z around inf 66.1%
if -3.69999999999999987e93 < z < 2.00000000000000012e63Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
associate-*r*94.8%
*-commutative94.8%
associate-+r-94.8%
+-commutative94.8%
associate-*l*94.8%
associate-*l*91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in x around inf 81.1%
associate-*r*81.1%
*-commutative81.1%
associate-*r*81.1%
Simplified81.1%
if 2.00000000000000012e63 < z Initial program 53.1%
+-commutative53.1%
associate-+r-53.1%
*-commutative53.1%
associate-*r*53.0%
*-commutative53.0%
associate-+r-53.0%
+-commutative53.0%
associate-*l*53.1%
associate-*l*57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in z around 0 51.1%
Taylor expanded in a around inf 51.8%
*-commutative51.8%
associate-/l*62.5%
Simplified62.5%
Final simplification74.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= b -8.5e+40) (not (<= b 2.45e+33)))
(/ (/ b c_m) z)
(* -4.0 (* t (/ a c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -8.5e+40) || !(b <= 2.45e+33)) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= (-8.5d+40)) .or. (.not. (b <= 2.45d+33))) then
tmp = (b / c_m) / z
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= -8.5e+40) || !(b <= 2.45e+33)) {
tmp = (b / c_m) / z;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= -8.5e+40) or not (b <= 2.45e+33): tmp = (b / c_m) / z else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= -8.5e+40) || !(b <= 2.45e+33)) tmp = Float64(Float64(b / c_m) / z); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 <= -8.5e+40) || ~((b <= 2.45e+33)))
tmp = (b / c_m) / z;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[b, -8.5e+40], N[Not[LessEqual[b, 2.45e+33]], $MachinePrecision]], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 -8.5 \cdot 10^{+40} \lor \neg \left(b \leq 2.45 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if b < -8.49999999999999996e40 or 2.45000000000000007e33 < b Initial program 83.5%
+-commutative83.5%
associate-+r-83.5%
*-commutative83.5%
associate-*r*79.8%
*-commutative79.8%
associate-+r-79.8%
+-commutative79.8%
associate-*l*79.8%
associate-*l*80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in z around 0 78.9%
Taylor expanded in b around inf 57.5%
associate-/r*59.5%
Simplified59.5%
if -8.49999999999999996e40 < b < 2.45000000000000007e33Initial program 80.6%
+-commutative80.6%
associate-+r-80.6%
*-commutative80.6%
associate-*r*84.4%
*-commutative84.4%
associate-+r-84.4%
+-commutative84.4%
associate-*l*84.5%
associate-*l*83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in z around 0 80.8%
Taylor expanded in a around inf 52.1%
*-commutative52.1%
associate-/l*52.9%
Simplified52.9%
Final simplification55.7%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -7.6e+40)
(/ (/ b c_m) z)
(if (<= b 2.6e+37) (* -4.0 (* t (/ a c_m))) (* b (/ 1.0 (* z c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -7.6e+40) {
tmp = (b / c_m) / z;
} else if (b <= 2.6e+37) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b * (1.0 / (z * c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (b <= (-7.6d+40)) then
tmp = (b / c_m) / z
else if (b <= 2.6d+37) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = b * (1.0d0 / (z * c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -7.6e+40) {
tmp = (b / c_m) / z;
} else if (b <= 2.6e+37) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b * (1.0 / (z * c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -7.6e+40: tmp = (b / c_m) / z elif b <= 2.6e+37: tmp = -4.0 * (t * (a / c_m)) else: tmp = b * (1.0 / (z * c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -7.6e+40) tmp = Float64(Float64(b / c_m) / z); elseif (b <= 2.6e+37) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(b * Float64(1.0 / Float64(z * c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (b <= -7.6e+40)
tmp = (b / c_m) / z;
elseif (b <= 2.6e+37)
tmp = -4.0 * (t * (a / c_m));
else
tmp = b * (1.0 / (z * c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -7.6e+40], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 2.6e+37], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -7.6 \cdot 10^{+40}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{+37}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c\_m}\\
\end{array}
\end{array}
if b < -7.60000000000000009e40Initial program 82.6%
+-commutative82.6%
associate-+r-82.6%
*-commutative82.6%
associate-*r*76.2%
*-commutative76.2%
associate-+r-76.2%
+-commutative76.2%
associate-*l*76.2%
associate-*l*80.6%
*-commutative80.6%
Simplified80.6%
Taylor expanded in z around 0 77.8%
Taylor expanded in b around inf 56.9%
associate-/r*61.5%
Simplified61.5%
if -7.60000000000000009e40 < b < 2.5999999999999999e37Initial program 80.9%
+-commutative80.9%
associate-+r-80.9%
*-commutative80.9%
associate-*r*84.6%
*-commutative84.6%
associate-+r-84.6%
+-commutative84.6%
associate-*l*84.7%
associate-*l*84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in z around 0 81.0%
Taylor expanded in a around inf 52.1%
*-commutative52.1%
associate-/l*52.9%
Simplified52.9%
if 2.5999999999999999e37 < b Initial program 83.6%
+-commutative83.6%
associate-+r-83.6%
*-commutative83.6%
associate-*r*82.0%
*-commutative82.0%
associate-+r-82.0%
+-commutative82.0%
associate-*l*82.0%
associate-*l*80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in b around inf 58.2%
*-commutative58.2%
Simplified58.2%
div-inv58.2%
Applied egg-rr58.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. NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* z c_m))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (z * c_m));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (z * c_m))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (z * c_m));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (z * c_m))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(z * c_m))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (z * c_m));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(z * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{z \cdot c\_m}
\end{array}
Initial program 81.8%
+-commutative81.8%
associate-+r-81.8%
*-commutative81.8%
associate-*r*82.5%
*-commutative82.5%
associate-+r-82.5%
+-commutative82.5%
associate-*l*82.5%
associate-*l*82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in b around inf 38.9%
*-commutative38.9%
Simplified38.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 2024103
(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)))