
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 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 7.2e-72)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(if (<= c_m 1.46e+227)
(- (/ (- (/ b c_m) (* -9.0 (/ x (/ c_m y)))) z) (* 4.0 (/ (* t a) c_m)))
(fma
(* t (/ a c_m))
-4.0
(fma 9.0 (* (/ x z) (/ y c_m)) (/ b (* c_m z))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (c_m <= 7.2e-72) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else if (c_m <= 1.46e+227) {
tmp = (((b / c_m) - (-9.0 * (x / (c_m / y)))) / z) - (4.0 * ((t * a) / c_m));
} else {
tmp = fma((t * (a / c_m)), -4.0, fma(9.0, ((x / z) * (y / c_m)), (b / (c_m * z))));
}
return c_s * tmp;
}
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if (c_m <= 7.2e-72) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); elseif (c_m <= 1.46e+227) tmp = Float64(Float64(Float64(Float64(b / c_m) - Float64(-9.0 * Float64(x / Float64(c_m / y)))) / z) - Float64(4.0 * Float64(Float64(t * a) / c_m))); else tmp = fma(Float64(t * Float64(a / c_m)), -4.0, fma(9.0, Float64(Float64(x / z) * Float64(y / c_m)), Float64(b / Float64(c_m * z)))); end return Float64(c_s * tmp) end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[c$95$m, 7.2e-72], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[c$95$m, 1.46e+227], N[(N[(N[(N[(b / c$95$m), $MachinePrecision] - N[(-9.0 * N[(x / N[(c$95$m / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c$95$m), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;c\_m \leq 7.2 \cdot 10^{-72}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;c\_m \leq 1.46 \cdot 10^{+227}:\\
\;\;\;\;\frac{\frac{b}{c\_m} - -9 \cdot \frac{x}{\frac{c\_m}{y}}}{z} - 4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \frac{a}{c\_m}, -4, \mathsf{fma}\left(9, \frac{x}{z} \cdot \frac{y}{c\_m}, \frac{b}{c\_m \cdot z}\right)\right)\\
\end{array}
\end{array}
if c < 7.2e-72Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
associate-*r*86.8%
*-commutative86.8%
associate-+l-86.8%
*-commutative86.8%
associate-*r*84.7%
*-commutative84.7%
associate-*l*84.6%
associate-*l*87.3%
Simplified87.3%
if 7.2e-72 < c < 1.45999999999999993e227Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*79.1%
*-commutative79.1%
associate-+l-79.1%
*-commutative79.1%
associate-*r*77.3%
*-commutative77.3%
associate-*l*77.4%
associate-*l*79.1%
Simplified79.1%
Taylor expanded in x around 0 86.5%
Taylor expanded in z around -inf 93.3%
associate-*r/93.3%
mul-1-neg93.3%
mul-1-neg93.3%
unsub-neg93.3%
associate-/l*93.3%
Simplified93.3%
if 1.45999999999999993e227 < c Initial program 43.5%
associate-+l-43.5%
*-commutative43.5%
associate-*r*43.1%
*-commutative43.1%
associate-+l-43.1%
*-commutative43.1%
associate-*r*43.5%
*-commutative43.5%
associate-*l*43.5%
associate-*l*33.7%
Simplified33.7%
Taylor expanded in x around 0 54.3%
cancel-sign-sub-inv54.3%
metadata-eval54.3%
+-commutative54.3%
*-commutative54.3%
fma-def54.3%
associate-/l*69.6%
associate-/r/71.4%
fma-def71.4%
*-commutative71.4%
times-frac86.8%
*-commutative86.8%
Simplified86.8%
Final simplification88.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c_m z))))
(*
c_s
(if (<= t_1 -1e-271)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z))
(if (<= t_1 0.0)
(/ (+ (/ b z) (* (* t a) -4.0)) c_m)
(if (<= t_1 INFINITY) t_1 (* -4.0 (/ a (/ c_m 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 * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
double tmp;
if (t_1 <= -1e-271) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else if (t_1 <= 0.0) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c_m / 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 * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
double tmp;
if (t_1 <= -1e-271) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
} else if (t_1 <= 0.0) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c_m / 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 * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z) tmp = 0 if t_1 <= -1e-271: tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) elif t_1 <= 0.0: tmp = ((b / z) + ((t * a) * -4.0)) / c_m elif t_1 <= math.inf: tmp = t_1 else: tmp = -4.0 * (a / (c_m / 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(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c_m * z)) tmp = 0.0 if (t_1 <= -1e-271) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c_m * z)); elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(b / z) + Float64(Float64(t * a) * -4.0)) / c_m); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(-4.0 * Float64(a / Float64(c_m / 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 * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c_m * z);
tmp = 0.0;
if (t_1 <= -1e-271)
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
elseif (t_1 <= 0.0)
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = -4.0 * (a / (c_m / 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[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[t$95$1, -1e-271], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(-4.0 * N[(a / N[(c$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-271}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{b}{z} + \left(t \cdot a\right) \cdot -4}{c\_m}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c\_m}{t}}\\
\end{array}
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -9.99999999999999963e-272Initial program 89.9%
associate-+l-89.9%
*-commutative89.9%
associate-*r*92.3%
*-commutative92.3%
associate-+l-92.3%
*-commutative92.3%
associate-*r*89.9%
*-commutative89.9%
associate-*l*89.9%
associate-*l*90.7%
Simplified90.7%
if -9.99999999999999963e-272 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -0.0Initial program 52.0%
associate-+l-52.0%
*-commutative52.0%
associate-*r*51.1%
*-commutative51.1%
associate-+l-51.1%
*-commutative51.1%
associate-*r*52.0%
*-commutative52.0%
associate-*l*52.0%
associate-*l*52.0%
Simplified52.0%
Taylor expanded in x around 0 78.2%
Taylor expanded in c around 0 99.8%
Taylor expanded in x around 0 78.2%
cancel-sign-sub-inv78.2%
metadata-eval78.2%
*-commutative78.2%
*-commutative78.2%
associate-*r/73.1%
*-commutative73.1%
associate-/r*79.2%
*-rgt-identity79.2%
associate-*r/79.2%
+-commutative79.2%
associate-*l*79.2%
*-commutative79.2%
associate-*r/79.2%
*-rgt-identity79.2%
associate-/r*73.1%
associate-/l/79.2%
Simplified79.2%
Taylor expanded in c around 0 84.3%
if -0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 88.1%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-+l-0.0%
*-commutative0.0%
associate-*r*0.9%
*-commutative0.9%
associate-+l-0.9%
*-commutative0.9%
associate-*r*0.0%
*-commutative0.0%
associate-*l*0.0%
associate-*l*0.9%
Simplified0.9%
Taylor expanded in z around inf 48.8%
*-commutative48.8%
associate-/l*83.3%
Simplified83.3%
Final simplification88.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (* x (/ (/ y c_m) z))))
(t_2 (/ 1.0 (/ (* c_m z) b)))
(t_3 (/ (* t -4.0) (/ c_m a))))
(*
c_s
(if (<= a -2.6e-32)
t_3
(if (<= a -2.55e-244)
t_2
(if (<= a 1.2e-277)
t_1
(if (<= a 2.4e-71)
(/ b (* c_m z))
(if (<= a 5e-35)
t_1
(if (<= a 7e+18) t_2 (if (<= a 1e+66) t_1 t_3))))))))))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 = 9.0 * (x * ((y / c_m) / z));
double t_2 = 1.0 / ((c_m * z) / b);
double t_3 = (t * -4.0) / (c_m / a);
double tmp;
if (a <= -2.6e-32) {
tmp = t_3;
} else if (a <= -2.55e-244) {
tmp = t_2;
} else if (a <= 1.2e-277) {
tmp = t_1;
} else if (a <= 2.4e-71) {
tmp = b / (c_m * z);
} else if (a <= 5e-35) {
tmp = t_1;
} else if (a <= 7e+18) {
tmp = t_2;
} else if (a <= 1e+66) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 9.0d0 * (x * ((y / c_m) / z))
t_2 = 1.0d0 / ((c_m * z) / b)
t_3 = (t * (-4.0d0)) / (c_m / a)
if (a <= (-2.6d-32)) then
tmp = t_3
else if (a <= (-2.55d-244)) then
tmp = t_2
else if (a <= 1.2d-277) then
tmp = t_1
else if (a <= 2.4d-71) then
tmp = b / (c_m * z)
else if (a <= 5d-35) then
tmp = t_1
else if (a <= 7d+18) then
tmp = t_2
else if (a <= 1d+66) then
tmp = t_1
else
tmp = t_3
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 = 9.0 * (x * ((y / c_m) / z));
double t_2 = 1.0 / ((c_m * z) / b);
double t_3 = (t * -4.0) / (c_m / a);
double tmp;
if (a <= -2.6e-32) {
tmp = t_3;
} else if (a <= -2.55e-244) {
tmp = t_2;
} else if (a <= 1.2e-277) {
tmp = t_1;
} else if (a <= 2.4e-71) {
tmp = b / (c_m * z);
} else if (a <= 5e-35) {
tmp = t_1;
} else if (a <= 7e+18) {
tmp = t_2;
} else if (a <= 1e+66) {
tmp = t_1;
} else {
tmp = t_3;
}
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 = 9.0 * (x * ((y / c_m) / z)) t_2 = 1.0 / ((c_m * z) / b) t_3 = (t * -4.0) / (c_m / a) tmp = 0 if a <= -2.6e-32: tmp = t_3 elif a <= -2.55e-244: tmp = t_2 elif a <= 1.2e-277: tmp = t_1 elif a <= 2.4e-71: tmp = b / (c_m * z) elif a <= 5e-35: tmp = t_1 elif a <= 7e+18: tmp = t_2 elif a <= 1e+66: tmp = t_1 else: tmp = t_3 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(9.0 * Float64(x * Float64(Float64(y / c_m) / z))) t_2 = Float64(1.0 / Float64(Float64(c_m * z) / b)) t_3 = Float64(Float64(t * -4.0) / Float64(c_m / a)) tmp = 0.0 if (a <= -2.6e-32) tmp = t_3; elseif (a <= -2.55e-244) tmp = t_2; elseif (a <= 1.2e-277) tmp = t_1; elseif (a <= 2.4e-71) tmp = Float64(b / Float64(c_m * z)); elseif (a <= 5e-35) tmp = t_1; elseif (a <= 7e+18) tmp = t_2; elseif (a <= 1e+66) tmp = t_1; else tmp = t_3; 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 = 9.0 * (x * ((y / c_m) / z));
t_2 = 1.0 / ((c_m * z) / b);
t_3 = (t * -4.0) / (c_m / a);
tmp = 0.0;
if (a <= -2.6e-32)
tmp = t_3;
elseif (a <= -2.55e-244)
tmp = t_2;
elseif (a <= 1.2e-277)
tmp = t_1;
elseif (a <= 2.4e-71)
tmp = b / (c_m * z);
elseif (a <= 5e-35)
tmp = t_1;
elseif (a <= 7e+18)
tmp = t_2;
elseif (a <= 1e+66)
tmp = t_1;
else
tmp = t_3;
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[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[(c$95$m * z), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * -4.0), $MachinePrecision] / N[(c$95$m / a), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -2.6e-32], t$95$3, If[LessEqual[a, -2.55e-244], t$95$2, If[LessEqual[a, 1.2e-277], t$95$1, If[LessEqual[a, 2.4e-71], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e-35], t$95$1, If[LessEqual[a, 7e+18], t$95$2, If[LessEqual[a, 1e+66], t$95$1, t$95$3]]]]]]]), $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 := 9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
t_2 := \frac{1}{\frac{c\_m \cdot z}{b}}\\
t_3 := \frac{t \cdot -4}{\frac{c\_m}{a}}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-32}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -2.55 \cdot 10^{-244}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-277}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-71}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
\end{array}
if a < -2.5999999999999997e-32 or 9.99999999999999945e65 < a Initial program 77.1%
associate-+l-77.1%
*-commutative77.1%
associate-*r*73.5%
*-commutative73.5%
associate-+l-73.5%
*-commutative73.5%
associate-*r*77.1%
*-commutative77.1%
associate-*l*77.1%
associate-*l*72.9%
Simplified72.9%
Taylor expanded in z around inf 51.4%
associate-/l*59.6%
associate-/r/63.1%
associate-*r*63.1%
*-commutative63.1%
associate-*r*63.1%
clear-num63.1%
un-div-inv63.1%
Applied egg-rr63.1%
if -2.5999999999999997e-32 < a < -2.5499999999999999e-244 or 4.99999999999999964e-35 < a < 7e18Initial program 86.4%
associate-+l-86.4%
*-commutative86.4%
associate-*r*86.5%
*-commutative86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*86.4%
*-commutative86.4%
associate-*l*86.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in b around inf 49.7%
*-commutative49.7%
Simplified49.7%
clear-num49.7%
inv-pow49.7%
Applied egg-rr49.7%
unpow-149.7%
associate-/l*37.0%
Simplified37.0%
Taylor expanded in z around 0 49.7%
if -2.5499999999999999e-244 < a < 1.2e-277 or 2.4e-71 < a < 4.99999999999999964e-35 or 7e18 < a < 9.99999999999999945e65Initial program 83.8%
associate-+l-83.8%
*-commutative83.8%
associate-*r*88.3%
*-commutative88.3%
associate-+l-88.3%
*-commutative88.3%
associate-*r*83.8%
*-commutative83.8%
associate-*l*83.8%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in x around inf 77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in x around 0 77.4%
associate-*r/69.0%
associate-/r*71.1%
Simplified71.1%
if 1.2e-277 < a < 2.4e-71Initial program 75.7%
associate-+l-75.7%
*-commutative75.7%
associate-*r*90.1%
*-commutative90.1%
associate-+l-90.1%
*-commutative90.1%
associate-*r*75.7%
*-commutative75.7%
associate-*l*75.7%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in b around inf 51.6%
*-commutative51.6%
Simplified51.6%
Final simplification59.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (* 9.0 (/ (* x y) (* c_m z))))
(t_2 (/ 1.0 (/ (* c_m z) b)))
(t_3 (/ (* t -4.0) (/ c_m a))))
(*
c_s
(if (<= a -2.7e-33)
t_3
(if (<= a -5.5e-243)
t_2
(if (<= a 5.2e-163)
t_1
(if (<= a 1.9e-71)
(/ b (* c_m z))
(if (<= a 4.5e-35)
(* 9.0 (* x (/ (/ y c_m) z)))
(if (<= a 7.8e+18) t_2 (if (<= a 1.45e+66) t_1 t_3))))))))))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 = 9.0 * ((x * y) / (c_m * z));
double t_2 = 1.0 / ((c_m * z) / b);
double t_3 = (t * -4.0) / (c_m / a);
double tmp;
if (a <= -2.7e-33) {
tmp = t_3;
} else if (a <= -5.5e-243) {
tmp = t_2;
} else if (a <= 5.2e-163) {
tmp = t_1;
} else if (a <= 1.9e-71) {
tmp = b / (c_m * z);
} else if (a <= 4.5e-35) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else if (a <= 7.8e+18) {
tmp = t_2;
} else if (a <= 1.45e+66) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 9.0d0 * ((x * y) / (c_m * z))
t_2 = 1.0d0 / ((c_m * z) / b)
t_3 = (t * (-4.0d0)) / (c_m / a)
if (a <= (-2.7d-33)) then
tmp = t_3
else if (a <= (-5.5d-243)) then
tmp = t_2
else if (a <= 5.2d-163) then
tmp = t_1
else if (a <= 1.9d-71) then
tmp = b / (c_m * z)
else if (a <= 4.5d-35) then
tmp = 9.0d0 * (x * ((y / c_m) / z))
else if (a <= 7.8d+18) then
tmp = t_2
else if (a <= 1.45d+66) then
tmp = t_1
else
tmp = t_3
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 = 9.0 * ((x * y) / (c_m * z));
double t_2 = 1.0 / ((c_m * z) / b);
double t_3 = (t * -4.0) / (c_m / a);
double tmp;
if (a <= -2.7e-33) {
tmp = t_3;
} else if (a <= -5.5e-243) {
tmp = t_2;
} else if (a <= 5.2e-163) {
tmp = t_1;
} else if (a <= 1.9e-71) {
tmp = b / (c_m * z);
} else if (a <= 4.5e-35) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else if (a <= 7.8e+18) {
tmp = t_2;
} else if (a <= 1.45e+66) {
tmp = t_1;
} else {
tmp = t_3;
}
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 = 9.0 * ((x * y) / (c_m * z)) t_2 = 1.0 / ((c_m * z) / b) t_3 = (t * -4.0) / (c_m / a) tmp = 0 if a <= -2.7e-33: tmp = t_3 elif a <= -5.5e-243: tmp = t_2 elif a <= 5.2e-163: tmp = t_1 elif a <= 1.9e-71: tmp = b / (c_m * z) elif a <= 4.5e-35: tmp = 9.0 * (x * ((y / c_m) / z)) elif a <= 7.8e+18: tmp = t_2 elif a <= 1.45e+66: tmp = t_1 else: tmp = t_3 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(9.0 * Float64(Float64(x * y) / Float64(c_m * z))) t_2 = Float64(1.0 / Float64(Float64(c_m * z) / b)) t_3 = Float64(Float64(t * -4.0) / Float64(c_m / a)) tmp = 0.0 if (a <= -2.7e-33) tmp = t_3; elseif (a <= -5.5e-243) tmp = t_2; elseif (a <= 5.2e-163) tmp = t_1; elseif (a <= 1.9e-71) tmp = Float64(b / Float64(c_m * z)); elseif (a <= 4.5e-35) tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); elseif (a <= 7.8e+18) tmp = t_2; elseif (a <= 1.45e+66) tmp = t_1; else tmp = t_3; 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 = 9.0 * ((x * y) / (c_m * z));
t_2 = 1.0 / ((c_m * z) / b);
t_3 = (t * -4.0) / (c_m / a);
tmp = 0.0;
if (a <= -2.7e-33)
tmp = t_3;
elseif (a <= -5.5e-243)
tmp = t_2;
elseif (a <= 5.2e-163)
tmp = t_1;
elseif (a <= 1.9e-71)
tmp = b / (c_m * z);
elseif (a <= 4.5e-35)
tmp = 9.0 * (x * ((y / c_m) / z));
elseif (a <= 7.8e+18)
tmp = t_2;
elseif (a <= 1.45e+66)
tmp = t_1;
else
tmp = t_3;
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[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[(c$95$m * z), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * -4.0), $MachinePrecision] / N[(c$95$m / a), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -2.7e-33], t$95$3, If[LessEqual[a, -5.5e-243], t$95$2, If[LessEqual[a, 5.2e-163], t$95$1, If[LessEqual[a, 1.9e-71], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.5e-35], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.8e+18], t$95$2, If[LessEqual[a, 1.45e+66], t$95$1, t$95$3]]]]]]]), $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 := 9 \cdot \frac{x \cdot y}{c\_m \cdot z}\\
t_2 := \frac{1}{\frac{c\_m \cdot z}{b}}\\
t_3 := \frac{t \cdot -4}{\frac{c\_m}{a}}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-33}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -5.5 \cdot 10^{-243}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-163}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{-71}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{-35}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
\end{array}
if a < -2.7000000000000001e-33 or 1.44999999999999993e66 < a Initial program 77.1%
associate-+l-77.1%
*-commutative77.1%
associate-*r*73.5%
*-commutative73.5%
associate-+l-73.5%
*-commutative73.5%
associate-*r*77.1%
*-commutative77.1%
associate-*l*77.1%
associate-*l*72.9%
Simplified72.9%
Taylor expanded in z around inf 51.4%
associate-/l*59.6%
associate-/r/63.1%
associate-*r*63.1%
*-commutative63.1%
associate-*r*63.1%
clear-num63.1%
un-div-inv63.1%
Applied egg-rr63.1%
if -2.7000000000000001e-33 < a < -5.50000000000000004e-243 or 4.5000000000000001e-35 < a < 7.8e18Initial program 86.4%
associate-+l-86.4%
*-commutative86.4%
associate-*r*86.5%
*-commutative86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*86.4%
*-commutative86.4%
associate-*l*86.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in b around inf 49.7%
*-commutative49.7%
Simplified49.7%
clear-num49.7%
inv-pow49.7%
Applied egg-rr49.7%
unpow-149.7%
associate-/l*37.0%
Simplified37.0%
Taylor expanded in z around 0 49.7%
if -5.50000000000000004e-243 < a < 5.20000000000000003e-163 or 7.8e18 < a < 1.44999999999999993e66Initial program 78.3%
associate-+l-78.3%
*-commutative78.3%
associate-*r*86.5%
*-commutative86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*78.3%
*-commutative78.3%
associate-*l*78.3%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in x around inf 59.0%
*-commutative59.0%
Simplified59.0%
if 5.20000000000000003e-163 < a < 1.89999999999999996e-71Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*92.4%
*-commutative92.4%
associate-+l-92.4%
*-commutative92.4%
associate-*r*75.0%
*-commutative75.0%
associate-*l*74.9%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in b around inf 56.0%
*-commutative56.0%
Simplified56.0%
if 1.89999999999999996e-71 < a < 4.5000000000000001e-35Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-+l-99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in x around 0 67.5%
associate-*r/67.4%
associate-/r*67.0%
Simplified67.0%
Final simplification59.0%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(let* ((t_1 (/ 1.0 (/ (* c_m z) b))) (t_2 (/ (* t -4.0) (/ c_m a))))
(*
c_s
(if (<= a -1.45e-37)
t_2
(if (<= a -1.45e-247)
t_1
(if (<= a 5.3e-163)
(* 9.0 (/ (* x y) (* c_m z)))
(if (<= a 1.75e-71)
(/ b (* c_m z))
(if (<= a 2.2e-35)
(* 9.0 (* x (/ (/ y c_m) z)))
(if (<= a 6.8e+18)
t_1
(if (<= a 1.7e+66) (* (* x y) (/ 9.0 (* c_m z))) t_2))))))))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double t_1 = 1.0 / ((c_m * z) / b);
double t_2 = (t * -4.0) / (c_m / a);
double tmp;
if (a <= -1.45e-37) {
tmp = t_2;
} else if (a <= -1.45e-247) {
tmp = t_1;
} else if (a <= 5.3e-163) {
tmp = 9.0 * ((x * y) / (c_m * z));
} else if (a <= 1.75e-71) {
tmp = b / (c_m * z);
} else if (a <= 2.2e-35) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else if (a <= 6.8e+18) {
tmp = t_1;
} else if (a <= 1.7e+66) {
tmp = (x * y) * (9.0 / (c_m * z));
} else {
tmp = t_2;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / ((c_m * z) / b)
t_2 = (t * (-4.0d0)) / (c_m / a)
if (a <= (-1.45d-37)) then
tmp = t_2
else if (a <= (-1.45d-247)) then
tmp = t_1
else if (a <= 5.3d-163) then
tmp = 9.0d0 * ((x * y) / (c_m * z))
else if (a <= 1.75d-71) then
tmp = b / (c_m * z)
else if (a <= 2.2d-35) then
tmp = 9.0d0 * (x * ((y / c_m) / z))
else if (a <= 6.8d+18) then
tmp = t_1
else if (a <= 1.7d+66) then
tmp = (x * y) * (9.0d0 / (c_m * z))
else
tmp = t_2
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
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 = 1.0 / ((c_m * z) / b);
double t_2 = (t * -4.0) / (c_m / a);
double tmp;
if (a <= -1.45e-37) {
tmp = t_2;
} else if (a <= -1.45e-247) {
tmp = t_1;
} else if (a <= 5.3e-163) {
tmp = 9.0 * ((x * y) / (c_m * z));
} else if (a <= 1.75e-71) {
tmp = b / (c_m * z);
} else if (a <= 2.2e-35) {
tmp = 9.0 * (x * ((y / c_m) / z));
} else if (a <= 6.8e+18) {
tmp = t_1;
} else if (a <= 1.7e+66) {
tmp = (x * y) * (9.0 / (c_m * z));
} else {
tmp = t_2;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): t_1 = 1.0 / ((c_m * z) / b) t_2 = (t * -4.0) / (c_m / a) tmp = 0 if a <= -1.45e-37: tmp = t_2 elif a <= -1.45e-247: tmp = t_1 elif a <= 5.3e-163: tmp = 9.0 * ((x * y) / (c_m * z)) elif a <= 1.75e-71: tmp = b / (c_m * z) elif a <= 2.2e-35: tmp = 9.0 * (x * ((y / c_m) / z)) elif a <= 6.8e+18: tmp = t_1 elif a <= 1.7e+66: tmp = (x * y) * (9.0 / (c_m * z)) else: tmp = t_2 return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) t_1 = Float64(1.0 / Float64(Float64(c_m * z) / b)) t_2 = Float64(Float64(t * -4.0) / Float64(c_m / a)) tmp = 0.0 if (a <= -1.45e-37) tmp = t_2; elseif (a <= -1.45e-247) tmp = t_1; elseif (a <= 5.3e-163) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c_m * z))); elseif (a <= 1.75e-71) tmp = Float64(b / Float64(c_m * z)); elseif (a <= 2.2e-35) tmp = Float64(9.0 * Float64(x * Float64(Float64(y / c_m) / z))); elseif (a <= 6.8e+18) tmp = t_1; elseif (a <= 1.7e+66) tmp = Float64(Float64(x * y) * Float64(9.0 / Float64(c_m * z))); else tmp = t_2; end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
t_1 = 1.0 / ((c_m * z) / b);
t_2 = (t * -4.0) / (c_m / a);
tmp = 0.0;
if (a <= -1.45e-37)
tmp = t_2;
elseif (a <= -1.45e-247)
tmp = t_1;
elseif (a <= 5.3e-163)
tmp = 9.0 * ((x * y) / (c_m * z));
elseif (a <= 1.75e-71)
tmp = b / (c_m * z);
elseif (a <= 2.2e-35)
tmp = 9.0 * (x * ((y / c_m) / z));
elseif (a <= 6.8e+18)
tmp = t_1;
elseif (a <= 1.7e+66)
tmp = (x * y) * (9.0 / (c_m * z));
else
tmp = t_2;
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := Block[{t$95$1 = N[(1.0 / N[(N[(c$95$m * z), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * -4.0), $MachinePrecision] / N[(c$95$m / a), $MachinePrecision]), $MachinePrecision]}, N[(c$95$s * If[LessEqual[a, -1.45e-37], t$95$2, If[LessEqual[a, -1.45e-247], t$95$1, If[LessEqual[a, 5.3e-163], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.75e-71], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.2e-35], N[(9.0 * N[(x * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.8e+18], t$95$1, If[LessEqual[a, 1.7e+66], N[(N[(x * y), $MachinePrecision] * N[(9.0 / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{c\_m \cdot z}{b}}\\
t_2 := \frac{t \cdot -4}{\frac{c\_m}{a}}\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{-37}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.45 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.3 \cdot 10^{-163}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-71}:\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-35}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+66}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{9}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
\end{array}
if a < -1.45000000000000002e-37 or 1.70000000000000015e66 < a Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*73.8%
*-commutative73.8%
associate-+l-73.8%
*-commutative73.8%
associate-*r*77.3%
*-commutative77.3%
associate-*l*77.3%
associate-*l*73.1%
Simplified73.1%
Taylor expanded in z around inf 51.0%
associate-/l*59.1%
associate-/r/62.5%
associate-*r*62.5%
*-commutative62.5%
associate-*r*62.5%
clear-num62.5%
un-div-inv62.6%
Applied egg-rr62.6%
if -1.45000000000000002e-37 < a < -1.45e-247 or 2.19999999999999994e-35 < a < 6.8e18Initial program 86.2%
associate-+l-86.2%
*-commutative86.2%
associate-*r*86.2%
*-commutative86.2%
associate-+l-86.2%
*-commutative86.2%
associate-*r*86.2%
*-commutative86.2%
associate-*l*86.1%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in b around inf 49.1%
*-commutative49.1%
Simplified49.1%
clear-num49.2%
inv-pow49.2%
Applied egg-rr49.2%
unpow-149.2%
associate-/l*36.1%
Simplified36.1%
Taylor expanded in z around 0 49.2%
if -1.45e-247 < a < 5.30000000000000016e-163Initial program 75.5%
associate-+l-75.5%
*-commutative75.5%
associate-*r*86.5%
*-commutative86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*75.5%
*-commutative75.5%
associate-*l*75.5%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in x around inf 49.8%
*-commutative49.8%
Simplified49.8%
if 5.30000000000000016e-163 < a < 1.75e-71Initial program 75.0%
associate-+l-75.0%
*-commutative75.0%
associate-*r*92.4%
*-commutative92.4%
associate-+l-92.4%
*-commutative92.4%
associate-*r*75.0%
*-commutative75.0%
associate-*l*74.9%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in b around inf 56.0%
*-commutative56.0%
Simplified56.0%
if 1.75e-71 < a < 2.19999999999999994e-35Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-+l-99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in x around 0 67.5%
associate-*r/67.4%
associate-/r*67.0%
Simplified67.0%
if 6.8e18 < a < 1.70000000000000015e66Initial program 86.8%
associate-+l-86.8%
*-commutative86.8%
associate-*r*86.8%
*-commutative86.8%
associate-+l-86.8%
*-commutative86.8%
associate-*r*86.8%
*-commutative86.8%
associate-*l*86.9%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in x around inf 86.7%
associate-*r/86.8%
*-commutative86.8%
*-commutative86.8%
associate-/l*86.8%
associate-/r/87.1%
*-commutative87.1%
Simplified87.1%
Final simplification58.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -1.22e-54) (not (<= z 1.35e+101)))
(- (/ (+ (* 9.0 (/ (* x y) z)) (/ b z)) c_m) (* 4.0 (/ (* t a) c_m)))
(/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* 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 <= -1.22e-54) || !(z <= 1.35e+101)) {
tmp = (((9.0 * ((x * y) / z)) + (b / z)) / c_m) - (4.0 * ((t * a) / c_m));
} else {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (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 <= (-1.22d-54)) .or. (.not. (z <= 1.35d+101))) then
tmp = (((9.0d0 * ((x * y) / z)) + (b / z)) / c_m) - (4.0d0 * ((t * a) / c_m))
else
tmp = (b + ((y * (x * 9.0d0)) - (a * ((z * 4.0d0) * t)))) / (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 <= -1.22e-54) || !(z <= 1.35e+101)) {
tmp = (((9.0 * ((x * y) / z)) + (b / z)) / c_m) - (4.0 * ((t * a) / c_m));
} else {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (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 <= -1.22e-54) or not (z <= 1.35e+101): tmp = (((9.0 * ((x * y) / z)) + (b / z)) / c_m) - (4.0 * ((t * a) / c_m)) else: tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (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 <= -1.22e-54) || !(z <= 1.35e+101)) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z)) / c_m) - Float64(4.0 * Float64(Float64(t * a) / c_m))); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / 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 <= -1.22e-54) || ~((z <= 1.35e+101)))
tmp = (((9.0 * ((x * y) / z)) + (b / z)) / c_m) - (4.0 * ((t * a) / c_m));
else
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (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, -1.22e-54], N[Not[LessEqual[z, 1.35e+101]], $MachinePrecision]], N[(N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $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 -1.22 \cdot 10^{-54} \lor \neg \left(z \leq 1.35 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}}{c\_m} - 4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -1.22e-54 or 1.35000000000000003e101 < z Initial program 61.1%
associate-+l-61.1%
*-commutative61.1%
associate-*r*65.1%
*-commutative65.1%
associate-+l-65.1%
*-commutative65.1%
associate-*r*61.1%
*-commutative61.1%
associate-*l*61.0%
associate-*l*67.7%
Simplified67.7%
Taylor expanded in x around 0 81.5%
Taylor expanded in c around 0 86.8%
if -1.22e-54 < z < 1.35000000000000003e101Initial program 95.9%
Final simplification91.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= z -6e+120) (not (<= z 3.5e+155)))
(/ (+ (/ b z) (* (* t a) -4.0)) c_m)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c_m z)))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -6e+120) || !(z <= 3.5e+155)) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((z <= (-6d+120)) .or. (.not. (z <= 3.5d+155))) then
tmp = ((b / z) + ((t * a) * (-4.0d0))) / c_m
else
tmp = (((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a))) + b) / (c_m * z)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((z <= -6e+120) || !(z <= 3.5e+155)) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (z <= -6e+120) or not (z <= 3.5e+155): tmp = ((b / z) + ((t * a) * -4.0)) / c_m else: tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z) return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((z <= -6e+120) || !(z <= 3.5e+155)) tmp = Float64(Float64(Float64(b / z) + Float64(Float64(t * a) * -4.0)) / c_m); else tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + 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 <= -6e+120) || ~((z <= 3.5e+155)))
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
else
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c_m * z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[Or[LessEqual[z, -6e+120], N[Not[LessEqual[z, 3.5e+155]], $MachinePrecision]], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $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 -6 \cdot 10^{+120} \lor \neg \left(z \leq 3.5 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{\frac{b}{z} + \left(t \cdot a\right) \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c\_m \cdot z}\\
\end{array}
\end{array}
if z < -6e120 or 3.49999999999999985e155 < z Initial program 41.9%
associate-+l-41.9%
*-commutative41.9%
associate-*r*50.9%
*-commutative50.9%
associate-+l-50.9%
*-commutative50.9%
associate-*r*41.9%
*-commutative41.9%
associate-*l*41.9%
associate-*l*52.6%
Simplified52.6%
Taylor expanded in x around 0 79.6%
Taylor expanded in c around 0 83.3%
Taylor expanded in x around 0 69.6%
cancel-sign-sub-inv69.6%
metadata-eval69.6%
*-commutative69.6%
*-commutative69.6%
associate-*r/72.2%
*-commutative72.2%
associate-/r*75.3%
*-rgt-identity75.3%
associate-*r/75.3%
+-commutative75.3%
associate-*l*75.3%
*-commutative75.3%
associate-*r/75.3%
*-rgt-identity75.3%
associate-/r*72.2%
associate-/l/66.5%
Simplified66.5%
Taylor expanded in c around 0 73.1%
if -6e120 < z < 3.49999999999999985e155Initial program 92.5%
associate-+l-92.5%
*-commutative92.5%
associate-*r*92.0%
*-commutative92.0%
associate-+l-92.0%
*-commutative92.0%
associate-*r*92.5%
*-commutative92.5%
associate-*l*92.5%
associate-*l*91.0%
Simplified91.0%
Final simplification86.5%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -2.95e-241)
(/ (+ (/ b z) (* (* t a) -4.0)) c_m)
(if (<= a 1.45e+66)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(+ (* t (* (/ a c_m) -4.0)) (/ (/ 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 (a <= -2.95e-241) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else if (a <= 1.45e+66) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (t * ((a / c_m) * -4.0)) + ((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 (a <= (-2.95d-241)) then
tmp = ((b / z) + ((t * a) * (-4.0d0))) / c_m
else if (a <= 1.45d+66) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (t * ((a / c_m) * (-4.0d0))) + ((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 (a <= -2.95e-241) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else if (a <= 1.45e+66) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (t * ((a / c_m) * -4.0)) + ((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 a <= -2.95e-241: tmp = ((b / z) + ((t * a) * -4.0)) / c_m elif a <= 1.45e+66: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = (t * ((a / c_m) * -4.0)) + ((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 (a <= -2.95e-241) tmp = Float64(Float64(Float64(b / z) + Float64(Float64(t * a) * -4.0)) / c_m); elseif (a <= 1.45e+66) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(t * Float64(Float64(a / c_m) * -4.0)) + Float64(Float64(b / c_m) / z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -2.95e-241)
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
elseif (a <= 1.45e+66)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = (t * ((a / c_m) * -4.0)) + ((b / c_m) / z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -2.95e-241], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[a, 1.45e+66], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(N[(a / c$95$m), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b / c$95$m), $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}\;a \leq -2.95 \cdot 10^{-241}:\\
\;\;\;\;\frac{\frac{b}{z} + \left(t \cdot a\right) \cdot -4}{c\_m}\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+66}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a}{c\_m} \cdot -4\right) + \frac{\frac{b}{c\_m}}{z}\\
\end{array}
\end{array}
if a < -2.9499999999999999e-241Initial program 80.1%
associate-+l-80.1%
*-commutative80.1%
associate-*r*78.1%
*-commutative78.1%
associate-+l-78.1%
*-commutative78.1%
associate-*r*80.1%
*-commutative80.1%
associate-*l*80.1%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in x around 0 78.9%
Taylor expanded in c around 0 79.0%
Taylor expanded in x around 0 62.6%
cancel-sign-sub-inv62.6%
metadata-eval62.6%
*-commutative62.6%
*-commutative62.6%
associate-*r/66.4%
*-commutative66.4%
associate-/r*62.8%
*-rgt-identity62.8%
associate-*r/62.8%
+-commutative62.8%
associate-*l*62.8%
*-commutative62.8%
associate-*r/62.8%
*-rgt-identity62.8%
associate-/r*66.4%
associate-/l/60.1%
Simplified60.1%
Taylor expanded in c around 0 60.0%
if -2.9499999999999999e-241 < a < 1.44999999999999993e66Initial program 79.5%
associate-+l-79.5%
*-commutative79.5%
associate-*r*87.8%
*-commutative87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*79.5%
*-commutative79.5%
associate-*l*79.5%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in x around inf 76.7%
if 1.44999999999999993e66 < a Initial program 80.1%
associate-+l-80.1%
*-commutative80.1%
associate-*r*76.1%
*-commutative76.1%
associate-+l-76.1%
*-commutative76.1%
associate-*r*80.1%
*-commutative80.1%
associate-*l*80.1%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in x around 0 69.8%
Taylor expanded in c around 0 72.2%
Taylor expanded in x around 0 64.9%
cancel-sign-sub-inv64.9%
metadata-eval64.9%
*-commutative64.9%
*-commutative64.9%
associate-*r/78.3%
*-commutative78.3%
associate-/r*78.3%
*-rgt-identity78.3%
associate-*r/78.4%
+-commutative78.4%
associate-*l*78.4%
*-commutative78.4%
associate-*r/78.3%
*-rgt-identity78.3%
associate-/r*78.3%
associate-/l/78.2%
Simplified78.2%
Final simplification70.3%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= a -7.2e-241)
(- (/ b (* c_m z)) (* 4.0 (/ (* t a) c_m)))
(if (<= a 1.45e+66)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(+ (* t (* (/ a c_m) -4.0)) (/ (/ 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 (a <= -7.2e-241) {
tmp = (b / (c_m * z)) - (4.0 * ((t * a) / c_m));
} else if (a <= 1.45e+66) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (t * ((a / c_m) * -4.0)) + ((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 (a <= (-7.2d-241)) then
tmp = (b / (c_m * z)) - (4.0d0 * ((t * a) / c_m))
else if (a <= 1.45d+66) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (t * ((a / c_m) * (-4.0d0))) + ((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 (a <= -7.2e-241) {
tmp = (b / (c_m * z)) - (4.0 * ((t * a) / c_m));
} else if (a <= 1.45e+66) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = (t * ((a / c_m) * -4.0)) + ((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 a <= -7.2e-241: tmp = (b / (c_m * z)) - (4.0 * ((t * a) / c_m)) elif a <= 1.45e+66: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = (t * ((a / c_m) * -4.0)) + ((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 (a <= -7.2e-241) tmp = Float64(Float64(b / Float64(c_m * z)) - Float64(4.0 * Float64(Float64(t * a) / c_m))); elseif (a <= 1.45e+66) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(Float64(t * Float64(Float64(a / c_m) * -4.0)) + Float64(Float64(b / c_m) / z)); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if (a <= -7.2e-241)
tmp = (b / (c_m * z)) - (4.0 * ((t * a) / c_m));
elseif (a <= 1.45e+66)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = (t * ((a / c_m) * -4.0)) + ((b / c_m) / z);
end
tmp_2 = c_s * tmp;
end
c_m = N[Abs[c], $MachinePrecision]
c_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
code[c$95$s_, x_, y_, z_, t_, a_, b_, c$95$m_] := N[(c$95$s * If[LessEqual[a, -7.2e-241], N[(N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.45e+66], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(N[(a / c$95$m), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b / c$95$m), $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}\;a \leq -7.2 \cdot 10^{-241}:\\
\;\;\;\;\frac{b}{c\_m \cdot z} - 4 \cdot \frac{t \cdot a}{c\_m}\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+66}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a}{c\_m} \cdot -4\right) + \frac{\frac{b}{c\_m}}{z}\\
\end{array}
\end{array}
if a < -7.1999999999999998e-241Initial program 80.1%
associate-+l-80.1%
*-commutative80.1%
associate-*r*78.1%
*-commutative78.1%
associate-+l-78.1%
*-commutative78.1%
associate-*r*80.1%
*-commutative80.1%
associate-*l*80.1%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in x around 0 78.9%
Taylor expanded in c around 0 79.0%
Taylor expanded in x around 0 62.6%
if -7.1999999999999998e-241 < a < 1.44999999999999993e66Initial program 79.5%
associate-+l-79.5%
*-commutative79.5%
associate-*r*87.8%
*-commutative87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*79.5%
*-commutative79.5%
associate-*l*79.5%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in x around inf 76.7%
if 1.44999999999999993e66 < a Initial program 80.1%
associate-+l-80.1%
*-commutative80.1%
associate-*r*76.1%
*-commutative76.1%
associate-+l-76.1%
*-commutative76.1%
associate-*r*80.1%
*-commutative80.1%
associate-*l*80.1%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in x around 0 69.8%
Taylor expanded in c around 0 72.2%
Taylor expanded in x around 0 64.9%
cancel-sign-sub-inv64.9%
metadata-eval64.9%
*-commutative64.9%
*-commutative64.9%
associate-*r/78.3%
*-commutative78.3%
associate-/r*78.3%
*-rgt-identity78.3%
associate-*r/78.4%
+-commutative78.4%
associate-*l*78.4%
*-commutative78.4%
associate-*r/78.3%
*-rgt-identity78.3%
associate-/r*78.3%
associate-/l/78.2%
Simplified78.2%
Final simplification71.4%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= y -0.125)
(* x (* 9.0 (/ (/ y c_m) z)))
(if (<= y 2.4e+148)
(/ (+ (/ b z) (* (* t a) -4.0)) c_m)
(* (* x y) (/ 9.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 (y <= -0.125) {
tmp = x * (9.0 * ((y / c_m) / z));
} else if (y <= 2.4e+148) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else {
tmp = (x * y) * (9.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 (y <= (-0.125d0)) then
tmp = x * (9.0d0 * ((y / c_m) / z))
else if (y <= 2.4d+148) then
tmp = ((b / z) + ((t * a) * (-4.0d0))) / c_m
else
tmp = (x * y) * (9.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 (y <= -0.125) {
tmp = x * (9.0 * ((y / c_m) / z));
} else if (y <= 2.4e+148) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else {
tmp = (x * y) * (9.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 y <= -0.125: tmp = x * (9.0 * ((y / c_m) / z)) elif y <= 2.4e+148: tmp = ((b / z) + ((t * a) * -4.0)) / c_m else: tmp = (x * y) * (9.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 (y <= -0.125) tmp = Float64(x * Float64(9.0 * Float64(Float64(y / c_m) / z))); elseif (y <= 2.4e+148) tmp = Float64(Float64(Float64(b / z) + Float64(Float64(t * a) * -4.0)) / c_m); else tmp = Float64(Float64(x * y) * Float64(9.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 (y <= -0.125)
tmp = x * (9.0 * ((y / c_m) / z));
elseif (y <= 2.4e+148)
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
else
tmp = (x * y) * (9.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[LessEqual[y, -0.125], N[(x * N[(9.0 * N[(N[(y / c$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+148], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * N[(9.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}\;y \leq -0.125:\\
\;\;\;\;x \cdot \left(9 \cdot \frac{\frac{y}{c\_m}}{z}\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+148}:\\
\;\;\;\;\frac{\frac{b}{z} + \left(t \cdot a\right) \cdot -4}{c\_m}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{9}{c\_m \cdot z}\\
\end{array}
\end{array}
if y < -0.125Initial program 80.0%
associate-+l-80.0%
*-commutative80.0%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
*-commutative78.8%
associate-*r*80.0%
*-commutative80.0%
associate-*l*79.9%
associate-*l*80.0%
Simplified80.0%
Taylor expanded in x around inf 52.8%
*-commutative52.8%
Simplified52.8%
Taylor expanded in x around 0 52.8%
*-commutative52.8%
associate-*r/51.8%
associate-*l*51.7%
associate-/r*51.8%
Simplified51.8%
if -0.125 < y < 2.39999999999999995e148Initial program 78.6%
associate-+l-78.6%
*-commutative78.6%
associate-*r*83.1%
*-commutative83.1%
associate-+l-83.1%
*-commutative83.1%
associate-*r*78.6%
*-commutative78.6%
associate-*l*78.6%
associate-*l*81.3%
Simplified81.3%
Taylor expanded in x around 0 81.2%
Taylor expanded in c around 0 81.8%
Taylor expanded in x around 0 72.8%
cancel-sign-sub-inv72.8%
metadata-eval72.8%
*-commutative72.8%
*-commutative72.8%
associate-*r/75.2%
*-commutative75.2%
associate-/r*72.2%
*-rgt-identity72.2%
associate-*r/72.2%
+-commutative72.2%
associate-*l*72.2%
*-commutative72.2%
associate-*r/72.2%
*-rgt-identity72.2%
associate-/r*75.2%
associate-/l/70.9%
Simplified70.9%
Taylor expanded in c around 0 73.9%
if 2.39999999999999995e148 < y Initial program 87.4%
associate-+l-87.4%
*-commutative87.4%
associate-*r*83.2%
*-commutative83.2%
associate-+l-83.2%
*-commutative83.2%
associate-*r*87.4%
*-commutative87.4%
associate-*l*87.5%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in x around inf 62.5%
associate-*r/62.5%
*-commutative62.5%
*-commutative62.5%
associate-/l*62.3%
associate-/r/62.5%
*-commutative62.5%
Simplified62.5%
Final simplification65.7%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (<= t -7.8e+59)
(/ (+ (/ b z) (* (* t a) -4.0)) c_m)
(if (<= t 2.65e-17)
(/ (+ b (* 9.0 (* x y))) (* c_m z))
(* -4.0 (/ a (/ c_m 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 tmp;
if (t <= -7.8e+59) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else if (t <= 2.65e-17) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (a / (c_m / t));
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if (t <= (-7.8d+59)) then
tmp = ((b / z) + ((t * a) * (-4.0d0))) / c_m
else if (t <= 2.65d-17) then
tmp = (b + (9.0d0 * (x * y))) / (c_m * z)
else
tmp = (-4.0d0) * (a / (c_m / t))
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if (t <= -7.8e+59) {
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
} else if (t <= 2.65e-17) {
tmp = (b + (9.0 * (x * y))) / (c_m * z);
} else {
tmp = -4.0 * (a / (c_m / 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): tmp = 0 if t <= -7.8e+59: tmp = ((b / z) + ((t * a) * -4.0)) / c_m elif t <= 2.65e-17: tmp = (b + (9.0 * (x * y))) / (c_m * z) else: tmp = -4.0 * (a / (c_m / 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) tmp = 0.0 if (t <= -7.8e+59) tmp = Float64(Float64(Float64(b / z) + Float64(Float64(t * a) * -4.0)) / c_m); elseif (t <= 2.65e-17) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(c_m * z)); else tmp = Float64(-4.0 * Float64(a / Float64(c_m / 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)
tmp = 0.0;
if (t <= -7.8e+59)
tmp = ((b / z) + ((t * a) * -4.0)) / c_m;
elseif (t <= 2.65e-17)
tmp = (b + (9.0 * (x * y))) / (c_m * z);
else
tmp = -4.0 * (a / (c_m / 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_] := N[(c$95$s * If[LessEqual[t, -7.8e+59], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] / c$95$m), $MachinePrecision], If[LessEqual[t, 2.65e-17], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c$95$m / t), $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}\;t \leq -7.8 \cdot 10^{+59}:\\
\;\;\;\;\frac{\frac{b}{z} + \left(t \cdot a\right) \cdot -4}{c\_m}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-17}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c\_m}{t}}\\
\end{array}
\end{array}
if t < -7.80000000000000043e59Initial program 77.4%
associate-+l-77.4%
*-commutative77.4%
associate-*r*82.7%
*-commutative82.7%
associate-+l-82.7%
*-commutative82.7%
associate-*r*77.4%
*-commutative77.4%
associate-*l*77.4%
associate-*l*79.3%
Simplified79.3%
Taylor expanded in x around 0 74.0%
Taylor expanded in c around 0 82.8%
Taylor expanded in x around 0 67.4%
cancel-sign-sub-inv67.4%
metadata-eval67.4%
*-commutative67.4%
*-commutative67.4%
associate-*r/73.0%
*-commutative73.0%
associate-/r*76.5%
*-rgt-identity76.5%
associate-*r/76.5%
+-commutative76.5%
associate-*l*76.5%
*-commutative76.5%
associate-*r/76.5%
*-rgt-identity76.5%
associate-/r*73.0%
associate-/l/74.7%
Simplified74.7%
Taylor expanded in c around 0 76.1%
if -7.80000000000000043e59 < t < 2.6499999999999999e-17Initial program 89.6%
associate-+l-89.6%
*-commutative89.6%
associate-*r*87.3%
*-commutative87.3%
associate-+l-87.3%
*-commutative87.3%
associate-*r*89.6%
*-commutative89.6%
associate-*l*89.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in x around inf 80.7%
if 2.6499999999999999e-17 < t Initial program 62.7%
associate-+l-62.7%
*-commutative62.7%
associate-*r*70.0%
*-commutative70.0%
associate-+l-70.0%
*-commutative70.0%
associate-*r*62.7%
*-commutative62.7%
associate-*l*62.7%
associate-*l*67.0%
Simplified67.0%
Taylor expanded in z around inf 52.2%
*-commutative52.2%
associate-/l*63.4%
Simplified63.4%
Final simplification75.1%
c_m = (fabs.f64 c)
c_s = (copysign.f64 1 c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
(FPCore (c_s x y z t a b c_m)
:precision binary64
(*
c_s
(if (or (<= b -5.3e+126) (not (<= b 5e+78)))
(/ b (* c_m z))
(* (* t (/ a c_m)) -4.0))))c_m = fabs(c);
c_s = copysign(1.0, c);
assert(x < y && y < z && z < t && t < a && a < b && b < c_m);
double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -5.3e+126) || !(b <= 5e+78)) {
tmp = b / (c_m * z);
} else {
tmp = (t * (a / c_m)) * -4.0;
}
return c_s * tmp;
}
c_m = abs(c)
c_s = copysign(1.0d0, c)
NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function.
real(8) function code(c_s, x, y, z, t, a, b, c_m)
real(8), intent (in) :: c_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c_m
real(8) :: tmp
if ((b <= (-5.3d+126)) .or. (.not. (b <= 5d+78))) then
tmp = b / (c_m * z)
else
tmp = (t * (a / c_m)) * (-4.0d0)
end if
code = c_s * tmp
end function
c_m = Math.abs(c);
c_s = Math.copySign(1.0, c);
assert x < y && y < z && z < t && t < a && a < b && b < c_m;
public static double code(double c_s, double x, double y, double z, double t, double a, double b, double c_m) {
double tmp;
if ((b <= -5.3e+126) || !(b <= 5e+78)) {
tmp = b / (c_m * z);
} else {
tmp = (t * (a / c_m)) * -4.0;
}
return c_s * tmp;
}
c_m = math.fabs(c) c_s = math.copysign(1.0, c) [x, y, z, t, a, b, c_m] = sort([x, y, z, t, a, b, c_m]) def code(c_s, x, y, z, t, a, b, c_m): tmp = 0 if (b <= -5.3e+126) or not (b <= 5e+78): tmp = b / (c_m * z) else: tmp = (t * (a / c_m)) * -4.0 return c_s * tmp
c_m = abs(c) c_s = copysign(1.0, c) x, y, z, t, a, b, c_m = sort([x, y, z, t, a, b, c_m]) function code(c_s, x, y, z, t, a, b, c_m) tmp = 0.0 if ((b <= -5.3e+126) || !(b <= 5e+78)) tmp = Float64(b / Float64(c_m * z)); else tmp = Float64(Float64(t * Float64(a / c_m)) * -4.0); end return Float64(c_s * tmp) end
c_m = abs(c);
c_s = sign(c) * abs(1.0);
x, y, z, t, a, b, c_m = num2cell(sort([x, y, z, t, a, b, c_m])){:}
function tmp_2 = code(c_s, x, y, z, t, a, b, c_m)
tmp = 0.0;
if ((b <= -5.3e+126) || ~((b <= 5e+78)))
tmp = b / (c_m * z);
else
tmp = (t * (a / c_m)) * -4.0;
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[b, -5.3e+126], N[Not[LessEqual[b, 5e+78]], $MachinePrecision]], N[(b / N[(c$95$m * z), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a / c$95$m), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
c_m = \left|c\right|
\\
c_s = \mathsf{copysign}\left(1, c\right)
\\
[x, y, z, t, a, b, c_m] = \mathsf{sort}([x, y, z, t, a, b, c_m])\\
\\
c\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq -5.3 \cdot 10^{+126} \lor \neg \left(b \leq 5 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{b}{c\_m \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \frac{a}{c\_m}\right) \cdot -4\\
\end{array}
\end{array}
if b < -5.30000000000000028e126 or 4.99999999999999984e78 < b Initial program 81.8%
associate-+l-81.8%
*-commutative81.8%
associate-*r*85.1%
*-commutative85.1%
associate-+l-85.1%
*-commutative85.1%
associate-*r*81.8%
*-commutative81.8%
associate-*l*81.8%
associate-*l*84.1%
Simplified84.1%
Taylor expanded in b around inf 63.1%
*-commutative63.1%
Simplified63.1%
if -5.30000000000000028e126 < b < 4.99999999999999984e78Initial program 78.7%
associate-+l-78.7%
*-commutative78.7%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
*-commutative79.8%
associate-*r*78.7%
*-commutative78.7%
associate-*l*78.7%
associate-*l*79.9%
Simplified79.9%
add-cube-cbrt79.7%
pow379.7%
*-commutative79.7%
associate-*l*79.7%
Applied egg-rr79.7%
Taylor expanded in z around inf 49.5%
associate-/l*51.3%
associate-/r/54.5%
Simplified54.5%
Final simplification57.6%
c_m = (fabs.f64 c) c_s = (copysign.f64 1 c) NOTE: x, y, z, t, a, b, and c_m should be sorted in increasing order before calling this function. (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 79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*81.7%
*-commutative81.7%
associate-+l-81.7%
*-commutative81.7%
associate-*r*79.9%
*-commutative79.9%
associate-*l*79.8%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in b around inf 35.0%
*-commutative35.0%
Simplified35.0%
Final simplification35.0%
(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 2024041
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))