
(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 19 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 (<= z -3.6e+54) (not (<= z 2.7e+21))) (+ (/ (+ (/ b z) (* 9.0 (* y (/ x z)))) c) (* (* (/ a c) t) -4.0)) (/ (fma x (* 9.0 y) (+ b (* t (* a (* z -4.0))))) (* 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 ((z <= -3.6e+54) || !(z <= 2.7e+21)) {
tmp = (((b / z) + (9.0 * (y * (x / z)))) / c) + (((a / c) * t) * -4.0);
} else {
tmp = fma(x, (9.0 * y), (b + (t * (a * (z * -4.0))))) / (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 ((z <= -3.6e+54) || !(z <= 2.7e+21)) tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(y * Float64(x / z)))) / c) + Float64(Float64(Float64(a / c) * t) * -4.0)); else tmp = Float64(fma(x, Float64(9.0 * y), Float64(b + Float64(t * Float64(a * Float64(z * -4.0))))) / Float64(z * c)); end return 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, -3.6e+54], N[Not[LessEqual[z, 2.7e+21]], $MachinePrecision]], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(b + N[(t * N[(a * N[(z * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 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 -3.6 \cdot 10^{+54} \lor \neg \left(z \leq 2.7 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{\frac{b}{z} + 9 \cdot \left(y \cdot \frac{x}{z}\right)}{c} + \left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, b + t \cdot \left(a \cdot \left(z \cdot -4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -3.6000000000000001e54 or 2.7e21 < z Initial program 53.4%
associate-+l-53.4%
*-commutative53.4%
associate-*r*55.9%
*-commutative55.9%
associate-+l-55.9%
Simplified60.1%
Taylor expanded in x around 0 80.2%
cancel-sign-sub-inv80.2%
metadata-eval80.2%
+-commutative80.2%
fma-def80.2%
times-frac80.1%
associate-/r*79.1%
*-commutative79.1%
associate-/l*86.3%
associate-/r/83.1%
Simplified83.1%
Taylor expanded in c around 0 88.3%
associate-*r/93.2%
Simplified93.2%
if -3.6000000000000001e54 < z < 2.7e21Initial program 97.9%
associate-+l-97.9%
associate-*l*98.7%
fma-neg98.7%
neg-sub098.7%
associate-+l-98.7%
neg-sub098.7%
+-commutative98.7%
distribute-rgt-neg-out98.7%
*-commutative98.7%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-rgt-neg-in97.9%
metadata-eval97.9%
Simplified97.9%
Final simplification95.8%
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 (+ (* (/ x (/ z y)) (/ 9.0 c)) (* -4.0 (* a (/ t c)))))
(t_2 (* -4.0 (* a t))))
(if (<= z -6.5e-14)
t_1
(if (<= z -6.8e-158)
(+ (* (* (/ a c) t) -4.0) (/ b (* z c)))
(if (<= z -2.7e-199)
(/ (+ (* 9.0 (/ (* y x) z)) t_2) c)
(if (<= z 7e-43)
(/ (+ b (* 9.0 (* y x))) (* z c))
(if (<= z 2.8e+79) (/ (+ (/ b z) t_2) c) t_1)))))))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 = ((x / (z / y)) * (9.0 / c)) + (-4.0 * (a * (t / c)));
double t_2 = -4.0 * (a * t);
double tmp;
if (z <= -6.5e-14) {
tmp = t_1;
} else if (z <= -6.8e-158) {
tmp = (((a / c) * t) * -4.0) + (b / (z * c));
} else if (z <= -2.7e-199) {
tmp = ((9.0 * ((y * x) / z)) + t_2) / c;
} else if (z <= 7e-43) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else if (z <= 2.8e+79) {
tmp = ((b / z) + t_2) / c;
} else {
tmp = t_1;
}
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 = ((x / (z / y)) * (9.0d0 / c)) + ((-4.0d0) * (a * (t / c)))
t_2 = (-4.0d0) * (a * t)
if (z <= (-6.5d-14)) then
tmp = t_1
else if (z <= (-6.8d-158)) then
tmp = (((a / c) * t) * (-4.0d0)) + (b / (z * c))
else if (z <= (-2.7d-199)) then
tmp = ((9.0d0 * ((y * x) / z)) + t_2) / c
else if (z <= 7d-43) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else if (z <= 2.8d+79) then
tmp = ((b / z) + t_2) / c
else
tmp = t_1
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 = ((x / (z / y)) * (9.0 / c)) + (-4.0 * (a * (t / c)));
double t_2 = -4.0 * (a * t);
double tmp;
if (z <= -6.5e-14) {
tmp = t_1;
} else if (z <= -6.8e-158) {
tmp = (((a / c) * t) * -4.0) + (b / (z * c));
} else if (z <= -2.7e-199) {
tmp = ((9.0 * ((y * x) / z)) + t_2) / c;
} else if (z <= 7e-43) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else if (z <= 2.8e+79) {
tmp = ((b / z) + t_2) / c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = ((x / (z / y)) * (9.0 / c)) + (-4.0 * (a * (t / c))) t_2 = -4.0 * (a * t) tmp = 0 if z <= -6.5e-14: tmp = t_1 elif z <= -6.8e-158: tmp = (((a / c) * t) * -4.0) + (b / (z * c)) elif z <= -2.7e-199: tmp = ((9.0 * ((y * x) / z)) + t_2) / c elif z <= 7e-43: tmp = (b + (9.0 * (y * x))) / (z * c) elif z <= 2.8e+79: tmp = ((b / z) + t_2) / c else: tmp = t_1 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(x / Float64(z / y)) * Float64(9.0 / c)) + Float64(-4.0 * Float64(a * Float64(t / c)))) t_2 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (z <= -6.5e-14) tmp = t_1; elseif (z <= -6.8e-158) tmp = Float64(Float64(Float64(Float64(a / c) * t) * -4.0) + Float64(b / Float64(z * c))); elseif (z <= -2.7e-199) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + t_2) / c); elseif (z <= 7e-43) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); elseif (z <= 2.8e+79) tmp = Float64(Float64(Float64(b / z) + t_2) / c); else tmp = t_1; 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 = ((x / (z / y)) * (9.0 / c)) + (-4.0 * (a * (t / c)));
t_2 = -4.0 * (a * t);
tmp = 0.0;
if (z <= -6.5e-14)
tmp = t_1;
elseif (z <= -6.8e-158)
tmp = (((a / c) * t) * -4.0) + (b / (z * c));
elseif (z <= -2.7e-199)
tmp = ((9.0 * ((y * x) / z)) + t_2) / c;
elseif (z <= 7e-43)
tmp = (b + (9.0 * (y * x))) / (z * c);
elseif (z <= 2.8e+79)
tmp = ((b / z) + t_2) / c;
else
tmp = t_1;
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[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] * N[(9.0 / c), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.5e-14], t$95$1, If[LessEqual[z, -6.8e-158], N[(N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-199], N[(N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 7e-43], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+79], N[(N[(N[(b / z), $MachinePrecision] + t$95$2), $MachinePrecision] / c), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{y}} \cdot \frac{9}{c} + -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
t_2 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-158}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4 + \frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-199}:\\
\;\;\;\;\frac{9 \cdot \frac{y \cdot x}{z} + t_2}{c}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-43}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+79}:\\
\;\;\;\;\frac{\frac{b}{z} + t_2}{c}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.5000000000000001e-14 or 2.8000000000000001e79 < z Initial program 55.3%
associate-+l-55.3%
*-commutative55.3%
associate-*r*57.9%
*-commutative57.9%
associate-+l-57.9%
Simplified62.0%
Taylor expanded in x around 0 81.1%
cancel-sign-sub-inv81.1%
metadata-eval81.1%
+-commutative81.1%
fma-def81.1%
times-frac80.2%
associate-/r*79.3%
*-commutative79.3%
associate-/l*85.6%
associate-/r/81.6%
Simplified81.6%
Taylor expanded in y around inf 77.9%
associate-*r/78.0%
*-commutative78.0%
*-commutative78.0%
times-frac80.4%
*-commutative80.4%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in a around 0 84.4%
associate-/l*89.2%
*-rgt-identity89.2%
associate-*r/89.2%
associate-/r/89.1%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
if -6.5000000000000001e-14 < z < -6.7999999999999999e-158Initial program 94.9%
associate-+l-94.9%
*-commutative94.9%
associate-*r*95.0%
*-commutative95.0%
associate-+l-95.0%
Simplified90.5%
Taylor expanded in x around 0 85.8%
cancel-sign-sub-inv85.8%
metadata-eval85.8%
+-commutative85.8%
fma-def85.8%
times-frac81.3%
associate-/r*81.1%
*-commutative81.1%
associate-/l*85.6%
associate-/r/85.6%
Simplified85.6%
Taylor expanded in z around 0 94.9%
associate-*l/94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in b around inf 90.6%
if -6.7999999999999999e-158 < z < -2.69999999999999989e-199Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in x around 0 79.8%
cancel-sign-sub-inv79.8%
metadata-eval79.8%
+-commutative79.8%
fma-def79.8%
times-frac80.0%
associate-/r*80.0%
*-commutative80.0%
associate-/l*80.0%
associate-/r/80.0%
Simplified80.0%
Taylor expanded in y around inf 79.8%
associate-*r/79.8%
*-commutative79.8%
*-commutative79.8%
times-frac80.0%
*-commutative80.0%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in c around 0 100.0%
if -2.69999999999999989e-199 < z < 6.99999999999999994e-43Initial program 99.1%
associate-+l-99.1%
associate-*l*99.0%
fma-neg99.0%
neg-sub099.0%
associate-+l-99.0%
neg-sub099.0%
+-commutative99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-rgt-neg-in97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in t around 0 89.7%
if 6.99999999999999994e-43 < z < 2.8000000000000001e79Initial program 87.6%
associate-+l-87.6%
*-commutative87.6%
associate-*r*87.5%
*-commutative87.5%
associate-+l-87.5%
Simplified87.6%
Taylor expanded in x around 0 87.2%
cancel-sign-sub-inv87.2%
metadata-eval87.2%
+-commutative87.2%
fma-def87.2%
times-frac91.2%
associate-/r*91.2%
*-commutative91.2%
associate-/l*86.7%
associate-/r/95.3%
Simplified95.3%
Taylor expanded in z around 0 91.3%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in b around inf 94.2%
Taylor expanded in c around 0 90.1%
Final simplification90.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 (* (/ x (/ z y)) (/ 9.0 c)))
(t_2 (* -4.0 (* a t)))
(t_3 (* (* (/ a c) t) -4.0)))
(if (<= z -5.5e-14)
(+ t_3 t_1)
(if (<= z -8.2e-158)
(+ t_3 (/ b (* z c)))
(if (<= z -2.7e-199)
(/ (+ (* 9.0 (/ (* y x) z)) t_2) c)
(if (<= z 7.5e-43)
(/ (+ b (* 9.0 (* y x))) (* z c))
(if (<= z 3.8e+78)
(/ (+ (/ b z) t_2) c)
(+ t_1 (* -4.0 (* a (/ t 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 = (x / (z / y)) * (9.0 / c);
double t_2 = -4.0 * (a * t);
double t_3 = ((a / c) * t) * -4.0;
double tmp;
if (z <= -5.5e-14) {
tmp = t_3 + t_1;
} else if (z <= -8.2e-158) {
tmp = t_3 + (b / (z * c));
} else if (z <= -2.7e-199) {
tmp = ((9.0 * ((y * x) / z)) + t_2) / c;
} else if (z <= 7.5e-43) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else if (z <= 3.8e+78) {
tmp = ((b / z) + t_2) / c;
} else {
tmp = t_1 + (-4.0 * (a * (t / 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x / (z / y)) * (9.0d0 / c)
t_2 = (-4.0d0) * (a * t)
t_3 = ((a / c) * t) * (-4.0d0)
if (z <= (-5.5d-14)) then
tmp = t_3 + t_1
else if (z <= (-8.2d-158)) then
tmp = t_3 + (b / (z * c))
else if (z <= (-2.7d-199)) then
tmp = ((9.0d0 * ((y * x) / z)) + t_2) / c
else if (z <= 7.5d-43) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else if (z <= 3.8d+78) then
tmp = ((b / z) + t_2) / c
else
tmp = t_1 + ((-4.0d0) * (a * (t / 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 = (x / (z / y)) * (9.0 / c);
double t_2 = -4.0 * (a * t);
double t_3 = ((a / c) * t) * -4.0;
double tmp;
if (z <= -5.5e-14) {
tmp = t_3 + t_1;
} else if (z <= -8.2e-158) {
tmp = t_3 + (b / (z * c));
} else if (z <= -2.7e-199) {
tmp = ((9.0 * ((y * x) / z)) + t_2) / c;
} else if (z <= 7.5e-43) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else if (z <= 3.8e+78) {
tmp = ((b / z) + t_2) / c;
} else {
tmp = t_1 + (-4.0 * (a * (t / c)));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (x / (z / y)) * (9.0 / c) t_2 = -4.0 * (a * t) t_3 = ((a / c) * t) * -4.0 tmp = 0 if z <= -5.5e-14: tmp = t_3 + t_1 elif z <= -8.2e-158: tmp = t_3 + (b / (z * c)) elif z <= -2.7e-199: tmp = ((9.0 * ((y * x) / z)) + t_2) / c elif z <= 7.5e-43: tmp = (b + (9.0 * (y * x))) / (z * c) elif z <= 3.8e+78: tmp = ((b / z) + t_2) / c else: tmp = t_1 + (-4.0 * (a * (t / 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(x / Float64(z / y)) * Float64(9.0 / c)) t_2 = Float64(-4.0 * Float64(a * t)) t_3 = Float64(Float64(Float64(a / c) * t) * -4.0) tmp = 0.0 if (z <= -5.5e-14) tmp = Float64(t_3 + t_1); elseif (z <= -8.2e-158) tmp = Float64(t_3 + Float64(b / Float64(z * c))); elseif (z <= -2.7e-199) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + t_2) / c); elseif (z <= 7.5e-43) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); elseif (z <= 3.8e+78) tmp = Float64(Float64(Float64(b / z) + t_2) / c); else tmp = Float64(t_1 + Float64(-4.0 * Float64(a * Float64(t / 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 = (x / (z / y)) * (9.0 / c);
t_2 = -4.0 * (a * t);
t_3 = ((a / c) * t) * -4.0;
tmp = 0.0;
if (z <= -5.5e-14)
tmp = t_3 + t_1;
elseif (z <= -8.2e-158)
tmp = t_3 + (b / (z * c));
elseif (z <= -2.7e-199)
tmp = ((9.0 * ((y * x) / z)) + t_2) / c;
elseif (z <= 7.5e-43)
tmp = (b + (9.0 * (y * x))) / (z * c);
elseif (z <= 3.8e+78)
tmp = ((b / z) + t_2) / c;
else
tmp = t_1 + (-4.0 * (a * (t / 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[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] * N[(9.0 / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[z, -5.5e-14], N[(t$95$3 + t$95$1), $MachinePrecision], If[LessEqual[z, -8.2e-158], N[(t$95$3 + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-199], N[(N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 7.5e-43], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+78], N[(N[(N[(b / z), $MachinePrecision] + t$95$2), $MachinePrecision] / c), $MachinePrecision], N[(t$95$1 + N[(-4.0 * N[(a * N[(t / c), $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{x}{\frac{z}{y}} \cdot \frac{9}{c}\\
t_2 := -4 \cdot \left(a \cdot t\right)\\
t_3 := \left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;t_3 + t_1\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-158}:\\
\;\;\;\;t_3 + \frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-199}:\\
\;\;\;\;\frac{9 \cdot \frac{y \cdot x}{z} + t_2}{c}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{b}{z} + t_2}{c}\\
\mathbf{else}:\\
\;\;\;\;t_1 + -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if z < -5.49999999999999991e-14Initial program 61.9%
associate-+l-61.9%
*-commutative61.9%
associate-*r*63.5%
*-commutative63.5%
associate-+l-63.5%
Simplified67.9%
Taylor expanded in x around 0 83.1%
cancel-sign-sub-inv83.1%
metadata-eval83.1%
+-commutative83.1%
fma-def83.1%
times-frac83.0%
associate-/r*83.0%
*-commutative83.0%
associate-/l*91.9%
associate-/r/84.6%
Simplified84.6%
Taylor expanded in y around inf 77.5%
associate-*r/77.5%
*-commutative77.5%
*-commutative77.5%
times-frac77.6%
*-commutative77.6%
associate-/l*82.1%
Simplified82.1%
if -5.49999999999999991e-14 < z < -8.20000000000000008e-158Initial program 94.9%
associate-+l-94.9%
*-commutative94.9%
associate-*r*95.0%
*-commutative95.0%
associate-+l-95.0%
Simplified90.5%
Taylor expanded in x around 0 85.8%
cancel-sign-sub-inv85.8%
metadata-eval85.8%
+-commutative85.8%
fma-def85.8%
times-frac81.3%
associate-/r*81.1%
*-commutative81.1%
associate-/l*85.6%
associate-/r/85.6%
Simplified85.6%
Taylor expanded in z around 0 94.9%
associate-*l/94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in b around inf 90.6%
if -8.20000000000000008e-158 < z < -2.69999999999999989e-199Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
associate-*r*99.8%
*-commutative99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in x around 0 79.8%
cancel-sign-sub-inv79.8%
metadata-eval79.8%
+-commutative79.8%
fma-def79.8%
times-frac80.0%
associate-/r*80.0%
*-commutative80.0%
associate-/l*80.0%
associate-/r/80.0%
Simplified80.0%
Taylor expanded in y around inf 79.8%
associate-*r/79.8%
*-commutative79.8%
*-commutative79.8%
times-frac80.0%
*-commutative80.0%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in c around 0 100.0%
if -2.69999999999999989e-199 < z < 7.50000000000000068e-43Initial program 99.1%
associate-+l-99.1%
associate-*l*99.0%
fma-neg99.0%
neg-sub099.0%
associate-+l-99.0%
neg-sub099.0%
+-commutative99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-rgt-neg-in97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in t around 0 89.7%
if 7.50000000000000068e-43 < z < 3.7999999999999999e78Initial program 87.6%
associate-+l-87.6%
*-commutative87.6%
associate-*r*87.5%
*-commutative87.5%
associate-+l-87.5%
Simplified87.6%
Taylor expanded in x around 0 87.2%
cancel-sign-sub-inv87.2%
metadata-eval87.2%
+-commutative87.2%
fma-def87.2%
times-frac91.2%
associate-/r*91.2%
*-commutative91.2%
associate-/l*86.7%
associate-/r/95.3%
Simplified95.3%
Taylor expanded in z around 0 91.3%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in b around inf 94.2%
Taylor expanded in c around 0 90.1%
if 3.7999999999999999e78 < z Initial program 47.4%
associate-+l-47.4%
*-commutative47.4%
associate-*r*51.1%
*-commutative51.1%
associate-+l-51.1%
Simplified54.9%
Taylor expanded in x around 0 78.7%
cancel-sign-sub-inv78.7%
metadata-eval78.7%
+-commutative78.7%
fma-def78.7%
times-frac76.9%
associate-/r*74.8%
*-commutative74.8%
associate-/l*78.0%
associate-/r/78.1%
Simplified78.1%
Taylor expanded in y around inf 78.4%
associate-*r/78.5%
*-commutative78.5%
*-commutative78.5%
times-frac83.8%
*-commutative83.8%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in a around 0 85.7%
associate-/l*85.4%
*-rgt-identity85.4%
associate-*r/85.5%
associate-/r/85.5%
associate-*l/85.6%
*-lft-identity85.6%
Simplified85.6%
Final simplification87.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 (if (or (<= c -3.2e+59) (not (<= c 1e+32))) (+ (* (* (/ a c) t) -4.0) (/ (+ (/ b c) (* 9.0 (* x (/ y c)))) z)) (/ (+ (/ b z) (+ (* 9.0 (/ (* y x) z)) (* -4.0 (* a t)))) 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 <= -3.2e+59) || !(c <= 1e+32)) {
tmp = (((a / c) * t) * -4.0) + (((b / c) + (9.0 * (x * (y / c)))) / z);
} else {
tmp = ((b / z) + ((9.0 * ((y * x) / z)) + (-4.0 * (a * t)))) / 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 <= (-3.2d+59)) .or. (.not. (c <= 1d+32))) then
tmp = (((a / c) * t) * (-4.0d0)) + (((b / c) + (9.0d0 * (x * (y / c)))) / z)
else
tmp = ((b / z) + ((9.0d0 * ((y * x) / z)) + ((-4.0d0) * (a * t)))) / 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 <= -3.2e+59) || !(c <= 1e+32)) {
tmp = (((a / c) * t) * -4.0) + (((b / c) + (9.0 * (x * (y / c)))) / z);
} else {
tmp = ((b / z) + ((9.0 * ((y * x) / z)) + (-4.0 * (a * t)))) / 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 <= -3.2e+59) or not (c <= 1e+32): tmp = (((a / c) * t) * -4.0) + (((b / c) + (9.0 * (x * (y / c)))) / z) else: tmp = ((b / z) + ((9.0 * ((y * x) / z)) + (-4.0 * (a * t)))) / 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 <= -3.2e+59) || !(c <= 1e+32)) tmp = Float64(Float64(Float64(Float64(a / c) * t) * -4.0) + Float64(Float64(Float64(b / c) + Float64(9.0 * Float64(x * Float64(y / c)))) / z)); else tmp = Float64(Float64(Float64(b / z) + Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + Float64(-4.0 * Float64(a * t)))) / 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 <= -3.2e+59) || ~((c <= 1e+32)))
tmp = (((a / c) * t) * -4.0) + (((b / c) + (9.0 * (x * (y / c)))) / z);
else
tmp = ((b / z) + ((9.0 * ((y * x) / z)) + (-4.0 * (a * t)))) / 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, -3.2e+59], N[Not[LessEqual[c, 1e+32]], $MachinePrecision]], N[(N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + N[(N[(N[(b / c), $MachinePrecision] + N[(9.0 * N[(x * N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $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 -3.2 \cdot 10^{+59} \lor \neg \left(c \leq 10^{+32}\right):\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4 + \frac{\frac{b}{c} + 9 \cdot \left(x \cdot \frac{y}{c}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} + \left(9 \cdot \frac{y \cdot x}{z} + -4 \cdot \left(a \cdot t\right)\right)}{c}\\
\end{array}
\end{array}
if c < -3.19999999999999982e59 or 1.00000000000000005e32 < c Initial program 65.5%
associate-+l-65.5%
*-commutative65.5%
associate-*r*66.4%
*-commutative66.4%
associate-+l-66.4%
Simplified63.9%
Taylor expanded in x around 0 77.5%
cancel-sign-sub-inv77.5%
metadata-eval77.5%
+-commutative77.5%
fma-def77.5%
times-frac79.0%
associate-/r*81.5%
*-commutative81.5%
associate-/l*93.5%
associate-/r/91.8%
Simplified91.8%
Taylor expanded in z around 0 92.0%
associate-*l/94.6%
*-commutative94.6%
Simplified94.6%
if -3.19999999999999982e59 < c < 1.00000000000000005e32Initial program 87.1%
associate-+l-87.1%
*-commutative87.1%
associate-*r*87.8%
*-commutative87.8%
associate-+l-87.8%
Simplified90.4%
Taylor expanded in x around 0 85.7%
cancel-sign-sub-inv85.7%
metadata-eval85.7%
+-commutative85.7%
fma-def85.7%
times-frac81.2%
associate-/r*79.5%
*-commutative79.5%
associate-/l*78.1%
associate-/r/77.6%
Simplified77.6%
Taylor expanded in z around 0 83.1%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in c around 0 97.8%
Final simplification96.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 (<= z -3.3e+54) (not (<= z 1.75e+22))) (+ (/ (+ (/ b z) (* 9.0 (* y (/ x z)))) c) (* (* (/ a c) t) -4.0)) (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* 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 ((z <= -3.3e+54) || !(z <= 1.75e+22)) {
tmp = (((b / z) + (9.0 * (y * (x / z)))) / c) + (((a / c) * t) * -4.0);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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 ((z <= (-3.3d+54)) .or. (.not. (z <= 1.75d+22))) then
tmp = (((b / z) + (9.0d0 * (y * (x / z)))) / c) + (((a / c) * t) * (-4.0d0))
else
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (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 ((z <= -3.3e+54) || !(z <= 1.75e+22)) {
tmp = (((b / z) + (9.0 * (y * (x / z)))) / c) + (((a / c) * t) * -4.0);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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 (z <= -3.3e+54) or not (z <= 1.75e+22): tmp = (((b / z) + (9.0 * (y * (x / z)))) / c) + (((a / c) * t) * -4.0) else: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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 ((z <= -3.3e+54) || !(z <= 1.75e+22)) tmp = Float64(Float64(Float64(Float64(b / z) + Float64(9.0 * Float64(y * Float64(x / z)))) / c) + Float64(Float64(Float64(a / c) * t) * -4.0)); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(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 ((z <= -3.3e+54) || ~((z <= 1.75e+22)))
tmp = (((b / z) + (9.0 * (y * (x / z)))) / c) + (((a / c) * t) * -4.0);
else
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (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[z, -3.3e+54], N[Not[LessEqual[z, 1.75e+22]], $MachinePrecision]], N[(N[(N[(N[(b / z), $MachinePrecision] + N[(9.0 * N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision] + N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * 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 -3.3 \cdot 10^{+54} \lor \neg \left(z \leq 1.75 \cdot 10^{+22}\right):\\
\;\;\;\;\frac{\frac{b}{z} + 9 \cdot \left(y \cdot \frac{x}{z}\right)}{c} + \left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -3.3e54 or 1.75e22 < z Initial program 53.4%
associate-+l-53.4%
*-commutative53.4%
associate-*r*55.9%
*-commutative55.9%
associate-+l-55.9%
Simplified60.1%
Taylor expanded in x around 0 80.2%
cancel-sign-sub-inv80.2%
metadata-eval80.2%
+-commutative80.2%
fma-def80.2%
times-frac80.1%
associate-/r*79.1%
*-commutative79.1%
associate-/l*86.3%
associate-/r/83.1%
Simplified83.1%
Taylor expanded in c around 0 88.3%
associate-*r/93.2%
Simplified93.2%
if -3.3e54 < z < 1.75e22Initial program 97.9%
Final simplification95.8%
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 (* (/ x (/ z y)) (/ 9.0 c))))
(if (<= z -6e+59)
(+ (* (* (/ a c) t) -4.0) t_1)
(if (<= z 1.4e+91)
(/ (+ b (- (* y (* 9.0 x)) (* (* z 4.0) (* a t)))) (* z c))
(+ t_1 (* -4.0 (* a (/ t 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 = (x / (z / y)) * (9.0 / c);
double tmp;
if (z <= -6e+59) {
tmp = (((a / c) * t) * -4.0) + t_1;
} else if (z <= 1.4e+91) {
tmp = (b + ((y * (9.0 * x)) - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = t_1 + (-4.0 * (a * (t / 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 = (x / (z / y)) * (9.0d0 / c)
if (z <= (-6d+59)) then
tmp = (((a / c) * t) * (-4.0d0)) + t_1
else if (z <= 1.4d+91) then
tmp = (b + ((y * (9.0d0 * x)) - ((z * 4.0d0) * (a * t)))) / (z * c)
else
tmp = t_1 + ((-4.0d0) * (a * (t / 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 = (x / (z / y)) * (9.0 / c);
double tmp;
if (z <= -6e+59) {
tmp = (((a / c) * t) * -4.0) + t_1;
} else if (z <= 1.4e+91) {
tmp = (b + ((y * (9.0 * x)) - ((z * 4.0) * (a * t)))) / (z * c);
} else {
tmp = t_1 + (-4.0 * (a * (t / c)));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (x / (z / y)) * (9.0 / c) tmp = 0 if z <= -6e+59: tmp = (((a / c) * t) * -4.0) + t_1 elif z <= 1.4e+91: tmp = (b + ((y * (9.0 * x)) - ((z * 4.0) * (a * t)))) / (z * c) else: tmp = t_1 + (-4.0 * (a * (t / 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(x / Float64(z / y)) * Float64(9.0 / c)) tmp = 0.0 if (z <= -6e+59) tmp = Float64(Float64(Float64(Float64(a / c) * t) * -4.0) + t_1); elseif (z <= 1.4e+91) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(Float64(z * 4.0) * Float64(a * t)))) / Float64(z * c)); else tmp = Float64(t_1 + Float64(-4.0 * Float64(a * Float64(t / 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 = (x / (z / y)) * (9.0 / c);
tmp = 0.0;
if (z <= -6e+59)
tmp = (((a / c) * t) * -4.0) + t_1;
elseif (z <= 1.4e+91)
tmp = (b + ((y * (9.0 * x)) - ((z * 4.0) * (a * t)))) / (z * c);
else
tmp = t_1 + (-4.0 * (a * (t / 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[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] * N[(9.0 / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+59], N[(N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 1.4e+91], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-4.0 * N[(a * N[(t / c), $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{x}{\frac{z}{y}} \cdot \frac{9}{c}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+59}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4 + t_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+91}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - \left(z \cdot 4\right) \cdot \left(a \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_1 + -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if z < -6.0000000000000001e59Initial program 53.2%
associate-+l-53.2%
*-commutative53.2%
associate-*r*55.1%
*-commutative55.1%
associate-+l-55.1%
Simplified60.6%
Taylor expanded in x around 0 79.3%
cancel-sign-sub-inv79.3%
metadata-eval79.3%
+-commutative79.3%
fma-def79.3%
times-frac81.0%
associate-/r*81.0%
*-commutative81.0%
associate-/l*92.0%
associate-/r/84.7%
Simplified84.7%
Taylor expanded in y around inf 77.3%
associate-*r/77.3%
*-commutative77.3%
*-commutative77.3%
times-frac77.4%
*-commutative77.4%
associate-/l*82.9%
Simplified82.9%
if -6.0000000000000001e59 < z < 1.3999999999999999e91Initial program 96.9%
associate-+l-96.9%
*-commutative96.9%
associate-*r*96.2%
*-commutative96.2%
associate-+l-96.2%
Simplified93.7%
if 1.3999999999999999e91 < z Initial program 45.3%
associate-+l-45.3%
*-commutative45.3%
associate-*r*49.2%
*-commutative49.2%
associate-+l-49.2%
Simplified53.2%
Taylor expanded in x around 0 77.9%
cancel-sign-sub-inv77.9%
metadata-eval77.9%
+-commutative77.9%
fma-def77.9%
times-frac77.8%
associate-/r*75.7%
*-commutative75.7%
associate-/l*79.0%
associate-/r/79.1%
Simplified79.1%
Taylor expanded in y around inf 77.6%
associate-*r/77.6%
*-commutative77.6%
*-commutative77.6%
times-frac83.2%
*-commutative83.2%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in a around 0 85.1%
associate-/l*84.8%
*-rgt-identity84.8%
associate-*r/84.9%
associate-/r/84.9%
associate-*l/85.0%
*-lft-identity85.0%
Simplified85.0%
Final simplification89.8%
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 (* (/ x (/ z y)) (/ 9.0 c))))
(if (<= z -5e+55)
(+ (* (* (/ a c) t) -4.0) t_1)
(if (<= z 9e+90)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(+ t_1 (* -4.0 (* a (/ t 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 = (x / (z / y)) * (9.0 / c);
double tmp;
if (z <= -5e+55) {
tmp = (((a / c) * t) * -4.0) + t_1;
} else if (z <= 9e+90) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = t_1 + (-4.0 * (a * (t / 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 = (x / (z / y)) * (9.0d0 / c)
if (z <= (-5d+55)) then
tmp = (((a / c) * t) * (-4.0d0)) + t_1
else if (z <= 9d+90) then
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = t_1 + ((-4.0d0) * (a * (t / 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 = (x / (z / y)) * (9.0 / c);
double tmp;
if (z <= -5e+55) {
tmp = (((a / c) * t) * -4.0) + t_1;
} else if (z <= 9e+90) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = t_1 + (-4.0 * (a * (t / c)));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (x / (z / y)) * (9.0 / c) tmp = 0 if z <= -5e+55: tmp = (((a / c) * t) * -4.0) + t_1 elif z <= 9e+90: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = t_1 + (-4.0 * (a * (t / 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(x / Float64(z / y)) * Float64(9.0 / c)) tmp = 0.0 if (z <= -5e+55) tmp = Float64(Float64(Float64(Float64(a / c) * t) * -4.0) + t_1); elseif (z <= 9e+90) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(t_1 + Float64(-4.0 * Float64(a * Float64(t / 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 = (x / (z / y)) * (9.0 / c);
tmp = 0.0;
if (z <= -5e+55)
tmp = (((a / c) * t) * -4.0) + t_1;
elseif (z <= 9e+90)
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = t_1 + (-4.0 * (a * (t / 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[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] * N[(9.0 / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+55], N[(N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 9e+90], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(-4.0 * N[(a * N[(t / c), $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{x}{\frac{z}{y}} \cdot \frac{9}{c}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+55}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4 + t_1\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+90}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_1 + -4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if z < -5.00000000000000046e55Initial program 53.2%
associate-+l-53.2%
*-commutative53.2%
associate-*r*55.1%
*-commutative55.1%
associate-+l-55.1%
Simplified60.6%
Taylor expanded in x around 0 79.3%
cancel-sign-sub-inv79.3%
metadata-eval79.3%
+-commutative79.3%
fma-def79.3%
times-frac81.0%
associate-/r*81.0%
*-commutative81.0%
associate-/l*92.0%
associate-/r/84.7%
Simplified84.7%
Taylor expanded in y around inf 77.3%
associate-*r/77.3%
*-commutative77.3%
*-commutative77.3%
times-frac77.4%
*-commutative77.4%
associate-/l*82.9%
Simplified82.9%
if -5.00000000000000046e55 < z < 9e90Initial program 96.9%
if 9e90 < z Initial program 45.3%
associate-+l-45.3%
*-commutative45.3%
associate-*r*49.2%
*-commutative49.2%
associate-+l-49.2%
Simplified53.2%
Taylor expanded in x around 0 77.9%
cancel-sign-sub-inv77.9%
metadata-eval77.9%
+-commutative77.9%
fma-def77.9%
times-frac77.8%
associate-/r*75.7%
*-commutative75.7%
associate-/l*79.0%
associate-/r/79.1%
Simplified79.1%
Taylor expanded in y around inf 77.6%
associate-*r/77.6%
*-commutative77.6%
*-commutative77.6%
times-frac83.2%
*-commutative83.2%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in a around 0 85.1%
associate-/l*84.8%
*-rgt-identity84.8%
associate-*r/84.9%
associate-/r/84.9%
associate-*l/85.0%
*-lft-identity85.0%
Simplified85.0%
Final simplification91.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 (<= z -4.1e+60)
(+ (* (* (/ a c) t) -4.0) (* (/ x (/ z y)) (/ 9.0 c)))
(if (<= z 2.4e-18)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* z c))
(/ (+ (/ b z) (+ (* -4.0 (* a t)) (* 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 (z <= -4.1e+60) {
tmp = (((a / c) * t) * -4.0) + ((x / (z / y)) * (9.0 / c));
} else if (z <= 2.4e-18) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / z) + ((-4.0 * (a * t)) + (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 (z <= (-4.1d+60)) then
tmp = (((a / c) * t) * (-4.0d0)) + ((x / (z / y)) * (9.0d0 / c))
else if (z <= 2.4d-18) then
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = ((b / z) + (((-4.0d0) * (a * t)) + (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 (z <= -4.1e+60) {
tmp = (((a / c) * t) * -4.0) + ((x / (z / y)) * (9.0 / c));
} else if (z <= 2.4e-18) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / z) + ((-4.0 * (a * t)) + (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 z <= -4.1e+60: tmp = (((a / c) * t) * -4.0) + ((x / (z / y)) * (9.0 / c)) elif z <= 2.4e-18: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = ((b / z) + ((-4.0 * (a * t)) + (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 (z <= -4.1e+60) tmp = Float64(Float64(Float64(Float64(a / c) * t) * -4.0) + Float64(Float64(x / Float64(z / y)) * Float64(9.0 / c))); elseif (z <= 2.4e-18) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) + Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(x * Float64(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 (z <= -4.1e+60)
tmp = (((a / c) * t) * -4.0) + ((x / (z / y)) * (9.0 / c));
elseif (z <= 2.4e-18)
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = ((b / z) + ((-4.0 * (a * t)) + (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[LessEqual[z, -4.1e+60], N[(N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + N[(N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision] * N[(9.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-18], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] + N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+60}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4 + \frac{x}{\frac{z}{y}} \cdot \frac{9}{c}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-18}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} + \left(-4 \cdot \left(a \cdot t\right) + 9 \cdot \left(x \cdot \frac{y}{z}\right)\right)}{c}\\
\end{array}
\end{array}
if z < -4.1e60Initial program 53.2%
associate-+l-53.2%
*-commutative53.2%
associate-*r*55.1%
*-commutative55.1%
associate-+l-55.1%
Simplified60.6%
Taylor expanded in x around 0 79.3%
cancel-sign-sub-inv79.3%
metadata-eval79.3%
+-commutative79.3%
fma-def79.3%
times-frac81.0%
associate-/r*81.0%
*-commutative81.0%
associate-/l*92.0%
associate-/r/84.7%
Simplified84.7%
Taylor expanded in y around inf 77.3%
associate-*r/77.3%
*-commutative77.3%
*-commutative77.3%
times-frac77.4%
*-commutative77.4%
associate-/l*82.9%
Simplified82.9%
if -4.1e60 < z < 2.39999999999999994e-18Initial program 98.6%
if 2.39999999999999994e-18 < z Initial program 56.7%
associate-+l-56.7%
*-commutative56.7%
associate-*r*59.5%
*-commutative59.5%
associate-+l-59.5%
Simplified62.3%
Taylor expanded in x around 0 81.4%
cancel-sign-sub-inv81.4%
metadata-eval81.4%
+-commutative81.4%
fma-def81.4%
times-frac81.3%
associate-/r*79.8%
*-commutative79.8%
associate-/l*80.7%
associate-/r/83.6%
Simplified83.6%
Taylor expanded in z around 0 79.5%
associate-*l/82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in c around 0 89.3%
div-inv89.3%
*-commutative89.3%
Applied egg-rr89.3%
associate-*l*93.3%
associate-*r/93.3%
*-rgt-identity93.3%
Simplified93.3%
Final simplification93.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
(let* ((t_1 (+ (* (* (/ a c) t) -4.0) (/ b (* z c)))))
(if (<= t -1.05e+96)
t_1
(if (<= t -1.6e-68)
(/ (+ (* 9.0 (/ (* y x) z)) (* -4.0 (* a t))) c)
(if (<= t 2e-164) (/ (+ b (* 9.0 (* y x))) (* z c)) t_1)))))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 = (((a / c) * t) * -4.0) + (b / (z * c));
double tmp;
if (t <= -1.05e+96) {
tmp = t_1;
} else if (t <= -1.6e-68) {
tmp = ((9.0 * ((y * x) / z)) + (-4.0 * (a * t))) / c;
} else if (t <= 2e-164) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = t_1;
}
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 = (((a / c) * t) * (-4.0d0)) + (b / (z * c))
if (t <= (-1.05d+96)) then
tmp = t_1
else if (t <= (-1.6d-68)) then
tmp = ((9.0d0 * ((y * x) / z)) + ((-4.0d0) * (a * t))) / c
else if (t <= 2d-164) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else
tmp = t_1
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 = (((a / c) * t) * -4.0) + (b / (z * c));
double tmp;
if (t <= -1.05e+96) {
tmp = t_1;
} else if (t <= -1.6e-68) {
tmp = ((9.0 * ((y * x) / z)) + (-4.0 * (a * t))) / c;
} else if (t <= 2e-164) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (((a / c) * t) * -4.0) + (b / (z * c)) tmp = 0 if t <= -1.05e+96: tmp = t_1 elif t <= -1.6e-68: tmp = ((9.0 * ((y * x) / z)) + (-4.0 * (a * t))) / c elif t <= 2e-164: tmp = (b + (9.0 * (y * x))) / (z * c) else: tmp = t_1 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(Float64(a / c) * t) * -4.0) + Float64(b / Float64(z * c))) tmp = 0.0 if (t <= -1.05e+96) tmp = t_1; elseif (t <= -1.6e-68) tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y * x) / z)) + Float64(-4.0 * Float64(a * t))) / c); elseif (t <= 2e-164) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); else tmp = t_1; 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 = (((a / c) * t) * -4.0) + (b / (z * c));
tmp = 0.0;
if (t <= -1.05e+96)
tmp = t_1;
elseif (t <= -1.6e-68)
tmp = ((9.0 * ((y * x) / z)) + (-4.0 * (a * t))) / c;
elseif (t <= 2e-164)
tmp = (b + (9.0 * (y * x))) / (z * c);
else
tmp = t_1;
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[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+96], t$95$1, If[LessEqual[t, -1.6e-68], N[(N[(N[(9.0 * N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t, 2e-164], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \left(\frac{a}{c} \cdot t\right) \cdot -4 + \frac{b}{z \cdot c}\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{9 \cdot \frac{y \cdot x}{z} + -4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-164}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.0500000000000001e96 or 1.99999999999999992e-164 < t Initial program 73.0%
associate-+l-73.0%
*-commutative73.0%
associate-*r*76.8%
*-commutative76.8%
associate-+l-76.8%
Simplified74.3%
Taylor expanded in x around 0 76.7%
cancel-sign-sub-inv76.7%
metadata-eval76.7%
+-commutative76.7%
fma-def76.7%
times-frac77.3%
associate-/r*76.7%
*-commutative76.7%
associate-/l*84.7%
associate-/r/83.6%
Simplified83.6%
Taylor expanded in z around 0 86.9%
associate-*l/88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in b around inf 74.1%
if -1.0500000000000001e96 < t < -1.5999999999999999e-68Initial program 67.5%
associate-+l-67.5%
*-commutative67.5%
associate-*r*70.6%
*-commutative70.6%
associate-+l-70.6%
Simplified70.6%
Taylor expanded in x around 0 83.6%
cancel-sign-sub-inv83.6%
metadata-eval83.6%
+-commutative83.6%
fma-def83.6%
times-frac83.3%
associate-/r*86.4%
*-commutative86.4%
associate-/l*86.4%
associate-/r/83.4%
Simplified83.4%
Taylor expanded in y around inf 64.7%
associate-*r/64.7%
*-commutative64.7%
*-commutative64.7%
times-frac64.8%
*-commutative64.8%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in c around 0 71.0%
if -1.5999999999999999e-68 < t < 1.99999999999999992e-164Initial program 91.5%
associate-+l-91.5%
associate-*l*91.5%
fma-neg91.5%
neg-sub091.5%
associate-+l-91.5%
neg-sub091.5%
+-commutative91.5%
distribute-rgt-neg-out91.5%
*-commutative91.5%
associate-*l*85.1%
distribute-rgt-neg-in85.1%
*-commutative85.1%
distribute-rgt-neg-in85.1%
distribute-rgt-neg-in85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in t around 0 82.4%
Final simplification76.2%
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 (<= z -3.9e+39)
(* (* (/ a c) t) -4.0)
(if (<= z 3.3e+15)
(/ (+ b (* 9.0 (* y x))) (* z c))
(* -4.0 (/ a (/ c t))))))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 <= -3.9e+39) {
tmp = ((a / c) * t) * -4.0;
} else if (z <= 3.3e+15) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
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 <= (-3.9d+39)) then
tmp = ((a / c) * t) * (-4.0d0)
else if (z <= 3.3d+15) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else
tmp = (-4.0d0) * (a / (c / t))
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 <= -3.9e+39) {
tmp = ((a / c) * t) * -4.0;
} else if (z <= 3.3e+15) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
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 <= -3.9e+39: tmp = ((a / c) * t) * -4.0 elif z <= 3.3e+15: tmp = (b + (9.0 * (y * x))) / (z * c) else: tmp = -4.0 * (a / (c / t)) 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 <= -3.9e+39) tmp = Float64(Float64(Float64(a / c) * t) * -4.0); elseif (z <= 3.3e+15) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 <= -3.9e+39)
tmp = ((a / c) * t) * -4.0;
elseif (z <= 3.3e+15)
tmp = (b + (9.0 * (y * x))) / (z * c);
else
tmp = -4.0 * (a / (c / t));
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[z, -3.9e+39], N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 3.3e+15], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+39}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+15}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -3.9000000000000001e39Initial program 56.5%
associate-+l-56.5%
*-commutative56.5%
associate-*r*58.3%
*-commutative58.3%
associate-+l-58.3%
Simplified63.4%
Taylor expanded in z around inf 62.0%
*-commutative62.0%
associate-/l*72.1%
associate-/r/62.2%
Simplified62.2%
if -3.9000000000000001e39 < z < 3.3e15Initial program 97.9%
associate-+l-97.9%
associate-*l*98.6%
fma-neg98.6%
neg-sub098.6%
associate-+l-98.6%
neg-sub098.6%
+-commutative98.6%
distribute-rgt-neg-out98.6%
*-commutative98.6%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-rgt-neg-in97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in t around 0 83.9%
if 3.3e15 < z Initial program 55.5%
associate-+l-55.5%
*-commutative55.5%
associate-*r*58.4%
*-commutative58.4%
associate-+l-58.4%
Simplified61.5%
Taylor expanded in z around inf 64.4%
*-commutative64.4%
associate-/l*64.2%
Simplified64.2%
Final simplification74.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
(if (<= z -4.8e+39)
(* (* (/ a c) t) -4.0)
(if (<= z 1e-44)
(/ (+ b (* 9.0 (* y x))) (* z c))
(/ (+ (/ b z) (* -4.0 (* a t))) 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 <= -4.8e+39) {
tmp = ((a / c) * t) * -4.0;
} else if (z <= 1e-44) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = ((b / z) + (-4.0 * (a * t))) / 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 <= (-4.8d+39)) then
tmp = ((a / c) * t) * (-4.0d0)
else if (z <= 1d-44) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else
tmp = ((b / z) + ((-4.0d0) * (a * t))) / 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 <= -4.8e+39) {
tmp = ((a / c) * t) * -4.0;
} else if (z <= 1e-44) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = ((b / z) + (-4.0 * (a * t))) / 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 <= -4.8e+39: tmp = ((a / c) * t) * -4.0 elif z <= 1e-44: tmp = (b + (9.0 * (y * x))) / (z * c) else: tmp = ((b / z) + (-4.0 * (a * t))) / 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 <= -4.8e+39) tmp = Float64(Float64(Float64(a / c) * t) * -4.0); elseif (z <= 1e-44) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) + Float64(-4.0 * Float64(a * t))) / 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 <= -4.8e+39)
tmp = ((a / c) * t) * -4.0;
elseif (z <= 1e-44)
tmp = (b + (9.0 * (y * x))) / (z * c);
else
tmp = ((b / z) + (-4.0 * (a * t))) / 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[z, -4.8e+39], N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[z, 1e-44], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+39}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{elif}\;z \leq 10^{-44}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(a \cdot t\right)}{c}\\
\end{array}
\end{array}
if z < -4.8000000000000002e39Initial program 56.5%
associate-+l-56.5%
*-commutative56.5%
associate-*r*58.3%
*-commutative58.3%
associate-+l-58.3%
Simplified63.4%
Taylor expanded in z around inf 62.0%
*-commutative62.0%
associate-/l*72.1%
associate-/r/62.2%
Simplified62.2%
if -4.8000000000000002e39 < z < 9.99999999999999953e-45Initial program 98.5%
associate-+l-98.5%
associate-*l*99.3%
fma-neg99.3%
neg-sub099.3%
associate-+l-99.3%
neg-sub099.3%
+-commutative99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
associate-*l*98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
distribute-rgt-neg-in98.5%
distribute-rgt-neg-in98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in t around 0 85.9%
if 9.99999999999999953e-45 < z Initial program 59.6%
associate-+l-59.6%
*-commutative59.6%
associate-*r*62.1%
*-commutative62.1%
associate-+l-62.1%
Simplified64.8%
Taylor expanded in x around 0 81.3%
cancel-sign-sub-inv81.3%
metadata-eval81.3%
+-commutative81.3%
fma-def81.3%
times-frac81.2%
associate-/r*79.8%
*-commutative79.8%
associate-/l*80.6%
associate-/r/83.3%
Simplified83.3%
Taylor expanded in z around 0 79.5%
associate-*l/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in b around inf 76.8%
Taylor expanded in c around 0 78.2%
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
(if (<= z -3.7e+39)
(+ (* (* (/ a c) t) -4.0) (/ b (* z c)))
(if (<= z 7.8e-44)
(/ (+ b (* 9.0 (* y x))) (* z c))
(/ (+ (/ b z) (* -4.0 (* a t))) 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 <= -3.7e+39) {
tmp = (((a / c) * t) * -4.0) + (b / (z * c));
} else if (z <= 7.8e-44) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = ((b / z) + (-4.0 * (a * t))) / 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 <= (-3.7d+39)) then
tmp = (((a / c) * t) * (-4.0d0)) + (b / (z * c))
else if (z <= 7.8d-44) then
tmp = (b + (9.0d0 * (y * x))) / (z * c)
else
tmp = ((b / z) + ((-4.0d0) * (a * t))) / 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 <= -3.7e+39) {
tmp = (((a / c) * t) * -4.0) + (b / (z * c));
} else if (z <= 7.8e-44) {
tmp = (b + (9.0 * (y * x))) / (z * c);
} else {
tmp = ((b / z) + (-4.0 * (a * t))) / 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 <= -3.7e+39: tmp = (((a / c) * t) * -4.0) + (b / (z * c)) elif z <= 7.8e-44: tmp = (b + (9.0 * (y * x))) / (z * c) else: tmp = ((b / z) + (-4.0 * (a * t))) / 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 <= -3.7e+39) tmp = Float64(Float64(Float64(Float64(a / c) * t) * -4.0) + Float64(b / Float64(z * c))); elseif (z <= 7.8e-44) tmp = Float64(Float64(b + Float64(9.0 * Float64(y * x))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / z) + Float64(-4.0 * Float64(a * t))) / 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 <= -3.7e+39)
tmp = (((a / c) * t) * -4.0) + (b / (z * c));
elseif (z <= 7.8e-44)
tmp = (b + (9.0 * (y * x))) / (z * c);
else
tmp = ((b / z) + (-4.0 * (a * t))) / 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[z, -3.7e+39], N[(N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e-44], N[(N[(b + N[(9.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / z), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+39}:\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4 + \frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{b + 9 \cdot \left(y \cdot x\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z} + -4 \cdot \left(a \cdot t\right)}{c}\\
\end{array}
\end{array}
if z < -3.70000000000000012e39Initial program 56.5%
associate-+l-56.5%
*-commutative56.5%
associate-*r*58.3%
*-commutative58.3%
associate-+l-58.3%
Simplified63.4%
Taylor expanded in x around 0 80.8%
cancel-sign-sub-inv80.8%
metadata-eval80.8%
+-commutative80.8%
fma-def80.8%
times-frac82.4%
associate-/r*82.3%
*-commutative82.3%
associate-/l*92.5%
associate-/r/85.8%
Simplified85.8%
Taylor expanded in z around 0 80.8%
associate-*l/82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in b around inf 67.6%
if -3.70000000000000012e39 < z < 7.8000000000000004e-44Initial program 98.5%
associate-+l-98.5%
associate-*l*99.3%
fma-neg99.3%
neg-sub099.3%
associate-+l-99.3%
neg-sub099.3%
+-commutative99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
associate-*l*98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
distribute-rgt-neg-in98.5%
distribute-rgt-neg-in98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in t around 0 85.9%
if 7.8000000000000004e-44 < z Initial program 59.6%
associate-+l-59.6%
*-commutative59.6%
associate-*r*62.1%
*-commutative62.1%
associate-+l-62.1%
Simplified64.8%
Taylor expanded in x around 0 81.3%
cancel-sign-sub-inv81.3%
metadata-eval81.3%
+-commutative81.3%
fma-def81.3%
times-frac81.2%
associate-/r*79.8%
*-commutative79.8%
associate-/l*80.6%
associate-/r/83.3%
Simplified83.3%
Taylor expanded in z around 0 79.5%
associate-*l/82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in b around inf 76.8%
Taylor expanded in c around 0 78.2%
Final simplification79.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
(let* ((t_1 (* (* (/ a c) t) -4.0)))
(if (<= t -1750000000.0)
t_1
(if (<= t -1.45e-210)
(* 9.0 (* x (/ y (* z c))))
(if (<= t 4.6e-138) (/ b (* z c)) t_1)))))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 = ((a / c) * t) * -4.0;
double tmp;
if (t <= -1750000000.0) {
tmp = t_1;
} else if (t <= -1.45e-210) {
tmp = 9.0 * (x * (y / (z * c)));
} else if (t <= 4.6e-138) {
tmp = b / (z * c);
} else {
tmp = t_1;
}
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 = ((a / c) * t) * (-4.0d0)
if (t <= (-1750000000.0d0)) then
tmp = t_1
else if (t <= (-1.45d-210)) then
tmp = 9.0d0 * (x * (y / (z * c)))
else if (t <= 4.6d-138) then
tmp = b / (z * c)
else
tmp = t_1
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 = ((a / c) * t) * -4.0;
double tmp;
if (t <= -1750000000.0) {
tmp = t_1;
} else if (t <= -1.45e-210) {
tmp = 9.0 * (x * (y / (z * c)));
} else if (t <= 4.6e-138) {
tmp = b / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = ((a / c) * t) * -4.0 tmp = 0 if t <= -1750000000.0: tmp = t_1 elif t <= -1.45e-210: tmp = 9.0 * (x * (y / (z * c))) elif t <= 4.6e-138: tmp = b / (z * c) else: tmp = t_1 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(a / c) * t) * -4.0) tmp = 0.0 if (t <= -1750000000.0) tmp = t_1; elseif (t <= -1.45e-210) tmp = Float64(9.0 * Float64(x * Float64(y / Float64(z * c)))); elseif (t <= 4.6e-138) tmp = Float64(b / Float64(z * c)); else tmp = t_1; 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 = ((a / c) * t) * -4.0;
tmp = 0.0;
if (t <= -1750000000.0)
tmp = t_1;
elseif (t <= -1.45e-210)
tmp = 9.0 * (x * (y / (z * c)));
elseif (t <= 4.6e-138)
tmp = b / (z * c);
else
tmp = t_1;
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[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[t, -1750000000.0], t$95$1, If[LessEqual[t, -1.45e-210], N[(9.0 * N[(x * N[(y / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-138], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{if}\;t \leq -1750000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-210}:\\
\;\;\;\;9 \cdot \left(x \cdot \frac{y}{z \cdot c}\right)\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-138}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.75e9 or 4.5999999999999998e-138 < t Initial program 73.0%
associate-+l-73.0%
*-commutative73.0%
associate-*r*77.1%
*-commutative77.1%
associate-+l-77.1%
Simplified74.8%
Taylor expanded in z around inf 53.0%
*-commutative53.0%
associate-/l*60.2%
associate-/r/58.0%
Simplified58.0%
if -1.75e9 < t < -1.45000000000000003e-210Initial program 74.8%
associate-+l-74.8%
*-commutative74.8%
associate-*r*72.2%
*-commutative72.2%
associate-+l-72.2%
Simplified74.8%
Taylor expanded in x around inf 46.9%
expm1-log1p-u22.4%
expm1-udef22.5%
associate-/l*24.6%
Applied egg-rr24.6%
expm1-def24.5%
expm1-log1p46.8%
associate-/r/41.9%
*-commutative41.9%
Simplified41.9%
if -1.45000000000000003e-210 < t < 4.5999999999999998e-138Initial program 95.0%
associate-+l-95.0%
associate-*l*95.0%
fma-neg95.0%
neg-sub095.0%
associate-+l-95.0%
neg-sub095.0%
+-commutative95.0%
distribute-rgt-neg-out95.0%
*-commutative95.0%
associate-*l*87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
distribute-rgt-neg-in87.6%
distribute-rgt-neg-in87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in b around inf 59.2%
Final simplification55.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
(let* ((t_1 (* (* (/ a c) t) -4.0)))
(if (<= t -440000000.0)
t_1
(if (<= t -7e-210)
(* 9.0 (/ (* y x) (* z c)))
(if (<= t 1.9e-138) (/ b (* z c)) t_1)))))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 = ((a / c) * t) * -4.0;
double tmp;
if (t <= -440000000.0) {
tmp = t_1;
} else if (t <= -7e-210) {
tmp = 9.0 * ((y * x) / (z * c));
} else if (t <= 1.9e-138) {
tmp = b / (z * c);
} else {
tmp = t_1;
}
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 = ((a / c) * t) * (-4.0d0)
if (t <= (-440000000.0d0)) then
tmp = t_1
else if (t <= (-7d-210)) then
tmp = 9.0d0 * ((y * x) / (z * c))
else if (t <= 1.9d-138) then
tmp = b / (z * c)
else
tmp = t_1
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 = ((a / c) * t) * -4.0;
double tmp;
if (t <= -440000000.0) {
tmp = t_1;
} else if (t <= -7e-210) {
tmp = 9.0 * ((y * x) / (z * c));
} else if (t <= 1.9e-138) {
tmp = b / (z * c);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = ((a / c) * t) * -4.0 tmp = 0 if t <= -440000000.0: tmp = t_1 elif t <= -7e-210: tmp = 9.0 * ((y * x) / (z * c)) elif t <= 1.9e-138: tmp = b / (z * c) else: tmp = t_1 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(a / c) * t) * -4.0) tmp = 0.0 if (t <= -440000000.0) tmp = t_1; elseif (t <= -7e-210) tmp = Float64(9.0 * Float64(Float64(y * x) / Float64(z * c))); elseif (t <= 1.9e-138) tmp = Float64(b / Float64(z * c)); else tmp = t_1; 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 = ((a / c) * t) * -4.0;
tmp = 0.0;
if (t <= -440000000.0)
tmp = t_1;
elseif (t <= -7e-210)
tmp = 9.0 * ((y * x) / (z * c));
elseif (t <= 1.9e-138)
tmp = b / (z * c);
else
tmp = t_1;
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[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[t, -440000000.0], t$95$1, If[LessEqual[t, -7e-210], N[(9.0 * N[(N[(y * x), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-138], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{if}\;t \leq -440000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7 \cdot 10^{-210}:\\
\;\;\;\;9 \cdot \frac{y \cdot x}{z \cdot c}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-138}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.4e8 or 1.9000000000000001e-138 < t Initial program 73.0%
associate-+l-73.0%
*-commutative73.0%
associate-*r*77.1%
*-commutative77.1%
associate-+l-77.1%
Simplified74.8%
Taylor expanded in z around inf 53.0%
*-commutative53.0%
associate-/l*60.2%
associate-/r/58.0%
Simplified58.0%
if -4.4e8 < t < -7.00000000000000031e-210Initial program 74.8%
associate-+l-74.8%
*-commutative74.8%
associate-*r*72.2%
*-commutative72.2%
associate-+l-72.2%
Simplified74.8%
Taylor expanded in x around inf 46.9%
if -7.00000000000000031e-210 < t < 1.9000000000000001e-138Initial program 95.0%
associate-+l-95.0%
associate-*l*95.0%
fma-neg95.0%
neg-sub095.0%
associate-+l-95.0%
neg-sub095.0%
+-commutative95.0%
distribute-rgt-neg-out95.0%
*-commutative95.0%
associate-*l*87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
distribute-rgt-neg-in87.6%
distribute-rgt-neg-in87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in b around inf 59.2%
Final simplification56.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 (<= z -1.5e-17) (not (<= z 8e-36))) (* -4.0 (/ (* a t) c)) (/ b (* 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 ((z <= -1.5e-17) || !(z <= 8e-36)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (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 ((z <= (-1.5d-17)) .or. (.not. (z <= 8d-36))) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = b / (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 ((z <= -1.5e-17) || !(z <= 8e-36)) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (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 (z <= -1.5e-17) or not (z <= 8e-36): tmp = -4.0 * ((a * t) / c) else: tmp = b / (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 ((z <= -1.5e-17) || !(z <= 8e-36)) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(b / Float64(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 ((z <= -1.5e-17) || ~((z <= 8e-36)))
tmp = -4.0 * ((a * t) / c);
else
tmp = b / (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[z, -1.5e-17], N[Not[LessEqual[z, 8e-36]], $MachinePrecision]], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * 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.5 \cdot 10^{-17} \lor \neg \left(z \leq 8 \cdot 10^{-36}\right):\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.50000000000000003e-17 or 7.9999999999999995e-36 < z Initial program 60.3%
associate-+l-60.3%
*-commutative60.3%
associate-*r*62.5%
*-commutative62.5%
associate-+l-62.5%
Simplified66.0%
Taylor expanded in z around inf 59.8%
if -1.50000000000000003e-17 < z < 7.9999999999999995e-36Initial program 98.4%
associate-+l-98.4%
associate-*l*99.3%
fma-neg99.3%
neg-sub099.3%
associate-+l-99.3%
neg-sub099.3%
+-commutative99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
associate-*l*98.4%
distribute-rgt-neg-in98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
distribute-rgt-neg-in98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in b around inf 52.7%
Final simplification56.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 (if (or (<= t -1800000000.0) (not (<= t 1.14e-138))) (* (* (/ a c) t) -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 <= -1800000000.0) || !(t <= 1.14e-138)) {
tmp = ((a / c) * t) * -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 <= (-1800000000.0d0)) .or. (.not. (t <= 1.14d-138))) then
tmp = ((a / c) * t) * (-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 <= -1800000000.0) || !(t <= 1.14e-138)) {
tmp = ((a / c) * t) * -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 <= -1800000000.0) or not (t <= 1.14e-138): tmp = ((a / c) * t) * -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 <= -1800000000.0) || !(t <= 1.14e-138)) tmp = Float64(Float64(Float64(a / c) * t) * -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 <= -1800000000.0) || ~((t <= 1.14e-138)))
tmp = ((a / c) * t) * -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, -1800000000.0], N[Not[LessEqual[t, 1.14e-138]], $MachinePrecision]], N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $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 -1800000000 \lor \neg \left(t \leq 1.14 \cdot 10^{-138}\right):\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if t < -1.8e9 or 1.1399999999999999e-138 < t Initial program 73.0%
associate-+l-73.0%
*-commutative73.0%
associate-*r*77.1%
*-commutative77.1%
associate-+l-77.1%
Simplified74.8%
Taylor expanded in z around inf 53.0%
*-commutative53.0%
associate-/l*60.2%
associate-/r/58.0%
Simplified58.0%
if -1.8e9 < t < 1.1399999999999999e-138Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*81.1%
*-commutative81.1%
associate-+l-81.1%
Simplified86.4%
Taylor expanded in b around inf 45.3%
associate-/r*46.9%
Simplified46.9%
Final simplification54.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 (if (or (<= t -440000000.0) (not (<= t 9.2e-141))) (* (* (/ a c) t) -4.0) (* (/ b c) (/ 1.0 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 <= -440000000.0) || !(t <= 9.2e-141)) {
tmp = ((a / c) * t) * -4.0;
} else {
tmp = (b / c) * (1.0 / 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 <= (-440000000.0d0)) .or. (.not. (t <= 9.2d-141))) then
tmp = ((a / c) * t) * (-4.0d0)
else
tmp = (b / c) * (1.0d0 / 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 <= -440000000.0) || !(t <= 9.2e-141)) {
tmp = ((a / c) * t) * -4.0;
} else {
tmp = (b / c) * (1.0 / 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 <= -440000000.0) or not (t <= 9.2e-141): tmp = ((a / c) * t) * -4.0 else: tmp = (b / c) * (1.0 / 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 <= -440000000.0) || !(t <= 9.2e-141)) tmp = Float64(Float64(Float64(a / c) * t) * -4.0); else tmp = Float64(Float64(b / c) * Float64(1.0 / 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 <= -440000000.0) || ~((t <= 9.2e-141)))
tmp = ((a / c) * t) * -4.0;
else
tmp = (b / c) * (1.0 / 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, -440000000.0], N[Not[LessEqual[t, 9.2e-141]], $MachinePrecision]], N[(N[(N[(a / c), $MachinePrecision] * t), $MachinePrecision] * -4.0), $MachinePrecision], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -440000000 \lor \neg \left(t \leq 9.2 \cdot 10^{-141}\right):\\
\;\;\;\;\left(\frac{a}{c} \cdot t\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\end{array}
\end{array}
if t < -4.4e8 or 9.1999999999999998e-141 < t Initial program 73.0%
associate-+l-73.0%
*-commutative73.0%
associate-*r*77.1%
*-commutative77.1%
associate-+l-77.1%
Simplified74.8%
Taylor expanded in z around inf 53.0%
*-commutative53.0%
associate-/l*60.2%
associate-/r/58.0%
Simplified58.0%
if -4.4e8 < t < 9.1999999999999998e-141Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
associate-*r*81.1%
*-commutative81.1%
associate-+l-81.1%
Simplified86.4%
Taylor expanded in b around inf 45.3%
associate-/r*46.9%
Simplified46.9%
div-inv46.9%
Applied egg-rr46.9%
Final simplification54.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 (/ b (* z c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
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 / (z * c)
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 / (z * c);
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) 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 / (z * c);
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[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 77.7%
associate-+l-77.7%
associate-*l*77.8%
fma-neg78.2%
neg-sub078.2%
associate-+l-78.2%
neg-sub078.2%
+-commutative78.2%
distribute-rgt-neg-out78.2%
*-commutative78.2%
associate-*l*78.9%
distribute-rgt-neg-in78.9%
*-commutative78.9%
distribute-rgt-neg-in78.9%
distribute-rgt-neg-in78.9%
metadata-eval78.9%
Simplified78.9%
Taylor expanded in b around inf 33.2%
Final simplification33.2%
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 77.7%
associate-+l-77.7%
*-commutative77.7%
associate-*r*78.5%
*-commutative78.5%
associate-+l-78.5%
Simplified78.9%
Taylor expanded in b around inf 33.2%
associate-/r*34.5%
Simplified34.5%
Final simplification34.5%
(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 2023268
(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)))