
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 5.4e+53)
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c_m)
(+
(* -4.0 (* a (/ t c_m)))
(/ (- (/ b 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 <= 5.4e+53) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (-4.0 * (a * (t / c_m))) + (((b / 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 <= 5.4d+53) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c_m
else
tmp = ((-4.0d0) * (a * (t / c_m))) + (((b / 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 <= 5.4e+53) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (-4.0 * (a * (t / c_m))) + (((b / 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 <= 5.4e+53: tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m else: tmp = (-4.0 * (a * (t / c_m))) + (((b / 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 <= 5.4e+53) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c_m); else tmp = Float64(Float64(-4.0 * Float64(a * Float64(t / c_m))) + Float64(Float64(Float64(b / 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 <= 5.4e+53)
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
else
tmp = (-4.0 * (a * (t / c_m))) + (((b / 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, 5.4e+53], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $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[(y / c$95$m), $MachinePrecision] * N[(x * -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 5.4 \cdot 10^{+53}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right) + \frac{\frac{b}{c\_m} - \frac{y}{c\_m} \cdot \left(x \cdot -9\right)}{z}\\
\end{array}
\end{array}
if c < 5.40000000000000039e53Initial program 81.3%
associate-+l-81.3%
*-commutative81.3%
associate-*r*80.3%
*-commutative80.3%
associate-+l-80.3%
associate-*l*80.3%
associate-*l*80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in x around 0 77.0%
cancel-sign-sub-inv77.0%
metadata-eval77.0%
+-commutative77.0%
*-commutative77.0%
fma-define77.0%
associate-/l*75.0%
fma-define75.0%
times-frac76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in c around 0 84.0%
if 5.40000000000000039e53 < c Initial program 61.5%
associate-+l-61.5%
*-commutative61.5%
associate-*r*65.0%
*-commutative65.0%
associate-+l-65.0%
associate-*l*65.0%
associate-*l*61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in x around 0 79.5%
cancel-sign-sub-inv79.5%
metadata-eval79.5%
+-commutative79.5%
*-commutative79.5%
fma-define79.5%
associate-/l*78.6%
fma-define78.6%
times-frac80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in c around 0 72.5%
Taylor expanded in z around -inf 82.8%
mul-1-neg82.8%
unsub-neg82.8%
associate-/l*82.0%
neg-mul-182.0%
unsub-neg82.0%
associate-/l*89.8%
associate-*r*89.8%
Simplified89.8%
Final simplification85.3%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.7e-131) (not (<= z 1.4e-211)))
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c_m)
(/ (+ b (* x (* 9.0 y))) (* c_m z)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.7e-131) || !(z <= 1.4e-211)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-2.7d-131)) .or. (.not. (z <= 1.4d-211))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c_m
else
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.7e-131) || !(z <= 1.4e-211)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.7e-131) or not (z <= 1.4e-211): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m else: tmp = (b + (x * (9.0 * y))) / (c_m * z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.7e-131) || !(z <= 1.4e-211)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c_m); else tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.7e-131) || ~((z <= 1.4e-211)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
else
tmp = (b + (x * (9.0 * y))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.7e-131], N[Not[LessEqual[z, 1.4e-211]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-131} \lor \neg \left(z \leq 1.4 \cdot 10^{-211}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -2.70000000000000021e-131 or 1.3999999999999999e-211 < z Initial program 71.9%
associate-+l-71.9%
*-commutative71.9%
associate-*r*71.9%
*-commutative71.9%
associate-+l-71.9%
associate-*l*71.9%
associate-*l*73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in x around 0 80.9%
cancel-sign-sub-inv80.9%
metadata-eval80.9%
+-commutative80.9%
*-commutative80.9%
fma-define80.9%
associate-/l*76.8%
fma-define76.8%
times-frac82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in c around 0 85.8%
if -2.70000000000000021e-131 < z < 1.3999999999999999e-211Initial program 96.2%
associate-+l-96.2%
*-commutative96.2%
associate-*r*96.3%
*-commutative96.3%
associate-+l-96.3%
associate-*l*96.3%
associate-*l*85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in x around inf 88.9%
associate-*r*88.9%
*-commutative88.9%
associate-*r*89.0%
Simplified89.0%
Final simplification86.4%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2e+45) (not (<= z 8.5e-88)))
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c_m)
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* 9.0 y)))) (* c_m z)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2e+45) || !(z <= 8.5e-88)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-2d+45)) .or. (.not. (z <= 8.5d-88))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c_m
else
tmp = (b - (((z * 4.0d0) * (a * t)) - (x * (9.0d0 * y)))) / (c_m * z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2e+45) || !(z <= 8.5e-88)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2e+45) or not (z <= 8.5e-88): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m else: tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2e+45) || !(z <= 8.5e-88)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c_m); else tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(9.0 * y)))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2e+45) || ~((z <= 8.5e-88)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
else
tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2e+45], N[Not[LessEqual[z, 8.5e-88]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b - N[(N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(x * N[(9.0 * y), $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}\;z \leq -2 \cdot 10^{+45} \lor \neg \left(z \leq 8.5 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b - \left(\left(z \cdot 4\right) \cdot \left(a \cdot t\right) - x \cdot \left(9 \cdot y\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -1.9999999999999999e45 or 8.4999999999999996e-88 < z Initial program 59.9%
associate-+l-59.9%
*-commutative59.9%
associate-*r*59.3%
*-commutative59.3%
associate-+l-59.3%
associate-*l*59.3%
associate-*l*62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in x around 0 76.5%
cancel-sign-sub-inv76.5%
metadata-eval76.5%
+-commutative76.5%
*-commutative76.5%
fma-define76.5%
associate-/l*74.0%
fma-define74.0%
times-frac83.0%
*-commutative83.0%
Simplified83.0%
Taylor expanded in c around 0 84.9%
if -1.9999999999999999e45 < z < 8.4999999999999996e-88Initial program 95.9%
associate-+l-95.9%
*-commutative95.9%
associate-*r*96.7%
*-commutative96.7%
associate-+l-96.7%
associate-*l*96.7%
associate-*l*91.9%
*-commutative91.9%
Simplified91.9%
Final simplification88.2%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -7.2e+40) (not (<= z 1.25e-66)))
(/ (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) c_m)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 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 ((z <= -7.2e+40) || !(z <= 1.25e-66)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 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 ((z <= (-7.2d+40)) .or. (.not. (z <= 1.25d-66))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) / c_m
else
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 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 ((z <= -7.2e+40) || !(z <= 1.25e-66)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 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 (z <= -7.2e+40) or not (z <= 1.25e-66): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m else: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 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 ((z <= -7.2e+40) || !(z <= 1.25e-66)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) / c_m); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -7.2e+40) || ~((z <= 1.25e-66)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) / c_m;
else
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 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[Or[LessEqual[z, -7.2e+40], N[Not[LessEqual[z, 1.25e-66]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 -7.2 \cdot 10^{+40} \lor \neg \left(z \leq 1.25 \cdot 10^{-66}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -7.19999999999999993e40 or 1.2499999999999999e-66 < z Initial program 59.0%
associate-+l-59.0%
*-commutative59.0%
associate-*r*58.3%
*-commutative58.3%
associate-+l-58.3%
associate-*l*58.4%
associate-*l*61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in x around 0 76.7%
cancel-sign-sub-inv76.7%
metadata-eval76.7%
+-commutative76.7%
*-commutative76.7%
fma-define76.7%
associate-/l*74.1%
fma-define74.1%
times-frac83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in c around 0 84.6%
if -7.19999999999999993e40 < z < 1.2499999999999999e-66Initial program 96.0%
Final simplification90.1%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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)))))
(*
c_s
(if (<= t -6.5e+69)
t_1
(if (<= t -2.5e-72)
(/ 1.0 (* z (/ c_m b)))
(if (<= t -2.7e-258)
(* 9.0 (* (/ x c_m) (/ y z)))
(if (<= t 1.45e-117) (/ b (* c_m z)) 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 * (a * (t / c_m));
double tmp;
if (t <= -6.5e+69) {
tmp = t_1;
} else if (t <= -2.5e-72) {
tmp = 1.0 / (z * (c_m / b));
} else if (t <= -2.7e-258) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else if (t <= 1.45e-117) {
tmp = b / (c_m * z);
} 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) * (a * (t / c_m))
if (t <= (-6.5d+69)) then
tmp = t_1
else if (t <= (-2.5d-72)) then
tmp = 1.0d0 / (z * (c_m / b))
else if (t <= (-2.7d-258)) then
tmp = 9.0d0 * ((x / c_m) * (y / z))
else if (t <= 1.45d-117) then
tmp = b / (c_m * z)
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 * (a * (t / c_m));
double tmp;
if (t <= -6.5e+69) {
tmp = t_1;
} else if (t <= -2.5e-72) {
tmp = 1.0 / (z * (c_m / b));
} else if (t <= -2.7e-258) {
tmp = 9.0 * ((x / c_m) * (y / z));
} else if (t <= 1.45e-117) {
tmp = b / (c_m * z);
} 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 * (a * (t / c_m)) tmp = 0 if t <= -6.5e+69: tmp = t_1 elif t <= -2.5e-72: tmp = 1.0 / (z * (c_m / b)) elif t <= -2.7e-258: tmp = 9.0 * ((x / c_m) * (y / z)) elif t <= 1.45e-117: tmp = b / (c_m * z) 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(a * Float64(t / c_m))) tmp = 0.0 if (t <= -6.5e+69) tmp = t_1; elseif (t <= -2.5e-72) tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); elseif (t <= -2.7e-258) tmp = Float64(9.0 * Float64(Float64(x / c_m) * Float64(y / z))); elseif (t <= 1.45e-117) tmp = Float64(b / Float64(c_m * z)); 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 * (a * (t / c_m));
tmp = 0.0;
if (t <= -6.5e+69)
tmp = t_1;
elseif (t <= -2.5e-72)
tmp = 1.0 / (z * (c_m / b));
elseif (t <= -2.7e-258)
tmp = 9.0 * ((x / c_m) * (y / z));
elseif (t <= 1.45e-117)
tmp = b / (c_m * z);
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[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -6.5e+69], t$95$1, If[LessEqual[t, -2.5e-72], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.7e-258], N[(9.0 * N[(N[(x / c$95$m), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-117], N[(b / N[(c$95$m * z), $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(a \cdot \frac{t}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{-72}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-258}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c\_m} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-117}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -6.5000000000000001e69 or 1.45e-117 < t Initial program 71.6%
associate-+l-71.6%
*-commutative71.6%
associate-*r*72.4%
*-commutative72.4%
associate-+l-72.4%
associate-*l*72.4%
associate-*l*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
associate-/l*63.3%
Simplified63.3%
if -6.5000000000000001e69 < t < -2.4999999999999998e-72Initial program 79.8%
associate-+l-79.8%
*-commutative79.8%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*79.8%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Applied egg-rr59.3%
Taylor expanded in b around inf 45.6%
associate-*l/48.2%
div-inv48.4%
div-inv48.3%
clear-num48.4%
frac-times48.5%
metadata-eval48.5%
Applied egg-rr48.5%
if -2.4999999999999998e-72 < t < -2.69999999999999996e-258Initial program 89.6%
associate-+l-89.6%
*-commutative89.6%
associate-*r*89.6%
*-commutative89.6%
associate-+l-89.6%
associate-*l*89.7%
associate-*l*89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in x around inf 45.0%
times-frac45.1%
Simplified45.1%
if -2.69999999999999996e-258 < t < 1.45e-117Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*81.6%
*-commutative81.6%
associate-+l-81.6%
associate-*l*81.7%
associate-*l*85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in b around inf 54.0%
*-commutative54.0%
Simplified54.0%
Final simplification57.6%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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)))))
(*
c_s
(if (<= t -5e+69)
t_1
(if (<= t -3.7e-85)
(/ 1.0 (* z (/ c_m b)))
(if (<= t -6.4e-282)
(* 9.0 (/ (* x y) (* c_m z)))
(if (<= t 1.45e-117) (/ b (* c_m z)) 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 * (a * (t / c_m));
double tmp;
if (t <= -5e+69) {
tmp = t_1;
} else if (t <= -3.7e-85) {
tmp = 1.0 / (z * (c_m / b));
} else if (t <= -6.4e-282) {
tmp = 9.0 * ((x * y) / (c_m * z));
} else if (t <= 1.45e-117) {
tmp = b / (c_m * z);
} 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) * (a * (t / c_m))
if (t <= (-5d+69)) then
tmp = t_1
else if (t <= (-3.7d-85)) then
tmp = 1.0d0 / (z * (c_m / b))
else if (t <= (-6.4d-282)) then
tmp = 9.0d0 * ((x * y) / (c_m * z))
else if (t <= 1.45d-117) then
tmp = b / (c_m * z)
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 * (a * (t / c_m));
double tmp;
if (t <= -5e+69) {
tmp = t_1;
} else if (t <= -3.7e-85) {
tmp = 1.0 / (z * (c_m / b));
} else if (t <= -6.4e-282) {
tmp = 9.0 * ((x * y) / (c_m * z));
} else if (t <= 1.45e-117) {
tmp = b / (c_m * z);
} 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 * (a * (t / c_m)) tmp = 0 if t <= -5e+69: tmp = t_1 elif t <= -3.7e-85: tmp = 1.0 / (z * (c_m / b)) elif t <= -6.4e-282: tmp = 9.0 * ((x * y) / (c_m * z)) elif t <= 1.45e-117: tmp = b / (c_m * z) 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(a * Float64(t / c_m))) tmp = 0.0 if (t <= -5e+69) tmp = t_1; elseif (t <= -3.7e-85) tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); elseif (t <= -6.4e-282) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c_m * z))); elseif (t <= 1.45e-117) tmp = Float64(b / Float64(c_m * z)); 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 * (a * (t / c_m));
tmp = 0.0;
if (t <= -5e+69)
tmp = t_1;
elseif (t <= -3.7e-85)
tmp = 1.0 / (z * (c_m / b));
elseif (t <= -6.4e-282)
tmp = 9.0 * ((x * y) / (c_m * z));
elseif (t <= 1.45e-117)
tmp = b / (c_m * z);
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[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -5e+69], t$95$1, If[LessEqual[t, -3.7e-85], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -6.4e-282], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-117], N[(b / N[(c$95$m * z), $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(a \cdot \frac{t}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.7 \cdot 10^{-85}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-282}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c\_m \cdot z}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-117}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -5.00000000000000036e69 or 1.45e-117 < t Initial program 71.6%
associate-+l-71.6%
*-commutative71.6%
associate-*r*72.4%
*-commutative72.4%
associate-+l-72.4%
associate-*l*72.4%
associate-*l*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
associate-/l*63.3%
Simplified63.3%
if -5.00000000000000036e69 < t < -3.69999999999999983e-85Initial program 77.9%
associate-+l-77.9%
*-commutative77.9%
associate-*r*77.9%
*-commutative77.9%
associate-+l-77.9%
associate-*l*77.9%
associate-*l*78.0%
*-commutative78.0%
Simplified78.0%
Applied egg-rr57.9%
Taylor expanded in b around inf 44.4%
associate-*l/47.2%
div-inv47.4%
div-inv47.3%
clear-num47.4%
frac-times47.5%
metadata-eval47.5%
Applied egg-rr47.5%
if -3.69999999999999983e-85 < t < -6.39999999999999966e-282Initial program 90.7%
associate-+l-90.7%
*-commutative90.7%
associate-*r*90.7%
*-commutative90.7%
associate-+l-90.7%
associate-*l*90.8%
associate-*l*90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in x around inf 45.6%
*-commutative45.6%
Simplified45.6%
if -6.39999999999999966e-282 < t < 1.45e-117Initial program 84.2%
associate-+l-84.2%
*-commutative84.2%
associate-*r*81.7%
*-commutative81.7%
associate-+l-81.7%
associate-*l*81.8%
associate-*l*86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in b around inf 52.9%
*-commutative52.9%
Simplified52.9%
Final simplification57.2%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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)))))
(*
c_s
(if (<= t -1.25e+69)
t_1
(if (<= t -8.5e-69)
(/ 1.0 (* z (/ c_m b)))
(if (<= t -1.35e-282)
(* x (/ (* 9.0 y) (* c_m z)))
(if (<= t 1.45e-117) (/ b (* c_m z)) 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 * (a * (t / c_m));
double tmp;
if (t <= -1.25e+69) {
tmp = t_1;
} else if (t <= -8.5e-69) {
tmp = 1.0 / (z * (c_m / b));
} else if (t <= -1.35e-282) {
tmp = x * ((9.0 * y) / (c_m * z));
} else if (t <= 1.45e-117) {
tmp = b / (c_m * z);
} 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) * (a * (t / c_m))
if (t <= (-1.25d+69)) then
tmp = t_1
else if (t <= (-8.5d-69)) then
tmp = 1.0d0 / (z * (c_m / b))
else if (t <= (-1.35d-282)) then
tmp = x * ((9.0d0 * y) / (c_m * z))
else if (t <= 1.45d-117) then
tmp = b / (c_m * z)
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 * (a * (t / c_m));
double tmp;
if (t <= -1.25e+69) {
tmp = t_1;
} else if (t <= -8.5e-69) {
tmp = 1.0 / (z * (c_m / b));
} else if (t <= -1.35e-282) {
tmp = x * ((9.0 * y) / (c_m * z));
} else if (t <= 1.45e-117) {
tmp = b / (c_m * z);
} 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 * (a * (t / c_m)) tmp = 0 if t <= -1.25e+69: tmp = t_1 elif t <= -8.5e-69: tmp = 1.0 / (z * (c_m / b)) elif t <= -1.35e-282: tmp = x * ((9.0 * y) / (c_m * z)) elif t <= 1.45e-117: tmp = b / (c_m * z) 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(a * Float64(t / c_m))) tmp = 0.0 if (t <= -1.25e+69) tmp = t_1; elseif (t <= -8.5e-69) tmp = Float64(1.0 / Float64(z * Float64(c_m / b))); elseif (t <= -1.35e-282) tmp = Float64(x * Float64(Float64(9.0 * y) / Float64(c_m * z))); elseif (t <= 1.45e-117) tmp = Float64(b / Float64(c_m * z)); 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 * (a * (t / c_m));
tmp = 0.0;
if (t <= -1.25e+69)
tmp = t_1;
elseif (t <= -8.5e-69)
tmp = 1.0 / (z * (c_m / b));
elseif (t <= -1.35e-282)
tmp = x * ((9.0 * y) / (c_m * z));
elseif (t <= 1.45e-117)
tmp = b / (c_m * z);
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[(a * N[(t / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t, -1.25e+69], t$95$1, If[LessEqual[t, -8.5e-69], N[(1.0 / N[(z * N[(c$95$m / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-282], N[(x * N[(N[(9.0 * y), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-117], N[(b / N[(c$95$m * z), $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(a \cdot \frac{t}{c\_m}\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-69}:\\
\;\;\;\;\frac{1}{z \cdot \frac{c\_m}{b}}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-282}:\\
\;\;\;\;x \cdot \frac{9 \cdot y}{c\_m \cdot z}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-117}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
\end{array}
if t < -1.25000000000000009e69 or 1.45e-117 < t Initial program 71.6%
associate-+l-71.6%
*-commutative71.6%
associate-*r*72.4%
*-commutative72.4%
associate-+l-72.4%
associate-*l*72.4%
associate-*l*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
associate-/l*63.3%
Simplified63.3%
if -1.25000000000000009e69 < t < -8.50000000000000046e-69Initial program 79.8%
associate-+l-79.8%
*-commutative79.8%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
associate-*l*79.8%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Applied egg-rr59.3%
Taylor expanded in b around inf 45.6%
associate-*l/48.2%
div-inv48.4%
div-inv48.3%
clear-num48.4%
frac-times48.5%
metadata-eval48.5%
Applied egg-rr48.5%
if -8.50000000000000046e-69 < t < -1.34999999999999991e-282Initial program 88.3%
associate-+l-88.3%
*-commutative88.3%
associate-*r*88.3%
*-commutative88.3%
associate-+l-88.3%
associate-*l*88.4%
associate-*l*88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in x around 0 85.3%
cancel-sign-sub-inv85.3%
metadata-eval85.3%
+-commutative85.3%
*-commutative85.3%
fma-define85.3%
associate-/l*82.4%
fma-define82.4%
times-frac79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in x around inf 44.5%
*-commutative44.5%
associate-/l*47.5%
associate-*l*47.5%
*-commutative47.5%
associate-/r*47.9%
associate-*r/47.9%
Simplified47.9%
Taylor expanded in y around 0 47.5%
associate-*r/47.4%
*-commutative47.4%
Simplified47.4%
if -1.34999999999999991e-282 < t < 1.45e-117Initial program 84.2%
associate-+l-84.2%
*-commutative84.2%
associate-*r*81.7%
*-commutative81.7%
associate-+l-81.7%
associate-*l*81.8%
associate-*l*86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in b around inf 52.9%
*-commutative52.9%
Simplified52.9%
Final simplification57.6%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1.9e+16) (not (<= z 9e-83)))
(/ (+ (* -4.0 (* a t)) (/ b z)) c_m)
(/ (+ b (* x (* 9.0 y))) (* c_m z)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.9e+16) || !(z <= 9e-83)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
} else {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-1.9d+16)) .or. (.not. (z <= 9d-83))) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c_m
else
tmp = (b + (x * (9.0d0 * y))) / (c_m * z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -1.9e+16) || !(z <= 9e-83)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
} else {
tmp = (b + (x * (9.0 * y))) / (c_m * z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -1.9e+16) or not (z <= 9e-83): tmp = ((-4.0 * (a * t)) + (b / z)) / c_m else: tmp = (b + (x * (9.0 * y))) / (c_m * z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -1.9e+16) || !(z <= 9e-83)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m); else tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -1.9e+16) || ~((z <= 9e-83)))
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
else
tmp = (b + (x * (9.0 * y))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -1.9e+16], N[Not[LessEqual[z, 9e-83]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+16} \lor \neg \left(z \leq 9 \cdot 10^{-83}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -1.9e16 or 8.99999999999999995e-83 < z Initial program 61.3%
associate-+l-61.3%
*-commutative61.3%
associate-*r*60.7%
*-commutative60.7%
associate-+l-60.7%
associate-*l*60.7%
associate-*l*63.5%
*-commutative63.5%
Simplified63.5%
Taylor expanded in x around 0 77.3%
cancel-sign-sub-inv77.3%
metadata-eval77.3%
+-commutative77.3%
*-commutative77.3%
fma-define77.3%
associate-/l*74.9%
fma-define74.9%
times-frac83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in c around 0 84.8%
Taylor expanded in x around 0 77.4%
if -1.9e16 < z < 8.99999999999999995e-83Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
associate-*r*96.6%
*-commutative96.6%
associate-+l-96.6%
associate-*l*96.6%
associate-*l*91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in x around inf 81.4%
associate-*r*81.5%
*-commutative81.5%
associate-*r*81.5%
Simplified81.5%
Final simplification79.2%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 -4.2e+62)
(* (/ y c_m) (/ (* 9.0 x) z))
(if (<= y 2.2e+196)
(/ (+ (* -4.0 (* a t)) (/ b z)) c_m)
(* 9.0 (* x (/ y (* c_m z))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
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 <= -4.2e+62) {
tmp = (y / c_m) * ((9.0 * x) / z);
} else if (y <= 2.2e+196) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
} else {
tmp = 9.0 * (x * (y / (c_m * z)));
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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 <= (-4.2d+62)) then
tmp = (y / c_m) * ((9.0d0 * x) / z)
else if (y <= 2.2d+196) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c_m
else
tmp = 9.0d0 * (x * (y / (c_m * z)))
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 <= -4.2e+62) {
tmp = (y / c_m) * ((9.0 * x) / z);
} else if (y <= 2.2e+196) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
} else {
tmp = 9.0 * (x * (y / (c_m * z)));
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) [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 <= -4.2e+62: tmp = (y / c_m) * ((9.0 * x) / z) elif y <= 2.2e+196: tmp = ((-4.0 * (a * t)) + (b / z)) / c_m else: tmp = 9.0 * (x * (y / (c_m * z))) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) 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 <= -4.2e+62) tmp = Float64(Float64(y / c_m) * Float64(Float64(9.0 * x) / z)); elseif (y <= 2.2e+196) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c_m); else tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
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 <= -4.2e+62)
tmp = (y / c_m) * ((9.0 * x) / z);
elseif (y <= 2.2e+196)
tmp = ((-4.0 * (a * t)) + (b / z)) / c_m;
else
tmp = 9.0 * (x * (y / (c_m * z)));
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
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, -4.2e+62], N[(N[(y / c$95$m), $MachinePrecision] * N[(N[(9.0 * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+196], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\\\
[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 -4.2 \cdot 10^{+62}:\\
\;\;\;\;\frac{y}{c\_m} \cdot \frac{9 \cdot x}{z}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+196}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\end{array}
\end{array}
if y < -4.2e62Initial program 69.3%
associate-+l-69.3%
*-commutative69.3%
associate-*r*69.3%
*-commutative69.3%
associate-+l-69.3%
associate-*l*69.4%
associate-*l*72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in x around inf 44.0%
*-commutative44.0%
associate-/l*44.0%
associate-*r*44.0%
Simplified44.0%
times-frac53.0%
*-commutative53.0%
Applied egg-rr53.0%
if -4.2e62 < y < 2.19999999999999998e196Initial program 79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*79.9%
*-commutative79.9%
associate-+l-79.9%
associate-*l*79.9%
associate-*l*78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in x around 0 83.7%
cancel-sign-sub-inv83.7%
metadata-eval83.7%
+-commutative83.7%
*-commutative83.7%
fma-define83.7%
associate-/l*81.1%
fma-define81.1%
times-frac79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in c around 0 88.8%
Taylor expanded in x around 0 75.9%
if 2.19999999999999998e196 < y Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
associate-*r*75.4%
*-commutative75.4%
associate-+l-75.4%
associate-*l*75.4%
associate-*l*65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in x around 0 60.5%
cancel-sign-sub-inv60.5%
metadata-eval60.5%
+-commutative60.5%
*-commutative60.5%
fma-define60.5%
associate-/l*65.4%
fma-define65.4%
times-frac65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in x around inf 36.3%
*-commutative36.3%
associate-/l*50.4%
Simplified50.4%
Final simplification68.3%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= t -7.5e+69) (not (<= t 1.45e-117)))
(* -4.0 (* a (/ t 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 ((t <= -7.5e+69) || !(t <= 1.45e-117)) {
tmp = -4.0 * (a * (t / 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 ((t <= (-7.5d+69)) .or. (.not. (t <= 1.45d-117))) then
tmp = (-4.0d0) * (a * (t / 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 ((t <= -7.5e+69) || !(t <= 1.45e-117)) {
tmp = -4.0 * (a * (t / 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 (t <= -7.5e+69) or not (t <= 1.45e-117): tmp = -4.0 * (a * (t / 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 ((t <= -7.5e+69) || !(t <= 1.45e-117)) tmp = Float64(-4.0 * Float64(a * Float64(t / 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 ((t <= -7.5e+69) || ~((t <= 1.45e-117)))
tmp = -4.0 * (a * (t / 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[t, -7.5e+69], N[Not[LessEqual[t, 1.45e-117]], $MachinePrecision]], N[(-4.0 * N[(a * N[(t / 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}\;t \leq -7.5 \cdot 10^{+69} \lor \neg \left(t \leq 1.45 \cdot 10^{-117}\right):\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if t < -7.49999999999999939e69 or 1.45e-117 < t Initial program 71.6%
associate-+l-71.6%
*-commutative71.6%
associate-*r*72.4%
*-commutative72.4%
associate-+l-72.4%
associate-*l*72.4%
associate-*l*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in z around inf 57.4%
*-commutative57.4%
associate-/l*63.3%
Simplified63.3%
if -7.49999999999999939e69 < t < 1.45e-117Initial program 84.1%
associate-+l-84.1%
*-commutative84.1%
associate-*r*83.1%
*-commutative83.1%
associate-+l-83.1%
associate-*l*83.2%
associate-*l*85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in b around inf 47.6%
*-commutative47.6%
Simplified47.6%
Final simplification56.6%
c_m = (fabs.f64 c) c_s = (copysign.f64 1 c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. 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 76.9%
associate-+l-76.9%
*-commutative76.9%
associate-*r*77.0%
*-commutative77.0%
associate-+l-77.0%
associate-*l*77.0%
associate-*l*76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in b around inf 36.2%
*-commutative36.2%
Simplified36.2%
Final simplification36.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024062
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))