
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -5e-224) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* -9.0 (* z y)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5e-224) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (-9.0 * (z * y)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5e-224) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(-9.0 * Float64(z * y))))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5e-224], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-224}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -4.9999999999999999e-224Initial program 93.4%
Simplified96.2%
Taylor expanded in t around 0 96.2%
associate-*r*96.2%
*-commutative96.2%
*-commutative96.2%
Simplified96.2%
if -4.9999999999999999e-224 < z Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*92.0%
distribute-lft-neg-in92.0%
*-commutative92.0%
cancel-sign-sub-inv92.0%
associate-+r-92.0%
associate-*l*92.1%
fma-def93.4%
cancel-sign-sub-inv93.4%
fma-def93.4%
distribute-lft-neg-in93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
associate-*r*96.1%
distribute-rgt-neg-out96.1%
*-commutative96.1%
associate-*r*96.1%
Simplified96.1%
Final simplification96.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 5e-63) (- (+ (* a (* 27.0 b)) (* x 2.0)) (* z (* y (* t 9.0)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* -9.0 (* z y)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 5e-63) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (z * (y * (t * 9.0)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (-9.0 * (z * y)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 5e-63) tmp = Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(z * Float64(y * Float64(t * 9.0)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(-9.0 * Float64(z * y))))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 5e-63], N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5 \cdot 10^{-63}:\\
\;\;\;\;\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - z \cdot \left(y \cdot \left(t \cdot 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 5.0000000000000002e-63Initial program 93.6%
sub-neg93.6%
sub-neg93.6%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
+-commutative93.5%
associate-+r-93.5%
associate-*l*94.1%
Applied egg-rr94.1%
Taylor expanded in y around 0 93.6%
*-commutative93.6%
associate-*r*94.1%
*-commutative94.1%
associate-*r*94.1%
*-commutative94.1%
metadata-eval94.1%
distribute-rgt-neg-in94.1%
associate-*r*94.1%
associate-*r*94.1%
distribute-rgt-neg-in94.1%
metadata-eval94.1%
associate-*l*94.1%
associate-*l*94.6%
Simplified94.6%
if 5.0000000000000002e-63 < t Initial program 95.8%
+-commutative95.8%
associate-+r-95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
associate-*r*90.4%
distribute-lft-neg-in90.4%
*-commutative90.4%
cancel-sign-sub-inv90.4%
associate-+r-90.4%
associate-*l*91.7%
fma-def93.0%
cancel-sign-sub-inv93.0%
fma-def93.0%
distribute-lft-neg-in93.0%
distribute-rgt-neg-in93.0%
*-commutative93.0%
associate-*r*98.5%
distribute-rgt-neg-out98.5%
*-commutative98.5%
associate-*r*98.4%
Simplified98.4%
Final simplification95.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -5e-224) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* z -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* -9.0 (* z y)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5e-224) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (z * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (-9.0 * (z * y)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5e-224) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(z * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(-9.0 * Float64(z * y))))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5e-224], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-224}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -4.9999999999999999e-224Initial program 93.4%
Simplified96.2%
if -4.9999999999999999e-224 < z Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*92.0%
distribute-lft-neg-in92.0%
*-commutative92.0%
cancel-sign-sub-inv92.0%
associate-+r-92.0%
associate-*l*92.1%
fma-def93.4%
cancel-sign-sub-inv93.4%
fma-def93.4%
distribute-lft-neg-in93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
associate-*r*96.1%
distribute-rgt-neg-out96.1%
*-commutative96.1%
associate-*r*96.1%
Simplified96.1%
Final simplification96.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.4e+41) (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* z t)))) (fma z (* -9.0 (* y t)) (* x 2.0))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+41) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = fma(z, (-9.0 * (y * t)), (x * 2.0));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.4e+41) tmp = Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(z * t)))); else tmp = fma(z, Float64(-9.0 * Float64(y * t)), Float64(x * 2.0)); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.4e+41], N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+41}:\\
\;\;\;\;\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, -9 \cdot \left(y \cdot t\right), x \cdot 2\right)\\
\end{array}
\end{array}
if z < 1.4e41Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*95.2%
associate-*l*95.8%
Simplified95.8%
+-commutative95.8%
associate-+r-95.8%
associate-*l*96.3%
Applied egg-rr96.3%
if 1.4e41 < z Initial program 90.9%
+-commutative90.9%
associate-+r-90.9%
*-commutative90.9%
cancel-sign-sub-inv90.9%
associate-*r*95.2%
distribute-lft-neg-in95.2%
*-commutative95.2%
cancel-sign-sub-inv95.2%
associate-+r-95.2%
associate-*l*95.2%
fma-def98.3%
cancel-sign-sub-inv98.3%
fma-def98.3%
distribute-lft-neg-in98.3%
distribute-rgt-neg-in98.3%
*-commutative98.3%
associate-*r*94.0%
distribute-rgt-neg-out94.0%
*-commutative94.0%
associate-*r*94.0%
Simplified94.0%
*-commutative94.0%
associate-*l*94.0%
*-commutative94.0%
associate-*r*89.4%
*-commutative89.4%
add-cube-cbrt89.1%
pow389.1%
*-commutative89.1%
associate-*r*93.7%
*-commutative93.7%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
associate-*r*93.6%
Applied egg-rr93.6%
Taylor expanded in a around 0 79.3%
pow-base-179.3%
associate-*r*79.3%
metadata-eval79.3%
associate-*r*79.3%
*-commutative79.3%
associate-*r*83.7%
associate-*r*83.7%
*-commutative83.7%
fma-def83.7%
associate-*r*83.7%
*-commutative83.7%
associate-*r*83.7%
Simplified83.7%
Final simplification93.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* b (* a 27.0)) (* (* z t) (* y -9.0)))))
(if (<= z -3.5e-55)
t_1
(if (<= z 1.35e-120)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= z 1.85e+40) t_1 (- (* x 2.0) (* 9.0 (* t (* z y)))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
double tmp;
if (z <= -3.5e-55) {
tmp = t_1;
} else if (z <= 1.35e-120) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (z <= 1.85e+40) {
tmp = t_1;
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (b * (a * 27.0d0)) + ((z * t) * (y * (-9.0d0)))
if (z <= (-3.5d-55)) then
tmp = t_1
else if (z <= 1.35d-120) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if (z <= 1.85d+40) then
tmp = t_1
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
double tmp;
if (z <= -3.5e-55) {
tmp = t_1;
} else if (z <= 1.35e-120) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (z <= 1.85e+40) {
tmp = t_1;
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (b * (a * 27.0)) + ((z * t) * (y * -9.0)) tmp = 0 if z <= -3.5e-55: tmp = t_1 elif z <= 1.35e-120: tmp = (x * 2.0) + (27.0 * (a * b)) elif z <= 1.85e+40: tmp = t_1 else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(z * t) * Float64(y * -9.0))) tmp = 0.0 if (z <= -3.5e-55) tmp = t_1; elseif (z <= 1.35e-120) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (z <= 1.85e+40) tmp = t_1; else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
tmp = 0.0;
if (z <= -3.5e-55)
tmp = t_1;
elseif (z <= 1.35e-120)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif (z <= 1.85e+40)
tmp = t_1;
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-55], t$95$1, If[LessEqual[z, 1.35e-120], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+40], t$95$1, N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right) + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-120}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.50000000000000025e-55 or 1.3499999999999999e-120 < z < 1.85e40Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in x around 0 68.0%
cancel-sign-sub-inv68.0%
associate-*r*68.0%
metadata-eval68.0%
*-commutative68.0%
associate-*r*68.0%
associate-*r*68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
associate-*r*68.0%
*-commutative68.0%
Applied egg-rr68.0%
if -3.50000000000000025e-55 < z < 1.3499999999999999e-120Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*98.7%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 89.3%
if 1.85e40 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*86.3%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in a around 0 79.3%
Final simplification77.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 9.0 (* t (* z y)))) (t_2 (* 27.0 (* a b))))
(if (<= z -8.5e-56)
(+ (* b (* a 27.0)) (* (* z t) (* y -9.0)))
(if (<= z 2e-121)
(+ (* x 2.0) t_2)
(if (<= z 5e+39) (- t_2 t_1) (- (* x 2.0) t_1))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (t * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -8.5e-56) {
tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
} else if (z <= 2e-121) {
tmp = (x * 2.0) + t_2;
} else if (z <= 5e+39) {
tmp = t_2 - t_1;
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (t * (z * y))
t_2 = 27.0d0 * (a * b)
if (z <= (-8.5d-56)) then
tmp = (b * (a * 27.0d0)) + ((z * t) * (y * (-9.0d0)))
else if (z <= 2d-121) then
tmp = (x * 2.0d0) + t_2
else if (z <= 5d+39) then
tmp = t_2 - t_1
else
tmp = (x * 2.0d0) - t_1
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (t * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -8.5e-56) {
tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
} else if (z <= 2e-121) {
tmp = (x * 2.0) + t_2;
} else if (z <= 5e+39) {
tmp = t_2 - t_1;
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 9.0 * (t * (z * y)) t_2 = 27.0 * (a * b) tmp = 0 if z <= -8.5e-56: tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0)) elif z <= 2e-121: tmp = (x * 2.0) + t_2 elif z <= 5e+39: tmp = t_2 - t_1 else: tmp = (x * 2.0) - t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(9.0 * Float64(t * Float64(z * y))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -8.5e-56) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(z * t) * Float64(y * -9.0))); elseif (z <= 2e-121) tmp = Float64(Float64(x * 2.0) + t_2); elseif (z <= 5e+39) tmp = Float64(t_2 - t_1); else tmp = Float64(Float64(x * 2.0) - t_1); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 9.0 * (t * (z * y));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -8.5e-56)
tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
elseif (z <= 2e-121)
tmp = (x * 2.0) + t_2;
elseif (z <= 5e+39)
tmp = t_2 - t_1;
else
tmp = (x * 2.0) - t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e-56], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-121], N[(N[(x * 2.0), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 5e+39], N[(t$95$2 - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{-56}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-121}:\\
\;\;\;\;x \cdot 2 + t_2\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+39}:\\
\;\;\;\;t_2 - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t_1\\
\end{array}
\end{array}
if z < -8.49999999999999932e-56Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*90.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around 0 67.4%
cancel-sign-sub-inv67.4%
associate-*r*66.1%
metadata-eval66.1%
*-commutative66.1%
associate-*r*66.2%
associate-*r*66.2%
*-commutative66.2%
*-commutative66.2%
*-commutative66.2%
associate-*r*66.1%
*-commutative66.1%
Applied egg-rr66.1%
if -8.49999999999999932e-56 < z < 2e-121Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 90.4%
if 2e-121 < z < 5.00000000000000015e39Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*94.2%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around 0 70.0%
if 5.00000000000000015e39 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*86.3%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in a around 0 79.3%
Final simplification77.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.42e+65) (+ (* b (* a 27.0)) (* (* z t) (* y -9.0))) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* z y) (* t 9.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.42e+65) {
tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
} else {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * y) * (t * 9.0)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.42d+65)) then
tmp = (b * (a * 27.0d0)) + ((z * t) * (y * (-9.0d0)))
else
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((z * y) * (t * 9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.42e+65) {
tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
} else {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * y) * (t * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.42e+65: tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0)) else: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * y) * (t * 9.0))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.42e+65) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(z * t) * Float64(y * -9.0))); else tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(z * y) * Float64(t * 9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.42e+65)
tmp = (b * (a * 27.0)) + ((z * t) * (y * -9.0));
else
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * y) * (t * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.42e+65], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+65}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(z \cdot y\right) \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if z < -1.42000000000000012e65Initial program 88.0%
sub-neg88.0%
sub-neg88.0%
associate-*l*87.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in x around 0 64.3%
cancel-sign-sub-inv64.3%
associate-*r*64.3%
metadata-eval64.3%
*-commutative64.3%
associate-*r*64.4%
associate-*r*64.4%
*-commutative64.4%
*-commutative64.4%
*-commutative64.4%
associate-*r*64.2%
*-commutative64.2%
Applied egg-rr64.2%
if -1.42000000000000012e65 < z Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*94.2%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around 0 96.1%
associate-*r*96.1%
Simplified96.1%
Final simplification90.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.4e+41) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* z t) (* y 9.0)))) (- (* x 2.0) (* 9.0 (* t (* z y))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+41) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * t) * (y * 9.0)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= 1.4d+41) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((z * t) * (y * 9.0d0)))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+41) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * t) * (y * 9.0)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.4e+41: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * t) * (y * 9.0))) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.4e+41) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(z * t) * Float64(y * 9.0)))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.4e+41)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((z * t) * (y * 9.0)));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.4e+41], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+41}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.4e41Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*95.2%
associate-*l*95.8%
Simplified95.8%
if 1.4e41 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*86.3%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in a around 0 79.3%
Final simplification91.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.4e+41) (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* z t)))) (- (* x 2.0) (* 9.0 (* t (* z y))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+41) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= 1.4d+41) then
tmp = ((a * (27.0d0 * b)) + (x * 2.0d0)) - (y * (9.0d0 * (z * t)))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.4e+41) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.4e+41: tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t))) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.4e+41) tmp = Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.4e+41)
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (z * t)));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.4e+41], N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+41}:\\
\;\;\;\;\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.4e41Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*95.2%
associate-*l*95.8%
Simplified95.8%
+-commutative95.8%
associate-+r-95.8%
associate-*l*96.3%
Applied egg-rr96.3%
if 1.4e41 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*86.3%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in a around 0 79.3%
Final simplification92.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.05e+42)
(* 9.0 (* z (* y (- t))))
(if (<= z 9e+38)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.05e+42) {
tmp = 9.0 * (z * (y * -t));
} else if (z <= 9e+38) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-2.05d+42)) then
tmp = 9.0d0 * (z * (y * -t))
else if (z <= 9d+38) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.05e+42) {
tmp = 9.0 * (z * (y * -t));
} else if (z <= 9e+38) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.05e+42: tmp = 9.0 * (z * (y * -t)) elif z <= 9e+38: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.05e+42) tmp = Float64(9.0 * Float64(z * Float64(y * Float64(-t)))); elseif (z <= 9e+38) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.05e+42)
tmp = 9.0 * (z * (y * -t));
elseif (z <= 9e+38)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.05e+42], N[(9.0 * N[(z * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+38], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+42}:\\
\;\;\;\;9 \cdot \left(z \cdot \left(y \cdot \left(-t\right)\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+38}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.05e42Initial program 88.9%
sub-neg88.9%
sub-neg88.9%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in y around inf 44.6%
associate-*r*44.7%
*-commutative44.7%
associate-*l*44.6%
associate-*r*44.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in y around 0 44.6%
*-commutative44.6%
associate-*l*44.6%
metadata-eval44.6%
*-commutative44.6%
distribute-lft-neg-in44.6%
associate-*r*48.2%
Applied egg-rr48.2%
if -2.05e42 < z < 8.99999999999999961e38Initial program 97.7%
sub-neg97.7%
sub-neg97.7%
associate-*l*97.7%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 87.0%
if 8.99999999999999961e38 < z Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in a around 0 79.1%
Final simplification76.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))))
(if (<= z -8e-58)
t_1
(if (<= z -2.35e-296)
(* x 2.0)
(if (<= z 6.1e+38) (* 27.0 (* a b)) t_1)))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -8e-58) {
tmp = t_1;
} else if (z <= -2.35e-296) {
tmp = x * 2.0;
} else if (z <= 6.1e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (z <= (-8d-58)) then
tmp = t_1
else if (z <= (-2.35d-296)) then
tmp = x * 2.0d0
else if (z <= 6.1d+38) then
tmp = 27.0d0 * (a * b)
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -8e-58) {
tmp = t_1;
} else if (z <= -2.35e-296) {
tmp = x * 2.0;
} else if (z <= 6.1e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if z <= -8e-58: tmp = t_1 elif z <= -2.35e-296: tmp = x * 2.0 elif z <= 6.1e+38: tmp = 27.0 * (a * b) else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -8e-58) tmp = t_1; elseif (z <= -2.35e-296) tmp = Float64(x * 2.0); elseif (z <= 6.1e+38) tmp = Float64(27.0 * Float64(a * b)); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -8e-58)
tmp = t_1;
elseif (z <= -2.35e-296)
tmp = x * 2.0;
elseif (z <= 6.1e+38)
tmp = 27.0 * (a * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e-58], t$95$1, If[LessEqual[z, -2.35e-296], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.1e+38], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{-58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-296}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{+38}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.0000000000000002e-58 or 6.0999999999999999e38 < z Initial program 90.7%
sub-neg90.7%
sub-neg90.7%
associate-*l*88.5%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in y around inf 51.6%
if -8.0000000000000002e-58 < z < -2.35e-296Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 54.0%
if -2.35e-296 < z < 6.0999999999999999e38Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*97.0%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in a around inf 51.9%
Final simplification52.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.16e-58)
(* -9.0 (* t (* z y)))
(if (<= z -2.4e-296)
(* x 2.0)
(if (<= z 4.1e+38) (* 27.0 (* a b)) (* t (* -9.0 (* z y)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.16e-58) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2.4e-296) {
tmp = x * 2.0;
} else if (z <= 4.1e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.16d-58)) then
tmp = (-9.0d0) * (t * (z * y))
else if (z <= (-2.4d-296)) then
tmp = x * 2.0d0
else if (z <= 4.1d+38) then
tmp = 27.0d0 * (a * b)
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.16e-58) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2.4e-296) {
tmp = x * 2.0;
} else if (z <= 4.1e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.16e-58: tmp = -9.0 * (t * (z * y)) elif z <= -2.4e-296: tmp = x * 2.0 elif z <= 4.1e+38: tmp = 27.0 * (a * b) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.16e-58) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (z <= -2.4e-296) tmp = Float64(x * 2.0); elseif (z <= 4.1e+38) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.16e-58)
tmp = -9.0 * (t * (z * y));
elseif (z <= -2.4e-296)
tmp = x * 2.0;
elseif (z <= 4.1e+38)
tmp = 27.0 * (a * b);
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.16e-58], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-296], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.1e+38], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{-58}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-296}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+38}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.16000000000000007e-58Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*90.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 38.8%
if -1.16000000000000007e-58 < z < -2.39999999999999996e-296Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 54.0%
if -2.39999999999999996e-296 < z < 4.1000000000000003e38Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*97.0%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in a around inf 51.9%
if 4.1000000000000003e38 < z Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 65.7%
associate-*r*65.7%
*-commutative65.7%
associate-*l*65.8%
associate-*r*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y around 0 65.8%
Final simplification52.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -6.6e-57)
(* t (* z (* y -9.0)))
(if (<= z -2.4e-296)
(* x 2.0)
(if (<= z 6e+38) (* 27.0 (* a b)) (* t (* -9.0 (* z y)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.6e-57) {
tmp = t * (z * (y * -9.0));
} else if (z <= -2.4e-296) {
tmp = x * 2.0;
} else if (z <= 6e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-6.6d-57)) then
tmp = t * (z * (y * (-9.0d0)))
else if (z <= (-2.4d-296)) then
tmp = x * 2.0d0
else if (z <= 6d+38) then
tmp = 27.0d0 * (a * b)
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.6e-57) {
tmp = t * (z * (y * -9.0));
} else if (z <= -2.4e-296) {
tmp = x * 2.0;
} else if (z <= 6e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -6.6e-57: tmp = t * (z * (y * -9.0)) elif z <= -2.4e-296: tmp = x * 2.0 elif z <= 6e+38: tmp = 27.0 * (a * b) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6.6e-57) tmp = Float64(t * Float64(z * Float64(y * -9.0))); elseif (z <= -2.4e-296) tmp = Float64(x * 2.0); elseif (z <= 6e+38) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -6.6e-57)
tmp = t * (z * (y * -9.0));
elseif (z <= -2.4e-296)
tmp = x * 2.0;
elseif (z <= 6e+38)
tmp = 27.0 * (a * b);
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6.6e-57], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-296], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6e+38], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-57}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-296}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+38}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -6.5999999999999997e-57Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*90.4%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around inf 38.8%
associate-*r*38.9%
*-commutative38.9%
associate-*l*38.9%
associate-*r*38.9%
*-commutative38.9%
Simplified38.9%
if -6.5999999999999997e-57 < z < -2.39999999999999996e-296Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 54.0%
if -2.39999999999999996e-296 < z < 6.0000000000000002e38Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*97.0%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in a around inf 51.9%
if 6.0000000000000002e38 < z Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 65.7%
associate-*r*65.7%
*-commutative65.7%
associate-*l*65.8%
associate-*r*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y around 0 65.8%
Final simplification52.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.65e-51)
(* 9.0 (* z (* y (- t))))
(if (<= z -2.35e-296)
(* x 2.0)
(if (<= z 9.5e+38) (* 27.0 (* a b)) (* t (* -9.0 (* z y)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e-51) {
tmp = 9.0 * (z * (y * -t));
} else if (z <= -2.35e-296) {
tmp = x * 2.0;
} else if (z <= 9.5e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.65d-51)) then
tmp = 9.0d0 * (z * (y * -t))
else if (z <= (-2.35d-296)) then
tmp = x * 2.0d0
else if (z <= 9.5d+38) then
tmp = 27.0d0 * (a * b)
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e-51) {
tmp = 9.0 * (z * (y * -t));
} else if (z <= -2.35e-296) {
tmp = x * 2.0;
} else if (z <= 9.5e+38) {
tmp = 27.0 * (a * b);
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.65e-51: tmp = 9.0 * (z * (y * -t)) elif z <= -2.35e-296: tmp = x * 2.0 elif z <= 9.5e+38: tmp = 27.0 * (a * b) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.65e-51) tmp = Float64(9.0 * Float64(z * Float64(y * Float64(-t)))); elseif (z <= -2.35e-296) tmp = Float64(x * 2.0); elseif (z <= 9.5e+38) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.65e-51)
tmp = 9.0 * (z * (y * -t));
elseif (z <= -2.35e-296)
tmp = x * 2.0;
elseif (z <= 9.5e+38)
tmp = 27.0 * (a * b);
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.65e-51], N[(9.0 * N[(z * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.35e-296], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 9.5e+38], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-51}:\\
\;\;\;\;9 \cdot \left(z \cdot \left(y \cdot \left(-t\right)\right)\right)\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-296}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+38}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.64999999999999986e-51Initial program 91.7%
sub-neg91.7%
sub-neg91.7%
associate-*l*91.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in y around inf 38.0%
associate-*r*38.0%
*-commutative38.0%
associate-*l*38.0%
associate-*r*38.0%
*-commutative38.0%
Simplified38.0%
Taylor expanded in y around 0 38.0%
*-commutative38.0%
associate-*l*38.0%
metadata-eval38.0%
*-commutative38.0%
distribute-lft-neg-in38.0%
associate-*r*40.6%
Applied egg-rr40.6%
if -1.64999999999999986e-51 < z < -2.35e-296Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*97.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 52.9%
if -2.35e-296 < z < 9.4999999999999995e38Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*97.0%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in a around inf 51.9%
if 9.4999999999999995e38 < z Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*86.5%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 65.7%
associate-*r*65.7%
*-commutative65.7%
associate-*l*65.8%
associate-*r*65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y around 0 65.8%
Final simplification52.5%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.85e+42) (* 9.0 (* z (* y (- t)))) (if (<= z 3e+85) (+ (* x 2.0) (* 27.0 (* a b))) (* t (* -9.0 (* z y))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+42) {
tmp = 9.0 * (z * (y * -t));
} else if (z <= 3e+85) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.85d+42)) then
tmp = 9.0d0 * (z * (y * -t))
else if (z <= 3d+85) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * ((-9.0d0) * (z * y))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.85e+42) {
tmp = 9.0 * (z * (y * -t));
} else if (z <= 3e+85) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (-9.0 * (z * y));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.85e+42: tmp = 9.0 * (z * (y * -t)) elif z <= 3e+85: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * (-9.0 * (z * y)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.85e+42) tmp = Float64(9.0 * Float64(z * Float64(y * Float64(-t)))); elseif (z <= 3e+85) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(-9.0 * Float64(z * y))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.85e+42)
tmp = 9.0 * (z * (y * -t));
elseif (z <= 3e+85)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * (-9.0 * (z * y));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.85e+42], N[(9.0 * N[(z * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+85], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+42}:\\
\;\;\;\;9 \cdot \left(z \cdot \left(y \cdot \left(-t\right)\right)\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+85}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.84999999999999998e42Initial program 88.9%
sub-neg88.9%
sub-neg88.9%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in y around inf 44.6%
associate-*r*44.7%
*-commutative44.7%
associate-*l*44.6%
associate-*r*44.7%
*-commutative44.7%
Simplified44.7%
Taylor expanded in y around 0 44.6%
*-commutative44.6%
associate-*l*44.6%
metadata-eval44.6%
*-commutative44.6%
distribute-lft-neg-in44.6%
associate-*r*48.2%
Applied egg-rr48.2%
if -1.84999999999999998e42 < z < 3e85Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*96.4%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 85.6%
if 3e85 < z Initial program 90.1%
sub-neg90.1%
sub-neg90.1%
associate-*l*88.4%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around inf 67.8%
associate-*r*67.8%
*-commutative67.8%
associate-*l*67.9%
associate-*r*67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in y around 0 67.9%
Final simplification73.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -3e+129) (not (<= a 4.95e-57))) (* 27.0 (* a b)) (* x 2.0)))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3e+129) || !(a <= 4.95e-57)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((a <= (-3d+129)) .or. (.not. (a <= 4.95d-57))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3e+129) || !(a <= 4.95e-57)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -3e+129) or not (a <= 4.95e-57): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3e+129) || !(a <= 4.95e-57)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -3e+129) || ~((a <= 4.95e-57)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3e+129], N[Not[LessEqual[a, 4.95e-57]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+129} \lor \neg \left(a \leq 4.95 \cdot 10^{-57}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.0000000000000003e129 or 4.9499999999999998e-57 < a Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*91.3%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around inf 52.6%
if -3.0000000000000003e129 < a < 4.9499999999999998e-57Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*94.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 41.9%
Final simplification47.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -3e+129) (not (<= a 4.4e-57))) (* a (* 27.0 b)) (* x 2.0)))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3e+129) || !(a <= 4.4e-57)) {
tmp = a * (27.0 * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((a <= (-3d+129)) .or. (.not. (a <= 4.4d-57))) then
tmp = a * (27.0d0 * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3e+129) || !(a <= 4.4e-57)) {
tmp = a * (27.0 * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -3e+129) or not (a <= 4.4e-57): tmp = a * (27.0 * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3e+129) || !(a <= 4.4e-57)) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -3e+129) || ~((a <= 4.4e-57)))
tmp = a * (27.0 * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3e+129], N[Not[LessEqual[a, 4.4e-57]], $MachinePrecision]], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+129} \lor \neg \left(a \leq 4.4 \cdot 10^{-57}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.0000000000000003e129 or 4.39999999999999997e-57 < a Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*91.3%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around inf 52.6%
associate-*r*52.6%
*-commutative52.6%
associate-*r*52.6%
Simplified52.6%
if -3.0000000000000003e129 < a < 4.39999999999999997e-57Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*94.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 41.9%
Final simplification47.2%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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
code = x * 2.0d0
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
x \cdot 2
\end{array}
Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*93.0%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around inf 32.3%
Final simplification32.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2023306
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))