
(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 15 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 and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= c -1.85e-88) (not (<= c 1.35e+69))) (+ (* t (* (/ a c) -4.0)) (/ (- (/ b c) (* (/ x (/ c y)) -9.0)) z)) (/ (+ (* -4.0 (* t a)) (/ (- b (* -9.0 (* x y))) z)) c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -1.85e-88) || !(c <= 1.35e+69)) {
tmp = (t * ((a / c) * -4.0)) + (((b / c) - ((x / (c / y)) * -9.0)) / z);
} else {
tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 ((c <= (-1.85d-88)) .or. (.not. (c <= 1.35d+69))) then
tmp = (t * ((a / c) * (-4.0d0))) + (((b / c) - ((x / (c / y)) * (-9.0d0))) / z)
else
tmp = (((-4.0d0) * (t * a)) + ((b - ((-9.0d0) * (x * y))) / z)) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -1.85e-88) || !(c <= 1.35e+69)) {
tmp = (t * ((a / c) * -4.0)) + (((b / c) - ((x / (c / y)) * -9.0)) / z);
} else {
tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (c <= -1.85e-88) or not (c <= 1.35e+69): tmp = (t * ((a / c) * -4.0)) + (((b / c) - ((x / (c / y)) * -9.0)) / z) else: tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -1.85e-88) || !(c <= 1.35e+69)) tmp = Float64(Float64(t * Float64(Float64(a / c) * -4.0)) + Float64(Float64(Float64(b / c) - Float64(Float64(x / Float64(c / y)) * -9.0)) / z)); else tmp = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(b - Float64(-9.0 * Float64(x * y))) / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((c <= -1.85e-88) || ~((c <= 1.35e+69)))
tmp = (t * ((a / c) * -4.0)) + (((b / c) - ((x / (c / y)) * -9.0)) / z);
else
tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[c, -1.85e-88], N[Not[LessEqual[c, 1.35e+69]], $MachinePrecision]], N[(N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b / c), $MachinePrecision] - N[(N[(x / N[(c / y), $MachinePrecision]), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(-9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.85 \cdot 10^{-88} \lor \neg \left(c \leq 1.35 \cdot 10^{+69}\right):\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right) + \frac{\frac{b}{c} - \frac{x}{\frac{c}{y}} \cdot -9}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right) + \frac{b - -9 \cdot \left(x \cdot y\right)}{z}}{c}\\
\end{array}
\end{array}
if c < -1.8499999999999999e-88 or 1.3499999999999999e69 < c Initial program 71.1%
associate-+l-71.1%
*-commutative71.1%
associate-*r*70.3%
*-commutative70.3%
associate-+l-70.3%
Simplified69.8%
Taylor expanded in x around 0 77.0%
cancel-sign-sub-inv77.0%
metadata-eval77.0%
+-commutative77.0%
*-commutative77.0%
fma-def77.0%
associate-/l*83.4%
associate-*r/83.4%
associate-*r*83.4%
*-commutative83.4%
associate-*r*83.4%
*-commutative83.4%
times-frac87.8%
fma-def87.8%
associate-/l*87.2%
associate-/r*90.4%
Simplified90.4%
Taylor expanded in z around -inf 83.6%
mul-1-neg83.6%
unsub-neg83.6%
associate-*l/91.0%
*-commutative91.0%
*-commutative91.0%
associate-*l*91.0%
mul-1-neg91.0%
unsub-neg91.0%
*-commutative91.0%
associate-/l*94.9%
Simplified94.9%
if -1.8499999999999999e-88 < c < 1.3499999999999999e69Initial program 88.6%
associate-+l-88.6%
*-commutative88.6%
associate-*r*87.9%
*-commutative87.9%
associate-+l-87.9%
Simplified91.3%
Taylor expanded in x around 0 78.9%
cancel-sign-sub-inv78.9%
metadata-eval78.9%
+-commutative78.9%
*-commutative78.9%
fma-def78.9%
associate-/l*75.4%
associate-*r/75.4%
associate-*r*75.4%
*-commutative75.4%
associate-*r*75.4%
*-commutative75.4%
times-frac74.4%
fma-def76.2%
associate-/l*76.2%
associate-/r*75.4%
Simplified75.4%
Taylor expanded in z around -inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-*l/76.6%
*-commutative76.6%
*-commutative76.6%
associate-*l*76.6%
mul-1-neg76.6%
unsub-neg76.6%
*-commutative76.6%
associate-/l*75.7%
Simplified75.7%
Taylor expanded in c around 0 93.6%
associate--l+93.6%
associate-*r/93.6%
sub-div96.3%
Applied egg-rr96.3%
Final simplification95.5%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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))))) (* c z)))
(t_2 (/ (+ (* -4.0 (* t a)) (/ (- b (* -9.0 (* x y))) z)) c)))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -2e-213)
t_1
(if (<= t_1 INFINITY)
t_2
(- (* t (* (/ a c) -4.0)) (* -9.0 (* (/ x c) (/ y z)))))))))assert(x < y);
assert(t < a);
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))))) / (c * z);
double t_2 = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -2e-213) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z)));
}
return tmp;
}
assert x < y;
assert t < a;
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))))) / (c * z);
double t_2 = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -2e-213) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z)));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z) t_2 = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -2e-213: tmp = t_1 elif t_1 <= math.inf: tmp = t_2 else: tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) 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(c * z)) t_2 = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(b - Float64(-9.0 * Float64(x * y))) / z)) / c) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -2e-213) tmp = t_1; elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(t * Float64(Float64(a / c) * -4.0)) - Float64(-9.0 * Float64(Float64(x / c) * Float64(y / z)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (c * z);
t_2 = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
tmp = 0.0;
if (t_1 <= -Inf)
tmp = t_2;
elseif (t_1 <= -2e-213)
tmp = t_1;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(-9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-213], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(-9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\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)}{c \cdot z}\\
t_2 := \frac{-4 \cdot \left(t \cdot a\right) + \frac{b - -9 \cdot \left(x \cdot y\right)}{z}}{c}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-213}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right) - -9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -inf.0 or -1.9999999999999999e-213 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
associate-*r*85.2%
*-commutative85.2%
associate-+l-85.2%
Simplified85.8%
Taylor expanded in x around 0 79.2%
cancel-sign-sub-inv79.2%
metadata-eval79.2%
+-commutative79.2%
*-commutative79.2%
fma-def79.2%
associate-/l*78.7%
associate-*r/78.7%
associate-*r*78.7%
*-commutative78.7%
associate-*r*78.7%
*-commutative78.7%
times-frac80.7%
fma-def81.8%
associate-/l*81.8%
associate-/r*85.1%
Simplified85.1%
Taylor expanded in z around -inf 87.6%
mul-1-neg87.6%
unsub-neg87.6%
associate-*l/86.4%
*-commutative86.4%
*-commutative86.4%
associate-*l*86.4%
mul-1-neg86.4%
unsub-neg86.4%
*-commutative86.4%
associate-/l*86.4%
Simplified86.4%
Taylor expanded in c around 0 91.1%
associate--l+91.1%
associate-*r/91.1%
sub-div93.4%
Applied egg-rr93.4%
if -inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -1.9999999999999999e-213Initial program 99.5%
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*10.1%
*-commutative10.1%
associate-+l-10.1%
Simplified10.1%
Taylor expanded in x around 0 40.7%
cancel-sign-sub-inv40.7%
metadata-eval40.7%
+-commutative40.7%
*-commutative40.7%
fma-def40.7%
associate-/l*53.9%
associate-*r/53.9%
associate-*r*53.9%
*-commutative53.9%
associate-*r*53.9%
*-commutative53.9%
times-frac85.5%
fma-def85.5%
associate-/l*85.5%
associate-/r*85.5%
Simplified85.5%
Taylor expanded in z around -inf 41.8%
mul-1-neg41.8%
unsub-neg41.8%
associate-*l/60.3%
*-commutative60.3%
*-commutative60.3%
associate-*l*60.3%
mul-1-neg60.3%
unsub-neg60.3%
*-commutative60.3%
associate-/l*84.1%
Simplified84.1%
Taylor expanded in x around inf 59.2%
times-frac90.8%
Simplified90.8%
Final simplification94.4%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* y (* x 9.0))))
(if (<= t_1 -5e+201)
(/ x (* (/ c y) (/ z 9.0)))
(if (<= t_1 2e+235)
(/ (+ (* -4.0 (* t a)) (/ (- b (* -9.0 (* x y))) z)) c)
(* 9.0 (* (/ x c) (/ y z)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -5e+201) {
tmp = x / ((c / y) * (z / 9.0));
} else if (t_1 <= 2e+235) {
tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
} else {
tmp = 9.0 * ((x / c) * (y / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = y * (x * 9.0d0)
if (t_1 <= (-5d+201)) then
tmp = x / ((c / y) * (z / 9.0d0))
else if (t_1 <= 2d+235) then
tmp = (((-4.0d0) * (t * a)) + ((b - ((-9.0d0) * (x * y))) / z)) / c
else
tmp = 9.0d0 * ((x / c) * (y / z))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = y * (x * 9.0);
double tmp;
if (t_1 <= -5e+201) {
tmp = x / ((c / y) * (z / 9.0));
} else if (t_1 <= 2e+235) {
tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
} else {
tmp = 9.0 * ((x / c) * (y / z));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = y * (x * 9.0) tmp = 0 if t_1 <= -5e+201: tmp = x / ((c / y) * (z / 9.0)) elif t_1 <= 2e+235: tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c else: tmp = 9.0 * ((x / c) * (y / z)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(y * Float64(x * 9.0)) tmp = 0.0 if (t_1 <= -5e+201) tmp = Float64(x / Float64(Float64(c / y) * Float64(z / 9.0))); elseif (t_1 <= 2e+235) tmp = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(Float64(b - Float64(-9.0 * Float64(x * y))) / z)) / c); else tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = y * (x * 9.0);
tmp = 0.0;
if (t_1 <= -5e+201)
tmp = x / ((c / y) * (z / 9.0));
elseif (t_1 <= 2e+235)
tmp = ((-4.0 * (t * a)) + ((b - (-9.0 * (x * y))) / z)) / c;
else
tmp = 9.0 * ((x / c) * (y / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+201], N[(x / N[(N[(c / y), $MachinePrecision] * N[(z / 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+235], N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(b - N[(-9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 9\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+201}:\\
\;\;\;\;\frac{x}{\frac{c}{y} \cdot \frac{z}{9}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+235}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right) + \frac{b - -9 \cdot \left(x \cdot y\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 x 9) y) < -4.9999999999999995e201Initial program 76.3%
associate-+l-76.3%
*-commutative76.3%
associate-*r*79.5%
*-commutative79.5%
associate-+l-79.5%
Simplified79.5%
Taylor expanded in x around inf 76.6%
associate-*r/76.5%
*-commutative76.5%
Simplified76.5%
times-frac74.1%
Applied egg-rr74.1%
clear-num74.1%
associate-/l*81.9%
frac-times93.3%
*-un-lft-identity93.3%
Applied egg-rr93.3%
if -4.9999999999999995e201 < (*.f64 (*.f64 x 9) y) < 2.0000000000000001e235Initial program 81.9%
associate-+l-81.9%
*-commutative81.9%
associate-*r*79.8%
*-commutative79.8%
associate-+l-79.8%
Simplified81.8%
Taylor expanded in x around 0 84.5%
cancel-sign-sub-inv84.5%
metadata-eval84.5%
+-commutative84.5%
*-commutative84.5%
fma-def84.5%
associate-/l*88.3%
associate-*r/88.3%
associate-*r*88.4%
*-commutative88.4%
associate-*r*88.3%
*-commutative88.3%
times-frac83.6%
fma-def84.7%
associate-/l*84.2%
associate-/r*85.2%
Simplified85.2%
Taylor expanded in z around -inf 89.0%
mul-1-neg89.0%
unsub-neg89.0%
associate-*l/92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*92.5%
mul-1-neg92.5%
unsub-neg92.5%
*-commutative92.5%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in c around 0 89.2%
associate--l+89.2%
associate-*r/89.1%
sub-div89.7%
Applied egg-rr89.7%
if 2.0000000000000001e235 < (*.f64 (*.f64 x 9) y) Initial program 58.2%
associate-+l-58.2%
*-commutative58.2%
associate-*r*61.7%
*-commutative61.7%
associate-+l-61.7%
Simplified58.2%
Taylor expanded in x around inf 61.8%
times-frac89.5%
Applied egg-rr89.5%
Final simplification90.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* t a))) (t_2 (/ (+ t_1 (/ b z)) c)))
(if (<= z -2.8e+67)
t_2
(if (<= z 5.6e-71)
(* (/ 1.0 z) (/ (+ b (* y (* x 9.0))) c))
(if (<= z 6.9e+151) (/ (- t_1 (* -9.0 (/ (* x y) z))) c) t_2)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (t * a);
double t_2 = (t_1 + (b / z)) / c;
double tmp;
if (z <= -2.8e+67) {
tmp = t_2;
} else if (z <= 5.6e-71) {
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
} else if (z <= 6.9e+151) {
tmp = (t_1 - (-9.0 * ((x * y) / z))) / c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = (t_1 + (b / z)) / c
if (z <= (-2.8d+67)) then
tmp = t_2
else if (z <= 5.6d-71) then
tmp = (1.0d0 / z) * ((b + (y * (x * 9.0d0))) / c)
else if (z <= 6.9d+151) then
tmp = (t_1 - ((-9.0d0) * ((x * y) / z))) / c
else
tmp = t_2
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (t * a);
double t_2 = (t_1 + (b / z)) / c;
double tmp;
if (z <= -2.8e+67) {
tmp = t_2;
} else if (z <= 5.6e-71) {
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
} else if (z <= 6.9e+151) {
tmp = (t_1 - (-9.0 * ((x * y) / z))) / c;
} else {
tmp = t_2;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (t * a) t_2 = (t_1 + (b / z)) / c tmp = 0 if z <= -2.8e+67: tmp = t_2 elif z <= 5.6e-71: tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c) elif z <= 6.9e+151: tmp = (t_1 - (-9.0 * ((x * y) / z))) / c else: tmp = t_2 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(t * a)) t_2 = Float64(Float64(t_1 + Float64(b / z)) / c) tmp = 0.0 if (z <= -2.8e+67) tmp = t_2; elseif (z <= 5.6e-71) tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + Float64(y * Float64(x * 9.0))) / c)); elseif (z <= 6.9e+151) tmp = Float64(Float64(t_1 - Float64(-9.0 * Float64(Float64(x * y) / z))) / c); else tmp = t_2; end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (t * a);
t_2 = (t_1 + (b / z)) / c;
tmp = 0.0;
if (z <= -2.8e+67)
tmp = t_2;
elseif (z <= 5.6e-71)
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
elseif (z <= 6.9e+151)
tmp = (t_1 - (-9.0 * ((x * y) / z))) / c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.8e+67], t$95$2, If[LessEqual[z, 5.6e-71], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.9e+151], N[(N[(t$95$1 - N[(-9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := \frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-71}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + y \cdot \left(x \cdot 9\right)}{c}\\
\mathbf{elif}\;z \leq 6.9 \cdot 10^{+151}:\\
\;\;\;\;\frac{t_1 - -9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.7999999999999998e67 or 6.90000000000000025e151 < z Initial program 56.9%
associate-+l-56.9%
*-commutative56.9%
associate-*r*54.6%
*-commutative54.6%
associate-+l-54.6%
Simplified59.9%
Taylor expanded in x around 0 76.2%
cancel-sign-sub-inv76.2%
metadata-eval76.2%
+-commutative76.2%
*-commutative76.2%
fma-def76.2%
associate-/l*77.3%
associate-*r/77.3%
associate-*r*77.2%
*-commutative77.2%
associate-*r*77.2%
*-commutative77.2%
times-frac89.4%
fma-def89.4%
associate-/l*89.4%
associate-/r*90.4%
Simplified90.4%
Taylor expanded in z around -inf 77.3%
mul-1-neg77.3%
unsub-neg77.3%
associate-*l/79.8%
*-commutative79.8%
*-commutative79.8%
associate-*l*79.8%
mul-1-neg79.8%
unsub-neg79.8%
*-commutative79.8%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in c around 0 83.5%
Taylor expanded in x around 0 74.1%
if -2.7999999999999998e67 < z < 5.60000000000000001e-71Initial program 95.1%
associate-+l-95.1%
*-commutative95.1%
associate-*r*94.4%
*-commutative94.4%
associate-+l-94.4%
Simplified92.0%
*-un-lft-identity92.0%
times-frac93.4%
associate-+l-93.4%
associate-*r*96.5%
associate-+l-96.5%
associate-*l*96.6%
associate-*r*93.5%
Applied egg-rr93.5%
Taylor expanded in x around inf 82.9%
*-commutative82.9%
associate-*r*82.9%
*-commutative82.9%
associate-*l*82.9%
Simplified82.9%
if 5.60000000000000001e-71 < z < 6.90000000000000025e151Initial program 78.4%
associate-+l-78.4%
*-commutative78.4%
associate-*r*81.1%
*-commutative81.1%
associate-+l-81.1%
Simplified83.2%
Taylor expanded in x around 0 81.0%
cancel-sign-sub-inv81.0%
metadata-eval81.0%
+-commutative81.0%
*-commutative81.0%
fma-def81.0%
associate-/l*78.4%
associate-*r/78.3%
associate-*r*78.4%
*-commutative78.4%
associate-*r*78.3%
*-commutative78.3%
times-frac87.4%
fma-def87.4%
associate-/l*85.5%
associate-/r*85.5%
Simplified85.5%
Taylor expanded in z around -inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-*l/81.1%
*-commutative81.1%
*-commutative81.1%
associate-*l*81.1%
mul-1-neg81.1%
unsub-neg81.1%
*-commutative81.1%
associate-/l*81.2%
Simplified81.2%
Taylor expanded in c around 0 88.2%
Taylor expanded in b around 0 80.5%
Final simplification79.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -1e+67) (not (<= z 1.1e-101))) (- (* t (* (/ a c) -4.0)) (* -9.0 (* (/ x c) (/ y z)))) (* (/ 1.0 z) (/ (+ b (* y (* x 9.0))) c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1e+67) || !(z <= 1.1e-101)) {
tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z)));
} else {
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-1d+67)) .or. (.not. (z <= 1.1d-101))) then
tmp = (t * ((a / c) * (-4.0d0))) - ((-9.0d0) * ((x / c) * (y / z)))
else
tmp = (1.0d0 / z) * ((b + (y * (x * 9.0d0))) / c)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -1e+67) || !(z <= 1.1e-101)) {
tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z)));
} else {
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -1e+67) or not (z <= 1.1e-101): tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z))) else: tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -1e+67) || !(z <= 1.1e-101)) tmp = Float64(Float64(t * Float64(Float64(a / c) * -4.0)) - Float64(-9.0 * Float64(Float64(x / c) * Float64(y / z)))); else tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + Float64(y * Float64(x * 9.0))) / c)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -1e+67) || ~((z <= 1.1e-101)))
tmp = (t * ((a / c) * -4.0)) - (-9.0 * ((x / c) * (y / z)));
else
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -1e+67], N[Not[LessEqual[z, 1.1e-101]], $MachinePrecision]], N[(N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] - N[(-9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+67} \lor \neg \left(z \leq 1.1 \cdot 10^{-101}\right):\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right) - -9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + y \cdot \left(x \cdot 9\right)}{c}\\
\end{array}
\end{array}
if z < -9.99999999999999983e66 or 1.0999999999999999e-101 < z Initial program 64.8%
associate-+l-64.8%
*-commutative64.8%
associate-*r*64.1%
*-commutative64.1%
associate-+l-64.1%
Simplified67.5%
Taylor expanded in x around 0 77.6%
cancel-sign-sub-inv77.6%
metadata-eval77.6%
+-commutative77.6%
*-commutative77.6%
fma-def77.6%
associate-/l*78.2%
associate-*r/78.2%
associate-*r*78.2%
*-commutative78.2%
associate-*r*78.1%
*-commutative78.1%
times-frac89.4%
fma-def89.4%
associate-/l*88.9%
associate-/r*89.5%
Simplified89.5%
Taylor expanded in z around -inf 78.4%
mul-1-neg78.4%
unsub-neg78.4%
associate-*l/80.7%
*-commutative80.7%
*-commutative80.7%
associate-*l*80.7%
mul-1-neg80.7%
unsub-neg80.7%
*-commutative80.7%
associate-/l*86.1%
Simplified86.1%
Taylor expanded in x around inf 68.8%
times-frac76.6%
Simplified76.6%
if -9.99999999999999983e66 < z < 1.0999999999999999e-101Initial program 95.6%
associate-+l-95.6%
*-commutative95.6%
associate-*r*94.8%
*-commutative94.8%
associate-+l-94.8%
Simplified93.1%
*-un-lft-identity93.1%
times-frac94.6%
associate-+l-94.6%
associate-*r*97.1%
associate-+l-97.1%
associate-*l*97.2%
associate-*r*94.7%
Applied egg-rr94.7%
Taylor expanded in x around inf 84.2%
*-commutative84.2%
associate-*r*84.3%
*-commutative84.3%
associate-*l*84.2%
Simplified84.2%
Final simplification80.0%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ (* -4.0 (* t a)) (/ b z)) c)))
(if (<= z -2.35e+66)
t_1
(if (<= z 6.2e-14)
(/ (+ b (* (* x y) 9.0)) (* c z))
(if (or (<= z 1e+130) (not (<= z 8.5e+150)))
t_1
(* 9.0 (* (/ x z) (/ y c))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((-4.0 * (t * a)) + (b / z)) / c;
double tmp;
if (z <= -2.35e+66) {
tmp = t_1;
} else if (z <= 6.2e-14) {
tmp = (b + ((x * y) * 9.0)) / (c * z);
} else if ((z <= 1e+130) || !(z <= 8.5e+150)) {
tmp = t_1;
} else {
tmp = 9.0 * ((x / z) * (y / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = (((-4.0d0) * (t * a)) + (b / z)) / c
if (z <= (-2.35d+66)) then
tmp = t_1
else if (z <= 6.2d-14) then
tmp = (b + ((x * y) * 9.0d0)) / (c * z)
else if ((z <= 1d+130) .or. (.not. (z <= 8.5d+150))) then
tmp = t_1
else
tmp = 9.0d0 * ((x / z) * (y / c))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((-4.0 * (t * a)) + (b / z)) / c;
double tmp;
if (z <= -2.35e+66) {
tmp = t_1;
} else if (z <= 6.2e-14) {
tmp = (b + ((x * y) * 9.0)) / (c * z);
} else if ((z <= 1e+130) || !(z <= 8.5e+150)) {
tmp = t_1;
} else {
tmp = 9.0 * ((x / z) * (y / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = ((-4.0 * (t * a)) + (b / z)) / c tmp = 0 if z <= -2.35e+66: tmp = t_1 elif z <= 6.2e-14: tmp = (b + ((x * y) * 9.0)) / (c * z) elif (z <= 1e+130) or not (z <= 8.5e+150): tmp = t_1 else: tmp = 9.0 * ((x / z) * (y / c)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(b / z)) / c) tmp = 0.0 if (z <= -2.35e+66) tmp = t_1; elseif (z <= 6.2e-14) tmp = Float64(Float64(b + Float64(Float64(x * y) * 9.0)) / Float64(c * z)); elseif ((z <= 1e+130) || !(z <= 8.5e+150)) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = ((-4.0 * (t * a)) + (b / z)) / c;
tmp = 0.0;
if (z <= -2.35e+66)
tmp = t_1;
elseif (z <= 6.2e-14)
tmp = (b + ((x * y) * 9.0)) / (c * z);
elseif ((z <= 1e+130) || ~((z <= 8.5e+150)))
tmp = t_1;
else
tmp = 9.0 * ((x / z) * (y / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -2.35e+66], t$95$1, If[LessEqual[z, 6.2e-14], N[(N[(b + N[(N[(x * y), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1e+130], N[Not[LessEqual[z, 8.5e+150]], $MachinePrecision]], t$95$1, N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(t \cdot a\right) + \frac{b}{z}}{c}\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{b + \left(x \cdot y\right) \cdot 9}{c \cdot z}\\
\mathbf{elif}\;z \leq 10^{+130} \lor \neg \left(z \leq 8.5 \cdot 10^{+150}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if z < -2.3500000000000001e66 or 6.20000000000000009e-14 < z < 1.0000000000000001e130 or 8.4999999999999999e150 < z Initial program 62.1%
associate-+l-62.1%
*-commutative62.1%
associate-*r*60.4%
*-commutative60.4%
associate-+l-60.4%
Simplified66.1%
Taylor expanded in x around 0 78.9%
cancel-sign-sub-inv78.9%
metadata-eval78.9%
+-commutative78.9%
*-commutative78.9%
fma-def78.9%
associate-/l*79.7%
associate-*r/79.7%
associate-*r*79.7%
*-commutative79.7%
associate-*r*79.7%
*-commutative79.7%
times-frac89.3%
fma-def89.3%
associate-/l*89.3%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in z around -inf 79.8%
mul-1-neg79.8%
unsub-neg79.8%
associate-*l/81.8%
*-commutative81.8%
*-commutative81.8%
associate-*l*81.8%
mul-1-neg81.8%
unsub-neg81.8%
*-commutative81.8%
associate-/l*87.4%
Simplified87.4%
Taylor expanded in c around 0 86.3%
Taylor expanded in x around 0 73.6%
if -2.3500000000000001e66 < z < 6.20000000000000009e-14Initial program 96.1%
associate-+l-96.1%
*-commutative96.1%
associate-*r*95.4%
*-commutative95.4%
associate-+l-95.4%
Simplified92.5%
Taylor expanded in x around inf 81.6%
if 1.0000000000000001e130 < z < 8.4999999999999999e150Initial program 31.5%
associate-+l-31.5%
*-commutative31.5%
associate-*r*45.8%
*-commutative45.8%
associate-+l-45.8%
Simplified45.8%
Taylor expanded in x around inf 45.8%
div-inv45.5%
*-commutative45.5%
Applied egg-rr45.5%
associate-*r/45.8%
*-rgt-identity45.8%
times-frac99.6%
Simplified99.6%
Final simplification78.4%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (+ (* -4.0 (* t a)) (/ b z)) c)))
(if (<= z -3.2e+68)
t_1
(if (<= z 4000000.0)
(* (/ 1.0 z) (/ (+ b (* y (* x 9.0))) c))
(if (or (<= z 8.8e+130) (not (<= z 8.5e+150)))
t_1
(* 9.0 (* (/ x z) (/ y c))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((-4.0 * (t * a)) + (b / z)) / c;
double tmp;
if (z <= -3.2e+68) {
tmp = t_1;
} else if (z <= 4000000.0) {
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
} else if ((z <= 8.8e+130) || !(z <= 8.5e+150)) {
tmp = t_1;
} else {
tmp = 9.0 * ((x / z) * (y / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = (((-4.0d0) * (t * a)) + (b / z)) / c
if (z <= (-3.2d+68)) then
tmp = t_1
else if (z <= 4000000.0d0) then
tmp = (1.0d0 / z) * ((b + (y * (x * 9.0d0))) / c)
else if ((z <= 8.8d+130) .or. (.not. (z <= 8.5d+150))) then
tmp = t_1
else
tmp = 9.0d0 * ((x / z) * (y / c))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((-4.0 * (t * a)) + (b / z)) / c;
double tmp;
if (z <= -3.2e+68) {
tmp = t_1;
} else if (z <= 4000000.0) {
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
} else if ((z <= 8.8e+130) || !(z <= 8.5e+150)) {
tmp = t_1;
} else {
tmp = 9.0 * ((x / z) * (y / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = ((-4.0 * (t * a)) + (b / z)) / c tmp = 0 if z <= -3.2e+68: tmp = t_1 elif z <= 4000000.0: tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c) elif (z <= 8.8e+130) or not (z <= 8.5e+150): tmp = t_1 else: tmp = 9.0 * ((x / z) * (y / c)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(b / z)) / c) tmp = 0.0 if (z <= -3.2e+68) tmp = t_1; elseif (z <= 4000000.0) tmp = Float64(Float64(1.0 / z) * Float64(Float64(b + Float64(y * Float64(x * 9.0))) / c)); elseif ((z <= 8.8e+130) || !(z <= 8.5e+150)) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = ((-4.0 * (t * a)) + (b / z)) / c;
tmp = 0.0;
if (z <= -3.2e+68)
tmp = t_1;
elseif (z <= 4000000.0)
tmp = (1.0 / z) * ((b + (y * (x * 9.0))) / c);
elseif ((z <= 8.8e+130) || ~((z <= 8.5e+150)))
tmp = t_1;
else
tmp = 9.0 * ((x / z) * (y / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -3.2e+68], t$95$1, If[LessEqual[z, 4000000.0], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(b + N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 8.8e+130], N[Not[LessEqual[z, 8.5e+150]], $MachinePrecision]], t$95$1, N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{-4 \cdot \left(t \cdot a\right) + \frac{b}{z}}{c}\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4000000:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b + y \cdot \left(x \cdot 9\right)}{c}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+130} \lor \neg \left(z \leq 8.5 \cdot 10^{+150}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if z < -3.19999999999999994e68 or 4e6 < z < 8.79999999999999974e130 or 8.4999999999999999e150 < z Initial program 61.6%
associate-+l-61.6%
*-commutative61.6%
associate-*r*59.8%
*-commutative59.8%
associate-+l-59.8%
Simplified65.7%
Taylor expanded in x around 0 79.1%
cancel-sign-sub-inv79.1%
metadata-eval79.1%
+-commutative79.1%
*-commutative79.1%
fma-def79.1%
associate-/l*79.8%
associate-*r/79.8%
associate-*r*79.8%
*-commutative79.8%
associate-*r*79.8%
*-commutative79.8%
times-frac89.7%
fma-def89.7%
associate-/l*89.7%
associate-/r*90.5%
Simplified90.5%
Taylor expanded in z around -inf 79.1%
mul-1-neg79.1%
unsub-neg79.1%
associate-*l/81.2%
*-commutative81.2%
*-commutative81.2%
associate-*l*81.2%
mul-1-neg81.2%
unsub-neg81.2%
*-commutative81.2%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in c around 0 85.8%
Taylor expanded in x around 0 74.0%
if -3.19999999999999994e68 < z < 4e6Initial program 95.5%
associate-+l-95.5%
*-commutative95.5%
associate-*r*94.9%
*-commutative94.9%
associate-+l-94.9%
Simplified92.0%
*-un-lft-identity92.0%
times-frac93.2%
associate-+l-93.2%
associate-*r*96.8%
associate-+l-96.8%
associate-*l*96.8%
associate-*r*93.3%
Applied egg-rr93.3%
Taylor expanded in x around inf 81.4%
*-commutative81.4%
associate-*r*81.4%
*-commutative81.4%
associate-*l*81.4%
Simplified81.4%
if 8.79999999999999974e130 < z < 8.4999999999999999e150Initial program 31.5%
associate-+l-31.5%
*-commutative31.5%
associate-*r*45.8%
*-commutative45.8%
associate-+l-45.8%
Simplified45.8%
Taylor expanded in x around inf 45.8%
div-inv45.5%
*-commutative45.5%
Applied egg-rr45.5%
associate-*r/45.8%
*-rgt-identity45.8%
times-frac99.6%
Simplified99.6%
Final simplification78.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -1.28e+137)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= x 8e-11)
(/ (+ (* -4.0 (* t a)) (/ b z)) c)
(* (/ 9.0 z) (* x (/ y c))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.28e+137) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (x <= 8e-11) {
tmp = ((-4.0 * (t * a)) + (b / z)) / c;
} else {
tmp = (9.0 / z) * (x * (y / c));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 (x <= (-1.28d+137)) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (x <= 8d-11) then
tmp = (((-4.0d0) * (t * a)) + (b / z)) / c
else
tmp = (9.0d0 / z) * (x * (y / c))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -1.28e+137) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (x <= 8e-11) {
tmp = ((-4.0 * (t * a)) + (b / z)) / c;
} else {
tmp = (9.0 / z) * (x * (y / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if x <= -1.28e+137: tmp = 9.0 * ((x / c) * (y / z)) elif x <= 8e-11: tmp = ((-4.0 * (t * a)) + (b / z)) / c else: tmp = (9.0 / z) * (x * (y / c)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -1.28e+137) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (x <= 8e-11) tmp = Float64(Float64(Float64(-4.0 * Float64(t * a)) + Float64(b / z)) / c); else tmp = Float64(Float64(9.0 / z) * Float64(x * Float64(y / c))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (x <= -1.28e+137)
tmp = 9.0 * ((x / c) * (y / z));
elseif (x <= 8e-11)
tmp = ((-4.0 * (t * a)) + (b / z)) / c;
else
tmp = (9.0 / z) * (x * (y / c));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -1.28e+137], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-11], N[(N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(9.0 / z), $MachinePrecision] * N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.28 \cdot 10^{+137}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{9}{z} \cdot \left(x \cdot \frac{y}{c}\right)\\
\end{array}
\end{array}
if x < -1.27999999999999995e137Initial program 77.3%
associate-+l-77.3%
*-commutative77.3%
associate-*r*75.1%
*-commutative75.1%
associate-+l-75.1%
Simplified75.2%
Taylor expanded in x around inf 60.9%
times-frac77.8%
Applied egg-rr77.8%
if -1.27999999999999995e137 < x < 7.99999999999999952e-11Initial program 82.8%
associate-+l-82.8%
*-commutative82.8%
associate-*r*82.8%
*-commutative82.8%
associate-+l-82.8%
Simplified84.8%
Taylor expanded in x around 0 85.0%
cancel-sign-sub-inv85.0%
metadata-eval85.0%
+-commutative85.0%
*-commutative85.0%
fma-def85.0%
associate-/l*87.7%
associate-*r/87.7%
associate-*r*87.7%
*-commutative87.7%
associate-*r*87.7%
*-commutative87.7%
times-frac85.6%
fma-def86.3%
associate-/l*86.3%
associate-/r*89.1%
Simplified89.1%
Taylor expanded in z around -inf 90.7%
mul-1-neg90.7%
unsub-neg90.7%
associate-*l/93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*93.7%
mul-1-neg93.7%
unsub-neg93.7%
*-commutative93.7%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in c around 0 89.5%
Taylor expanded in x around 0 80.1%
if 7.99999999999999952e-11 < x Initial program 71.4%
associate-+l-71.4%
*-commutative71.4%
associate-*r*70.0%
*-commutative70.0%
associate-+l-70.0%
Simplified70.2%
Taylor expanded in x around inf 45.3%
associate-*r/45.3%
*-commutative45.3%
Simplified45.3%
times-frac45.8%
Applied egg-rr45.8%
expm1-log1p-u28.6%
expm1-udef21.8%
associate-/l*25.2%
Applied egg-rr25.2%
expm1-def29.4%
expm1-log1p48.4%
associate-/l*45.8%
*-rgt-identity45.8%
associate-*r/45.8%
associate-*l*49.9%
associate-*r/49.9%
*-rgt-identity49.9%
Simplified49.9%
Final simplification70.9%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -1.22e+73)
(* -4.0 (/ a (/ c t)))
(if (<= t -2.9e-196)
(* 9.0 (* (/ x c) (/ y z)))
(if (<= t 3.4e-187) (* (/ b c) (/ 1.0 z)) (* t (* (/ a c) -4.0))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.22e+73) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -2.9e-196) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (t <= 3.4e-187) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t * ((a / c) * -4.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.22d+73)) then
tmp = (-4.0d0) * (a / (c / t))
else if (t <= (-2.9d-196)) then
tmp = 9.0d0 * ((x / c) * (y / z))
else if (t <= 3.4d-187) then
tmp = (b / c) * (1.0d0 / z)
else
tmp = t * ((a / c) * (-4.0d0))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.22e+73) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -2.9e-196) {
tmp = 9.0 * ((x / c) * (y / z));
} else if (t <= 3.4e-187) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t * ((a / c) * -4.0);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -1.22e+73: tmp = -4.0 * (a / (c / t)) elif t <= -2.9e-196: tmp = 9.0 * ((x / c) * (y / z)) elif t <= 3.4e-187: tmp = (b / c) * (1.0 / z) else: tmp = t * ((a / c) * -4.0) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -1.22e+73) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (t <= -2.9e-196) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); elseif (t <= 3.4e-187) tmp = Float64(Float64(b / c) * Float64(1.0 / z)); else tmp = Float64(t * Float64(Float64(a / c) * -4.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -1.22e+73)
tmp = -4.0 * (a / (c / t));
elseif (t <= -2.9e-196)
tmp = 9.0 * ((x / c) * (y / z));
elseif (t <= 3.4e-187)
tmp = (b / c) * (1.0 / z);
else
tmp = t * ((a / c) * -4.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -1.22e+73], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.9e-196], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-187], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+73}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-196}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-187}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right)\\
\end{array}
\end{array}
if t < -1.21999999999999998e73Initial program 65.3%
associate-+l-65.3%
*-commutative65.3%
associate-*r*71.7%
*-commutative71.7%
associate-+l-71.7%
Simplified67.8%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
associate-/l*59.5%
Simplified59.5%
if -1.21999999999999998e73 < t < -2.89999999999999987e-196Initial program 89.3%
associate-+l-89.3%
*-commutative89.3%
associate-*r*83.3%
*-commutative83.3%
associate-+l-83.3%
Simplified89.3%
Taylor expanded in x around inf 44.8%
times-frac47.4%
Applied egg-rr47.4%
if -2.89999999999999987e-196 < t < 3.4000000000000001e-187Initial program 85.9%
associate-+l-85.9%
*-commutative85.9%
associate-*r*77.5%
*-commutative77.5%
associate-+l-77.5%
Simplified85.9%
*-un-lft-identity85.9%
times-frac91.7%
associate-+l-91.7%
associate-*r*91.7%
associate-+l-91.7%
associate-*l*91.7%
associate-*r*91.7%
Applied egg-rr91.7%
Taylor expanded in b around inf 51.2%
if 3.4000000000000001e-187 < t Initial program 76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
Simplified76.4%
Taylor expanded in x around 0 80.1%
cancel-sign-sub-inv80.1%
metadata-eval80.1%
+-commutative80.1%
*-commutative80.1%
fma-def80.1%
associate-/l*81.7%
associate-*r/81.7%
associate-*r*81.7%
*-commutative81.7%
associate-*r*81.7%
*-commutative81.7%
times-frac82.3%
fma-def83.2%
associate-/l*82.5%
associate-/r*82.6%
Simplified82.6%
Taylor expanded in a around inf 44.3%
associate-*l/48.2%
*-commutative48.2%
*-commutative48.2%
associate-*l*48.2%
Simplified48.2%
Final simplification50.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -1.6e+71)
(* -4.0 (/ a (/ c t)))
(if (<= t -8e-201)
(* 9.0 (* (/ x z) (/ y c)))
(if (<= t 8.5e-188) (* (/ b c) (/ 1.0 z)) (* t (* (/ a c) -4.0))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.6e+71) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -8e-201) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (t <= 8.5e-188) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t * ((a / c) * -4.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.6d+71)) then
tmp = (-4.0d0) * (a / (c / t))
else if (t <= (-8d-201)) then
tmp = 9.0d0 * ((x / z) * (y / c))
else if (t <= 8.5d-188) then
tmp = (b / c) * (1.0d0 / z)
else
tmp = t * ((a / c) * (-4.0d0))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -1.6e+71) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -8e-201) {
tmp = 9.0 * ((x / z) * (y / c));
} else if (t <= 8.5e-188) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t * ((a / c) * -4.0);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -1.6e+71: tmp = -4.0 * (a / (c / t)) elif t <= -8e-201: tmp = 9.0 * ((x / z) * (y / c)) elif t <= 8.5e-188: tmp = (b / c) * (1.0 / z) else: tmp = t * ((a / c) * -4.0) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -1.6e+71) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (t <= -8e-201) tmp = Float64(9.0 * Float64(Float64(x / z) * Float64(y / c))); elseif (t <= 8.5e-188) tmp = Float64(Float64(b / c) * Float64(1.0 / z)); else tmp = Float64(t * Float64(Float64(a / c) * -4.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -1.6e+71)
tmp = -4.0 * (a / (c / t));
elseif (t <= -8e-201)
tmp = 9.0 * ((x / z) * (y / c));
elseif (t <= 8.5e-188)
tmp = (b / c) * (1.0 / z);
else
tmp = t * ((a / c) * -4.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -1.6e+71], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8e-201], N[(9.0 * N[(N[(x / z), $MachinePrecision] * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-188], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+71}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-201}:\\
\;\;\;\;9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-188}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right)\\
\end{array}
\end{array}
if t < -1.60000000000000012e71Initial program 65.3%
associate-+l-65.3%
*-commutative65.3%
associate-*r*71.7%
*-commutative71.7%
associate-+l-71.7%
Simplified67.8%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
associate-/l*59.5%
Simplified59.5%
if -1.60000000000000012e71 < t < -7.99999999999999957e-201Initial program 89.5%
associate-+l-89.5%
*-commutative89.5%
associate-*r*83.7%
*-commutative83.7%
associate-+l-83.7%
Simplified89.6%
Taylor expanded in x around inf 43.9%
div-inv43.8%
*-commutative43.8%
Applied egg-rr43.8%
associate-*r/43.9%
*-rgt-identity43.9%
times-frac44.3%
Simplified44.3%
if -7.99999999999999957e-201 < t < 8.5000000000000004e-188Initial program 85.6%
associate-+l-85.6%
*-commutative85.6%
associate-*r*77.0%
*-commutative77.0%
associate-+l-77.0%
Simplified85.6%
*-un-lft-identity85.6%
times-frac93.6%
associate-+l-93.6%
associate-*r*93.6%
associate-+l-93.6%
associate-*l*93.6%
associate-*r*93.6%
Applied egg-rr93.6%
Taylor expanded in b around inf 52.2%
if 8.5000000000000004e-188 < t Initial program 76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
Simplified76.4%
Taylor expanded in x around 0 80.1%
cancel-sign-sub-inv80.1%
metadata-eval80.1%
+-commutative80.1%
*-commutative80.1%
fma-def80.1%
associate-/l*81.7%
associate-*r/81.7%
associate-*r*81.7%
*-commutative81.7%
associate-*r*81.7%
*-commutative81.7%
times-frac82.3%
fma-def83.2%
associate-/l*82.5%
associate-/r*82.6%
Simplified82.6%
Taylor expanded in a around inf 44.3%
associate-*l/48.2%
*-commutative48.2%
*-commutative48.2%
associate-*l*48.2%
Simplified48.2%
Final simplification50.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= t -3.7e+71)
(* -4.0 (/ a (/ c t)))
(if (<= t -8.6e-199)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= t 7.8e-187) (* (/ b c) (/ 1.0 z)) (* t (* (/ a c) -4.0))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -3.7e+71) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -8.6e-199) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (t <= 7.8e-187) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t * ((a / c) * -4.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-3.7d+71)) then
tmp = (-4.0d0) * (a / (c / t))
else if (t <= (-8.6d-199)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (t <= 7.8d-187) then
tmp = (b / c) * (1.0d0 / z)
else
tmp = t * ((a / c) * (-4.0d0))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (t <= -3.7e+71) {
tmp = -4.0 * (a / (c / t));
} else if (t <= -8.6e-199) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (t <= 7.8e-187) {
tmp = (b / c) * (1.0 / z);
} else {
tmp = t * ((a / c) * -4.0);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if t <= -3.7e+71: tmp = -4.0 * (a / (c / t)) elif t <= -8.6e-199: tmp = 9.0 * (y / (z / (x / c))) elif t <= 7.8e-187: tmp = (b / c) * (1.0 / z) else: tmp = t * ((a / c) * -4.0) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (t <= -3.7e+71) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (t <= -8.6e-199) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (t <= 7.8e-187) tmp = Float64(Float64(b / c) * Float64(1.0 / z)); else tmp = Float64(t * Float64(Float64(a / c) * -4.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (t <= -3.7e+71)
tmp = -4.0 * (a / (c / t));
elseif (t <= -8.6e-199)
tmp = 9.0 * (y / (z / (x / c)));
elseif (t <= 7.8e-187)
tmp = (b / c) * (1.0 / z);
else
tmp = t * ((a / c) * -4.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[t, -3.7e+71], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.6e-199], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-187], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+71}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;t \leq -8.6 \cdot 10^{-199}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-187}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right)\\
\end{array}
\end{array}
if t < -3.7e71Initial program 65.3%
associate-+l-65.3%
*-commutative65.3%
associate-*r*71.7%
*-commutative71.7%
associate-+l-71.7%
Simplified67.8%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
associate-/l*59.5%
Simplified59.5%
if -3.7e71 < t < -8.6000000000000007e-199Initial program 89.3%
associate-+l-89.3%
*-commutative89.3%
associate-*r*83.3%
*-commutative83.3%
associate-+l-83.3%
Simplified89.3%
Taylor expanded in x around 0 83.2%
cancel-sign-sub-inv83.2%
metadata-eval83.2%
+-commutative83.2%
*-commutative83.2%
fma-def83.2%
associate-/l*83.2%
associate-*r/83.1%
associate-*r*83.3%
*-commutative83.3%
associate-*r*83.2%
*-commutative83.2%
times-frac87.1%
fma-def87.1%
associate-/l*87.1%
associate-/r*87.1%
Simplified87.1%
Taylor expanded in z around -inf 83.4%
mul-1-neg83.4%
unsub-neg83.4%
associate-*l/83.4%
*-commutative83.4%
*-commutative83.4%
associate-*l*83.4%
mul-1-neg83.4%
unsub-neg83.4%
*-commutative83.4%
associate-/l*87.4%
Simplified87.4%
Taylor expanded in x around inf 44.8%
*-commutative44.8%
associate-/r*39.4%
associate-*l/43.5%
*-commutative43.5%
associate-/l*45.4%
Simplified45.4%
if -8.6000000000000007e-199 < t < 7.7999999999999998e-187Initial program 85.9%
associate-+l-85.9%
*-commutative85.9%
associate-*r*77.5%
*-commutative77.5%
associate-+l-77.5%
Simplified85.9%
*-un-lft-identity85.9%
times-frac91.7%
associate-+l-91.7%
associate-*r*91.7%
associate-+l-91.7%
associate-*l*91.7%
associate-*r*91.7%
Applied egg-rr91.7%
Taylor expanded in b around inf 51.2%
if 7.7999999999999998e-187 < t Initial program 76.6%
associate-+l-76.6%
*-commutative76.6%
associate-*r*78.2%
*-commutative78.2%
associate-+l-78.2%
Simplified76.4%
Taylor expanded in x around 0 80.1%
cancel-sign-sub-inv80.1%
metadata-eval80.1%
+-commutative80.1%
*-commutative80.1%
fma-def80.1%
associate-/l*81.7%
associate-*r/81.7%
associate-*r*81.7%
*-commutative81.7%
associate-*r*81.7%
*-commutative81.7%
times-frac82.3%
fma-def83.2%
associate-/l*82.5%
associate-/r*82.6%
Simplified82.6%
Taylor expanded in a around inf 44.3%
associate-*l/48.2%
*-commutative48.2%
*-commutative48.2%
associate-*l*48.2%
Simplified48.2%
Final simplification50.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -1.95e+27) (not (<= t 1.4e-186))) (* -4.0 (/ (* t a) c)) (/ (/ b c) z)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.95e+27) || !(t <= 1.4e-186)) {
tmp = -4.0 * ((t * a) / c);
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.95d+27)) .or. (.not. (t <= 1.4d-186))) then
tmp = (-4.0d0) * ((t * a) / c)
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -1.95e+27) || !(t <= 1.4e-186)) {
tmp = -4.0 * ((t * a) / c);
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -1.95e+27) or not (t <= 1.4e-186): tmp = -4.0 * ((t * a) / c) else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -1.95e+27) || !(t <= 1.4e-186)) tmp = Float64(-4.0 * Float64(Float64(t * a) / c)); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -1.95e+27) || ~((t <= 1.4e-186)))
tmp = -4.0 * ((t * a) / c);
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -1.95e+27], N[Not[LessEqual[t, 1.4e-186]], $MachinePrecision]], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+27} \lor \neg \left(t \leq 1.4 \cdot 10^{-186}\right):\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if t < -1.9499999999999999e27 or 1.39999999999999992e-186 < t Initial program 73.6%
associate-+l-73.6%
*-commutative73.6%
associate-*r*76.5%
*-commutative76.5%
associate-+l-76.5%
Simplified74.2%
Taylor expanded in z around inf 45.6%
if -1.9499999999999999e27 < t < 1.39999999999999992e-186Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*80.1%
*-commutative80.1%
associate-+l-80.1%
Simplified87.8%
Taylor expanded in b around inf 46.3%
associate-/r*48.5%
Simplified48.5%
Final simplification46.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= t -8.2e+27) (not (<= t 4.4e-187))) (* t (* (/ a c) -4.0)) (/ (/ b c) z)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -8.2e+27) || !(t <= 4.4e-187)) {
tmp = t * ((a / c) * -4.0);
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-8.2d+27)) .or. (.not. (t <= 4.4d-187))) then
tmp = t * ((a / c) * (-4.0d0))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -8.2e+27) || !(t <= 4.4e-187)) {
tmp = t * ((a / c) * -4.0);
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -8.2e+27) or not (t <= 4.4e-187): tmp = t * ((a / c) * -4.0) else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -8.2e+27) || !(t <= 4.4e-187)) tmp = Float64(t * Float64(Float64(a / c) * -4.0)); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -8.2e+27) || ~((t <= 4.4e-187)))
tmp = t * ((a / c) * -4.0);
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -8.2e+27], N[Not[LessEqual[t, 4.4e-187]], $MachinePrecision]], N[(t * N[(N[(a / c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+27} \lor \neg \left(t \leq 4.4 \cdot 10^{-187}\right):\\
\;\;\;\;t \cdot \left(\frac{a}{c} \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if t < -8.2000000000000005e27 or 4.40000000000000016e-187 < t Initial program 73.6%
associate-+l-73.6%
*-commutative73.6%
associate-*r*76.5%
*-commutative76.5%
associate-+l-76.5%
Simplified74.2%
Taylor expanded in x around 0 76.1%
cancel-sign-sub-inv76.1%
metadata-eval76.1%
+-commutative76.1%
*-commutative76.1%
fma-def76.1%
associate-/l*79.4%
associate-*r/79.4%
associate-*r*79.4%
*-commutative79.4%
associate-*r*79.4%
*-commutative79.4%
times-frac82.1%
fma-def83.3%
associate-/l*82.8%
associate-/r*83.3%
Simplified83.3%
Taylor expanded in a around inf 45.6%
associate-*l/49.8%
*-commutative49.8%
*-commutative49.8%
associate-*l*49.8%
Simplified49.8%
if -8.2000000000000005e27 < t < 4.40000000000000016e-187Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
associate-*r*80.1%
*-commutative80.1%
associate-+l-80.1%
Simplified87.8%
Taylor expanded in b around inf 46.3%
associate-/r*48.5%
Simplified48.5%
Final simplification49.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* c z)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 / (c * z)
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (c * z);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 78.5%
associate-+l-78.5%
*-commutative78.5%
associate-*r*77.8%
*-commutative77.8%
associate-+l-77.8%
Simplified78.9%
Taylor expanded in b around inf 33.3%
*-commutative33.3%
Simplified33.3%
Final simplification33.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ (/ b c) z))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 / c) / z
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return (b / c) / z
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(Float64(b / c) / z) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = (b / c) / z;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{\frac{b}{c}}{z}
\end{array}
Initial program 78.5%
associate-+l-78.5%
*-commutative78.5%
associate-*r*77.8%
*-commutative77.8%
associate-+l-77.8%
Simplified78.9%
Taylor expanded in b around inf 33.3%
associate-/r*34.0%
Simplified34.0%
Final simplification34.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 2023290
(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)))