
(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 16 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 (<= (* y 9.0) -1e+54) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* -9.0 z))))) (fma x 2.0 (fma z (* y (* t -9.0)) (* b (* a 27.0))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -1e+54) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (-9.0 * z)))));
} else {
tmp = fma(x, 2.0, fma(z, (y * (t * -9.0)), (b * (a * 27.0))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -1e+54) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(-9.0 * z))))); else tmp = fma(x, 2.0, fma(z, Float64(y * Float64(t * -9.0)), Float64(b * Float64(a * 27.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[N[(y * 9.0), $MachinePrecision], -1e+54], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(z, y \cdot \left(t \cdot -9\right), b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -1.0000000000000001e54Initial program 96.1%
+-commutative96.1%
associate-+r-96.1%
cancel-sign-sub-inv96.1%
*-commutative96.1%
distribute-rgt-neg-out96.1%
associate-*r*93.9%
*-commutative93.9%
distribute-rgt-neg-in93.9%
associate-+r+93.9%
sub-neg93.9%
associate-*l*93.9%
fma-def93.9%
fma-neg93.9%
associate-*l*93.9%
*-commutative93.9%
associate-*r*99.8%
distribute-rgt-neg-in99.8%
Simplified99.8%
if -1.0000000000000001e54 < (*.f64 y 9) Initial program 96.1%
+-commutative96.1%
associate-+r-96.1%
cancel-sign-sub-inv96.1%
*-commutative96.1%
distribute-rgt-neg-out96.1%
associate-*r*97.4%
*-commutative97.4%
distribute-rgt-neg-in97.4%
associate-+r+97.4%
sub-neg97.4%
+-commutative97.4%
associate-+l-97.4%
fma-neg97.4%
associate-*l*93.9%
fma-neg94.4%
*-commutative94.4%
fma-neg93.9%
Simplified97.9%
Final simplification98.3%
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 (<= (* y 9.0) -5e+172) (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* -9.0 z))))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* (* y 9.0) z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -5e+172) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (-9.0 * z)))));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * ((y * 9.0) * z)));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -5e+172) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(-9.0 * z))))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z)))); 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[N[(y * 9.0), $MachinePrecision], -5e+172], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -5.0000000000000001e172Initial program 96.1%
+-commutative96.1%
associate-+r-96.1%
cancel-sign-sub-inv96.1%
*-commutative96.1%
distribute-rgt-neg-out96.1%
associate-*r*91.9%
*-commutative91.9%
distribute-rgt-neg-in91.9%
associate-+r+91.9%
sub-neg91.9%
associate-*l*92.0%
fma-def92.0%
fma-neg92.0%
associate-*l*92.0%
*-commutative92.0%
associate-*r*99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
if -5.0000000000000001e172 < (*.f64 y 9) Initial program 96.1%
Final simplification96.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
(let* ((t_1 (* t (* -9.0 (* y z)))))
(if (<= z -6e-16)
t_1
(if (<= z -2.8e-61)
(* a (* 27.0 b))
(if (<= z -3.5e-113)
(* x 2.0)
(if (<= z -6.5e-190)
(* 27.0 (* a b))
(if (<= z -4.1e-288)
(* x 2.0)
(if (<= z 2.7e-82)
(* b (* a 27.0))
(if (<= z 1.2e-35) (* 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 = t * (-9.0 * (y * z));
double tmp;
if (z <= -6e-16) {
tmp = t_1;
} else if (z <= -2.8e-61) {
tmp = a * (27.0 * b);
} else if (z <= -3.5e-113) {
tmp = x * 2.0;
} else if (z <= -6.5e-190) {
tmp = 27.0 * (a * b);
} else if (z <= -4.1e-288) {
tmp = x * 2.0;
} else if (z <= 2.7e-82) {
tmp = b * (a * 27.0);
} else if (z <= 1.2e-35) {
tmp = x * 2.0;
} 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 = t * ((-9.0d0) * (y * z))
if (z <= (-6d-16)) then
tmp = t_1
else if (z <= (-2.8d-61)) then
tmp = a * (27.0d0 * b)
else if (z <= (-3.5d-113)) then
tmp = x * 2.0d0
else if (z <= (-6.5d-190)) then
tmp = 27.0d0 * (a * b)
else if (z <= (-4.1d-288)) then
tmp = x * 2.0d0
else if (z <= 2.7d-82) then
tmp = b * (a * 27.0d0)
else if (z <= 1.2d-35) then
tmp = x * 2.0d0
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 = t * (-9.0 * (y * z));
double tmp;
if (z <= -6e-16) {
tmp = t_1;
} else if (z <= -2.8e-61) {
tmp = a * (27.0 * b);
} else if (z <= -3.5e-113) {
tmp = x * 2.0;
} else if (z <= -6.5e-190) {
tmp = 27.0 * (a * b);
} else if (z <= -4.1e-288) {
tmp = x * 2.0;
} else if (z <= 2.7e-82) {
tmp = b * (a * 27.0);
} else if (z <= 1.2e-35) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = t * (-9.0 * (y * z)) tmp = 0 if z <= -6e-16: tmp = t_1 elif z <= -2.8e-61: tmp = a * (27.0 * b) elif z <= -3.5e-113: tmp = x * 2.0 elif z <= -6.5e-190: tmp = 27.0 * (a * b) elif z <= -4.1e-288: tmp = x * 2.0 elif z <= 2.7e-82: tmp = b * (a * 27.0) elif z <= 1.2e-35: tmp = x * 2.0 else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(-9.0 * Float64(y * z))) tmp = 0.0 if (z <= -6e-16) tmp = t_1; elseif (z <= -2.8e-61) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= -3.5e-113) tmp = Float64(x * 2.0); elseif (z <= -6.5e-190) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= -4.1e-288) tmp = Float64(x * 2.0); elseif (z <= 2.7e-82) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.2e-35) tmp = Float64(x * 2.0); 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 = t * (-9.0 * (y * z));
tmp = 0.0;
if (z <= -6e-16)
tmp = t_1;
elseif (z <= -2.8e-61)
tmp = a * (27.0 * b);
elseif (z <= -3.5e-113)
tmp = x * 2.0;
elseif (z <= -6.5e-190)
tmp = 27.0 * (a * b);
elseif (z <= -4.1e-288)
tmp = x * 2.0;
elseif (z <= 2.7e-82)
tmp = b * (a * 27.0);
elseif (z <= 1.2e-35)
tmp = x * 2.0;
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[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e-16], t$95$1, If[LessEqual[z, -2.8e-61], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e-113], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -6.5e-190], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e-288], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.7e-82], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-35], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{-16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-61}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-113}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-190}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-82}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-35}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.99999999999999987e-16 or 1.2000000000000001e-35 < z Initial program 93.0%
sub-neg93.0%
distribute-lft-neg-in93.0%
associate-*l*93.0%
*-commutative93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
*-commutative93.0%
*-commutative93.0%
associate-*l*93.0%
associate-*l*92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in y around inf 50.7%
associate-*r*50.7%
*-commutative50.7%
associate-*l*54.4%
*-commutative54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in z around 0 50.7%
*-commutative50.7%
associate-*r*50.4%
*-commutative50.4%
associate-*r*50.7%
*-commutative50.7%
associate-*l*50.7%
Simplified50.7%
if -5.99999999999999987e-16 < z < -2.8000000000000001e-61Initial program 100.0%
Taylor expanded in y around 0 99.9%
Taylor expanded in a around inf 47.1%
*-commutative47.1%
*-commutative47.1%
associate-*r*47.2%
Simplified47.2%
Taylor expanded in b around 0 47.1%
*-commutative47.1%
associate-*l*47.2%
Simplified47.2%
if -2.8000000000000001e-61 < z < -3.50000000000000029e-113 or -6.4999999999999997e-190 < z < -4.10000000000000007e-288 or 2.7000000000000001e-82 < z < 1.2000000000000001e-35Initial program 99.9%
sub-neg99.9%
distribute-lft-neg-in99.9%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 46.1%
if -3.50000000000000029e-113 < z < -6.4999999999999997e-190Initial program 99.5%
Taylor expanded in y around 0 99.4%
Taylor expanded in a around inf 40.9%
*-commutative40.9%
Simplified40.9%
if -4.10000000000000007e-288 < z < 2.7000000000000001e-82Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in a around inf 51.9%
*-commutative51.9%
*-commutative51.9%
associate-*r*51.8%
Simplified51.8%
Final simplification49.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -1.85e-13)
(* z (* y (* t -9.0)))
(if (<= z -2.55e-61)
t_1
(if (<= z -9.6e-124)
(* x 2.0)
(if (<= z -8e-191)
t_1
(if (<= z -3.4e-288)
(* x 2.0)
(if (<= z 4.2e-81)
(* b (* a 27.0))
(if (<= z 3.1e-33) (* x 2.0) (* t (* -9.0 (* y z))))))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.85e-13) {
tmp = z * (y * (t * -9.0));
} else if (z <= -2.55e-61) {
tmp = t_1;
} else if (z <= -9.6e-124) {
tmp = x * 2.0;
} else if (z <= -8e-191) {
tmp = t_1;
} else if (z <= -3.4e-288) {
tmp = x * 2.0;
} else if (z <= 4.2e-81) {
tmp = b * (a * 27.0);
} else if (z <= 3.1e-33) {
tmp = x * 2.0;
} else {
tmp = t * (-9.0 * (y * z));
}
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 = a * (27.0d0 * b)
if (z <= (-1.85d-13)) then
tmp = z * (y * (t * (-9.0d0)))
else if (z <= (-2.55d-61)) then
tmp = t_1
else if (z <= (-9.6d-124)) then
tmp = x * 2.0d0
else if (z <= (-8d-191)) then
tmp = t_1
else if (z <= (-3.4d-288)) then
tmp = x * 2.0d0
else if (z <= 4.2d-81) then
tmp = b * (a * 27.0d0)
else if (z <= 3.1d-33) then
tmp = x * 2.0d0
else
tmp = t * ((-9.0d0) * (y * z))
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 = a * (27.0 * b);
double tmp;
if (z <= -1.85e-13) {
tmp = z * (y * (t * -9.0));
} else if (z <= -2.55e-61) {
tmp = t_1;
} else if (z <= -9.6e-124) {
tmp = x * 2.0;
} else if (z <= -8e-191) {
tmp = t_1;
} else if (z <= -3.4e-288) {
tmp = x * 2.0;
} else if (z <= 4.2e-81) {
tmp = b * (a * 27.0);
} else if (z <= 3.1e-33) {
tmp = x * 2.0;
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -1.85e-13: tmp = z * (y * (t * -9.0)) elif z <= -2.55e-61: tmp = t_1 elif z <= -9.6e-124: tmp = x * 2.0 elif z <= -8e-191: tmp = t_1 elif z <= -3.4e-288: tmp = x * 2.0 elif z <= 4.2e-81: tmp = b * (a * 27.0) elif z <= 3.1e-33: tmp = x * 2.0 else: tmp = t * (-9.0 * (y * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.85e-13) tmp = Float64(z * Float64(y * Float64(t * -9.0))); elseif (z <= -2.55e-61) tmp = t_1; elseif (z <= -9.6e-124) tmp = Float64(x * 2.0); elseif (z <= -8e-191) tmp = t_1; elseif (z <= -3.4e-288) tmp = Float64(x * 2.0); elseif (z <= 4.2e-81) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 3.1e-33) tmp = Float64(x * 2.0); else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.85e-13)
tmp = z * (y * (t * -9.0));
elseif (z <= -2.55e-61)
tmp = t_1;
elseif (z <= -9.6e-124)
tmp = x * 2.0;
elseif (z <= -8e-191)
tmp = t_1;
elseif (z <= -3.4e-288)
tmp = x * 2.0;
elseif (z <= 4.2e-81)
tmp = b * (a * 27.0);
elseif (z <= 3.1e-33)
tmp = x * 2.0;
else
tmp = t * (-9.0 * (y * z));
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e-13], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.55e-61], t$95$1, If[LessEqual[z, -9.6e-124], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -8e-191], t$95$1, If[LessEqual[z, -3.4e-288], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.2e-81], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e-33], N[(x * 2.0), $MachinePrecision], N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{-13}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-124}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-81}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-33}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.84999999999999994e-13Initial program 94.1%
sub-neg94.1%
distribute-lft-neg-in94.1%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*94.1%
associate-*l*87.5%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in y around inf 55.5%
associate-*r*55.5%
*-commutative55.5%
associate-*l*55.4%
*-commutative55.4%
*-commutative55.4%
Simplified55.4%
if -1.84999999999999994e-13 < z < -2.54999999999999984e-61 or -9.5999999999999997e-124 < z < -8.0000000000000002e-191Initial program 99.8%
Taylor expanded in y around 0 99.7%
Taylor expanded in a around inf 42.0%
*-commutative42.0%
*-commutative42.0%
associate-*r*42.0%
Simplified42.0%
Taylor expanded in b around 0 42.0%
*-commutative42.0%
associate-*l*42.1%
Simplified42.1%
if -2.54999999999999984e-61 < z < -9.5999999999999997e-124 or -8.0000000000000002e-191 < z < -3.39999999999999972e-288 or 4.1999999999999998e-81 < z < 3.09999999999999997e-33Initial program 99.8%
sub-neg99.8%
distribute-lft-neg-in99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 44.1%
if -3.39999999999999972e-288 < z < 4.1999999999999998e-81Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in a around inf 51.9%
*-commutative51.9%
*-commutative51.9%
associate-*r*51.8%
Simplified51.8%
if 3.09999999999999997e-33 < z Initial program 91.9%
sub-neg91.9%
distribute-lft-neg-in91.9%
associate-*l*91.9%
*-commutative91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
*-commutative91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*l*97.2%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in y around inf 45.9%
associate-*r*45.9%
*-commutative45.9%
associate-*l*53.3%
*-commutative53.3%
*-commutative53.3%
Simplified53.3%
Taylor expanded in z around 0 45.9%
*-commutative45.9%
associate-*r*50.6%
*-commutative50.6%
associate-*r*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
Final simplification49.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -1.7e-15)
(* z (* y (* t -9.0)))
(if (<= z -1.6e-61)
t_1
(if (<= z -7e-124)
(* x 2.0)
(if (<= z -3.4e-190)
t_1
(if (<= z -4.2e-288)
(* x 2.0)
(if (<= z 3.5e-81)
(* b (* a 27.0))
(if (<= z 6.5e-36) (* x 2.0) (* -9.0 (* t (* y z))))))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.7e-15) {
tmp = z * (y * (t * -9.0));
} else if (z <= -1.6e-61) {
tmp = t_1;
} else if (z <= -7e-124) {
tmp = x * 2.0;
} else if (z <= -3.4e-190) {
tmp = t_1;
} else if (z <= -4.2e-288) {
tmp = x * 2.0;
} else if (z <= 3.5e-81) {
tmp = b * (a * 27.0);
} else if (z <= 6.5e-36) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
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 = a * (27.0d0 * b)
if (z <= (-1.7d-15)) then
tmp = z * (y * (t * (-9.0d0)))
else if (z <= (-1.6d-61)) then
tmp = t_1
else if (z <= (-7d-124)) then
tmp = x * 2.0d0
else if (z <= (-3.4d-190)) then
tmp = t_1
else if (z <= (-4.2d-288)) then
tmp = x * 2.0d0
else if (z <= 3.5d-81) then
tmp = b * (a * 27.0d0)
else if (z <= 6.5d-36) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (y * z))
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 = a * (27.0 * b);
double tmp;
if (z <= -1.7e-15) {
tmp = z * (y * (t * -9.0));
} else if (z <= -1.6e-61) {
tmp = t_1;
} else if (z <= -7e-124) {
tmp = x * 2.0;
} else if (z <= -3.4e-190) {
tmp = t_1;
} else if (z <= -4.2e-288) {
tmp = x * 2.0;
} else if (z <= 3.5e-81) {
tmp = b * (a * 27.0);
} else if (z <= 6.5e-36) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -1.7e-15: tmp = z * (y * (t * -9.0)) elif z <= -1.6e-61: tmp = t_1 elif z <= -7e-124: tmp = x * 2.0 elif z <= -3.4e-190: tmp = t_1 elif z <= -4.2e-288: tmp = x * 2.0 elif z <= 3.5e-81: tmp = b * (a * 27.0) elif z <= 6.5e-36: tmp = x * 2.0 else: tmp = -9.0 * (t * (y * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.7e-15) tmp = Float64(z * Float64(y * Float64(t * -9.0))); elseif (z <= -1.6e-61) tmp = t_1; elseif (z <= -7e-124) tmp = Float64(x * 2.0); elseif (z <= -3.4e-190) tmp = t_1; elseif (z <= -4.2e-288) tmp = Float64(x * 2.0); elseif (z <= 3.5e-81) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 6.5e-36) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.7e-15)
tmp = z * (y * (t * -9.0));
elseif (z <= -1.6e-61)
tmp = t_1;
elseif (z <= -7e-124)
tmp = x * 2.0;
elseif (z <= -3.4e-190)
tmp = t_1;
elseif (z <= -4.2e-288)
tmp = x * 2.0;
elseif (z <= 3.5e-81)
tmp = b * (a * 27.0);
elseif (z <= 6.5e-36)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (y * z));
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e-15], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-61], t$95$1, If[LessEqual[z, -7e-124], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -3.4e-190], t$95$1, If[LessEqual[z, -4.2e-288], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.5e-81], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-36], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{-15}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-61}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-124}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-81}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.7e-15Initial program 94.1%
sub-neg94.1%
distribute-lft-neg-in94.1%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*94.1%
associate-*l*87.5%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in y around inf 55.5%
associate-*r*55.5%
*-commutative55.5%
associate-*l*55.4%
*-commutative55.4%
*-commutative55.4%
Simplified55.4%
if -1.7e-15 < z < -1.6000000000000001e-61 or -6.9999999999999997e-124 < z < -3.39999999999999981e-190Initial program 99.8%
Taylor expanded in y around 0 99.7%
Taylor expanded in a around inf 42.0%
*-commutative42.0%
*-commutative42.0%
associate-*r*42.0%
Simplified42.0%
Taylor expanded in b around 0 42.0%
*-commutative42.0%
associate-*l*42.1%
Simplified42.1%
if -1.6000000000000001e-61 < z < -6.9999999999999997e-124 or -3.39999999999999981e-190 < z < -4.19999999999999991e-288 or 3.49999999999999986e-81 < z < 6.50000000000000012e-36Initial program 99.8%
sub-neg99.8%
distribute-lft-neg-in99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 44.1%
if -4.19999999999999991e-288 < z < 3.49999999999999986e-81Initial program 99.7%
Taylor expanded in y around 0 99.7%
Taylor expanded in a around inf 51.9%
*-commutative51.9%
*-commutative51.9%
associate-*r*51.8%
Simplified51.8%
if 6.50000000000000012e-36 < z Initial program 91.9%
sub-neg91.9%
distribute-lft-neg-in91.9%
associate-*l*91.9%
*-commutative91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
*-commutative91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*l*97.2%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
Simplified45.9%
Final simplification49.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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* 9.0 (* t (* y z)))))
(if (<= (* x 2.0) -4e+92)
(- (* x 2.0) t_2)
(if (<= (* x 2.0) 10000000000000.0) (- t_1 t_2) (+ (* 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 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if ((x * 2.0) <= -4e+92) {
tmp = (x * 2.0) - t_2;
} else if ((x * 2.0) <= 10000000000000.0) {
tmp = t_1 - t_2;
} 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 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
if ((x * 2.0d0) <= (-4d+92)) then
tmp = (x * 2.0d0) - t_2
else if ((x * 2.0d0) <= 10000000000000.0d0) then
tmp = t_1 - t_2
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 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double tmp;
if ((x * 2.0) <= -4e+92) {
tmp = (x * 2.0) - t_2;
} else if ((x * 2.0) <= 10000000000000.0) {
tmp = t_1 - t_2;
} 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 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) tmp = 0 if (x * 2.0) <= -4e+92: tmp = (x * 2.0) - t_2 elif (x * 2.0) <= 10000000000000.0: tmp = t_1 - t_2 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(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (Float64(x * 2.0) <= -4e+92) tmp = Float64(Float64(x * 2.0) - t_2); elseif (Float64(x * 2.0) <= 10000000000000.0) tmp = Float64(t_1 - t_2); 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 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
tmp = 0.0;
if ((x * 2.0) <= -4e+92)
tmp = (x * 2.0) - t_2;
elseif ((x * 2.0) <= 10000000000000.0)
tmp = t_1 - t_2;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 2.0), $MachinePrecision], -4e+92], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 10000000000000.0], N[(t$95$1 - t$95$2), $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 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;x \cdot 2 \leq -4 \cdot 10^{+92}:\\
\;\;\;\;x \cdot 2 - t_2\\
\mathbf{elif}\;x \cdot 2 \leq 10000000000000:\\
\;\;\;\;t_1 - t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t_1\\
\end{array}
\end{array}
if (*.f64 x 2) < -4.0000000000000002e92Initial program 96.1%
sub-neg96.1%
distribute-lft-neg-in96.1%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*96.1%
associate-*l*97.9%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 83.0%
if -4.0000000000000002e92 < (*.f64 x 2) < 1e13Initial program 96.1%
sub-neg96.1%
distribute-lft-neg-in96.1%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*96.1%
associate-*l*93.7%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in x around 0 88.3%
if 1e13 < (*.f64 x 2) Initial program 96.0%
sub-neg96.0%
distribute-lft-neg-in96.0%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.0%
associate-*l*96.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in y around 0 78.0%
Final simplification85.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 (or (<= (* a 27.0) -5e+81) (not (<= (* a 27.0) 2e-189))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * 27.0) <= -5e+81) || !((a * 27.0) <= 2e-189)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 * 27.0d0) <= (-5d+81)) .or. (.not. ((a * 27.0d0) <= 2d-189))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
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 * 27.0) <= -5e+81) || !((a * 27.0) <= 2e-189)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if ((a * 27.0) <= -5e+81) or not ((a * 27.0) <= 2e-189): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * 27.0) <= -5e+81) || !(Float64(a * 27.0) <= 2e-189)) 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(y * z)))); 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 * 27.0) <= -5e+81) || ~(((a * 27.0) <= 2e-189)))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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[N[(a * 27.0), $MachinePrecision], -5e+81], N[Not[LessEqual[N[(a * 27.0), $MachinePrecision], 2e-189]], $MachinePrecision]], 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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 27 \leq -5 \cdot 10^{+81} \lor \neg \left(a \cdot 27 \leq 2 \cdot 10^{-189}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 a 27) < -4.9999999999999998e81 or 2.00000000000000014e-189 < (*.f64 a 27) Initial program 97.2%
sub-neg97.2%
distribute-lft-neg-in97.2%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.2%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around 0 71.9%
if -4.9999999999999998e81 < (*.f64 a 27) < 2.00000000000000014e-189Initial program 94.6%
sub-neg94.6%
distribute-lft-neg-in94.6%
associate-*l*94.6%
*-commutative94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
*-commutative94.6%
*-commutative94.6%
associate-*l*94.6%
associate-*l*95.6%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 81.3%
Final simplification75.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 27.0) -5e+81) (not (<= (* a 27.0) 2e-189))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* x 2.0) (* (* y 9.0) (* t z)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a * 27.0) <= -5e+81) || !((a * 27.0) <= 2e-189)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - ((y * 9.0) * (t * z));
}
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 * 27.0d0) <= (-5d+81)) .or. (.not. ((a * 27.0d0) <= 2d-189))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - ((y * 9.0d0) * (t * z))
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 * 27.0) <= -5e+81) || !((a * 27.0) <= 2e-189)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - ((y * 9.0) * (t * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if ((a * 27.0) <= -5e+81) or not ((a * 27.0) <= 2e-189): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - ((y * 9.0) * (t * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a * 27.0) <= -5e+81) || !(Float64(a * 27.0) <= 2e-189)) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))); 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 * 27.0) <= -5e+81) || ~(((a * 27.0) <= 2e-189)))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - ((y * 9.0) * (t * z));
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[N[(a * 27.0), $MachinePrecision], -5e+81], N[Not[LessEqual[N[(a * 27.0), $MachinePrecision], 2e-189]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 27 \leq -5 \cdot 10^{+81} \lor \neg \left(a \cdot 27 \leq 2 \cdot 10^{-189}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 a 27) < -4.9999999999999998e81 or 2.00000000000000014e-189 < (*.f64 a 27) Initial program 97.2%
sub-neg97.2%
distribute-lft-neg-in97.2%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.2%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around 0 71.9%
if -4.9999999999999998e81 < (*.f64 a 27) < 2.00000000000000014e-189Initial program 94.6%
sub-neg94.6%
distribute-lft-neg-in94.6%
associate-*l*94.6%
*-commutative94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
*-commutative94.6%
*-commutative94.6%
associate-*l*94.6%
associate-*l*95.6%
associate-*l*94.7%
Simplified94.7%
associate-+l-94.7%
associate-*r*93.7%
associate-*r*94.6%
associate-*r*95.6%
associate-*l*95.6%
associate-*r*94.7%
Applied egg-rr94.7%
associate-*r*95.6%
add-cube-cbrt95.4%
pow395.4%
associate-*r*94.5%
Applied egg-rr94.5%
Taylor expanded in y around inf 81.3%
*-commutative81.3%
associate-*r*81.5%
associate-*r*81.4%
*-commutative81.4%
Simplified81.4%
Final simplification75.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 3.8e+75) (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.8e+75) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 <= 3.8d+75) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
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 <= 3.8e+75) {
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 3.8e+75: tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.8e+75) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); 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 <= 3.8e+75)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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, 3.8e+75], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.8 \cdot 10^{+75}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 3.8000000000000002e75Initial program 98.0%
sub-neg98.0%
distribute-lft-neg-in98.0%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*98.0%
associate-*l*95.0%
associate-*l*94.5%
Simplified94.5%
if 3.8000000000000002e75 < z Initial program 87.2%
sub-neg87.2%
distribute-lft-neg-in87.2%
associate-*l*87.1%
*-commutative87.1%
*-commutative87.1%
cancel-sign-sub-inv87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*87.2%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around 0 69.5%
Final simplification90.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 8.5e+63) (+ (* x 2.0) (- (* a (* 27.0 b)) (* y (* 9.0 (* t z))))) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 8.5e+63) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * (9.0 * (t * z))));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
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 <= 8.5d+63) then
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - (y * (9.0d0 * (t * z))))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
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 <= 8.5e+63) {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * (9.0 * (t * z))));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= 8.5e+63: tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * (9.0 * (t * z)))) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 8.5e+63) tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(y * Float64(9.0 * Float64(t * z))))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); 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 <= 8.5e+63)
tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * (9.0 * (t * z))));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
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, 8.5e+63], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.5 \cdot 10^{+63}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 8.5000000000000004e63Initial program 97.9%
sub-neg97.9%
distribute-lft-neg-in97.9%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*97.9%
associate-*l*94.9%
associate-*l*94.4%
Simplified94.4%
associate-+l-94.4%
associate-*r*97.5%
associate-*r*97.9%
associate-*r*94.9%
associate-*l*94.9%
associate-*r*94.5%
Applied egg-rr94.5%
if 8.5000000000000004e63 < z Initial program 87.7%
sub-neg87.7%
distribute-lft-neg-in87.7%
associate-*l*87.6%
*-commutative87.6%
*-commutative87.6%
cancel-sign-sub-inv87.6%
*-commutative87.6%
*-commutative87.6%
associate-*l*87.7%
associate-*l*95.8%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around 0 68.8%
Final simplification89.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 (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* 9.0 (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (y * z))));
}
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 = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (9.0d0 * (y * z))))
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (y * z))));
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (y * z))))
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(y * z))))) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (y * z))));
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right)
\end{array}
Initial program 96.1%
Taylor expanded in y around 0 96.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 -4.5e+64) (* z (* y (* t -9.0))) (if (<= z 1.55e-10) (+ (* x 2.0) (* 27.0 (* a b))) (* -9.0 (* t (* y z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+64) {
tmp = z * (y * (t * -9.0));
} else if (z <= 1.55e-10) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
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 <= (-4.5d+64)) then
tmp = z * (y * (t * (-9.0d0)))
else if (z <= 1.55d-10) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (-9.0d0) * (t * (y * z))
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 <= -4.5e+64) {
tmp = z * (y * (t * -9.0));
} else if (z <= 1.55e-10) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4.5e+64: tmp = z * (y * (t * -9.0)) elif z <= 1.55e-10: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = -9.0 * (t * (y * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e+64) tmp = Float64(z * Float64(y * Float64(t * -9.0))); elseif (z <= 1.55e-10) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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 <= -4.5e+64)
tmp = z * (y * (t * -9.0));
elseif (z <= 1.55e-10)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = -9.0 * (t * (y * z));
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, -4.5e+64], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-10], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+64}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -4.49999999999999973e64Initial program 92.7%
sub-neg92.7%
distribute-lft-neg-in92.7%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*92.7%
associate-*l*84.3%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in y around inf 61.7%
associate-*r*61.7%
*-commutative61.7%
associate-*l*61.7%
*-commutative61.7%
*-commutative61.7%
Simplified61.7%
if -4.49999999999999973e64 < z < 1.55000000000000008e-10Initial program 99.8%
sub-neg99.8%
distribute-lft-neg-in99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*98.5%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in y around 0 79.5%
if 1.55000000000000008e-10 < z Initial program 91.0%
sub-neg91.0%
distribute-lft-neg-in91.0%
associate-*l*91.0%
*-commutative91.0%
*-commutative91.0%
cancel-sign-sub-inv91.0%
*-commutative91.0%
*-commutative91.0%
associate-*l*91.0%
associate-*l*96.8%
associate-*l*96.8%
Simplified96.8%
Taylor expanded in y around inf 47.7%
*-commutative47.7%
Simplified47.7%
Final simplification67.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 (<= x -3.1e+87) (* x 2.0) (if (<= x 1e+14) (* 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 (x <= -3.1e+87) {
tmp = x * 2.0;
} else if (x <= 1e+14) {
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 (x <= (-3.1d+87)) then
tmp = x * 2.0d0
else if (x <= 1d+14) 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 (x <= -3.1e+87) {
tmp = x * 2.0;
} else if (x <= 1e+14) {
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 x <= -3.1e+87: tmp = x * 2.0 elif x <= 1e+14: 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 (x <= -3.1e+87) tmp = Float64(x * 2.0); elseif (x <= 1e+14) 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 (x <= -3.1e+87)
tmp = x * 2.0;
elseif (x <= 1e+14)
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[LessEqual[x, -3.1e+87], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 1e+14], 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}\;x \leq -3.1 \cdot 10^{+87}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 10^{+14}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -3.1e87 or 1e14 < x Initial program 96.1%
sub-neg96.1%
distribute-lft-neg-in96.1%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.1%
associate-*l*97.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 59.9%
if -3.1e87 < x < 1e14Initial program 96.1%
Taylor expanded in y around 0 96.1%
Taylor expanded in a around inf 43.8%
*-commutative43.8%
*-commutative43.8%
associate-*r*43.7%
Simplified43.7%
Taylor expanded in b around 0 43.8%
*-commutative43.8%
associate-*l*43.7%
Simplified43.7%
Final simplification50.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 (<= x -1.42e+88) (* x 2.0) (if (<= x 3.2e+15) (* b (* a 27.0)) (* 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 (x <= -1.42e+88) {
tmp = x * 2.0;
} else if (x <= 3.2e+15) {
tmp = b * (a * 27.0);
} 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 (x <= (-1.42d+88)) then
tmp = x * 2.0d0
else if (x <= 3.2d+15) then
tmp = b * (a * 27.0d0)
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 (x <= -1.42e+88) {
tmp = x * 2.0;
} else if (x <= 3.2e+15) {
tmp = b * (a * 27.0);
} 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 x <= -1.42e+88: tmp = x * 2.0 elif x <= 3.2e+15: tmp = b * (a * 27.0) 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 (x <= -1.42e+88) tmp = Float64(x * 2.0); elseif (x <= 3.2e+15) tmp = Float64(b * Float64(a * 27.0)); 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 (x <= -1.42e+88)
tmp = x * 2.0;
elseif (x <= 3.2e+15)
tmp = b * (a * 27.0);
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[LessEqual[x, -1.42e+88], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 3.2e+15], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \cdot 10^{+88}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+15}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.41999999999999996e88 or 3.2e15 < x Initial program 96.1%
sub-neg96.1%
distribute-lft-neg-in96.1%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.1%
associate-*l*97.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 59.9%
if -1.41999999999999996e88 < x < 3.2e15Initial program 96.1%
Taylor expanded in y around 0 96.1%
Taylor expanded in a around inf 43.8%
*-commutative43.8%
*-commutative43.8%
associate-*r*43.7%
Simplified43.7%
Final simplification50.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 (<= x -1.8e+85) (* x 2.0) (if (<= x 3.6e+15) (* 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 (x <= -1.8e+85) {
tmp = x * 2.0;
} else if (x <= 3.6e+15) {
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 (x <= (-1.8d+85)) then
tmp = x * 2.0d0
else if (x <= 3.6d+15) 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 (x <= -1.8e+85) {
tmp = x * 2.0;
} else if (x <= 3.6e+15) {
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 x <= -1.8e+85: tmp = x * 2.0 elif x <= 3.6e+15: 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 (x <= -1.8e+85) tmp = Float64(x * 2.0); elseif (x <= 3.6e+15) 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 (x <= -1.8e+85)
tmp = x * 2.0;
elseif (x <= 3.6e+15)
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[LessEqual[x, -1.8e+85], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 3.6e+15], 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}\;x \leq -1.8 \cdot 10^{+85}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.7999999999999999e85 or 3.6e15 < x Initial program 96.1%
sub-neg96.1%
distribute-lft-neg-in96.1%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.1%
associate-*l*97.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in x around inf 59.9%
if -1.7999999999999999e85 < x < 3.6e15Initial program 96.1%
Taylor expanded in y around 0 96.1%
Taylor expanded in a around inf 43.8%
*-commutative43.8%
Simplified43.8%
Final simplification50.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 96.1%
sub-neg96.1%
distribute-lft-neg-in96.1%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*96.1%
associate-*l*95.1%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 29.9%
Final simplification29.9%
(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 2023293
(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)))