
(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 12 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: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -2e-114) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -2e-114) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -2e-114) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -2e-114], 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[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -2 \cdot 10^{-114}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -2.0000000000000001e-114Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
*-commutative95.1%
cancel-sign-sub-inv95.1%
associate-*r*91.6%
distribute-lft-neg-in91.6%
*-commutative91.6%
cancel-sign-sub-inv91.6%
associate-+r-91.6%
associate-*l*91.6%
fma-def91.6%
fma-neg91.6%
associate-*l*98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
associate-*l*98.5%
*-commutative98.5%
distribute-lft-neg-in98.5%
associate-*r*98.5%
Simplified98.5%
if -2.0000000000000001e-114 < (*.f64 y 9) Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around 0 97.2%
associate-*r*97.2%
*-commutative97.2%
Simplified97.2%
Final simplification97.6%
NOTE: x, y, z, t, a, and b 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 (* y z)))) (t_2 (* 27.0 (* a b))))
(if (<= z -2.4e-90)
t_1
(if (<= z -2.5e-107)
(* x 2.0)
(if (<= z -1.32e-139)
t_1
(if (<= z -1.4e-225)
t_2
(if (<= z -1.25e-283)
(* x 2.0)
(if (<= z 1.2e-286)
t_2
(if (<= z 4.2e-261)
(* x 2.0)
(if (<= z 2e-106)
t_2
(if (<= z 9.5e-10) (* x 2.0) t_1)))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -2.4e-90) {
tmp = t_1;
} else if (z <= -2.5e-107) {
tmp = x * 2.0;
} else if (z <= -1.32e-139) {
tmp = t_1;
} else if (z <= -1.4e-225) {
tmp = t_2;
} else if (z <= -1.25e-283) {
tmp = x * 2.0;
} else if (z <= 1.2e-286) {
tmp = t_2;
} else if (z <= 4.2e-261) {
tmp = x * 2.0;
} else if (z <= 2e-106) {
tmp = t_2;
} else if (z <= 9.5e-10) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 * (y * z))
t_2 = 27.0d0 * (a * b)
if (z <= (-2.4d-90)) then
tmp = t_1
else if (z <= (-2.5d-107)) then
tmp = x * 2.0d0
else if (z <= (-1.32d-139)) then
tmp = t_1
else if (z <= (-1.4d-225)) then
tmp = t_2
else if (z <= (-1.25d-283)) then
tmp = x * 2.0d0
else if (z <= 1.2d-286) then
tmp = t_2
else if (z <= 4.2d-261) then
tmp = x * 2.0d0
else if (z <= 2d-106) then
tmp = t_2
else if (z <= 9.5d-10) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -2.4e-90) {
tmp = t_1;
} else if (z <= -2.5e-107) {
tmp = x * 2.0;
} else if (z <= -1.32e-139) {
tmp = t_1;
} else if (z <= -1.4e-225) {
tmp = t_2;
} else if (z <= -1.25e-283) {
tmp = x * 2.0;
} else if (z <= 1.2e-286) {
tmp = t_2;
} else if (z <= 4.2e-261) {
tmp = x * 2.0;
} else if (z <= 2e-106) {
tmp = t_2;
} else if (z <= 9.5e-10) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) t_2 = 27.0 * (a * b) tmp = 0 if z <= -2.4e-90: tmp = t_1 elif z <= -2.5e-107: tmp = x * 2.0 elif z <= -1.32e-139: tmp = t_1 elif z <= -1.4e-225: tmp = t_2 elif z <= -1.25e-283: tmp = x * 2.0 elif z <= 1.2e-286: tmp = t_2 elif z <= 4.2e-261: tmp = x * 2.0 elif z <= 2e-106: tmp = t_2 elif z <= 9.5e-10: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -2.4e-90) tmp = t_1; elseif (z <= -2.5e-107) tmp = Float64(x * 2.0); elseif (z <= -1.32e-139) tmp = t_1; elseif (z <= -1.4e-225) tmp = t_2; elseif (z <= -1.25e-283) tmp = Float64(x * 2.0); elseif (z <= 1.2e-286) tmp = t_2; elseif (z <= 4.2e-261) tmp = Float64(x * 2.0); elseif (z <= 2e-106) tmp = t_2; elseif (z <= 9.5e-10) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -2.4e-90)
tmp = t_1;
elseif (z <= -2.5e-107)
tmp = x * 2.0;
elseif (z <= -1.32e-139)
tmp = t_1;
elseif (z <= -1.4e-225)
tmp = t_2;
elseif (z <= -1.25e-283)
tmp = x * 2.0;
elseif (z <= 1.2e-286)
tmp = t_2;
elseif (z <= 4.2e-261)
tmp = x * 2.0;
elseif (z <= 2e-106)
tmp = t_2;
elseif (z <= 9.5e-10)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b 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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e-90], t$95$1, If[LessEqual[z, -2.5e-107], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.32e-139], t$95$1, If[LessEqual[z, -1.4e-225], t$95$2, If[LessEqual[z, -1.25e-283], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.2e-286], t$95$2, If[LessEqual[z, 4.2e-261], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2e-106], t$95$2, If[LessEqual[z, 9.5e-10], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-107}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.32 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-225}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-283}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-286}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-261}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-10}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.4000000000000002e-90 or -2.49999999999999985e-107 < z < -1.31999999999999995e-139 or 9.50000000000000028e-10 < z Initial program 94.0%
sub-neg94.0%
sub-neg94.0%
associate-*l*92.8%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in y around inf 49.8%
if -2.4000000000000002e-90 < z < -2.49999999999999985e-107 or -1.4e-225 < z < -1.25e-283 or 1.19999999999999997e-286 < z < 4.19999999999999991e-261 or 1.99999999999999988e-106 < z < 9.50000000000000028e-10Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 51.7%
if -1.31999999999999995e-139 < z < -1.4e-225 or -1.25e-283 < z < 1.19999999999999997e-286 or 4.19999999999999991e-261 < z < 1.99999999999999988e-106Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around inf 51.5%
Final simplification50.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (* -9.0 (* z t)))) (t_2 (* 27.0 (* a b))))
(if (<= z -1.25e-90)
t_1
(if (<= z -2.45e-107)
(* x 2.0)
(if (<= z -1.15e-139)
t_1
(if (<= z -2.45e-225)
t_2
(if (<= z -1.6e-286)
(* x 2.0)
(if (<= z 4.5e-287)
t_2
(if (<= z 2.1e-260)
(* x 2.0)
(if (<= z 2.1e-106)
t_2
(if (<= z 1.6e-9)
(* x 2.0)
(* -9.0 (* t (* y z))))))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (-9.0 * (z * t));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -1.25e-90) {
tmp = t_1;
} else if (z <= -2.45e-107) {
tmp = x * 2.0;
} else if (z <= -1.15e-139) {
tmp = t_1;
} else if (z <= -2.45e-225) {
tmp = t_2;
} else if (z <= -1.6e-286) {
tmp = x * 2.0;
} else if (z <= 4.5e-287) {
tmp = t_2;
} else if (z <= 2.1e-260) {
tmp = x * 2.0;
} else if (z <= 2.1e-106) {
tmp = t_2;
} else if (z <= 1.6e-9) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 = y * ((-9.0d0) * (z * t))
t_2 = 27.0d0 * (a * b)
if (z <= (-1.25d-90)) then
tmp = t_1
else if (z <= (-2.45d-107)) then
tmp = x * 2.0d0
else if (z <= (-1.15d-139)) then
tmp = t_1
else if (z <= (-2.45d-225)) then
tmp = t_2
else if (z <= (-1.6d-286)) then
tmp = x * 2.0d0
else if (z <= 4.5d-287) then
tmp = t_2
else if (z <= 2.1d-260) then
tmp = x * 2.0d0
else if (z <= 2.1d-106) then
tmp = t_2
else if (z <= 1.6d-9) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (-9.0 * (z * t));
double t_2 = 27.0 * (a * b);
double tmp;
if (z <= -1.25e-90) {
tmp = t_1;
} else if (z <= -2.45e-107) {
tmp = x * 2.0;
} else if (z <= -1.15e-139) {
tmp = t_1;
} else if (z <= -2.45e-225) {
tmp = t_2;
} else if (z <= -1.6e-286) {
tmp = x * 2.0;
} else if (z <= 4.5e-287) {
tmp = t_2;
} else if (z <= 2.1e-260) {
tmp = x * 2.0;
} else if (z <= 2.1e-106) {
tmp = t_2;
} else if (z <= 1.6e-9) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = y * (-9.0 * (z * t)) t_2 = 27.0 * (a * b) tmp = 0 if z <= -1.25e-90: tmp = t_1 elif z <= -2.45e-107: tmp = x * 2.0 elif z <= -1.15e-139: tmp = t_1 elif z <= -2.45e-225: tmp = t_2 elif z <= -1.6e-286: tmp = x * 2.0 elif z <= 4.5e-287: tmp = t_2 elif z <= 2.1e-260: tmp = x * 2.0 elif z <= 2.1e-106: tmp = t_2 elif z <= 1.6e-9: tmp = x * 2.0 else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(-9.0 * Float64(z * t))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -1.25e-90) tmp = t_1; elseif (z <= -2.45e-107) tmp = Float64(x * 2.0); elseif (z <= -1.15e-139) tmp = t_1; elseif (z <= -2.45e-225) tmp = t_2; elseif (z <= -1.6e-286) tmp = Float64(x * 2.0); elseif (z <= 4.5e-287) tmp = t_2; elseif (z <= 2.1e-260) tmp = Float64(x * 2.0); elseif (z <= 2.1e-106) tmp = t_2; elseif (z <= 1.6e-9) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = y * (-9.0 * (z * t));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -1.25e-90)
tmp = t_1;
elseif (z <= -2.45e-107)
tmp = x * 2.0;
elseif (z <= -1.15e-139)
tmp = t_1;
elseif (z <= -2.45e-225)
tmp = t_2;
elseif (z <= -1.6e-286)
tmp = x * 2.0;
elseif (z <= 4.5e-287)
tmp = t_2;
elseif (z <= 2.1e-260)
tmp = x * 2.0;
elseif (z <= 2.1e-106)
tmp = t_2;
elseif (z <= 1.6e-9)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e-90], t$95$1, If[LessEqual[z, -2.45e-107], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.15e-139], t$95$1, If[LessEqual[z, -2.45e-225], t$95$2, If[LessEqual[z, -1.6e-286], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.5e-287], t$95$2, If[LessEqual[z, 2.1e-260], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.1e-106], t$95$2, If[LessEqual[z, 1.6e-9], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-107}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-225}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-286}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-287}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-260}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-9}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.25000000000000005e-90 or -2.4499999999999999e-107 < z < -1.15000000000000006e-139Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*90.9%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in y around inf 44.2%
*-commutative44.2%
*-commutative44.2%
associate-*l*46.3%
associate-*r*46.3%
*-commutative46.3%
associate-*l*46.3%
Simplified46.3%
Taylor expanded in t around 0 46.3%
if -1.25000000000000005e-90 < z < -2.4499999999999999e-107 or -2.44999999999999985e-225 < z < -1.60000000000000003e-286 or 4.50000000000000017e-287 < z < 2.10000000000000005e-260 or 2.10000000000000003e-106 < z < 1.60000000000000006e-9Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 50.9%
if -1.15000000000000006e-139 < z < -2.44999999999999985e-225 or -1.60000000000000003e-286 < z < 4.50000000000000017e-287 or 2.10000000000000005e-260 < z < 2.10000000000000003e-106Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around inf 51.9%
if 1.60000000000000006e-9 < z Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around inf 57.2%
Final simplification51.2%
NOTE: x, y, z, t, a, and b 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))))
(if (<= z -4.5e-90)
(* y (* -9.0 (* z t)))
(if (<= z -2.3e-107)
(* x 2.0)
(if (<= z -1.58e-139)
(* y (* t (* z -9.0)))
(if (<= z -3.3e-225)
t_1
(if (<= z -5.2e-286)
(* x 2.0)
(if (<= z 3.15e-286)
t_1
(if (<= z 1.15e-259)
(* x 2.0)
(if (<= z 8e-107)
t_1
(if (<= z 1.35e-9)
(* x 2.0)
(* -9.0 (* t (* y z))))))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -4.5e-90) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -2.3e-107) {
tmp = x * 2.0;
} else if (z <= -1.58e-139) {
tmp = y * (t * (z * -9.0));
} else if (z <= -3.3e-225) {
tmp = t_1;
} else if (z <= -5.2e-286) {
tmp = x * 2.0;
} else if (z <= 3.15e-286) {
tmp = t_1;
} else if (z <= 1.15e-259) {
tmp = x * 2.0;
} else if (z <= 8e-107) {
tmp = t_1;
} else if (z <= 1.35e-9) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 = 27.0d0 * (a * b)
if (z <= (-4.5d-90)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-2.3d-107)) then
tmp = x * 2.0d0
else if (z <= (-1.58d-139)) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= (-3.3d-225)) then
tmp = t_1
else if (z <= (-5.2d-286)) then
tmp = x * 2.0d0
else if (z <= 3.15d-286) then
tmp = t_1
else if (z <= 1.15d-259) then
tmp = x * 2.0d0
else if (z <= 8d-107) then
tmp = t_1
else if (z <= 1.35d-9) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -4.5e-90) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -2.3e-107) {
tmp = x * 2.0;
} else if (z <= -1.58e-139) {
tmp = y * (t * (z * -9.0));
} else if (z <= -3.3e-225) {
tmp = t_1;
} else if (z <= -5.2e-286) {
tmp = x * 2.0;
} else if (z <= 3.15e-286) {
tmp = t_1;
} else if (z <= 1.15e-259) {
tmp = x * 2.0;
} else if (z <= 8e-107) {
tmp = t_1;
} else if (z <= 1.35e-9) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -4.5e-90: tmp = y * (-9.0 * (z * t)) elif z <= -2.3e-107: tmp = x * 2.0 elif z <= -1.58e-139: tmp = y * (t * (z * -9.0)) elif z <= -3.3e-225: tmp = t_1 elif z <= -5.2e-286: tmp = x * 2.0 elif z <= 3.15e-286: tmp = t_1 elif z <= 1.15e-259: tmp = x * 2.0 elif z <= 8e-107: tmp = t_1 elif z <= 1.35e-9: tmp = x * 2.0 else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -4.5e-90) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -2.3e-107) tmp = Float64(x * 2.0); elseif (z <= -1.58e-139) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= -3.3e-225) tmp = t_1; elseif (z <= -5.2e-286) tmp = Float64(x * 2.0); elseif (z <= 3.15e-286) tmp = t_1; elseif (z <= 1.15e-259) tmp = Float64(x * 2.0); elseif (z <= 8e-107) tmp = t_1; elseif (z <= 1.35e-9) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -4.5e-90)
tmp = y * (-9.0 * (z * t));
elseif (z <= -2.3e-107)
tmp = x * 2.0;
elseif (z <= -1.58e-139)
tmp = y * (t * (z * -9.0));
elseif (z <= -3.3e-225)
tmp = t_1;
elseif (z <= -5.2e-286)
tmp = x * 2.0;
elseif (z <= 3.15e-286)
tmp = t_1;
elseif (z <= 1.15e-259)
tmp = x * 2.0;
elseif (z <= 8e-107)
tmp = t_1;
elseif (z <= 1.35e-9)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b 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]}, If[LessEqual[z, -4.5e-90], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-107], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.58e-139], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-225], t$95$1, If[LessEqual[z, -5.2e-286], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.15e-286], t$95$1, If[LessEqual[z, 1.15e-259], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 8e-107], t$95$1, If[LessEqual[z, 1.35e-9], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-90}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-107}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.58 \cdot 10^{-139}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-286}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-286}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-259}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-9}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -4.50000000000000009e-90Initial program 91.2%
sub-neg91.2%
sub-neg91.2%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in y around inf 45.2%
*-commutative45.2%
*-commutative45.2%
associate-*l*47.5%
associate-*r*47.5%
*-commutative47.5%
associate-*l*47.5%
Simplified47.5%
Taylor expanded in t around 0 47.5%
if -4.50000000000000009e-90 < z < -2.30000000000000003e-107 or -3.3000000000000001e-225 < z < -5.1999999999999999e-286 or 3.1499999999999999e-286 < z < 1.15e-259 or 8e-107 < z < 1.3500000000000001e-9Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 50.9%
if -2.30000000000000003e-107 < z < -1.57999999999999993e-139Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around inf 40.0%
*-commutative40.0%
*-commutative40.0%
associate-*l*40.0%
associate-*r*40.0%
*-commutative40.0%
associate-*l*40.0%
Simplified40.0%
if -1.57999999999999993e-139 < z < -3.3000000000000001e-225 or -5.1999999999999999e-286 < z < 3.1499999999999999e-286 or 1.15e-259 < z < 8e-107Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around inf 52.7%
if 1.3500000000000001e-9 < z Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around inf 57.2%
Final simplification51.6%
NOTE: x, y, z, t, a, and b 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))))
(if (<= z -6.2e-90)
(* y (* -9.0 (* z t)))
(if (<= z -2.1e-107)
(* x 2.0)
(if (<= z -3.75e-140)
(* y (* t (* z -9.0)))
(if (<= z -2.4e-225)
t_1
(if (<= z -1.32e-285)
(* x 2.0)
(if (<= z 7.2e-286)
t_1
(if (<= z 1.25e-260)
(* x 2.0)
(if (<= z 3.6e-109)
t_1
(if (<= z 1.65e-9)
(* x 2.0)
(* z (* t (* y -9.0))))))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -6.2e-90) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -2.1e-107) {
tmp = x * 2.0;
} else if (z <= -3.75e-140) {
tmp = y * (t * (z * -9.0));
} else if (z <= -2.4e-225) {
tmp = t_1;
} else if (z <= -1.32e-285) {
tmp = x * 2.0;
} else if (z <= 7.2e-286) {
tmp = t_1;
} else if (z <= 1.25e-260) {
tmp = x * 2.0;
} else if (z <= 3.6e-109) {
tmp = t_1;
} else if (z <= 1.65e-9) {
tmp = x * 2.0;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 = 27.0d0 * (a * b)
if (z <= (-6.2d-90)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-2.1d-107)) then
tmp = x * 2.0d0
else if (z <= (-3.75d-140)) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= (-2.4d-225)) then
tmp = t_1
else if (z <= (-1.32d-285)) then
tmp = x * 2.0d0
else if (z <= 7.2d-286) then
tmp = t_1
else if (z <= 1.25d-260) then
tmp = x * 2.0d0
else if (z <= 3.6d-109) then
tmp = t_1
else if (z <= 1.65d-9) then
tmp = x * 2.0d0
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -6.2e-90) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -2.1e-107) {
tmp = x * 2.0;
} else if (z <= -3.75e-140) {
tmp = y * (t * (z * -9.0));
} else if (z <= -2.4e-225) {
tmp = t_1;
} else if (z <= -1.32e-285) {
tmp = x * 2.0;
} else if (z <= 7.2e-286) {
tmp = t_1;
} else if (z <= 1.25e-260) {
tmp = x * 2.0;
} else if (z <= 3.6e-109) {
tmp = t_1;
} else if (z <= 1.65e-9) {
tmp = x * 2.0;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -6.2e-90: tmp = y * (-9.0 * (z * t)) elif z <= -2.1e-107: tmp = x * 2.0 elif z <= -3.75e-140: tmp = y * (t * (z * -9.0)) elif z <= -2.4e-225: tmp = t_1 elif z <= -1.32e-285: tmp = x * 2.0 elif z <= 7.2e-286: tmp = t_1 elif z <= 1.25e-260: tmp = x * 2.0 elif z <= 3.6e-109: tmp = t_1 elif z <= 1.65e-9: tmp = x * 2.0 else: tmp = z * (t * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -6.2e-90) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -2.1e-107) tmp = Float64(x * 2.0); elseif (z <= -3.75e-140) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= -2.4e-225) tmp = t_1; elseif (z <= -1.32e-285) tmp = Float64(x * 2.0); elseif (z <= 7.2e-286) tmp = t_1; elseif (z <= 1.25e-260) tmp = Float64(x * 2.0); elseif (z <= 3.6e-109) tmp = t_1; elseif (z <= 1.65e-9) tmp = Float64(x * 2.0); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -6.2e-90)
tmp = y * (-9.0 * (z * t));
elseif (z <= -2.1e-107)
tmp = x * 2.0;
elseif (z <= -3.75e-140)
tmp = y * (t * (z * -9.0));
elseif (z <= -2.4e-225)
tmp = t_1;
elseif (z <= -1.32e-285)
tmp = x * 2.0;
elseif (z <= 7.2e-286)
tmp = t_1;
elseif (z <= 1.25e-260)
tmp = x * 2.0;
elseif (z <= 3.6e-109)
tmp = t_1;
elseif (z <= 1.65e-9)
tmp = x * 2.0;
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b 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]}, If[LessEqual[z, -6.2e-90], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-107], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -3.75e-140], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-225], t$95$1, If[LessEqual[z, -1.32e-285], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 7.2e-286], t$95$1, If[LessEqual[z, 1.25e-260], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.6e-109], t$95$1, If[LessEqual[z, 1.65e-9], N[(x * 2.0), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-90}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-107}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -3.75 \cdot 10^{-140}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.32 \cdot 10^{-285}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-286}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-260}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -6.2000000000000003e-90Initial program 91.2%
sub-neg91.2%
sub-neg91.2%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in y around inf 45.2%
*-commutative45.2%
*-commutative45.2%
associate-*l*47.5%
associate-*r*47.5%
*-commutative47.5%
associate-*l*47.5%
Simplified47.5%
Taylor expanded in t around 0 47.5%
if -6.2000000000000003e-90 < z < -2.0999999999999999e-107 or -2.39999999999999996e-225 < z < -1.3199999999999999e-285 or 7.20000000000000027e-286 < z < 1.2500000000000001e-260 or 3.6000000000000001e-109 < z < 1.65000000000000009e-9Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 50.9%
if -2.0999999999999999e-107 < z < -3.7499999999999999e-140Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around inf 36.1%
*-commutative36.1%
*-commutative36.1%
associate-*l*36.1%
associate-*r*36.1%
*-commutative36.1%
associate-*l*36.1%
Simplified36.1%
if -3.7499999999999999e-140 < z < -2.39999999999999996e-225 or -1.3199999999999999e-285 < z < 7.20000000000000027e-286 or 1.2500000000000001e-260 < z < 3.6000000000000001e-109Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around inf 51.9%
if 1.65000000000000009e-9 < z Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around inf 57.2%
associate-*r*57.3%
*-commutative57.3%
associate-*r*58.1%
Simplified58.1%
Taylor expanded in t around 0 58.1%
*-commutative58.1%
associate-*r*58.1%
Simplified58.1%
Final simplification51.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (or (<= b -4.2e-5)
(and (not (<= b 1.55e+31))
(or (<= b 4.6e+129) (not (<= b 1.2e+178)))))
(* 27.0 (* a b))
(* x 2.0)))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.2e-5) || (!(b <= 1.55e+31) && ((b <= 4.6e+129) || !(b <= 1.2e+178)))) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 ((b <= (-4.2d-5)) .or. (.not. (b <= 1.55d+31)) .and. (b <= 4.6d+129) .or. (.not. (b <= 1.2d+178))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.2e-5) || (!(b <= 1.55e+31) && ((b <= 4.6e+129) || !(b <= 1.2e+178)))) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.2e-5) or (not (b <= 1.55e+31) and ((b <= 4.6e+129) or not (b <= 1.2e+178))): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.2e-5) || (!(b <= 1.55e+31) && ((b <= 4.6e+129) || !(b <= 1.2e+178)))) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -4.2e-5) || (~((b <= 1.55e+31)) && ((b <= 4.6e+129) || ~((b <= 1.2e+178)))))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.2e-5], And[N[Not[LessEqual[b, 1.55e+31]], $MachinePrecision], Or[LessEqual[b, 4.6e+129], N[Not[LessEqual[b, 1.2e+178]], $MachinePrecision]]]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{-5} \lor \neg \left(b \leq 1.55 \cdot 10^{+31}\right) \land \left(b \leq 4.6 \cdot 10^{+129} \lor \neg \left(b \leq 1.2 \cdot 10^{+178}\right)\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -4.19999999999999977e-5 or 1.5500000000000001e31 < b < 4.59999999999999981e129 or 1.2e178 < b Initial program 96.6%
sub-neg96.6%
sub-neg96.6%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around inf 54.4%
if -4.19999999999999977e-5 < b < 1.5500000000000001e31 or 4.59999999999999981e129 < b < 1.2e178Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*94.9%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 43.3%
Final simplification48.5%
NOTE: x, y, z, t, a, and b 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.5e-11)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (- (* x 2.0) (* 9.0 (* z (* y t)))) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
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.5e-11) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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.5d-11) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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.5e-11) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= 1.5e-11: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= 1.5e-11) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + t_1); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= 1.5e-11)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b 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.5e-11], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 1.5 \cdot 10^{-11}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + t\_1\\
\end{array}
\end{array}
if z < 1.5e-11Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
if 1.5e-11 < z Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around 0 96.6%
associate-*r*98.3%
*-commutative98.3%
Simplified98.3%
Final simplification96.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1e-137) (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* y 9.0) (* z t)))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-137) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 <= 1d-137) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (t * ((y * 9.0d0) * z))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-137) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1e-137: tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1e-137) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1e-137)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1e-137], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{-137}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 9.99999999999999978e-138Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
if 9.99999999999999978e-138 < z Initial program 97.5%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -0.00039)
(* y (* -9.0 (* z t)))
(if (<= z 9e-14)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.00039) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 9e-14) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 <= (-0.00039d0)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 9d-14) 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 x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.00039) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 9e-14) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -0.00039: tmp = y * (-9.0 * (z * t)) elif z <= 9e-14: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.00039) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 9e-14) 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
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -0.00039)
tmp = y * (-9.0 * (z * t));
elseif (z <= 9e-14)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.00039], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-14], 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}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00039:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-14}:\\
\;\;\;\;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 z < -3.89999999999999993e-4Initial program 88.8%
sub-neg88.8%
sub-neg88.8%
associate-*l*87.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in y around inf 48.2%
*-commutative48.2%
*-commutative48.2%
associate-*l*51.2%
associate-*r*51.1%
*-commutative51.1%
associate-*l*51.1%
Simplified51.1%
Taylor expanded in t around 0 51.1%
if -3.89999999999999993e-4 < z < 8.9999999999999995e-14Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.0%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 85.8%
if 8.9999999999999995e-14 < z Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 72.1%
Final simplification74.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -0.0007) (* y (* -9.0 (* z t))) (if (<= z 1.65e-9) (+ (* x 2.0) (* 27.0 (* a b))) (* z (* t (* y -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.0007) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1.65e-9) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b 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 <= (-0.0007d0)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 1.65d-9) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -0.0007) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1.65e-9) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -0.0007: tmp = y * (-9.0 * (z * t)) elif z <= 1.65e-9: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = z * (t * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -0.0007) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 1.65e-9) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -0.0007)
tmp = y * (-9.0 * (z * t));
elseif (z <= 1.65e-9)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -0.0007], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-9], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0007:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-9}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -6.99999999999999993e-4Initial program 88.8%
sub-neg88.8%
sub-neg88.8%
associate-*l*87.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in y around inf 48.2%
*-commutative48.2%
*-commutative48.2%
associate-*l*51.2%
associate-*r*51.1%
*-commutative51.1%
associate-*l*51.1%
Simplified51.1%
Taylor expanded in t around 0 51.1%
if -6.99999999999999993e-4 < z < 1.65000000000000009e-9Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.0%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in y around 0 85.9%
if 1.65000000000000009e-9 < z Initial program 96.7%
sub-neg96.7%
sub-neg96.7%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around inf 57.2%
associate-*r*57.3%
*-commutative57.3%
associate-*r*58.1%
Simplified58.1%
Taylor expanded in t around 0 58.1%
*-commutative58.1%
associate-*r*58.1%
Simplified58.1%
Final simplification71.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
NOTE: x, y, z, t, a, and b 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) - (9.0d0 * (z * (y * t)))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in y around 0 96.5%
associate-*r*95.4%
*-commutative95.4%
Simplified95.4%
Final simplification95.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b 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 x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b 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}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around inf 32.7%
Final simplification32.7%
(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 2024031
(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)))