
(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 12 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}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* c (* z t))))
(if (<= z -1.8e+18)
(/ (* x (- (+ (* 9.0 (/ y z)) (/ b (* z x))) (* 4.0 (/ (* a t) x)))) c)
(if (<= z 1.8e+95)
(/ (+ (* (* t (* z a)) (/ -4.0 c)) (/ (+ b (* 9.0 (* x y))) c)) z)
(* t (+ (* -4.0 (/ a c)) (+ (* 9.0 (/ (* x y) t_1)) (/ b t_1))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c * (z * t);
double tmp;
if (z <= -1.8e+18) {
tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c;
} else if (z <= 1.8e+95) {
tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z;
} else {
tmp = t * ((-4.0 * (a / c)) + ((9.0 * ((x * y) / t_1)) + (b / t_1)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
t_1 = c * (z * t)
if (z <= (-1.8d+18)) then
tmp = (x * (((9.0d0 * (y / z)) + (b / (z * x))) - (4.0d0 * ((a * t) / x)))) / c
else if (z <= 1.8d+95) then
tmp = (((t * (z * a)) * ((-4.0d0) / c)) + ((b + (9.0d0 * (x * y))) / c)) / z
else
tmp = t * (((-4.0d0) * (a / c)) + ((9.0d0 * ((x * y) / t_1)) + (b / t_1)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = c * (z * t);
double tmp;
if (z <= -1.8e+18) {
tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c;
} else if (z <= 1.8e+95) {
tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z;
} else {
tmp = t * ((-4.0 * (a / c)) + ((9.0 * ((x * y) / t_1)) + (b / t_1)));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = c * (z * t) tmp = 0 if z <= -1.8e+18: tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c elif z <= 1.8e+95: tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z else: tmp = t * ((-4.0 * (a / c)) + ((9.0 * ((x * y) / t_1)) + (b / t_1))) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(c * Float64(z * t)) tmp = 0.0 if (z <= -1.8e+18) tmp = Float64(Float64(x * Float64(Float64(Float64(9.0 * Float64(y / z)) + Float64(b / Float64(z * x))) - Float64(4.0 * Float64(Float64(a * t) / x)))) / c); elseif (z <= 1.8e+95) tmp = Float64(Float64(Float64(Float64(t * Float64(z * a)) * Float64(-4.0 / c)) + Float64(Float64(b + Float64(9.0 * Float64(x * y))) / c)) / z); else tmp = Float64(t * Float64(Float64(-4.0 * Float64(a / c)) + Float64(Float64(9.0 * Float64(Float64(x * y) / t_1)) + Float64(b / t_1)))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = c * (z * t);
tmp = 0.0;
if (z <= -1.8e+18)
tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c;
elseif (z <= 1.8e+95)
tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z;
else
tmp = t * ((-4.0 * (a / c)) + ((9.0 * ((x * y) / t_1)) + (b / t_1)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+18], N[(N[(x * N[(N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.8e+95], N[(N[(N[(N[(t * N[(z * a), $MachinePrecision]), $MachinePrecision] * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(t * N[(N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := c \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{x \cdot \left(\left(9 \cdot \frac{y}{z} + \frac{b}{z \cdot x}\right) - 4 \cdot \frac{a \cdot t}{x}\right)}{c}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+95}:\\
\;\;\;\;\frac{\left(t \cdot \left(z \cdot a\right)\right) \cdot \frac{-4}{c} + \frac{b + 9 \cdot \left(x \cdot y\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c} + \left(9 \cdot \frac{x \cdot y}{t\_1} + \frac{b}{t\_1}\right)\right)\\
\end{array}
\end{array}
if z < -1.8e18Initial program 51.2%
associate-+l-51.2%
*-commutative51.2%
associate-*r*57.6%
*-commutative57.6%
associate-+l-57.6%
associate-*l*57.6%
associate-*l*57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around inf 76.1%
Taylor expanded in c around 0 91.0%
if -1.8e18 < z < 1.79999999999999989e95Initial program 92.9%
associate-+l-92.9%
*-commutative92.9%
associate-*r*93.6%
*-commutative93.6%
associate-+l-93.6%
associate-*l*94.1%
associate-*l*90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in y around inf 83.8%
associate--l+83.8%
associate-*r/83.8%
div-sub83.8%
cancel-sign-sub-inv83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in z around 0 87.1%
div-inv87.1%
+-commutative87.1%
associate-/l*82.0%
fma-define82.6%
fma-define82.6%
associate-*r/82.6%
Applied egg-rr82.6%
associate-*r/82.7%
*-rgt-identity82.7%
Simplified94.5%
Taylor expanded in c around 0 94.5%
if 1.79999999999999989e95 < z Initial program 61.4%
associate-+l-61.4%
*-commutative61.4%
associate-*r*61.4%
*-commutative61.4%
associate-+l-61.4%
associate-*l*61.4%
associate-*l*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in t around inf 78.9%
Final simplification91.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))))
(if (<= t_1 -2e-219)
t_1
(if (<= t_1 5e-216)
(/ (+ (* 9.0 (/ (* x y) c)) (/ b c)) z)
(if (<= t_1 INFINITY) t_1 (* a (/ (* t -4.0) c)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
double tmp;
if (t_1 <= -2e-219) {
tmp = t_1;
} else if (t_1 <= 5e-216) {
tmp = ((9.0 * ((x * y) / c)) + (b / c)) / z;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
double tmp;
if (t_1 <= -2e-219) {
tmp = t_1;
} else if (t_1 <= 5e-216) {
tmp = ((9.0 * ((x * y) / c)) + (b / c)) / z;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) tmp = 0 if t_1 <= -2e-219: tmp = t_1 elif t_1 <= 5e-216: tmp = ((9.0 * ((x * y) / c)) + (b / c)) / z elif t_1 <= math.inf: tmp = t_1 else: tmp = a * ((t * -4.0) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)) tmp = 0.0 if (t_1 <= -2e-219) tmp = t_1; elseif (t_1 <= 5e-216) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / c)) + Float64(b / c)) / z); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(Float64(t * -4.0) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
tmp = 0.0;
if (t_1 <= -2e-219)
tmp = t_1;
elseif (t_1 <= 5e-216)
tmp = ((9.0 * ((x * y) / c)) + (b / c)) / z;
elseif (t_1 <= Inf)
tmp = t_1;
else
tmp = a * ((t * -4.0) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-219], t$95$1, If[LessEqual[t$95$1, 5e-216], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-219}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-216}:\\
\;\;\;\;\frac{9 \cdot \frac{x \cdot y}{c} + \frac{b}{c}}{z}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\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-219 or 5.00000000000000021e-216 < (/.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 88.6%
if -2.0000000000000001e-219 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x #s(literal 9 binary64)) y) (*.f64 (*.f64 (*.f64 z #s(literal 4 binary64)) t) a)) b) (*.f64 z c)) < 5.00000000000000021e-216Initial program 59.3%
associate-+l-59.3%
*-commutative59.3%
associate-*r*54.6%
*-commutative54.6%
associate-+l-54.6%
associate-*l*54.5%
associate-*l*59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in z around 0 99.7%
Taylor expanded in a around 0 90.8%
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%
associate-+l-0.0%
*-commutative0.0%
associate-*r*0.9%
*-commutative0.9%
associate-+l-0.9%
associate-*l*0.9%
associate-*l*0.9%
*-commutative0.9%
Simplified0.9%
Taylor expanded in z around inf 73.0%
*-commutative73.0%
associate-/l*88.9%
associate-*r*88.9%
associate-*l/88.9%
Simplified88.9%
Final simplification88.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -6e+16)
(/ (* x (- (+ (* 9.0 (/ y z)) (/ b (* z x))) (* 4.0 (/ (* a t) x)))) c)
(if (<= z 9e+144)
(/ (+ (* (* t (* z a)) (/ -4.0 c)) (/ (+ b (* 9.0 (* x y))) c)) z)
(- (/ b (* z c)) (* 4.0 (/ (* a t) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -6e+16) {
tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c;
} else if (z <= 9e+144) {
tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z;
} else {
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if (z <= (-6d+16)) then
tmp = (x * (((9.0d0 * (y / z)) + (b / (z * x))) - (4.0d0 * ((a * t) / x)))) / c
else if (z <= 9d+144) then
tmp = (((t * (z * a)) * ((-4.0d0) / c)) + ((b + (9.0d0 * (x * y))) / c)) / z
else
tmp = (b / (z * c)) - (4.0d0 * ((a * t) / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -6e+16) {
tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c;
} else if (z <= 9e+144) {
tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z;
} else {
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -6e+16: tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c elif z <= 9e+144: tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z else: tmp = (b / (z * c)) - (4.0 * ((a * t) / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -6e+16) tmp = Float64(Float64(x * Float64(Float64(Float64(9.0 * Float64(y / z)) + Float64(b / Float64(z * x))) - Float64(4.0 * Float64(Float64(a * t) / x)))) / c); elseif (z <= 9e+144) tmp = Float64(Float64(Float64(Float64(t * Float64(z * a)) * Float64(-4.0 / c)) + Float64(Float64(b + Float64(9.0 * Float64(x * y))) / c)) / z); else tmp = Float64(Float64(b / Float64(z * c)) - Float64(4.0 * Float64(Float64(a * t) / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -6e+16)
tmp = (x * (((9.0 * (y / z)) + (b / (z * x))) - (4.0 * ((a * t) / x)))) / c;
elseif (z <= 9e+144)
tmp = (((t * (z * a)) * (-4.0 / c)) + ((b + (9.0 * (x * y))) / c)) / z;
else
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -6e+16], N[(N[(x * N[(N[(N[(9.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 9e+144], N[(N[(N[(N[(t * N[(z * a), $MachinePrecision]), $MachinePrecision] * N[(-4.0 / c), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+16}:\\
\;\;\;\;\frac{x \cdot \left(\left(9 \cdot \frac{y}{z} + \frac{b}{z \cdot x}\right) - 4 \cdot \frac{a \cdot t}{x}\right)}{c}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+144}:\\
\;\;\;\;\frac{\left(t \cdot \left(z \cdot a\right)\right) \cdot \frac{-4}{c} + \frac{b + 9 \cdot \left(x \cdot y\right)}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -6e16Initial program 51.2%
associate-+l-51.2%
*-commutative51.2%
associate-*r*57.6%
*-commutative57.6%
associate-+l-57.6%
associate-*l*57.6%
associate-*l*57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in x around inf 76.1%
Taylor expanded in c around 0 91.0%
if -6e16 < z < 8.99999999999999935e144Initial program 91.5%
associate-+l-91.5%
*-commutative91.5%
associate-*r*92.0%
*-commutative92.0%
associate-+l-92.0%
associate-*l*92.5%
associate-*l*89.3%
*-commutative89.3%
Simplified89.3%
Taylor expanded in y around inf 82.1%
associate--l+82.1%
associate-*r/82.1%
div-sub82.1%
cancel-sign-sub-inv82.1%
metadata-eval82.1%
Simplified82.1%
Taylor expanded in z around 0 84.6%
div-inv84.6%
+-commutative84.6%
associate-/l*79.5%
fma-define80.0%
fma-define80.0%
associate-*r/80.0%
Applied egg-rr80.0%
associate-*r/80.1%
*-rgt-identity80.1%
Simplified92.9%
Taylor expanded in c around 0 92.9%
if 8.99999999999999935e144 < z Initial program 52.3%
associate-+l-52.3%
*-commutative52.3%
associate-*r*52.2%
*-commutative52.2%
associate-+l-52.2%
associate-*l*52.2%
associate-*l*55.8%
*-commutative55.8%
Simplified55.8%
Taylor expanded in x around inf 73.4%
Taylor expanded in x around 0 83.3%
Final simplification91.5%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= z 1.4e+145) (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* a t)))) (* z c)) (- (/ b (* z c)) (* 4.0 (/ (* a t) c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 1.4e+145) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if (z <= 1.4d+145) then
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (a * t)))) / (z * c)
else
tmp = (b / (z * c)) - (4.0d0 * ((a * t) / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 1.4e+145) {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= 1.4e+145: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (z * c) else: tmp = (b / (z * c)) - (4.0 * ((a * t) / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= 1.4e+145) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(z * c)); else tmp = Float64(Float64(b / Float64(z * c)) - Float64(4.0 * Float64(Float64(a * t) / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= 1.4e+145)
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (a * t)))) / (z * c);
else
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, 1.4e+145], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+145}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < 1.3999999999999999e145Initial program 83.5%
associate-+l-83.5%
*-commutative83.5%
associate-*r*85.2%
*-commutative85.2%
associate-+l-85.2%
associate-*l*85.6%
associate-*l*83.0%
*-commutative83.0%
Simplified83.0%
if 1.3999999999999999e145 < z Initial program 52.3%
associate-+l-52.3%
*-commutative52.3%
associate-*r*52.2%
*-commutative52.2%
associate-+l-52.2%
associate-*l*52.2%
associate-*l*55.8%
*-commutative55.8%
Simplified55.8%
Taylor expanded in x around inf 73.4%
Taylor expanded in x around 0 83.3%
Final simplification83.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -4.3e-32) (not (<= z 1.6e-80))) (- (/ b (* z c)) (* 4.0 (/ (* a t) c))) (/ (+ b (* 9.0 (* x y))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -4.3e-32) || !(z <= 1.6e-80)) {
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if ((z <= (-4.3d-32)) .or. (.not. (z <= 1.6d-80))) then
tmp = (b / (z * c)) - (4.0d0 * ((a * t) / c))
else
tmp = (b + (9.0d0 * (x * y))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -4.3e-32) || !(z <= 1.6e-80)) {
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -4.3e-32) or not (z <= 1.6e-80): tmp = (b / (z * c)) - (4.0 * ((a * t) / c)) else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -4.3e-32) || !(z <= 1.6e-80)) tmp = Float64(Float64(b / Float64(z * c)) - Float64(4.0 * Float64(Float64(a * t) / c))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -4.3e-32) || ~((z <= 1.6e-80)))
tmp = (b / (z * c)) - (4.0 * ((a * t) / c));
else
tmp = (b + (9.0 * (x * y))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -4.3e-32], N[Not[LessEqual[z, 1.6e-80]], $MachinePrecision]], N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-32} \lor \neg \left(z \leq 1.6 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.2999999999999999e-32 or 1.5999999999999999e-80 < z Initial program 67.2%
associate-+l-67.2%
*-commutative67.2%
associate-*r*69.9%
*-commutative69.9%
associate-+l-69.9%
associate-*l*70.0%
associate-*l*70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in x around inf 70.5%
Taylor expanded in x around 0 72.0%
if -4.2999999999999999e-32 < z < 1.5999999999999999e-80Initial program 95.8%
associate-+l-95.8%
*-commutative95.8%
associate-*r*95.8%
*-commutative95.8%
associate-+l-95.8%
associate-*l*96.6%
associate-*l*92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in z around 0 85.6%
*-commutative85.6%
Simplified85.6%
Final simplification78.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -1.45e+126)
(* -4.0 (* t (/ a c)))
(if (<= t -4.6e-69)
(* 9.0 (* x (/ y (* z c))))
(if (<= t 6e-93) (* b (/ 1.0 (* z c))) (* a (/ (* t -4.0) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.45e+126) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -4.6e-69) {
tmp = 9.0 * (x * (y / (z * c)));
} else if (t <= 6e-93) {
tmp = b * (1.0 / (z * c));
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if (t <= (-1.45d+126)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= (-4.6d-69)) then
tmp = 9.0d0 * (x * (y / (z * c)))
else if (t <= 6d-93) then
tmp = b * (1.0d0 / (z * c))
else
tmp = a * ((t * (-4.0d0)) / c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.45e+126) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -4.6e-69) {
tmp = 9.0 * (x * (y / (z * c)));
} else if (t <= 6e-93) {
tmp = b * (1.0 / (z * c));
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -1.45e+126: tmp = -4.0 * (t * (a / c)) elif t <= -4.6e-69: tmp = 9.0 * (x * (y / (z * c))) elif t <= 6e-93: tmp = b * (1.0 / (z * c)) else: tmp = a * ((t * -4.0) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -1.45e+126) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= -4.6e-69) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(z * c)))); elseif (t <= 6e-93) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = Float64(a * Float64(Float64(t * -4.0) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -1.45e+126)
tmp = -4.0 * (t * (a / c));
elseif (t <= -4.6e-69)
tmp = 9.0 * (x * (y / (z * c)));
elseif (t <= 6e-93)
tmp = b * (1.0 / (z * c));
else
tmp = a * ((t * -4.0) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -1.45e+126], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.6e-69], N[(9.0 * N[(x * N[(y / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-93], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+126}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-69}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{z \cdot c}\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-93}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\end{array}
\end{array}
if t < -1.44999999999999993e126Initial program 70.3%
associate-+l-70.3%
*-commutative70.3%
associate-*r*76.3%
*-commutative76.3%
associate-+l-76.3%
associate-*l*76.3%
associate-*l*67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in z around 0 70.6%
Taylor expanded in a around inf 59.4%
associate-*l/67.9%
Simplified67.9%
if -1.44999999999999993e126 < t < -4.6000000000000001e-69Initial program 85.4%
associate-+l-85.4%
*-commutative85.4%
associate-*r*85.4%
*-commutative85.4%
associate-+l-85.4%
associate-*l*85.3%
associate-*l*81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in x around inf 53.3%
associate-/l*53.3%
*-commutative53.3%
Simplified53.3%
if -4.6000000000000001e-69 < t < 6.0000000000000003e-93Initial program 87.5%
associate-+l-87.5%
*-commutative87.5%
associate-*r*86.4%
*-commutative86.4%
associate-+l-86.4%
associate-*l*87.4%
associate-*l*88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in b around inf 47.7%
*-commutative47.7%
Simplified47.7%
div-inv47.5%
Applied egg-rr47.5%
if 6.0000000000000003e-93 < t Initial program 72.7%
associate-+l-72.7%
*-commutative72.7%
associate-*r*76.1%
*-commutative76.1%
associate-+l-76.1%
associate-*l*76.1%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in z around inf 47.5%
*-commutative47.5%
associate-/l*48.7%
associate-*r*48.7%
associate-*l/48.7%
Simplified48.7%
Final simplification51.6%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -2.15e+125)
(* -4.0 (* t (/ a c)))
(if (<= t -1.66e-71)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= t 6.5e-93) (* b (/ 1.0 (* z c))) (* a (/ (* t -4.0) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -2.15e+125) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -1.66e-71) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (t <= 6.5e-93) {
tmp = b * (1.0 / (z * c));
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if (t <= (-2.15d+125)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= (-1.66d-71)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (t <= 6.5d-93) then
tmp = b * (1.0d0 / (z * c))
else
tmp = a * ((t * (-4.0d0)) / c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -2.15e+125) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -1.66e-71) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (t <= 6.5e-93) {
tmp = b * (1.0 / (z * c));
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -2.15e+125: tmp = -4.0 * (t * (a / c)) elif t <= -1.66e-71: tmp = 9.0 * ((y / z) * (x / c)) elif t <= 6.5e-93: tmp = b * (1.0 / (z * c)) else: tmp = a * ((t * -4.0) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -2.15e+125) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= -1.66e-71) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (t <= 6.5e-93) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = Float64(a * Float64(Float64(t * -4.0) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -2.15e+125)
tmp = -4.0 * (t * (a / c));
elseif (t <= -1.66e-71)
tmp = 9.0 * ((y / z) * (x / c));
elseif (t <= 6.5e-93)
tmp = b * (1.0 / (z * c));
else
tmp = a * ((t * -4.0) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -2.15e+125], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.66e-71], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-93], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+125}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq -1.66 \cdot 10^{-71}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-93}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\end{array}
\end{array}
if t < -2.15000000000000018e125Initial program 70.3%
associate-+l-70.3%
*-commutative70.3%
associate-*r*76.3%
*-commutative76.3%
associate-+l-76.3%
associate-*l*76.3%
associate-*l*67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in z around 0 70.6%
Taylor expanded in a around inf 59.4%
associate-*l/67.9%
Simplified67.9%
if -2.15000000000000018e125 < t < -1.6599999999999999e-71Initial program 85.7%
associate-+l-85.7%
*-commutative85.7%
associate-*r*85.7%
*-commutative85.7%
associate-+l-85.7%
associate-*l*85.6%
associate-*l*81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in x around inf 52.1%
times-frac56.3%
Applied egg-rr56.3%
if -1.6599999999999999e-71 < t < 6.5e-93Initial program 87.3%
associate-+l-87.3%
*-commutative87.3%
associate-*r*86.2%
*-commutative86.2%
associate-+l-86.2%
associate-*l*87.2%
associate-*l*88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in b around inf 47.1%
*-commutative47.1%
Simplified47.1%
div-inv46.9%
Applied egg-rr46.9%
if 6.5e-93 < t Initial program 72.7%
associate-+l-72.7%
*-commutative72.7%
associate-*r*76.1%
*-commutative76.1%
associate-+l-76.1%
associate-*l*76.1%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in z around inf 47.5%
*-commutative47.5%
associate-/l*48.7%
associate-*r*48.7%
associate-*l/48.7%
Simplified48.7%
Final simplification51.9%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -4.5e+147)
(* -4.0 (* t (/ a c)))
(if (<= t -3.6e-70)
(* 9.0 (/ y (* z (/ c x))))
(if (<= t 5.8e-93) (* b (/ 1.0 (* z c))) (* a (/ (* t -4.0) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -4.5e+147) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -3.6e-70) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (t <= 5.8e-93) {
tmp = b * (1.0 / (z * c));
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if (t <= (-4.5d+147)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= (-3.6d-70)) then
tmp = 9.0d0 * (y / (z * (c / x)))
else if (t <= 5.8d-93) then
tmp = b * (1.0d0 / (z * c))
else
tmp = a * ((t * (-4.0d0)) / c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -4.5e+147) {
tmp = -4.0 * (t * (a / c));
} else if (t <= -3.6e-70) {
tmp = 9.0 * (y / (z * (c / x)));
} else if (t <= 5.8e-93) {
tmp = b * (1.0 / (z * c));
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -4.5e+147: tmp = -4.0 * (t * (a / c)) elif t <= -3.6e-70: tmp = 9.0 * (y / (z * (c / x))) elif t <= 5.8e-93: tmp = b * (1.0 / (z * c)) else: tmp = a * ((t * -4.0) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -4.5e+147) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= -3.6e-70) tmp = Float64(9.0 * Float64(y / Float64(z * Float64(c / x)))); elseif (t <= 5.8e-93) tmp = Float64(b * Float64(1.0 / Float64(z * c))); else tmp = Float64(a * Float64(Float64(t * -4.0) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -4.5e+147)
tmp = -4.0 * (t * (a / c));
elseif (t <= -3.6e-70)
tmp = 9.0 * (y / (z * (c / x)));
elseif (t <= 5.8e-93)
tmp = b * (1.0 / (z * c));
else
tmp = a * ((t * -4.0) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -4.5e+147], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.6e-70], N[(9.0 * N[(y / N[(z * N[(c / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-93], N[(b * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+147}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-70}:\\
\;\;\;\;9 \cdot \frac{y}{z \cdot \frac{c}{x}}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-93}:\\
\;\;\;\;b \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\end{array}
\end{array}
if t < -4.50000000000000008e147Initial program 68.4%
associate-+l-68.4%
*-commutative68.4%
associate-*r*74.8%
*-commutative74.8%
associate-+l-74.8%
associate-*l*74.8%
associate-*l*68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in z around 0 68.8%
Taylor expanded in a around inf 63.0%
associate-*l/69.0%
Simplified69.0%
if -4.50000000000000008e147 < t < -3.6000000000000002e-70Initial program 86.0%
associate-+l-86.0%
*-commutative86.0%
associate-*r*86.0%
*-commutative86.0%
associate-+l-86.0%
associate-*l*85.9%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in x around inf 51.1%
times-frac55.2%
Applied egg-rr55.2%
clear-num55.2%
frac-times55.3%
*-un-lft-identity55.3%
Applied egg-rr55.3%
if -3.6000000000000002e-70 < t < 5.7999999999999997e-93Initial program 87.5%
associate-+l-87.5%
*-commutative87.5%
associate-*r*86.4%
*-commutative86.4%
associate-+l-86.4%
associate-*l*87.4%
associate-*l*88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in b around inf 47.7%
*-commutative47.7%
Simplified47.7%
div-inv47.5%
Applied egg-rr47.5%
if 5.7999999999999997e-93 < t Initial program 72.7%
associate-+l-72.7%
*-commutative72.7%
associate-*r*76.1%
*-commutative76.1%
associate-+l-76.1%
associate-*l*76.1%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in z around inf 47.5%
*-commutative47.5%
associate-/l*48.7%
associate-*r*48.7%
associate-*l/48.7%
Simplified48.7%
Final simplification52.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -2e+149) (not (<= t 0.00068))) (* -4.0 (* t (/ a c))) (/ (+ b (* 9.0 (* x y))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -2e+149) || !(t <= 0.00068)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if ((t <= (-2d+149)) .or. (.not. (t <= 0.00068d0))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (b + (9.0d0 * (x * y))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -2e+149) || !(t <= 0.00068)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -2e+149) or not (t <= 0.00068): tmp = -4.0 * (t * (a / c)) else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -2e+149) || !(t <= 0.00068)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -2e+149) || ~((t <= 0.00068)))
tmp = -4.0 * (t * (a / c));
else
tmp = (b + (9.0 * (x * y))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -2e+149], N[Not[LessEqual[t, 0.00068]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+149} \lor \neg \left(t \leq 0.00068\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if t < -2.0000000000000001e149 or 6.8e-4 < t Initial program 68.4%
associate-+l-68.4%
*-commutative68.4%
associate-*r*74.6%
*-commutative74.6%
associate-+l-74.6%
associate-*l*74.5%
associate-*l*70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in z around 0 67.6%
Taylor expanded in a around inf 59.4%
associate-*l/61.8%
Simplified61.8%
if -2.0000000000000001e149 < t < 6.8e-4Initial program 86.9%
associate-+l-86.9%
*-commutative86.9%
associate-*r*85.6%
*-commutative85.6%
associate-+l-85.6%
associate-*l*86.2%
associate-*l*85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in z around 0 78.4%
*-commutative78.4%
Simplified78.4%
Final simplification72.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -2e+158) (not (<= t 6.2e-93))) (* -4.0 (* t (/ a c))) (/ (/ b c) z)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -2e+158) || !(t <= 6.2e-93)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if ((t <= (-2d+158)) .or. (.not. (t <= 6.2d-93))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -2e+158) || !(t <= 6.2e-93)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -2e+158) or not (t <= 6.2e-93): tmp = -4.0 * (t * (a / c)) else: tmp = (b / c) / z return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -2e+158) || !(t <= 6.2e-93)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -2e+158) || ~((t <= 6.2e-93)))
tmp = -4.0 * (t * (a / c));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -2e+158], N[Not[LessEqual[t, 6.2e-93]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+158} \lor \neg \left(t \leq 6.2 \cdot 10^{-93}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if t < -1.99999999999999991e158 or 6.19999999999999999e-93 < t Initial program 71.9%
associate-+l-71.9%
*-commutative71.9%
associate-*r*76.2%
*-commutative76.2%
associate-+l-76.2%
associate-*l*76.2%
associate-*l*73.7%
*-commutative73.7%
Simplified73.7%
Taylor expanded in z around 0 70.4%
Taylor expanded in a around inf 52.5%
associate-*l/54.5%
Simplified54.5%
if -1.99999999999999991e158 < t < 6.19999999999999999e-93Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*85.8%
*-commutative85.8%
associate-+l-85.8%
associate-*l*86.4%
associate-*l*85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y around inf 78.4%
associate--l+78.4%
associate-*r/78.4%
div-sub78.4%
cancel-sign-sub-inv78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in z around 0 82.4%
Taylor expanded in b around inf 44.1%
associate-/r*44.4%
Simplified44.4%
Final simplification49.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= t -1.9e+159) (* -4.0 (* t (/ a c))) (if (<= t 7e-93) (/ (/ b c) z) (* a (/ (* t -4.0) c)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.9e+159) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 7e-93) {
tmp = (b / c) / z;
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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) :: tmp
if (t <= (-1.9d+159)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= 7d-93) then
tmp = (b / c) / z
else
tmp = a * ((t * (-4.0d0)) / c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.9e+159) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 7e-93) {
tmp = (b / c) / z;
} else {
tmp = a * ((t * -4.0) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -1.9e+159: tmp = -4.0 * (t * (a / c)) elif t <= 7e-93: tmp = (b / c) / z else: tmp = a * ((t * -4.0) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -1.9e+159) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= 7e-93) tmp = Float64(Float64(b / c) / z); else tmp = Float64(a * Float64(Float64(t * -4.0) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -1.9e+159)
tmp = -4.0 * (t * (a / c));
elseif (t <= 7e-93)
tmp = (b / c) / z;
else
tmp = a * ((t * -4.0) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -1.9e+159], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-93], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+159}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-93}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t \cdot -4}{c}\\
\end{array}
\end{array}
if t < -1.89999999999999983e159Initial program 69.6%
associate-+l-69.6%
*-commutative69.6%
associate-*r*76.4%
*-commutative76.4%
associate-+l-76.4%
associate-*l*76.4%
associate-*l*69.9%
*-commutative69.9%
Simplified69.9%
Taylor expanded in z around 0 66.6%
Taylor expanded in a around inf 67.1%
associate-*l/73.4%
Simplified73.4%
if -1.89999999999999983e159 < t < 7e-93Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*85.8%
*-commutative85.8%
associate-+l-85.8%
associate-*l*86.4%
associate-*l*85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in y around inf 78.4%
associate--l+78.4%
associate-*r/78.4%
div-sub78.4%
cancel-sign-sub-inv78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in z around 0 82.4%
Taylor expanded in b around inf 44.1%
associate-/r*44.4%
Simplified44.4%
if 7e-93 < t Initial program 72.7%
associate-+l-72.7%
*-commutative72.7%
associate-*r*76.1%
*-commutative76.1%
associate-+l-76.1%
associate-*l*76.1%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in z around inf 47.5%
*-commutative47.5%
associate-/l*48.7%
associate-*r*48.7%
associate-*l/48.7%
Simplified48.7%
Final simplification49.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
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 = b / (z * c)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 79.9%
associate-+l-79.9%
*-commutative79.9%
associate-*r*81.5%
*-commutative81.5%
associate-+l-81.5%
associate-*l*81.8%
associate-*l*79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in b around inf 37.4%
*-commutative37.4%
Simplified37.4%
Final simplification37.4%
(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 2024067
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))