
(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 13 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
(*
c_s
(if (<= c_m 130000.0)
(/ (+ (* -4.0 (* a t)) (/ (+ b (* x (* y 9.0))) z)) c_m)
(+
(* -4.0 (* t (/ a c_m)))
(/ (- (/ b c_m) (* x (* (/ y c_m) -9.0))) z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= 130000.0) {
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
} else {
tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - (x * ((y / c_m) * -9.0))) / z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= 130000.0d0) then
tmp = (((-4.0d0) * (a * t)) + ((b + (x * (y * 9.0d0))) / z)) / c_m
else
tmp = ((-4.0d0) * (t * (a / c_m))) + (((b / c_m) - (x * ((y / c_m) * (-9.0d0)))) / z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= 130000.0) {
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
} else {
tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - (x * ((y / c_m) * -9.0))) / z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= 130000.0: tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m else: tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - (x * ((y / c_m) * -9.0))) / z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= 130000.0) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(b + Float64(x * Float64(y * 9.0))) / z)) / c_m); else tmp = Float64(Float64(-4.0 * Float64(t * Float64(a / c_m))) + Float64(Float64(Float64(b / c_m) - Float64(x * Float64(Float64(y / c_m) * -9.0))) / z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 <= 130000.0)
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
else
tmp = (-4.0 * (t * (a / c_m))) + (((b / c_m) - (x * ((y / c_m) * -9.0))) / z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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, 130000.0], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c$95$m), $MachinePrecision] - N[(x * N[(N[(y / c$95$m), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 130000:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b + x \cdot \left(y \cdot 9\right)}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right) + \frac{\frac{b}{c\_m} - x \cdot \left(\frac{y}{c\_m} \cdot -9\right)}{z}\\
\end{array}
\end{array}
if c < 1.3e5Initial program 83.5%
Simplified85.1%
associate-/r*88.0%
div-inv88.0%
+-commutative88.0%
associate-*r*88.0%
*-commutative88.0%
associate-*l*88.0%
Applied egg-rr88.0%
Taylor expanded in b around 0 87.8%
Taylor expanded in c around 0 87.8%
Taylor expanded in z around 0 90.4%
*-commutative90.4%
associate-*l*90.4%
Simplified90.4%
if 1.3e5 < c Initial program 65.3%
Simplified63.9%
associate-/r*62.9%
div-inv62.9%
+-commutative62.9%
associate-*r*62.9%
*-commutative62.9%
associate-*l*62.9%
Applied egg-rr62.9%
Taylor expanded in b around 0 70.6%
Taylor expanded in c around 0 70.6%
Taylor expanded in z around -inf 81.2%
mul-1-neg81.2%
unsub-neg81.2%
associate-*r/81.2%
associate-*r*81.2%
associate-*l/84.9%
associate-*r/84.8%
associate-*l*84.8%
neg-mul-184.8%
unsub-neg84.8%
*-commutative84.8%
associate-/l*93.9%
associate-*l*93.8%
Simplified93.8%
Final simplification91.3%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(*
c_s
(if (<= t_1 (- INFINITY))
(* (* x (/ y c_m)) (/ 9.0 z))
(if (<= t_1 5e+288)
(/ (+ (* -4.0 (* a t)) (/ (+ b (* x (* y 9.0))) z)) c_m)
(* 9.0 (* (/ y c_m) (/ x 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 = y * (x * 9.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * (y / c_m)) * (9.0 / z);
} else if (t_1 <= 5e+288) {
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
} else {
tmp = 9.0 * ((y / c_m) * (x / z));
}
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);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x * (y / c_m)) * (9.0 / z);
} else if (t_1 <= 5e+288) {
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
} else {
tmp = 9.0 * ((y / c_m) * (x / 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 = y * (x * 9.0) tmp = 0 if t_1 <= -math.inf: tmp = (x * (y / c_m)) * (9.0 / z) elif t_1 <= 5e+288: tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m else: tmp = 9.0 * ((y / c_m) * (x / 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(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * Float64(y / c_m)) * Float64(9.0 / z)); elseif (t_1 <= 5e+288) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(b + Float64(x * Float64(y * 9.0))) / z)) / c_m); else tmp = Float64(9.0 * Float64(Float64(y / c_m) * Float64(x / 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 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -Inf)
tmp = (x * (y / c_m)) * (9.0 / z);
elseif (t_1 <= 5e+288)
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
else
tmp = 9.0 * ((y / c_m) * (x / 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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+288], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(9.0 * N[(N[(y / c$95$m), $MachinePrecision] * N[(x / 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 := y \cdot \left(x \cdot 9\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(x \cdot \frac{y}{c\_m}\right) \cdot \frac{9}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b + x \cdot \left(y \cdot 9\right)}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c\_m} \cdot \frac{x}{z}\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 x #s(literal 9 binary64)) y) < -inf.0Initial program 74.5%
Simplified67.9%
Taylor expanded in x around inf 80.7%
associate-*r/74.5%
*-commutative74.5%
times-frac80.9%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) < 5.0000000000000003e288Initial program 82.6%
Simplified84.0%
associate-/r*86.3%
div-inv86.3%
+-commutative86.3%
associate-*r*86.3%
*-commutative86.3%
associate-*l*86.3%
Applied egg-rr86.3%
Taylor expanded in b around 0 89.6%
Taylor expanded in c around 0 89.7%
Taylor expanded in z around 0 90.6%
*-commutative90.6%
associate-*l*90.6%
Simplified90.6%
if 5.0000000000000003e288 < (*.f64 (*.f64 x #s(literal 9 binary64)) y) Initial program 49.4%
Simplified49.4%
associate-/r*50.0%
div-inv50.0%
+-commutative50.0%
associate-*r*50.0%
*-commutative50.0%
associate-*l*50.0%
Applied egg-rr50.0%
Taylor expanded in x around inf 53.8%
*-commutative53.8%
times-frac79.1%
Simplified79.1%
Final simplification90.1%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (* x (/ y (* c_m z))))))
(*
c_s
(if (<= z -24000000.0)
(* -4.0 (/ (* a t) c_m))
(if (<= z -1.02e-227)
t_1
(if (<= z 6.2e-151)
(/ (/ b c_m) z)
(if (<= z 0.0017) t_1 (* -4.0 (* t (/ a c_m))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * (x * (y / (c_m * z)));
double tmp;
if (z <= -24000000.0) {
tmp = -4.0 * ((a * t) / c_m);
} else if (z <= -1.02e-227) {
tmp = t_1;
} else if (z <= 6.2e-151) {
tmp = (b / c_m) / z;
} else if (z <= 0.0017) {
tmp = t_1;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * (x * (y / (c_m * z)))
if (z <= (-24000000.0d0)) then
tmp = (-4.0d0) * ((a * t) / c_m)
else if (z <= (-1.02d-227)) then
tmp = t_1
else if (z <= 6.2d-151) then
tmp = (b / c_m) / z
else if (z <= 0.0017d0) then
tmp = t_1
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 9.0 * (x * (y / (c_m * z)));
double tmp;
if (z <= -24000000.0) {
tmp = -4.0 * ((a * t) / c_m);
} else if (z <= -1.02e-227) {
tmp = t_1;
} else if (z <= 6.2e-151) {
tmp = (b / c_m) / z;
} else if (z <= 0.0017) {
tmp = t_1;
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 9.0 * (x * (y / (c_m * z))) tmp = 0 if z <= -24000000.0: tmp = -4.0 * ((a * t) / c_m) elif z <= -1.02e-227: tmp = t_1 elif z <= 6.2e-151: tmp = (b / c_m) / z elif z <= 0.0017: tmp = t_1 else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))) tmp = 0.0 if (z <= -24000000.0) tmp = Float64(-4.0 * Float64(Float64(a * t) / c_m)); elseif (z <= -1.02e-227) tmp = t_1; elseif (z <= 6.2e-151) tmp = Float64(Float64(b / c_m) / z); elseif (z <= 0.0017) tmp = t_1; else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 9.0 * (x * (y / (c_m * z)));
tmp = 0.0;
if (z <= -24000000.0)
tmp = -4.0 * ((a * t) / c_m);
elseif (z <= -1.02e-227)
tmp = t_1;
elseif (z <= 6.2e-151)
tmp = (b / c_m) / z;
elseif (z <= 0.0017)
tmp = t_1;
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[z, -24000000.0], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.02e-227], t$95$1, If[LessEqual[z, 6.2e-151], N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 0.0017], t$95$1, N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -24000000:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c\_m}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{elif}\;z \leq 0.0017:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
\end{array}
if z < -2.4e7Initial program 67.9%
Simplified77.3%
Taylor expanded in z around inf 53.6%
if -2.4e7 < z < -1.02e-227 or 6.19999999999999969e-151 < z < 0.00169999999999999991Initial program 89.7%
Simplified86.2%
Taylor expanded in x around inf 52.8%
associate-/l*56.1%
*-commutative56.1%
Simplified56.1%
if -1.02e-227 < z < 6.19999999999999969e-151Initial program 95.0%
Simplified91.7%
associate-/r*82.1%
div-inv82.1%
+-commutative82.1%
associate-*r*82.1%
*-commutative82.1%
associate-*l*82.1%
Applied egg-rr82.1%
Taylor expanded in b around inf 68.5%
associate-/r*70.0%
Simplified70.0%
if 0.00169999999999999991 < z Initial program 59.8%
Simplified63.2%
associate-/r*76.9%
div-inv76.9%
+-commutative76.9%
associate-*r*76.9%
*-commutative76.9%
associate-*l*76.9%
Applied egg-rr76.9%
Taylor expanded in b around 0 89.1%
Taylor expanded in c around 0 89.0%
Taylor expanded in a around inf 67.1%
associate-*r/67.1%
associate-*r*67.1%
associate-*l/61.7%
associate-*r/61.6%
associate-*l*61.6%
Simplified61.6%
Final simplification60.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 (<= c_m 4000000.0)
(/ (+ (* -4.0 (* a t)) (/ (+ b (* x (* y 9.0))) z)) c_m)
(+
(* -4.0 (* a (/ t c_m)))
(/ (- (/ b c_m) (* (* x (/ y c_m)) -9.0)) z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= 4000000.0) {
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
} else {
tmp = (-4.0 * (a * (t / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= 4000000.0d0) then
tmp = (((-4.0d0) * (a * t)) + ((b + (x * (y * 9.0d0))) / z)) / c_m
else
tmp = ((-4.0d0) * (a * (t / c_m))) + (((b / c_m) - ((x * (y / c_m)) * (-9.0d0))) / z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= 4000000.0) {
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
} else {
tmp = (-4.0 * (a * (t / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= 4000000.0: tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m else: tmp = (-4.0 * (a * (t / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= 4000000.0) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(b + Float64(x * Float64(y * 9.0))) / z)) / c_m); else tmp = Float64(Float64(-4.0 * Float64(a * Float64(t / c_m))) + Float64(Float64(Float64(b / c_m) - Float64(Float64(x * Float64(y / c_m)) * -9.0)) / z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 <= 4000000.0)
tmp = ((-4.0 * (a * t)) + ((b + (x * (y * 9.0))) / z)) / c_m;
else
tmp = (-4.0 * (a * (t / c_m))) + (((b / c_m) - ((x * (y / c_m)) * -9.0)) / z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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, 4000000.0], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(-4.0 * N[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c$95$m), $MachinePrecision] - N[(N[(x * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 4000000:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b + x \cdot \left(y \cdot 9\right)}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right) + \frac{\frac{b}{c\_m} - \left(x \cdot \frac{y}{c\_m}\right) \cdot -9}{z}\\
\end{array}
\end{array}
if c < 4e6Initial program 83.6%
Simplified85.2%
associate-/r*88.1%
div-inv88.1%
+-commutative88.1%
associate-*r*88.1%
*-commutative88.1%
associate-*l*88.1%
Applied egg-rr88.1%
Taylor expanded in b around 0 87.8%
Taylor expanded in c around 0 87.9%
Taylor expanded in z around 0 90.5%
*-commutative90.5%
associate-*l*90.5%
Simplified90.5%
if 4e6 < c Initial program 64.8%
Simplified63.3%
associate-/r*62.3%
div-inv62.3%
+-commutative62.3%
associate-*r*62.3%
*-commutative62.3%
associate-*l*62.3%
Applied egg-rr62.3%
Taylor expanded in b around 0 70.2%
Taylor expanded in z around -inf 80.9%
mul-1-neg80.9%
unsub-neg80.9%
associate-/l*85.7%
fma-define85.7%
associate-*r/95.0%
neg-mul-195.0%
fmm-undef95.0%
Simplified95.0%
Final simplification91.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 (<= b -7e-95)
(/ (+ b (* x (* y 9.0))) (* c_m z))
(if (<= b 2e-12)
(/ (+ (* -4.0 (* a t)) (* 9.0 (/ (* x y) z))) c_m)
(/ (- b (* 4.0 (* a (* t z)))) (* 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 (b <= -7e-95) {
tmp = (b + (x * (y * 9.0))) / (c_m * z);
} else if (b <= 2e-12) {
tmp = ((-4.0 * (a * t)) + (9.0 * ((x * y) / z))) / c_m;
} else {
tmp = (b - (4.0 * (a * (t * z)))) / (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 (b <= (-7d-95)) then
tmp = (b + (x * (y * 9.0d0))) / (c_m * z)
else if (b <= 2d-12) then
tmp = (((-4.0d0) * (a * t)) + (9.0d0 * ((x * y) / z))) / c_m
else
tmp = (b - (4.0d0 * (a * (t * z)))) / (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 (b <= -7e-95) {
tmp = (b + (x * (y * 9.0))) / (c_m * z);
} else if (b <= 2e-12) {
tmp = ((-4.0 * (a * t)) + (9.0 * ((x * y) / z))) / c_m;
} else {
tmp = (b - (4.0 * (a * (t * z)))) / (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 b <= -7e-95: tmp = (b + (x * (y * 9.0))) / (c_m * z) elif b <= 2e-12: tmp = ((-4.0 * (a * t)) + (9.0 * ((x * y) / z))) / c_m else: tmp = (b - (4.0 * (a * (t * z)))) / (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 (b <= -7e-95) tmp = Float64(Float64(b + Float64(x * Float64(y * 9.0))) / Float64(c_m * z)); elseif (b <= 2e-12) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(Float64(x * y) / z))) / c_m); else tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(t * z)))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (b <= -7e-95)
tmp = (b + (x * (y * 9.0))) / (c_m * z);
elseif (b <= 2e-12)
tmp = ((-4.0 * (a * t)) + (9.0 * ((x * y) / z))) / c_m;
else
tmp = (b - (4.0 * (a * (t * z)))) / (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[b, -7e-95], N[(N[(b + N[(x * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-12], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b - N[(4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-95}:\\
\;\;\;\;\frac{b + x \cdot \left(y \cdot 9\right)}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-12}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + 9 \cdot \frac{x \cdot y}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if b < -6.9999999999999994e-95Initial program 83.6%
Simplified83.6%
associate-/r*78.7%
div-inv78.7%
+-commutative78.7%
associate-*r*78.7%
*-commutative78.7%
associate-*l*78.7%
Applied egg-rr78.7%
Taylor expanded in z around 0 77.2%
+-commutative77.2%
associate-*r*77.2%
*-commutative77.2%
associate-*r*77.2%
*-commutative77.2%
Simplified77.2%
if -6.9999999999999994e-95 < b < 1.99999999999999996e-12Initial program 74.1%
Simplified77.6%
associate-/r*87.4%
div-inv87.3%
+-commutative87.3%
associate-*r*87.3%
*-commutative87.3%
associate-*l*87.3%
Applied egg-rr87.3%
Taylor expanded in b around 0 91.4%
Taylor expanded in b around 0 85.5%
if 1.99999999999999996e-12 < b Initial program 82.8%
associate-+l-82.8%
*-commutative82.8%
associate-*r*81.5%
*-commutative81.5%
associate-+l-81.5%
associate-*l*81.5%
associate-*l*80.1%
*-commutative80.1%
Simplified80.1%
Taylor expanded in x around 0 72.9%
Final simplification79.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -1.6e+114)
(* a (* -4.0 (/ t c_m)))
(if (<= t 9.5e-98)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(* (/ (+ b (* a (* z (* -4.0 t)))) z) (/ 1.0 c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.6e+114) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= 9.5e-98) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b + (a * (z * (-4.0 * t)))) / z) * (1.0 / c_m);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (t <= (-1.6d+114)) then
tmp = a * ((-4.0d0) * (t / c_m))
else if (t <= 9.5d-98) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = ((b + (a * (z * ((-4.0d0) * t)))) / z) * (1.0d0 / c_m)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -1.6e+114) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= 9.5e-98) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b + (a * (z * (-4.0 * t)))) / z) * (1.0 / c_m);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -1.6e+114: tmp = a * (-4.0 * (t / c_m)) elif t <= 9.5e-98: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = ((b + (a * (z * (-4.0 * t)))) / z) * (1.0 / c_m) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -1.6e+114) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); elseif (t <= 9.5e-98) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(b + Float64(a * Float64(z * Float64(-4.0 * t)))) / z) * Float64(1.0 / c_m)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -1.6e+114)
tmp = a * (-4.0 * (t / c_m));
elseif (t <= 9.5e-98)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = ((b + (a * (z * (-4.0 * t)))) / z) * (1.0 / c_m);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -1.6e+114], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-98], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(a * N[(z * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] * N[(1.0 / c$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+114}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + a \cdot \left(z \cdot \left(-4 \cdot t\right)\right)}{z} \cdot \frac{1}{c\_m}\\
\end{array}
\end{array}
if t < -1.6e114Initial program 74.0%
Simplified68.3%
Taylor expanded in z around inf 58.9%
associate-/l*69.8%
associate-*r*69.8%
*-commutative69.8%
associate-*r*69.8%
Simplified69.8%
if -1.6e114 < t < 9.5000000000000001e-98Initial program 83.7%
Simplified84.5%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
*-commutative75.6%
Simplified75.6%
if 9.5000000000000001e-98 < t Initial program 74.5%
Simplified77.8%
associate-/r*83.1%
div-inv83.0%
+-commutative83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*l*83.0%
Applied egg-rr83.0%
Taylor expanded in x around 0 58.9%
*-commutative58.9%
*-commutative58.9%
associate-*r*57.8%
associate-*l*57.8%
*-commutative57.8%
Simplified57.8%
Final simplification68.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 (<= t -7e+118)
(* a (* -4.0 (/ t c_m)))
(if (<= t 8.6e-97)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(/ (- b (* 4.0 (* a (* t z)))) (* 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 (t <= -7e+118) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= 8.6e-97) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (b - (4.0 * (a * (t * z)))) / (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 (t <= (-7d+118)) then
tmp = a * ((-4.0d0) * (t / c_m))
else if (t <= 8.6d-97) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (b - (4.0d0 * (a * (t * z)))) / (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 (t <= -7e+118) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= 8.6e-97) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (b - (4.0 * (a * (t * z)))) / (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 t <= -7e+118: tmp = a * (-4.0 * (t / c_m)) elif t <= 8.6e-97: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = (b - (4.0 * (a * (t * z)))) / (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 (t <= -7e+118) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); elseif (t <= 8.6e-97) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(t * z)))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -7e+118)
tmp = a * (-4.0 * (t / c_m));
elseif (t <= 8.6e-97)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = (b - (4.0 * (a * (t * z)))) / (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[t, -7e+118], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e-97], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(b - N[(4.0 * N[(a * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+118}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{-97}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(t \cdot z\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -7.00000000000000033e118Initial program 74.0%
Simplified68.3%
Taylor expanded in z around inf 58.9%
associate-/l*69.8%
associate-*r*69.8%
*-commutative69.8%
associate-*r*69.8%
Simplified69.8%
if -7.00000000000000033e118 < t < 8.6e-97Initial program 83.7%
Simplified84.5%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
*-commutative75.6%
Simplified75.6%
if 8.6e-97 < t Initial program 74.5%
associate-+l-74.5%
*-commutative74.5%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
associate-*l*79.9%
associate-*l*77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in x around 0 59.9%
Final simplification69.3%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -6.2e+118)
(* a (* -4.0 (/ t c_m)))
(if (<= t -1.15e-71)
(* 9.0 (* (/ x c_m) (/ y z)))
(if (<= t 5.5e-86) (/ (/ 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 (t <= -6.2e+118) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= -1.15e-71) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else if (t <= 5.5e-86) {
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 (t <= (-6.2d+118)) then
tmp = a * ((-4.0d0) * (t / c_m))
else if (t <= (-1.15d-71)) then
tmp = 9.0d0 * ((x / c_m) * (y / z))
else if (t <= 5.5d-86) 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 (t <= -6.2e+118) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= -1.15e-71) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else if (t <= 5.5e-86) {
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 t <= -6.2e+118: tmp = a * (-4.0 * (t / c_m)) elif t <= -1.15e-71: tmp = 9.0 * ((x / c_m) * (y / z)) elif t <= 5.5e-86: 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 (t <= -6.2e+118) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); elseif (t <= -1.15e-71) tmp = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))); elseif (t <= 5.5e-86) 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 (t <= -6.2e+118)
tmp = a * (-4.0 * (t / c_m));
elseif (t <= -1.15e-71)
tmp = 9.0 * ((x / c_m) * (y / z));
elseif (t <= 5.5e-86)
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[LessEqual[t, -6.2e+118], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.15e-71], N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-86], 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}\;t \leq -6.2 \cdot 10^{+118}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-71}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{b}{c\_m}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if t < -6.19999999999999973e118Initial program 74.0%
Simplified68.3%
Taylor expanded in z around inf 58.9%
associate-/l*69.8%
associate-*r*69.8%
*-commutative69.8%
associate-*r*69.8%
Simplified69.8%
if -6.19999999999999973e118 < t < -1.1499999999999999e-71Initial program 77.1%
Simplified79.6%
Taylor expanded in x around inf 46.8%
times-frac48.5%
Applied egg-rr48.5%
if -1.1499999999999999e-71 < t < 5.5e-86Initial program 86.1%
Simplified86.1%
associate-/r*87.3%
div-inv87.3%
+-commutative87.3%
associate-*r*87.3%
*-commutative87.3%
associate-*l*87.3%
Applied egg-rr87.3%
Taylor expanded in b around inf 51.8%
associate-/r*48.7%
Simplified48.7%
if 5.5e-86 < t Initial program 74.9%
Simplified78.3%
associate-/r*82.7%
div-inv82.7%
+-commutative82.7%
associate-*r*82.7%
*-commutative82.7%
associate-*l*82.7%
Applied egg-rr82.7%
Taylor expanded in b around 0 83.6%
Taylor expanded in c around 0 83.6%
Taylor expanded in a around inf 51.9%
associate-*r/51.9%
associate-*r*51.9%
associate-*l/52.3%
associate-*r/52.2%
associate-*l*52.2%
Simplified52.2%
Final simplification52.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 (<= t -3.9e+115)
(* a (* -4.0 (/ t c_m)))
(if (<= t 2.7e-84)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(* -4.0 (* t (/ a c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -3.9e+115) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= 2.7e-84) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (t <= (-3.9d+115)) then
tmp = a * ((-4.0d0) * (t / c_m))
else if (t <= 2.7d-84) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (-4.0d0) * (t * (a / c_m))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -3.9e+115) {
tmp = a * (-4.0 * (t / c_m));
} else if (t <= 2.7e-84) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (t * (a / c_m));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if t <= -3.9e+115: tmp = a * (-4.0 * (t / c_m)) elif t <= 2.7e-84: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = -4.0 * (t * (a / c_m)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (t <= -3.9e+115) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); elseif (t <= 2.7e-84) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (t <= -3.9e+115)
tmp = a * (-4.0 * (t / c_m));
elseif (t <= 2.7e-84)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = -4.0 * (t * (a / c_m));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[t, -3.9e+115], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-84], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{+115}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-84}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if t < -3.90000000000000006e115Initial program 74.0%
Simplified68.3%
Taylor expanded in z around inf 58.9%
associate-/l*69.8%
associate-*r*69.8%
*-commutative69.8%
associate-*r*69.8%
Simplified69.8%
if -3.90000000000000006e115 < t < 2.6999999999999999e-84Initial program 83.2%
Simplified84.1%
Taylor expanded in z around 0 75.3%
+-commutative75.3%
*-commutative75.3%
Simplified75.3%
if 2.6999999999999999e-84 < t Initial program 74.9%
Simplified78.3%
associate-/r*82.7%
div-inv82.7%
+-commutative82.7%
associate-*r*82.7%
*-commutative82.7%
associate-*l*82.7%
Applied egg-rr82.7%
Taylor expanded in b around 0 83.6%
Taylor expanded in c around 0 83.6%
Taylor expanded in a around inf 51.9%
associate-*r/51.9%
associate-*r*51.9%
associate-*l/52.3%
associate-*r/52.2%
associate-*l*52.2%
Simplified52.2%
Final simplification66.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 (or (<= a -4.2e-82) (not (<= a 2.2e+56)))
(* -4.0 (* t (/ a c_m)))
(/ b (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((a <= -4.2e-82) || !(a <= 2.2e+56)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((a <= (-4.2d-82)) .or. (.not. (a <= 2.2d+56))) then
tmp = (-4.0d0) * (t * (a / c_m))
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((a <= -4.2e-82) || !(a <= 2.2e+56)) {
tmp = -4.0 * (t * (a / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (a <= -4.2e-82) or not (a <= 2.2e+56): tmp = -4.0 * (t * (a / c_m)) else: tmp = b / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((a <= -4.2e-82) || !(a <= 2.2e+56)) tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); else tmp = Float64(b / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((a <= -4.2e-82) || ~((a <= 2.2e+56)))
tmp = -4.0 * (t * (a / c_m));
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[a, -4.2e-82], N[Not[LessEqual[a, 2.2e+56]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-82} \lor \neg \left(a \leq 2.2 \cdot 10^{+56}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if a < -4.2000000000000001e-82 or 2.20000000000000016e56 < a Initial program 76.3%
Simplified73.6%
associate-/r*77.2%
div-inv77.2%
+-commutative77.2%
associate-*r*77.2%
*-commutative77.2%
associate-*l*77.2%
Applied egg-rr77.2%
Taylor expanded in b around 0 80.4%
Taylor expanded in c around 0 80.4%
Taylor expanded in a around inf 48.0%
associate-*r/48.0%
associate-*r*48.0%
associate-*l/51.3%
associate-*r/51.3%
associate-*l*51.3%
Simplified51.3%
if -4.2000000000000001e-82 < a < 2.20000000000000016e56Initial program 82.7%
Simplified88.0%
Taylor expanded in b around inf 50.6%
*-commutative50.6%
Simplified50.6%
Final simplification51.0%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -9e-83)
(* a (* -4.0 (/ t c_m)))
(if (<= a 1.1e+56) (/ 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 (a <= -9e-83) {
tmp = a * (-4.0 * (t / c_m));
} else if (a <= 1.1e+56) {
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 (a <= (-9d-83)) then
tmp = a * ((-4.0d0) * (t / c_m))
else if (a <= 1.1d+56) 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 (a <= -9e-83) {
tmp = a * (-4.0 * (t / c_m));
} else if (a <= 1.1e+56) {
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 a <= -9e-83: tmp = a * (-4.0 * (t / c_m)) elif a <= 1.1e+56: 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 (a <= -9e-83) tmp = Float64(a * Float64(-4.0 * Float64(t / c_m))); elseif (a <= 1.1e+56) tmp = Float64(b / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c_m))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -9e-83)
tmp = a * (-4.0 * (t / c_m));
elseif (a <= 1.1e+56)
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[LessEqual[a, -9e-83], N[(a * N[(-4.0 * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.1e+56], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{-83}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c\_m}\right)\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+56}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c\_m}\right)\\
\end{array}
\end{array}
if a < -8.99999999999999995e-83Initial program 71.2%
Simplified70.3%
Taylor expanded in z around inf 45.9%
associate-/l*47.9%
associate-*r*47.9%
*-commutative47.9%
associate-*r*47.9%
Simplified47.9%
if -8.99999999999999995e-83 < a < 1.10000000000000008e56Initial program 82.7%
Simplified88.0%
Taylor expanded in b around inf 50.6%
*-commutative50.6%
Simplified50.6%
if 1.10000000000000008e56 < a Initial program 86.1%
Simplified80.0%
associate-/r*72.7%
div-inv72.8%
+-commutative72.8%
associate-*r*72.8%
*-commutative72.8%
associate-*l*72.8%
Applied egg-rr72.8%
Taylor expanded in b around 0 70.7%
Taylor expanded in c around 0 70.6%
Taylor expanded in a around inf 52.0%
associate-*r/52.0%
associate-*r*52.0%
associate-*l/57.9%
associate-*r/57.9%
associate-*l*57.9%
Simplified57.9%
Final simplification51.0%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ (/ b c_m) z)))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * ((b / c_m) / z);
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * ((b / c_m) / z)
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * ((b / c_m) / z);
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * ((b / c_m) / z)
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(Float64(b / c_m) / z)) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * ((b / c_m) / z);
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(N[(b / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{\frac{b}{c\_m}}{z}
\end{array}
Initial program 79.1%
Simplified80.0%
associate-/r*81.9%
div-inv81.9%
+-commutative81.9%
associate-*r*81.9%
*-commutative81.9%
associate-*l*81.9%
Applied egg-rr81.9%
Taylor expanded in b around inf 37.8%
associate-/r*38.1%
Simplified38.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 (/ b (* c_m z))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (c_m * z))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (c_m * z));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 79.1%
Simplified80.0%
Taylor expanded in b around inf 37.8%
*-commutative37.8%
Simplified37.8%
Final simplification37.8%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -220031348160821/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 365902434742109/31250000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 28768236795461370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 138385150424563190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c)))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))