
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= c_m 1e+22)
(/ (- (+ (* 9.0 (/ (* x y) z)) (/ b z)) (* 4.0 (* a t))) c_m)
(+
(* a (/ (* t -4.0) c_m))
(/ (- (/ b c_m) (* -9.0 (* x (/ y c_m)))) z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1e+22) {
tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / c_m;
} else {
tmp = (a * ((t * -4.0) / c_m)) + (((b / c_m) - (-9.0 * (x * (y / c_m)))) / z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (c_m <= 1d+22) then
tmp = (((9.0d0 * ((x * y) / z)) + (b / z)) - (4.0d0 * (a * t))) / c_m
else
tmp = (a * ((t * (-4.0d0)) / c_m)) + (((b / c_m) - ((-9.0d0) * (x * (y / c_m)))) / z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 1e+22) {
tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / c_m;
} else {
tmp = (a * ((t * -4.0) / c_m)) + (((b / c_m) - (-9.0 * (x * (y / c_m)))) / z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if c_m <= 1e+22: tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / c_m else: tmp = (a * ((t * -4.0) / c_m)) + (((b / c_m) - (-9.0 * (x * (y / c_m)))) / z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 1e+22) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z)) - Float64(4.0 * Float64(a * t))) / c_m); else tmp = Float64(Float64(a * Float64(Float64(t * -4.0) / c_m)) + Float64(Float64(Float64(b / c_m) - Float64(-9.0 * Float64(x * Float64(y / c_m)))) / z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (c_m <= 1e+22)
tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / c_m;
else
tmp = (a * ((t * -4.0) / c_m)) + (((b / c_m) - (-9.0 * (x * (y / c_m)))) / z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 1e+22], N[(N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c$95$m), $MachinePrecision] - N[(-9.0 * N[(x * N[(y / c$95$m), $MachinePrecision]), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 10^{+22}:\\
\;\;\;\;\frac{\left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right) - 4 \cdot \left(a \cdot t\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m} + \frac{\frac{b}{c\_m} - -9 \cdot \left(x \cdot \frac{y}{c\_m}\right)}{z}\\
\end{array}
\end{array}
if c < 1e22Initial program 84.3%
+-commutative84.3%
associate-+r-84.3%
*-commutative84.3%
associate-*r*82.7%
*-commutative82.7%
associate-+r-82.7%
+-commutative82.7%
associate-*l*82.7%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 77.9%
Taylor expanded in c around 0 88.2%
if 1e22 < c Initial program 70.6%
+-commutative70.6%
associate-+r-70.6%
*-commutative70.6%
associate-*r*68.9%
*-commutative68.9%
associate-+r-68.9%
+-commutative68.9%
associate-*l*68.9%
associate-*l*70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x around 0 84.6%
Taylor expanded in c around 0 84.9%
Taylor expanded in z around -inf 88.7%
metadata-eval88.7%
distribute-lft-neg-in88.7%
mul-1-neg88.7%
unsub-neg88.7%
distribute-lft-neg-in88.7%
metadata-eval88.7%
*-commutative88.7%
associate-*l/88.7%
associate-*r*88.7%
associate-/l*99.0%
*-commutative99.0%
Simplified96.9%
Final simplification90.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c_m z))))
(*
c_s
(if (<= t_1 -2e-250)
t_1
(if (<= t_1 0.0)
(/ (+ (* 9.0 (/ (* x y) z)) (/ b z)) c_m)
(if (<= t_1 INFINITY)
(/ (- b (- (* (* z 4.0) (* a t)) (* x (* 9.0 y)))) (* c_m z))
(* t (+ (* -4.0 (/ a c_m)) (/ b (* c_m (* z t)))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -2e-250) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((9.0 * ((x * y) / z)) + (b / z)) / c_m;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
double tmp;
if (t_1 <= -2e-250) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = ((9.0 * ((x * y) / z)) + (b / z)) / c_m;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z);
} else {
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z) tmp = 0 if t_1 <= -2e-250: tmp = t_1 elif t_1 <= 0.0: tmp = ((9.0 * ((x * y) / z)) + (b / z)) / c_m elif t_1 <= math.inf: tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z) else: tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t)))) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -2e-250) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z)) / c_m); elseif (t_1 <= Inf) tmp = Float64(Float64(b - Float64(Float64(Float64(z * 4.0) * Float64(a * t)) - Float64(x * Float64(9.0 * y)))) / Float64(c_m * z)); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c_m)) + Float64(b / Float64(c_m * Float64(z * t))))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -2e-250)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = ((9.0 * ((x * y) / z)) + (b / z)) / c_m;
elseif (t_1 <= Inf)
tmp = (b - (((z * 4.0) * (a * t)) - (x * (9.0 * y)))) / (c_m * z);
else
tmp = t * ((-4.0 * (a / c_m)) + (b / (c_m * (z * t))));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(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]}, N[(c$95$s * If[LessEqual[t$95$1, -2e-250], t$95$1, If[LessEqual[t$95$1, 0.0], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t$95$1, Infinity], 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], N[(t * N[(N[(-4.0 * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \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}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-250}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}}{c\_m}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c\_m} + \frac{b}{c\_m \cdot \left(z \cdot t\right)}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < -2.0000000000000001e-250Initial program 91.8%
if -2.0000000000000001e-250 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 0.0Initial program 34.7%
+-commutative34.7%
associate-+r-34.7%
*-commutative34.7%
associate-*r*27.4%
*-commutative27.4%
associate-+r-27.4%
+-commutative27.4%
associate-*l*27.4%
associate-*l*34.7%
*-commutative34.7%
Simplified34.7%
Taylor expanded in x around 0 54.1%
Taylor expanded in c around 0 99.6%
Taylor expanded in a around 0 78.1%
if 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < +inf.0Initial program 89.8%
+-commutative89.8%
associate-+r-89.8%
*-commutative89.8%
associate-*r*87.9%
*-commutative87.9%
associate-+r-87.9%
+-commutative87.9%
associate-*l*87.9%
associate-*l*92.5%
*-commutative92.5%
Simplified92.5%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) Initial program 0.0%
+-commutative0.0%
associate-+r-0.0%
*-commutative0.0%
associate-*r*0.0%
*-commutative0.0%
associate-+r-0.0%
+-commutative0.0%
associate-*l*0.0%
associate-*l*0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in x around 0 53.7%
Taylor expanded in c around 0 54.1%
Taylor expanded in x around 0 59.5%
Taylor expanded in t around inf 84.2%
Final simplification90.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ b (* c_m z))))
(*
c_s
(if (<= x -1e+66)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= x -9.5e-11)
t_1
(if (<= x 4.2e-286)
(* a (/ (* t -4.0) c_m))
(if (<= x 1.52e-55) t_1 (/ (* y (* 9.0 (/ x c_m))) z))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (c_m * z);
double tmp;
if (x <= -1e+66) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (x <= -9.5e-11) {
tmp = t_1;
} else if (x <= 4.2e-286) {
tmp = a * ((t * -4.0) / c_m);
} else if (x <= 1.52e-55) {
tmp = t_1;
} else {
tmp = (y * (9.0 * (x / c_m))) / z;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = b / (c_m * z)
if (x <= (-1d+66)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (x <= (-9.5d-11)) then
tmp = t_1
else if (x <= 4.2d-286) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (x <= 1.52d-55) then
tmp = t_1
else
tmp = (y * (9.0d0 * (x / c_m))) / z
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (c_m * z);
double tmp;
if (x <= -1e+66) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (x <= -9.5e-11) {
tmp = t_1;
} else if (x <= 4.2e-286) {
tmp = a * ((t * -4.0) / c_m);
} else if (x <= 1.52e-55) {
tmp = t_1;
} else {
tmp = (y * (9.0 * (x / c_m))) / z;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = b / (c_m * z) tmp = 0 if x <= -1e+66: tmp = 9.0 * (x * (y / (c_m * z))) elif x <= -9.5e-11: tmp = t_1 elif x <= 4.2e-286: tmp = a * ((t * -4.0) / c_m) elif x <= 1.52e-55: tmp = t_1 else: tmp = (y * (9.0 * (x / c_m))) / z return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(b / Float64(c_m * z)) tmp = 0.0 if (x <= -1e+66) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (x <= -9.5e-11) tmp = t_1; elseif (x <= 4.2e-286) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (x <= 1.52e-55) tmp = t_1; else tmp = Float64(Float64(y * Float64(9.0 * Float64(x / c_m))) / z); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = b / (c_m * z);
tmp = 0.0;
if (x <= -1e+66)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (x <= -9.5e-11)
tmp = t_1;
elseif (x <= 4.2e-286)
tmp = a * ((t * -4.0) / c_m);
elseif (x <= 1.52e-55)
tmp = t_1;
else
tmp = (y * (9.0 * (x / c_m))) / z;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -1e+66], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.5e-11], t$95$1, If[LessEqual[x, 4.2e-286], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.52e-55], t$95$1, N[(N[(y * N[(9.0 * N[(x / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+66}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-286}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 1.52 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(9 \cdot \frac{x}{c\_m}\right)}{z}\\
\end{array}
\end{array}
\end{array}
if x < -9.99999999999999945e65Initial program 79.5%
Simplified81.0%
Taylor expanded in x around inf 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 57.6%
associate-/r*52.9%
associate-/l*49.9%
Simplified49.9%
Taylor expanded in x around 0 57.6%
associate-/r*52.9%
associate-*r/49.9%
associate-*r/54.5%
associate-/r*60.5%
Simplified60.5%
if -9.99999999999999945e65 < x < -9.49999999999999951e-11 or 4.19999999999999977e-286 < x < 1.5200000000000001e-55Initial program 86.2%
Simplified83.1%
Taylor expanded in b around inf 52.3%
*-commutative52.3%
Simplified52.3%
if -9.49999999999999951e-11 < x < 4.19999999999999977e-286Initial program 75.6%
Simplified71.8%
Taylor expanded in t around inf 37.6%
*-commutative37.6%
associate-/l*44.0%
associate-*r*44.0%
associate-*l/44.1%
Simplified44.1%
if 1.5200000000000001e-55 < x Initial program 80.7%
+-commutative80.7%
associate-+r-80.7%
*-commutative80.7%
associate-*r*80.6%
*-commutative80.6%
associate-+r-80.6%
+-commutative80.6%
associate-*l*80.5%
associate-*l*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y around inf 68.4%
Taylor expanded in z around 0 62.4%
Taylor expanded in x around inf 45.5%
Final simplification50.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ b (* c_m z))))
(*
c_s
(if (<= x -1.62e+66)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= x -4.8e-11)
t_1
(if (<= x 3.9e-287)
(* a (/ (* t -4.0) c_m))
(if (<= x 6.8e-59) t_1 (* 9.0 (/ (* x (/ y c_m)) z)))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (c_m * z);
double tmp;
if (x <= -1.62e+66) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (x <= -4.8e-11) {
tmp = t_1;
} else if (x <= 3.9e-287) {
tmp = a * ((t * -4.0) / c_m);
} else if (x <= 6.8e-59) {
tmp = t_1;
} else {
tmp = 9.0 * ((x * (y / c_m)) / z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = b / (c_m * z)
if (x <= (-1.62d+66)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (x <= (-4.8d-11)) then
tmp = t_1
else if (x <= 3.9d-287) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (x <= 6.8d-59) then
tmp = t_1
else
tmp = 9.0d0 * ((x * (y / c_m)) / z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (c_m * z);
double tmp;
if (x <= -1.62e+66) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (x <= -4.8e-11) {
tmp = t_1;
} else if (x <= 3.9e-287) {
tmp = a * ((t * -4.0) / c_m);
} else if (x <= 6.8e-59) {
tmp = t_1;
} else {
tmp = 9.0 * ((x * (y / c_m)) / z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = b / (c_m * z) tmp = 0 if x <= -1.62e+66: tmp = 9.0 * (x * (y / (c_m * z))) elif x <= -4.8e-11: tmp = t_1 elif x <= 3.9e-287: tmp = a * ((t * -4.0) / c_m) elif x <= 6.8e-59: tmp = t_1 else: tmp = 9.0 * ((x * (y / c_m)) / z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(b / Float64(c_m * z)) tmp = 0.0 if (x <= -1.62e+66) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (x <= -4.8e-11) tmp = t_1; elseif (x <= 3.9e-287) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (x <= 6.8e-59) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(x * Float64(y / c_m)) / z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = b / (c_m * z);
tmp = 0.0;
if (x <= -1.62e+66)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (x <= -4.8e-11)
tmp = t_1;
elseif (x <= 3.9e-287)
tmp = a * ((t * -4.0) / c_m);
elseif (x <= 6.8e-59)
tmp = t_1;
else
tmp = 9.0 * ((x * (y / c_m)) / z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -1.62e+66], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.8e-11], t$95$1, If[LessEqual[x, 3.9e-287], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e-59], t$95$1, N[(9.0 * N[(N[(x * N[(y / c$95$m), $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])\\
\\
\begin{array}{l}
t_1 := \frac{b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -1.62 \cdot 10^{+66}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-287}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{x \cdot \frac{y}{c\_m}}{z}\\
\end{array}
\end{array}
\end{array}
if x < -1.62e66Initial program 79.5%
Simplified81.0%
Taylor expanded in x around inf 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 57.6%
associate-/r*52.9%
associate-/l*49.9%
Simplified49.9%
Taylor expanded in x around 0 57.6%
associate-/r*52.9%
associate-*r/49.9%
associate-*r/54.5%
associate-/r*60.5%
Simplified60.5%
if -1.62e66 < x < -4.8000000000000002e-11 or 3.9e-287 < x < 6.80000000000000035e-59Initial program 85.5%
Simplified82.5%
Taylor expanded in b around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -4.8000000000000002e-11 < x < 3.9e-287Initial program 76.4%
Simplified72.4%
Taylor expanded in t around inf 38.3%
*-commutative38.3%
associate-/l*44.9%
associate-*r*44.9%
associate-*l/45.0%
Simplified45.0%
if 6.80000000000000035e-59 < x Initial program 80.7%
Simplified80.5%
Taylor expanded in x around inf 44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in x around 0 44.4%
associate-/r*43.2%
associate-/l*45.0%
Simplified45.0%
Final simplification50.6%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ b (* c_m z))))
(*
c_s
(if (<= x -2.8e+66)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= x -2.75e-11)
t_1
(if (<= x 2.4e-289)
(* a (/ (* t -4.0) c_m))
(if (<= x 9.5e-62) t_1 (* 9.0 (* x (/ (/ y c_m) z))))))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (c_m * z);
double tmp;
if (x <= -2.8e+66) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (x <= -2.75e-11) {
tmp = t_1;
} else if (x <= 2.4e-289) {
tmp = a * ((t * -4.0) / c_m);
} else if (x <= 9.5e-62) {
tmp = t_1;
} else {
tmp = 9.0 * (x * ((y / c_m) / z));
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = b / (c_m * z)
if (x <= (-2.8d+66)) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (x <= (-2.75d-11)) then
tmp = t_1
else if (x <= 2.4d-289) then
tmp = a * ((t * (-4.0d0)) / c_m)
else if (x <= 9.5d-62) then
tmp = t_1
else
tmp = 9.0d0 * (x * ((y / c_m) / z))
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = b / (c_m * z);
double tmp;
if (x <= -2.8e+66) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (x <= -2.75e-11) {
tmp = t_1;
} else if (x <= 2.4e-289) {
tmp = a * ((t * -4.0) / c_m);
} else if (x <= 9.5e-62) {
tmp = t_1;
} else {
tmp = 9.0 * (x * ((y / c_m) / z));
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = b / (c_m * z) tmp = 0 if x <= -2.8e+66: tmp = 9.0 * (x * (y / (c_m * z))) elif x <= -2.75e-11: tmp = t_1 elif x <= 2.4e-289: tmp = a * ((t * -4.0) / c_m) elif x <= 9.5e-62: tmp = t_1 else: tmp = 9.0 * (x * ((y / c_m) / z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(b / Float64(c_m * z)) tmp = 0.0 if (x <= -2.8e+66) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (x <= -2.75e-11) tmp = t_1; elseif (x <= 2.4e-289) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); elseif (x <= 9.5e-62) tmp = t_1; else tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = b / (c_m * z);
tmp = 0.0;
if (x <= -2.8e+66)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (x <= -2.75e-11)
tmp = t_1;
elseif (x <= 2.4e-289)
tmp = a * ((t * -4.0) / c_m);
elseif (x <= 9.5e-62)
tmp = t_1;
else
tmp = 9.0 * (x * ((y / c_m) / z));
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[x, -2.8e+66], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.75e-11], t$95$1, If[LessEqual[x, 2.4e-289], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-62], t$95$1, N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+66}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;x \leq -2.75 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-289}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\end{array}
\end{array}
\end{array}
if x < -2.8000000000000001e66Initial program 79.5%
Simplified81.0%
Taylor expanded in x around inf 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around 0 57.6%
associate-/r*52.9%
associate-/l*49.9%
Simplified49.9%
Taylor expanded in x around 0 57.6%
associate-/r*52.9%
associate-*r/49.9%
associate-*r/54.5%
associate-/r*60.5%
Simplified60.5%
if -2.8000000000000001e66 < x < -2.74999999999999987e-11 or 2.39999999999999994e-289 < x < 9.49999999999999951e-62Initial program 85.5%
Simplified82.5%
Taylor expanded in b around inf 52.1%
*-commutative52.1%
Simplified52.1%
if -2.74999999999999987e-11 < x < 2.39999999999999994e-289Initial program 76.4%
Simplified72.4%
Taylor expanded in t around inf 38.3%
*-commutative38.3%
associate-/l*44.9%
associate-*r*44.9%
associate-*l/45.0%
Simplified45.0%
if 9.49999999999999951e-62 < x Initial program 80.7%
Simplified80.5%
Taylor expanded in x around inf 44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in x around 0 44.4%
associate-*r/46.8%
associate-/r*45.2%
Simplified45.2%
Final simplification50.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.2e-89) (not (<= z 5.4e-81)))
(/ (- (+ (* 9.0 (/ (* x y) z)) (/ b z)) (* 4.0 (* a t))) 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);
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.2e-89) || !(z <= 5.4e-81)) {
tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / 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.
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.2d-89)) .or. (.not. (z <= 5.4d-81))) then
tmp = (((9.0d0 * ((x * y) / z)) + (b / z)) - (4.0d0 * (a * t))) / 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;
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.2e-89) || !(z <= 5.4e-81)) {
tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / 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]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.2e-89) or not (z <= 5.4e-81): tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / 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]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.2e-89) || !(z <= 5.4e-81)) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z)) - Float64(4.0 * Float64(a * t))) / 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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.2e-89) || ~((z <= 5.4e-81)))
tmp = (((9.0 * ((x * y) / z)) + (b / z)) - (4.0 * (a * t))) / 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.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.2e-89], N[Not[LessEqual[z, 5.4e-81]], $MachinePrecision]], N[(N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(a * t), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-89} \lor \neg \left(z \leq 5.4 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{\left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right) - 4 \cdot \left(a \cdot t\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 < -2.20000000000000012e-89 or 5.39999999999999979e-81 < z Initial program 70.8%
+-commutative70.8%
associate-+r-70.8%
*-commutative70.8%
associate-*r*68.3%
*-commutative68.3%
associate-+r-68.3%
+-commutative68.3%
associate-*l*68.3%
associate-*l*74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in x around 0 81.8%
Taylor expanded in c around 0 89.1%
if -2.20000000000000012e-89 < z < 5.39999999999999979e-81Initial program 98.1%
Final simplification92.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.4e+180) (not (<= z 4.5e+117)))
(- (/ (* 9.0 (* x (/ y z))) c_m) (/ (* 4.0 (* a t)) 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);
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.4e+180) || !(z <= 4.5e+117)) {
tmp = ((9.0 * (x * (y / z))) / c_m) - ((4.0 * (a * t)) / 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.
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.4d+180)) .or. (.not. (z <= 4.5d+117))) then
tmp = ((9.0d0 * (x * (y / z))) / c_m) - ((4.0d0 * (a * t)) / 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;
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.4e+180) || !(z <= 4.5e+117)) {
tmp = ((9.0 * (x * (y / z))) / c_m) - ((4.0 * (a * t)) / 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]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.4e+180) or not (z <= 4.5e+117): tmp = ((9.0 * (x * (y / z))) / c_m) - ((4.0 * (a * t)) / 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]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.4e+180) || !(z <= 4.5e+117)) tmp = Float64(Float64(Float64(9.0 * Float64(x * Float64(y / z))) / c_m) - Float64(Float64(4.0 * Float64(a * t)) / 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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.4e+180) || ~((z <= 4.5e+117)))
tmp = ((9.0 * (x * (y / z))) / c_m) - ((4.0 * (a * t)) / 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.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.4e+180], N[Not[LessEqual[z, 4.5e+117]], $MachinePrecision]], N[(N[(N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] - N[(N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision]), $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])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+180} \lor \neg \left(z \leq 4.5 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{9 \cdot \left(x \cdot \frac{y}{z}\right)}{c\_m} - \frac{4 \cdot \left(a \cdot t\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 < -2.3999999999999998e180 or 4.5e117 < z Initial program 50.3%
+-commutative50.3%
associate-+r-50.3%
*-commutative50.3%
associate-*r*48.2%
*-commutative48.2%
associate-+r-48.2%
+-commutative48.2%
associate-*l*48.3%
associate-*l*56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in x around 0 80.9%
Taylor expanded in c around 0 88.0%
Taylor expanded in x around inf 80.8%
associate-*r/82.8%
associate-*r*82.7%
Simplified82.7%
div-sub82.7%
associate-*l*82.8%
Applied egg-rr82.8%
if -2.3999999999999998e180 < z < 4.5e117Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
associate-*r*88.3%
*-commutative88.3%
associate-+r-88.3%
+-commutative88.3%
associate-*l*88.3%
associate-*l*89.8%
*-commutative89.8%
Simplified89.8%
Final simplification88.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 4.0 (* a t))))
(*
c_s
(if (<= z -3.5e+34)
(- (/ (* 9.0 (* x (/ y z))) c_m) (/ t_1 c_m))
(if (<= z -4e-72)
(* y (+ (/ (* 9.0 x) (* c_m z)) (* -4.0 (* a (/ t (* c_m y))))))
(if (<= z 1e+27)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(/ (- (/ b z) t_1) c_m)))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -3.5e+34) {
tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m);
} else if (z <= -4e-72) {
tmp = y * (((9.0 * x) / (c_m * z)) + (-4.0 * (a * (t / (c_m * y)))));
} else if (z <= 1e+27) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b / z) - t_1) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 4.0d0 * (a * t)
if (z <= (-3.5d+34)) then
tmp = ((9.0d0 * (x * (y / z))) / c_m) - (t_1 / c_m)
else if (z <= (-4d-72)) then
tmp = y * (((9.0d0 * x) / (c_m * z)) + ((-4.0d0) * (a * (t / (c_m * y)))))
else if (z <= 1d+27) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = ((b / z) - t_1) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -3.5e+34) {
tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m);
} else if (z <= -4e-72) {
tmp = y * (((9.0 * x) / (c_m * z)) + (-4.0 * (a * (t / (c_m * y)))));
} else if (z <= 1e+27) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b / z) - t_1) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 4.0 * (a * t) tmp = 0 if z <= -3.5e+34: tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m) elif z <= -4e-72: tmp = y * (((9.0 * x) / (c_m * z)) + (-4.0 * (a * (t / (c_m * y))))) elif z <= 1e+27: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = ((b / z) - t_1) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(4.0 * Float64(a * t)) tmp = 0.0 if (z <= -3.5e+34) tmp = Float64(Float64(Float64(9.0 * Float64(x * Float64(y / z))) / c_m) - Float64(t_1 / c_m)); elseif (z <= -4e-72) tmp = Float64(y * Float64(Float64(Float64(9.0 * x) / Float64(c_m * z)) + Float64(-4.0 * Float64(a * Float64(t / Float64(c_m * y)))))); elseif (z <= 1e+27) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(b / z) - t_1) / c_m); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 4.0 * (a * t);
tmp = 0.0;
if (z <= -3.5e+34)
tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m);
elseif (z <= -4e-72)
tmp = y * (((9.0 * x) / (c_m * z)) + (-4.0 * (a * (t / (c_m * y)))));
elseif (z <= 1e+27)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = ((b / z) - t_1) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[z, -3.5e+34], N[(N[(N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] - N[(t$95$1 / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e-72], N[(y * N[(N[(N[(9.0 * x), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a * N[(t / N[(c$95$m * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+27], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - t$95$1), $MachinePrecision] / c$95$m), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(a \cdot t\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{9 \cdot \left(x \cdot \frac{y}{z}\right)}{c\_m} - \frac{t\_1}{c\_m}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \left(\frac{9 \cdot x}{c\_m \cdot z} + -4 \cdot \left(a \cdot \frac{t}{c\_m \cdot y}\right)\right)\\
\mathbf{elif}\;z \leq 10^{+27}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - t\_1}{c\_m}\\
\end{array}
\end{array}
\end{array}
if z < -3.49999999999999998e34Initial program 65.8%
+-commutative65.8%
associate-+r-65.8%
*-commutative65.8%
associate-*r*56.0%
*-commutative56.0%
associate-+r-56.0%
+-commutative56.0%
associate-*l*56.0%
associate-*l*67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in x around 0 78.9%
Taylor expanded in c around 0 87.2%
Taylor expanded in x around inf 69.0%
associate-*r/72.2%
associate-*r*72.1%
Simplified72.1%
div-sub72.1%
associate-*l*72.2%
Applied egg-rr72.2%
if -3.49999999999999998e34 < z < -3.9999999999999999e-72Initial program 77.4%
+-commutative77.4%
associate-+r-77.4%
*-commutative77.4%
associate-*r*72.6%
*-commutative72.6%
associate-+r-72.6%
+-commutative72.6%
associate-*l*72.6%
associate-*l*77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y around inf 90.4%
Taylor expanded in b around 0 76.7%
cancel-sign-sub-inv76.7%
associate-*r/76.6%
metadata-eval76.6%
associate-/l*81.3%
Simplified81.3%
if -3.9999999999999999e-72 < z < 1e27Initial program 97.6%
Simplified97.7%
Taylor expanded in t around 0 89.3%
if 1e27 < z Initial program 58.9%
+-commutative58.9%
associate-+r-58.9%
*-commutative58.9%
associate-*r*64.6%
*-commutative64.6%
associate-+r-64.6%
+-commutative64.6%
associate-*l*64.6%
associate-*l*68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in x around 0 84.2%
Taylor expanded in c around 0 91.8%
Taylor expanded in x around 0 78.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= b -1500000000.0)
(/ b (* c_m z))
(if (<= b 2e-169)
(* 9.0 (* x (/ y (* c_m z))))
(if (<= b 9.2e+27) (* a (/ (* t -4.0) c_m)) (/ (/ b z) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1500000000.0) {
tmp = b / (c_m * z);
} else if (b <= 2e-169) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= 9.2e+27) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (b <= (-1500000000.0d0)) then
tmp = b / (c_m * z)
else if (b <= 2d-169) then
tmp = 9.0d0 * (x * (y / (c_m * z)))
else if (b <= 9.2d+27) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = (b / z) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (b <= -1500000000.0) {
tmp = b / (c_m * z);
} else if (b <= 2e-169) {
tmp = 9.0 * (x * (y / (c_m * z)));
} else if (b <= 9.2e+27) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b / z) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if b <= -1500000000.0: tmp = b / (c_m * z) elif b <= 2e-169: tmp = 9.0 * (x * (y / (c_m * z))) elif b <= 9.2e+27: tmp = a * ((t * -4.0) / c_m) else: tmp = (b / z) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (b <= -1500000000.0) tmp = Float64(b / Float64(c_m * z)); elseif (b <= 2e-169) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(c_m * z)))); elseif (b <= 9.2e+27) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(Float64(b / z) / c_m); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (b <= -1500000000.0)
tmp = b / (c_m * z);
elseif (b <= 2e-169)
tmp = 9.0 * (x * (y / (c_m * z)));
elseif (b <= 9.2e+27)
tmp = a * ((t * -4.0) / c_m);
else
tmp = (b / z) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[b, -1500000000.0], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-169], N[(9.0 * N[(x * N[(y / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.2e+27], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c$95$m), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -1500000000:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-169}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{c\_m \cdot z}\right)\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c\_m}\\
\end{array}
\end{array}
if b < -1.5e9Initial program 93.6%
Simplified92.0%
Taylor expanded in b around inf 59.2%
*-commutative59.2%
Simplified59.2%
if -1.5e9 < b < 2.00000000000000004e-169Initial program 76.3%
Simplified75.3%
Taylor expanded in x around inf 51.3%
*-commutative51.3%
Simplified51.3%
Taylor expanded in x around 0 51.3%
associate-/r*48.7%
associate-/l*48.3%
Simplified48.3%
Taylor expanded in x around 0 51.3%
associate-/r*48.7%
associate-*r/48.3%
associate-*r/49.8%
associate-/r*54.1%
Simplified54.1%
if 2.00000000000000004e-169 < b < 9.2000000000000002e27Initial program 76.8%
Simplified79.3%
Taylor expanded in t around inf 51.9%
*-commutative51.9%
associate-/l*54.8%
associate-*r*54.8%
associate-*l/54.8%
Simplified54.8%
if 9.2000000000000002e27 < b Initial program 77.5%
+-commutative77.5%
associate-+r-77.5%
*-commutative77.5%
associate-*r*72.6%
*-commutative72.6%
associate-+r-72.6%
+-commutative72.6%
associate-*l*72.6%
associate-*l*77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y around inf 66.7%
Taylor expanded in z around 0 62.5%
Taylor expanded in y around 0 62.0%
*-commutative62.0%
associate-/r*63.5%
Simplified63.5%
Final simplification57.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 4.0 (* a t))))
(*
c_s
(if (<= z -3.5e-68)
(- (/ (* 9.0 (* x (/ y z))) c_m) (/ t_1 c_m))
(if (<= z 2.8e+28)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(/ (- (/ b z) t_1) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -3.5e-68) {
tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m);
} else if (z <= 2.8e+28) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b / z) - t_1) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 4.0d0 * (a * t)
if (z <= (-3.5d-68)) then
tmp = ((9.0d0 * (x * (y / z))) / c_m) - (t_1 / c_m)
else if (z <= 2.8d+28) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = ((b / z) - t_1) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -3.5e-68) {
tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m);
} else if (z <= 2.8e+28) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b / z) - t_1) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 4.0 * (a * t) tmp = 0 if z <= -3.5e-68: tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m) elif z <= 2.8e+28: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = ((b / z) - t_1) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(4.0 * Float64(a * t)) tmp = 0.0 if (z <= -3.5e-68) tmp = Float64(Float64(Float64(9.0 * Float64(x * Float64(y / z))) / c_m) - Float64(t_1 / c_m)); elseif (z <= 2.8e+28) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(b / z) - t_1) / c_m); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 4.0 * (a * t);
tmp = 0.0;
if (z <= -3.5e-68)
tmp = ((9.0 * (x * (y / z))) / c_m) - (t_1 / c_m);
elseif (z <= 2.8e+28)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = ((b / z) - t_1) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[z, -3.5e-68], N[(N[(N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] - N[(t$95$1 / c$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+28], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - t$95$1), $MachinePrecision] / c$95$m), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(a \cdot t\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-68}:\\
\;\;\;\;\frac{9 \cdot \left(x \cdot \frac{y}{z}\right)}{c\_m} - \frac{t\_1}{c\_m}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - t\_1}{c\_m}\\
\end{array}
\end{array}
\end{array}
if z < -3.50000000000000013e-68Initial program 70.4%
+-commutative70.4%
associate-+r-70.4%
*-commutative70.4%
associate-*r*61.6%
*-commutative61.6%
associate-+r-61.6%
+-commutative61.6%
associate-*l*61.7%
associate-*l*71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in x around 0 80.4%
Taylor expanded in c around 0 86.7%
Taylor expanded in x around inf 68.0%
associate-*r/70.5%
associate-*r*70.4%
Simplified70.4%
div-sub70.4%
associate-*l*70.5%
Applied egg-rr70.5%
if -3.50000000000000013e-68 < z < 2.8000000000000001e28Initial program 96.2%
Simplified96.2%
Taylor expanded in t around 0 87.9%
if 2.8000000000000001e28 < z Initial program 58.9%
+-commutative58.9%
associate-+r-58.9%
*-commutative58.9%
associate-*r*64.6%
*-commutative64.6%
associate-+r-64.6%
+-commutative64.6%
associate-*l*64.6%
associate-*l*68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in x around 0 84.2%
Taylor expanded in c around 0 91.8%
Taylor expanded in x around 0 78.8%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.1e-66) (not (<= z 2e+29)))
(/ (- (/ b z) (* 4.0 (* a t))) c_m)
(/ (+ b (* 9.0 (* x y))) (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.1e-66) || !(z <= 2e+29)) {
tmp = ((b / z) - (4.0 * (a * t))) / c_m;
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-2.1d-66)) .or. (.not. (z <= 2d+29))) then
tmp = ((b / z) - (4.0d0 * (a * t))) / c_m
else
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.1e-66) || !(z <= 2e+29)) {
tmp = ((b / z) - (4.0 * (a * t))) / c_m;
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.1e-66) or not (z <= 2e+29): tmp = ((b / z) - (4.0 * (a * t))) / c_m else: tmp = (b + (9.0 * (x * y))) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.1e-66) || !(z <= 2e+29)) tmp = Float64(Float64(Float64(b / z) - Float64(4.0 * Float64(a * t))) / c_m); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.1e-66) || ~((z <= 2e+29)))
tmp = ((b / z) - (4.0 * (a * t))) / c_m;
else
tmp = (b + (9.0 * (x * y))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.1e-66], N[Not[LessEqual[z, 2e+29]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] - N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-66} \lor \neg \left(z \leq 2 \cdot 10^{+29}\right):\\
\;\;\;\;\frac{\frac{b}{z} - 4 \cdot \left(a \cdot t\right)}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -2.1e-66 or 1.99999999999999983e29 < z Initial program 65.9%
+-commutative65.9%
associate-+r-65.9%
*-commutative65.9%
associate-*r*62.8%
*-commutative62.8%
associate-+r-62.8%
+-commutative62.8%
associate-*l*62.8%
associate-*l*70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in x around 0 81.9%
Taylor expanded in c around 0 88.7%
Taylor expanded in x around 0 69.7%
if -2.1e-66 < z < 1.99999999999999983e29Initial program 96.2%
Simplified96.2%
Taylor expanded in t around 0 87.9%
Final simplification78.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.5e+180) (not (<= z 3.3e+77)))
(* a (/ (* t -4.0) c_m))
(/ (+ b (* 9.0 (* x y))) (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.5e+180) || !(z <= 3.3e+77)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-2.5d+180)) .or. (.not. (z <= 3.3d+77))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.5e+180) || !(z <= 3.3e+77)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.5e+180) or not (z <= 3.3e+77): tmp = a * ((t * -4.0) / c_m) else: tmp = (b + (9.0 * (x * y))) / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.5e+180) || !(z <= 3.3e+77)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.5e+180) || ~((z <= 3.3e+77)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = (b + (9.0 * (x * y))) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.5e+180], N[Not[LessEqual[z, 3.3e+77]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+180} \lor \neg \left(z \leq 3.3 \cdot 10^{+77}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -2.4999999999999998e180 or 3.2999999999999998e77 < z Initial program 54.6%
Simplified54.4%
Taylor expanded in t around inf 63.3%
*-commutative63.3%
associate-/l*69.6%
associate-*r*69.6%
associate-*l/69.6%
Simplified69.6%
if -2.4999999999999998e180 < z < 3.2999999999999998e77Initial program 90.7%
Simplified89.1%
Taylor expanded in t around 0 77.5%
Final simplification75.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 4.0 (* a t))))
(*
c_s
(if (<= z -2e-66)
(/ (- (* (/ y z) (* 9.0 x)) t_1) c_m)
(if (<= z 3.1e+28)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(/ (- (/ b z) t_1) c_m))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -2e-66) {
tmp = (((y / z) * (9.0 * x)) - t_1) / c_m;
} else if (z <= 3.1e+28) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b / z) - t_1) / c_m;
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: tmp
t_1 = 4.0d0 * (a * t)
if (z <= (-2d-66)) then
tmp = (((y / z) * (9.0d0 * x)) - t_1) / c_m
else if (z <= 3.1d+28) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = ((b / z) - t_1) / c_m
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 4.0 * (a * t);
double tmp;
if (z <= -2e-66) {
tmp = (((y / z) * (9.0 * x)) - t_1) / c_m;
} else if (z <= 3.1e+28) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = ((b / z) - t_1) / c_m;
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 4.0 * (a * t) tmp = 0 if z <= -2e-66: tmp = (((y / z) * (9.0 * x)) - t_1) / c_m elif z <= 3.1e+28: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = ((b / z) - t_1) / c_m return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(4.0 * Float64(a * t)) tmp = 0.0 if (z <= -2e-66) tmp = Float64(Float64(Float64(Float64(y / z) * Float64(9.0 * x)) - t_1) / c_m); elseif (z <= 3.1e+28) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(Float64(b / z) - t_1) / c_m); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 4.0 * (a * t);
tmp = 0.0;
if (z <= -2e-66)
tmp = (((y / z) * (9.0 * x)) - t_1) / c_m;
elseif (z <= 3.1e+28)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = ((b / z) - t_1) / c_m;
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[z, -2e-66], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[z, 3.1e+28], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] - t$95$1), $MachinePrecision] / c$95$m), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(a \cdot t\right)\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-66}:\\
\;\;\;\;\frac{\frac{y}{z} \cdot \left(9 \cdot x\right) - t\_1}{c\_m}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+28}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} - t\_1}{c\_m}\\
\end{array}
\end{array}
\end{array}
if z < -2e-66Initial program 70.4%
+-commutative70.4%
associate-+r-70.4%
*-commutative70.4%
associate-*r*61.6%
*-commutative61.6%
associate-+r-61.6%
+-commutative61.6%
associate-*l*61.7%
associate-*l*71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in x around 0 80.4%
Taylor expanded in c around 0 86.7%
Taylor expanded in x around inf 68.0%
associate-*r/70.5%
associate-*r*70.4%
Simplified70.4%
if -2e-66 < z < 3.1000000000000001e28Initial program 96.2%
Simplified96.2%
Taylor expanded in t around 0 87.9%
if 3.1000000000000001e28 < z Initial program 58.9%
+-commutative58.9%
associate-+r-58.9%
*-commutative58.9%
associate-*r*64.6%
*-commutative64.6%
associate-+r-64.6%
+-commutative64.6%
associate-*l*64.6%
associate-*l*68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in x around 0 84.2%
Taylor expanded in c around 0 91.8%
Taylor expanded in x around 0 78.8%
Final simplification80.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.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -3.1e-97) (not (<= z 8e+40)))
(* a (/ (* t -4.0) c_m))
(* b (/ 1.0 (* c_m z))))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -3.1e-97) || !(z <= 8e+40)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b * (1.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.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-3.1d-97)) .or. (.not. (z <= 8d+40))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b * (1.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;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -3.1e-97) || !(z <= 8e+40)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b * (1.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]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -3.1e-97) or not (z <= 8e+40): tmp = a * ((t * -4.0) / c_m) else: tmp = b * (1.0 / (c_m * z)) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -3.1e-97) || !(z <= 8e+40)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b * Float64(1.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])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -3.1e-97) || ~((z <= 8e+40)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b * (1.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.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -3.1e-97], N[Not[LessEqual[z, 8e+40]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(b * N[(1.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-97} \lor \neg \left(z \leq 8 \cdot 10^{+40}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{1}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -3.10000000000000002e-97 or 8.00000000000000024e40 < z Initial program 64.6%
Simplified62.2%
Taylor expanded in t around inf 49.9%
*-commutative49.9%
associate-/l*54.8%
associate-*r*54.8%
associate-*l/54.9%
Simplified54.9%
if -3.10000000000000002e-97 < z < 8.00000000000000024e40Initial program 98.4%
Simplified98.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
Simplified53.5%
div-inv53.9%
*-commutative53.9%
Applied egg-rr53.9%
Final simplification54.4%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -2.25e-98) (not (<= z 7.6e+40)))
(* a (/ (* t -4.0) c_m))
(/ b (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.25e-98) || !(z <= 7.6e+40)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-2.25d-98)) .or. (.not. (z <= 7.6d+40))) then
tmp = a * ((t * (-4.0d0)) / c_m)
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -2.25e-98) || !(z <= 7.6e+40)) {
tmp = a * ((t * -4.0) / c_m);
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -2.25e-98) or not (z <= 7.6e+40): tmp = a * ((t * -4.0) / c_m) else: tmp = b / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -2.25e-98) || !(z <= 7.6e+40)) tmp = Float64(a * Float64(Float64(t * -4.0) / c_m)); else tmp = Float64(b / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -2.25e-98) || ~((z <= 7.6e+40)))
tmp = a * ((t * -4.0) / c_m);
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -2.25e-98], N[Not[LessEqual[z, 7.6e+40]], $MachinePrecision]], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-98} \lor \neg \left(z \leq 7.6 \cdot 10^{+40}\right):\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -2.24999999999999998e-98 or 7.60000000000000009e40 < z Initial program 64.6%
Simplified62.2%
Taylor expanded in t around inf 49.9%
*-commutative49.9%
associate-/l*54.8%
associate-*r*54.8%
associate-*l/54.9%
Simplified54.9%
if -2.24999999999999998e-98 < z < 7.60000000000000009e40Initial program 98.4%
Simplified98.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
Simplified53.5%
Final simplification54.2%
c\_m = (fabs.f64 c)
c\_s = (copysign.f64 #s(literal 1 binary64) c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -7.2e-98) (not (<= z 4.3e+43)))
(* a (* t (/ -4.0 c_m)))
(/ b (* c_m z)))))c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -7.2e-98) || !(z <= 4.3e+43)) {
tmp = a * (t * (-4.0 / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-7.2d-98)) .or. (.not. (z <= 4.3d+43))) then
tmp = a * (t * ((-4.0d0) / c_m))
else
tmp = b / (c_m * z)
end if
code = c_s * tmp
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -7.2e-98) || !(z <= 4.3e+43)) {
tmp = a * (t * (-4.0 / c_m));
} else {
tmp = b / (c_m * z);
}
return c_s * tmp;
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -7.2e-98) or not (z <= 4.3e+43): tmp = a * (t * (-4.0 / c_m)) else: tmp = b / (c_m * z) return c_s * tmp
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -7.2e-98) || !(z <= 4.3e+43)) tmp = Float64(a * Float64(t * Float64(-4.0 / c_m))); else tmp = Float64(b / Float64(c_m * z)); end return Float64(c_s * tmp) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((z <= -7.2e-98) || ~((z <= 4.3e+43)))
tmp = a * (t * (-4.0 / c_m));
else
tmp = b / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -7.2e-98], N[Not[LessEqual[z, 4.3e+43]], $MachinePrecision]], N[(a * N[(t * N[(-4.0 / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-98} \lor \neg \left(z \leq 4.3 \cdot 10^{+43}\right):\\
\;\;\;\;a \cdot \left(t \cdot \frac{-4}{c\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -7.2000000000000005e-98 or 4.3e43 < z Initial program 64.6%
Simplified62.2%
Taylor expanded in t around inf 49.9%
*-commutative49.9%
associate-/l*54.8%
associate-*r*54.8%
associate-*l/54.9%
Simplified54.9%
associate-/l*54.8%
Applied egg-rr54.8%
if -7.2000000000000005e-98 < z < 4.3e43Initial program 98.4%
Simplified98.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
Simplified53.5%
Final simplification54.2%
c\_m = (fabs.f64 c) c\_s = (copysign.f64 #s(literal 1 binary64) c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (FPCore (c_s x y z t a b c_m) :precision binary64 (* c_s (/ b (* c_m z))))
c\_m = fabs(c);
c\_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = abs(c)
c\_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
code = c_s * (b / (c_m * z))
end function
c\_m = Math.abs(c);
c\_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
return c_s * (b / (c_m * z));
}
c\_m = math.fabs(c) c\_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): return c_s * (b / (c_m * z))
c\_m = abs(c) c\_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) return Float64(c_s * Float64(b / Float64(c_m * z))) end
c\_m = abs(c);
c\_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp = code(c_s, x, y, z, t, a, b, c_m)
tmp = c_s * (b / (c_m * z));
end
c\_m = N[Abs[c], $MachinePrecision]
c\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c\_m = \left|c\right|
\\
c\_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \frac{b}{c\_m \cdot z}
\end{array}
Initial program 80.8%
Simplified79.6%
Taylor expanded in b around inf 36.8%
*-commutative36.8%
Simplified36.8%
Final simplification36.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 2024130
(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)))