
(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. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 31.0) (fma x 2.0 (fma y (* (* z t) -9.0) (* b (* a 27.0)))) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (pow (cbrt (* t (* z y))) 3.0))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 31.0) {
tmp = fma(x, 2.0, fma(y, ((z * t) * -9.0), (b * (a * 27.0))));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * pow(cbrt((t * (z * y))), 3.0))));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 31.0) tmp = fma(x, 2.0, fma(y, Float64(Float64(z * t) * -9.0), Float64(b * Float64(a * 27.0)))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * (cbrt(Float64(t * Float64(z * y))) ^ 3.0)))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 31.0], N[(x * 2.0 + N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[Power[N[Power[N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 31:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, \left(z \cdot t\right) \cdot -9, b \cdot \left(a \cdot 27\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot {\left(\sqrt[3]{t \cdot \left(z \cdot y\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if z < 31Initial program 97.7%
associate-+l-97.7%
fma-neg97.7%
neg-sub097.7%
associate-+l-97.7%
neg-sub097.7%
associate-*l*95.7%
associate-*l*95.7%
distribute-rgt-neg-in95.7%
fma-def96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
metadata-eval96.2%
Simplified96.2%
if 31 < z Initial program 81.6%
+-commutative81.6%
associate-*l*81.6%
fma-def84.6%
associate-*l*91.5%
*-commutative91.5%
associate-*l*91.3%
Simplified91.3%
add-cube-cbrt90.8%
pow390.9%
associate-*r*84.1%
Applied egg-rr84.1%
Final simplification93.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: 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) -5e+210) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (fma x 2.0 (fma t (* -9.0 (* z y)) (* b (* a 27.0))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -5e+210) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = fma(x, 2.0, fma(t, (-9.0 * (z * y)), (b * (a * 27.0))));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -5e+210) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = fma(x, 2.0, fma(t, Float64(-9.0 * Float64(z * y)), 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. NOTE: 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], -5e+210], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+210}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, -9 \cdot \left(z \cdot y\right), b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -4.9999999999999998e210Initial program 82.8%
+-commutative82.8%
associate-*l*82.8%
fma-def82.9%
associate-*l*99.9%
*-commutative99.9%
associate-*l*99.7%
Simplified99.7%
if -4.9999999999999998e210 < (*.f64 y 9) Initial program 94.4%
associate-+l-94.4%
fma-neg94.4%
neg-sub094.4%
associate-+l-94.4%
neg-sub094.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
fma-def95.3%
*-commutative95.3%
associate-*r*95.3%
distribute-rgt-neg-in95.3%
*-commutative95.3%
metadata-eval95.3%
Simplified95.3%
Final simplification95.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 (* b (* a 27.0))))
(if (<= z 4e-61)
(fma x 2.0 (fma y (* (* z t) -9.0) t_1))
(fma x 2.0 (fma t (* -9.0 (* z y)) t_1)))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= 4e-61) {
tmp = fma(x, 2.0, fma(y, ((z * t) * -9.0), t_1));
} else {
tmp = fma(x, 2.0, fma(t, (-9.0 * (z * y)), t_1));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 4e-61) tmp = fma(x, 2.0, fma(y, Float64(Float64(z * t) * -9.0), t_1)); else tmp = fma(x, 2.0, fma(t, Float64(-9.0 * Float64(z * y)), t_1)); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 4e-61], N[(x * 2.0 + N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 4 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(y, \left(z \cdot t\right) \cdot -9, t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, -9 \cdot \left(z \cdot y\right), t_1\right)\right)\\
\end{array}
\end{array}
if z < 4.0000000000000002e-61Initial program 97.6%
associate-+l-97.5%
fma-neg97.5%
neg-sub097.5%
associate-+l-97.5%
neg-sub097.5%
associate-*l*95.4%
associate-*l*95.4%
distribute-rgt-neg-in95.4%
fma-def96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
metadata-eval96.0%
Simplified96.0%
if 4.0000000000000002e-61 < z Initial program 84.5%
associate-+l-84.5%
fma-neg84.5%
neg-sub084.5%
associate-+l-84.5%
neg-sub084.5%
*-commutative84.5%
distribute-rgt-neg-in84.5%
fma-def85.8%
*-commutative85.8%
associate-*r*85.7%
distribute-rgt-neg-in85.7%
*-commutative85.7%
metadata-eval85.7%
Simplified85.7%
Final simplification92.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: 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) -5e+156) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* z (* y 9.0)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -5e+156) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.0))));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -5e+156) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0))))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: 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], -5e+156], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -4.99999999999999992e156Initial program 85.4%
+-commutative85.4%
associate-*l*85.4%
fma-def88.4%
associate-*l*99.8%
*-commutative99.8%
associate-*l*99.7%
Simplified99.7%
if -4.99999999999999992e156 < (*.f64 y 9) Initial program 94.6%
Final simplification95.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 (* z (* y 9.0))))
(if (<= t_1 1e+271)
(+ (* b (* a 27.0)) (- (* x 2.0) (* t t_1)))
(- (* 27.0 (* a b)) (* 9.0 (* y (* z t)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+271) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 = z * (y * 9.0d0)
if (t_1 <= 1d+271) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * t_1))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+271) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 1e+271: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1)) else: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 1e+271) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * t_1))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 1e+271)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
else
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+271], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 10^{+271}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 9.99999999999999953e270Initial program 96.8%
if 9.99999999999999953e270 < (*.f64 (*.f64 y 9) z) Initial program 68.3%
Taylor expanded in x around 0 93.2%
Final simplification96.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 (* z (* y 9.0))))
(if (<= t_1 4e+276)
(+ (* b (* a 27.0)) (- (* x 2.0) (* t t_1)))
(+ (* x 2.0) (- (* a (* 27.0 b)) (* (* z t) (* y 9.0)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 4e+276) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (y * 9.0)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 = z * (y * 9.0d0)
if (t_1 <= 4d+276) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * t_1))
else
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((z * t) * (y * 9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 4e+276) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (y * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 4e+276: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1)) else: tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (y * 9.0))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 4e+276) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * t_1))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(z * t) * Float64(y * 9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 4e+276)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
else
tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (y * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+276], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 4 \cdot 10^{+276}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 4.0000000000000002e276Initial program 96.8%
if 4.0000000000000002e276 < (*.f64 (*.f64 y 9) z) Initial program 67.3%
associate-+l-67.3%
sub-neg67.3%
neg-mul-167.3%
metadata-eval67.3%
metadata-eval67.3%
cancel-sign-sub-inv67.3%
metadata-eval67.3%
*-lft-identity67.3%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Final simplification96.4%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 (* z (* y 9.0))))
(if (<= t_1 2e+48)
(+ (* b (* a 27.0)) (- (* x 2.0) (* t t_1)))
(+ (* x 2.0) (- (* a (* 27.0 b)) (* y (* (* z t) 9.0)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+48) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * ((z * t) * 9.0)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 = z * (y * 9.0d0)
if (t_1 <= 2d+48) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * t_1))
else
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - (y * ((z * t) * 9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+48) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * ((z * t) * 9.0)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 2e+48: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1)) else: tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * ((z * t) * 9.0))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 2e+48) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * t_1))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(y * Float64(Float64(z * t) * 9.0)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 2e+48)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * t_1));
else
tmp = (x * 2.0) + ((a * (27.0 * b)) - (y * ((z * t) * 9.0)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+48], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * t), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+48}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - y \cdot \left(\left(z \cdot t\right) \cdot 9\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 2.00000000000000009e48Initial program 96.4%
if 2.00000000000000009e48 < (*.f64 (*.f64 y 9) z) Initial program 83.4%
associate-+l-83.4%
sub-neg83.4%
neg-mul-183.4%
metadata-eval83.4%
metadata-eval83.4%
cancel-sign-sub-inv83.4%
metadata-eval83.4%
*-lft-identity83.4%
associate-*l*94.9%
associate-*l*95.0%
Simplified95.0%
cancel-sign-sub-inv95.0%
associate-*l*94.9%
Applied egg-rr94.9%
Final simplification96.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= (* x 2.0) -1.8e+39)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= (* x 2.0) 1e+60)
(+ (* b (* a 27.0)) (* -9.0 (* z (* y t))))
(- (* x 2.0) (* (* a b) -27.0)))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * 2.0) <= -1.8e+39) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if ((x * 2.0) <= 1e+60) {
tmp = (b * (a * 27.0)) + (-9.0 * (z * (y * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 ((x * 2.0d0) <= (-1.8d+39)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if ((x * 2.0d0) <= 1d+60) then
tmp = (b * (a * 27.0d0)) + ((-9.0d0) * (z * (y * t)))
else
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * 2.0) <= -1.8e+39) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if ((x * 2.0) <= 1e+60) {
tmp = (b * (a * 27.0)) + (-9.0 * (z * (y * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x * 2.0) <= -1.8e+39: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif (x * 2.0) <= 1e+60: tmp = (b * (a * 27.0)) + (-9.0 * (z * (y * t))) else: tmp = (x * 2.0) - ((a * b) * -27.0) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * 2.0) <= -1.8e+39) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (Float64(x * 2.0) <= 1e+60) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(-9.0 * Float64(z * Float64(y * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x * 2.0) <= -1.8e+39)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif ((x * 2.0) <= 1e+60)
tmp = (b * (a * 27.0)) + (-9.0 * (z * (y * t)));
else
tmp = (x * 2.0) - ((a * b) * -27.0);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * 2.0), $MachinePrecision], -1.8e+39], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 1e+60], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -1.8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \cdot 2 \leq 10^{+60}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\end{array}
if (*.f64 x 2) < -1.79999999999999992e39Initial program 92.4%
Taylor expanded in a around 0 86.5%
if -1.79999999999999992e39 < (*.f64 x 2) < 9.9999999999999995e59Initial program 92.4%
Taylor expanded in x around 0 85.3%
cancel-sign-sub-inv85.3%
associate-*r*85.2%
metadata-eval85.2%
associate-*r*87.4%
Applied egg-rr87.4%
if 9.9999999999999995e59 < (*.f64 x 2) Initial program 97.8%
associate-+l-97.8%
sub-neg97.8%
neg-mul-197.8%
metadata-eval97.8%
metadata-eval97.8%
cancel-sign-sub-inv97.8%
metadata-eval97.8%
*-lft-identity97.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around 0 88.2%
*-commutative88.2%
Simplified88.2%
Final simplification87.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 (* y (* z t)))))
(if (<= (* x 2.0) -1.8e+39)
(- (* x 2.0) t_1)
(if (<= (* x 2.0) 1e+60)
(- (* 27.0 (* a b)) t_1)
(- (* x 2.0) (* (* a b) -27.0))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (y * (z * t));
double tmp;
if ((x * 2.0) <= -1.8e+39) {
tmp = (x * 2.0) - t_1;
} else if ((x * 2.0) <= 1e+60) {
tmp = (27.0 * (a * b)) - t_1;
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 = 9.0d0 * (y * (z * t))
if ((x * 2.0d0) <= (-1.8d+39)) then
tmp = (x * 2.0d0) - t_1
else if ((x * 2.0d0) <= 1d+60) then
tmp = (27.0d0 * (a * b)) - t_1
else
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (y * (z * t));
double tmp;
if ((x * 2.0) <= -1.8e+39) {
tmp = (x * 2.0) - t_1;
} else if ((x * 2.0) <= 1e+60) {
tmp = (27.0 * (a * b)) - t_1;
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 9.0 * (y * (z * t)) tmp = 0 if (x * 2.0) <= -1.8e+39: tmp = (x * 2.0) - t_1 elif (x * 2.0) <= 1e+60: tmp = (27.0 * (a * b)) - t_1 else: tmp = (x * 2.0) - ((a * b) * -27.0) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (Float64(x * 2.0) <= -1.8e+39) tmp = Float64(Float64(x * 2.0) - t_1); elseif (Float64(x * 2.0) <= 1e+60) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 9.0 * (y * (z * t));
tmp = 0.0;
if ((x * 2.0) <= -1.8e+39)
tmp = (x * 2.0) - t_1;
elseif ((x * 2.0) <= 1e+60)
tmp = (27.0 * (a * b)) - t_1;
else
tmp = (x * 2.0) - ((a * b) * -27.0);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 2.0), $MachinePrecision], -1.8e+39], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 1e+60], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;x \cdot 2 \leq -1.8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{elif}\;x \cdot 2 \leq 10^{+60}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\end{array}
if (*.f64 x 2) < -1.79999999999999992e39Initial program 92.4%
Taylor expanded in a around 0 86.5%
if -1.79999999999999992e39 < (*.f64 x 2) < 9.9999999999999995e59Initial program 92.4%
Taylor expanded in x around 0 85.3%
if 9.9999999999999995e59 < (*.f64 x 2) Initial program 97.8%
associate-+l-97.8%
sub-neg97.8%
neg-mul-197.8%
metadata-eval97.8%
metadata-eval97.8%
cancel-sign-sub-inv97.8%
metadata-eval97.8%
*-lft-identity97.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around 0 88.2%
*-commutative88.2%
Simplified88.2%
Final simplification86.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.12e+23) (- (* x 2.0) (* 9.0 (* y (* z t)))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* 9.0 (* z y)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.12e+23) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 <= (-1.12d+23)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (9.0d0 * (z * y))))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.12e+23) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.12e+23: tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y)))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.12e+23) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y))))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.12e+23)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.12e+23], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.12e23Initial program 92.9%
Taylor expanded in a around 0 77.5%
if -1.12e23 < z Initial program 93.6%
Taylor expanded in y around 0 93.6%
Final simplification90.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 (* z y)))))
(if (<= x -5.8e+69)
(* x 2.0)
(if (<= x -9.2e-294)
t_1
(if (<= x 2.7e-219)
(* 27.0 (* a b))
(if (<= x 4.4e+59) t_1 (* x 2.0)))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (x <= -5.8e+69) {
tmp = x * 2.0;
} else if (x <= -9.2e-294) {
tmp = t_1;
} else if (x <= 2.7e-219) {
tmp = 27.0 * (a * b);
} else if (x <= 4.4e+59) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 = (-9.0d0) * (t * (z * y))
if (x <= (-5.8d+69)) then
tmp = x * 2.0d0
else if (x <= (-9.2d-294)) then
tmp = t_1
else if (x <= 2.7d-219) then
tmp = 27.0d0 * (a * b)
else if (x <= 4.4d+59) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (x <= -5.8e+69) {
tmp = x * 2.0;
} else if (x <= -9.2e-294) {
tmp = t_1;
} else if (x <= 2.7e-219) {
tmp = 27.0 * (a * b);
} else if (x <= 4.4e+59) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if x <= -5.8e+69: tmp = x * 2.0 elif x <= -9.2e-294: tmp = t_1 elif x <= 2.7e-219: tmp = 27.0 * (a * b) elif x <= 4.4e+59: tmp = t_1 else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (x <= -5.8e+69) tmp = Float64(x * 2.0); elseif (x <= -9.2e-294) tmp = t_1; elseif (x <= 2.7e-219) tmp = Float64(27.0 * Float64(a * b)); elseif (x <= 4.4e+59) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (x <= -5.8e+69)
tmp = x * 2.0;
elseif (x <= -9.2e-294)
tmp = t_1;
elseif (x <= 2.7e-219)
tmp = 27.0 * (a * b);
elseif (x <= 4.4e+59)
tmp = t_1;
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.
NOTE: 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[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e+69], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -9.2e-294], t$95$1, If[LessEqual[x, 2.7e-219], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e+59], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{+69}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{-294}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-219}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+59}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -5.7999999999999997e69 or 4.3999999999999999e59 < x Initial program 94.5%
associate-+l-94.5%
fma-neg94.5%
neg-sub094.5%
associate-+l-94.5%
neg-sub094.5%
associate-*l*94.4%
associate-*l*94.4%
distribute-rgt-neg-in94.4%
fma-def95.3%
*-commutative95.3%
distribute-rgt-neg-in95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in x around inf 61.0%
if -5.7999999999999997e69 < x < -9.20000000000000064e-294 or 2.7e-219 < x < 4.3999999999999999e59Initial program 92.6%
+-commutative92.6%
associate-*l*92.6%
fma-def92.6%
associate-*l*95.1%
*-commutative95.1%
associate-*l*95.0%
Simplified95.0%
add-cube-cbrt94.5%
pow394.5%
associate-*r*92.2%
Applied egg-rr92.2%
Taylor expanded in y around inf 59.6%
associate-*r*59.7%
*-commutative59.7%
associate-*r*59.6%
associate-*r*57.3%
*-commutative57.3%
Simplified57.3%
if -9.20000000000000064e-294 < x < 2.7e-219Initial program 92.8%
+-commutative92.8%
associate-*l*92.7%
fma-def92.7%
associate-*l*85.7%
*-commutative85.7%
associate-*l*85.7%
Simplified85.7%
add-cube-cbrt85.4%
pow385.3%
associate-*r*92.4%
Applied egg-rr92.4%
Taylor expanded in a around inf 75.4%
Final simplification60.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.4e+32)
(* 27.0 (* a b))
(if (<= b 8.5e+131)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(- (* x 2.0) (* (* a b) -27.0)))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.4e+32) {
tmp = 27.0 * (a * b);
} else if (b <= 8.5e+131) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 <= (-2.4d+32)) then
tmp = 27.0d0 * (a * b)
else if (b <= 8.5d+131) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.4e+32) {
tmp = 27.0 * (a * b);
} else if (b <= 8.5e+131) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - ((a * b) * -27.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -2.4e+32: tmp = 27.0 * (a * b) elif b <= 8.5e+131: tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) - ((a * b) * -27.0) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.4e+32) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 8.5e+131) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -2.4e+32)
tmp = 27.0 * (a * b);
elseif (b <= 8.5e+131)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - ((a * b) * -27.0);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.4e+32], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e+131], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+32}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{+131}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\end{array}
\end{array}
if b < -2.39999999999999991e32Initial program 89.8%
+-commutative89.8%
associate-*l*89.7%
fma-def91.9%
associate-*l*91.7%
*-commutative91.7%
associate-*l*91.6%
Simplified91.6%
add-cube-cbrt91.4%
pow391.4%
associate-*r*91.7%
Applied egg-rr91.7%
Taylor expanded in a around inf 55.6%
if -2.39999999999999991e32 < b < 8.50000000000000063e131Initial program 94.1%
Taylor expanded in a around 0 81.9%
if 8.50000000000000063e131 < b Initial program 94.9%
associate-+l-94.9%
sub-neg94.9%
neg-mul-194.9%
metadata-eval94.9%
metadata-eval94.9%
cancel-sign-sub-inv94.9%
metadata-eval94.9%
*-lft-identity94.9%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around 0 80.5%
*-commutative80.5%
Simplified80.5%
Final simplification76.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.25e-48) (* y (* (* z t) -9.0)) (if (<= z 3.9e-7) (- (* x 2.0) (* a (* b -27.0))) (* (* z y) (* t -9.0)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-48) {
tmp = y * ((z * t) * -9.0);
} else if (z <= 3.9e-7) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (z * y) * (t * -9.0);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 <= (-1.25d-48)) then
tmp = y * ((z * t) * (-9.0d0))
else if (z <= 3.9d-7) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (z * y) * (t * (-9.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-48) {
tmp = y * ((z * t) * -9.0);
} else if (z <= 3.9e-7) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (z * y) * (t * -9.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.25e-48: tmp = y * ((z * t) * -9.0) elif z <= 3.9e-7: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (z * y) * (t * -9.0) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.25e-48) tmp = Float64(y * Float64(Float64(z * t) * -9.0)); elseif (z <= 3.9e-7) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(z * y) * Float64(t * -9.0)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.25e-48)
tmp = y * ((z * t) * -9.0);
elseif (z <= 3.9e-7)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (z * y) * (t * -9.0);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.25e-48], N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e-7], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-48}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\
\end{array}
\end{array}
if z < -1.25e-48Initial program 93.6%
+-commutative93.6%
associate-*l*93.5%
fma-def93.6%
associate-*l*87.5%
*-commutative87.5%
associate-*l*87.5%
Simplified87.5%
add-cube-cbrt86.9%
pow386.9%
associate-*r*93.0%
Applied egg-rr93.0%
Taylor expanded in y around inf 60.2%
expm1-log1p-u35.6%
expm1-udef35.0%
associate-*r*39.1%
*-commutative39.1%
Applied egg-rr39.1%
expm1-def39.8%
expm1-log1p66.4%
*-commutative66.4%
*-commutative66.4%
associate-*r*60.2%
associate-*l*60.2%
Simplified60.2%
if -1.25e-48 < z < 3.90000000000000025e-7Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 84.3%
*-commutative84.3%
associate-*l*84.2%
Simplified84.2%
if 3.90000000000000025e-7 < z Initial program 81.9%
+-commutative81.9%
associate-*l*81.9%
fma-def84.8%
associate-*l*91.6%
*-commutative91.6%
associate-*l*91.5%
Simplified91.5%
add-cube-cbrt91.0%
pow391.0%
associate-*r*84.4%
Applied egg-rr84.4%
Taylor expanded in y around inf 64.2%
associate-*r*69.6%
*-commutative69.6%
*-commutative69.6%
associate-*r*57.4%
*-commutative57.4%
associate-*l*57.4%
Simplified57.4%
Final simplification71.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.25e-48) (* y (* (* z t) -9.0)) (if (<= z 3e-5) (- (* x 2.0) (* (* a b) -27.0)) (* (* z y) (* t -9.0)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-48) {
tmp = y * ((z * t) * -9.0);
} else if (z <= 3e-5) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (z * y) * (t * -9.0);
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 <= (-1.25d-48)) then
tmp = y * ((z * t) * (-9.0d0))
else if (z <= 3d-5) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else
tmp = (z * y) * (t * (-9.0d0))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e-48) {
tmp = y * ((z * t) * -9.0);
} else if (z <= 3e-5) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else {
tmp = (z * y) * (t * -9.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.25e-48: tmp = y * ((z * t) * -9.0) elif z <= 3e-5: tmp = (x * 2.0) - ((a * b) * -27.0) else: tmp = (z * y) * (t * -9.0) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.25e-48) tmp = Float64(y * Float64(Float64(z * t) * -9.0)); elseif (z <= 3e-5) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); else tmp = Float64(Float64(z * y) * Float64(t * -9.0)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.25e-48)
tmp = y * ((z * t) * -9.0);
elseif (z <= 3e-5)
tmp = (x * 2.0) - ((a * b) * -27.0);
else
tmp = (z * y) * (t * -9.0);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.25e-48], N[(y * N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-5], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-48}:\\
\;\;\;\;y \cdot \left(\left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-5}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\
\end{array}
\end{array}
if z < -1.25e-48Initial program 93.6%
+-commutative93.6%
associate-*l*93.5%
fma-def93.6%
associate-*l*87.5%
*-commutative87.5%
associate-*l*87.5%
Simplified87.5%
add-cube-cbrt86.9%
pow386.9%
associate-*r*93.0%
Applied egg-rr93.0%
Taylor expanded in y around inf 60.2%
expm1-log1p-u35.6%
expm1-udef35.0%
associate-*r*39.1%
*-commutative39.1%
Applied egg-rr39.1%
expm1-def39.8%
expm1-log1p66.4%
*-commutative66.4%
*-commutative66.4%
associate-*r*60.2%
associate-*l*60.2%
Simplified60.2%
if -1.25e-48 < z < 3.00000000000000008e-5Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 84.3%
*-commutative84.3%
Simplified84.3%
if 3.00000000000000008e-5 < z Initial program 81.9%
+-commutative81.9%
associate-*l*81.9%
fma-def84.8%
associate-*l*91.6%
*-commutative91.6%
associate-*l*91.5%
Simplified91.5%
add-cube-cbrt91.0%
pow391.0%
associate-*r*84.4%
Applied egg-rr84.4%
Taylor expanded in y around inf 64.2%
associate-*r*69.6%
*-commutative69.6%
*-commutative69.6%
associate-*r*57.4%
*-commutative57.4%
associate-*l*57.4%
Simplified57.4%
Final simplification71.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= x -3.6e+38) (* x 2.0) (if (<= x 2.2e+117) (* 27.0 (* a b)) (* x 2.0))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+38) {
tmp = x * 2.0;
} else if (x <= 2.2e+117) {
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.
NOTE: 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 (x <= (-3.6d+38)) then
tmp = x * 2.0d0
else if (x <= 2.2d+117) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+38) {
tmp = x * 2.0;
} else if (x <= 2.2e+117) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -3.6e+38: tmp = x * 2.0 elif x <= 2.2e+117: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.6e+38) tmp = Float64(x * 2.0); elseif (x <= 2.2e+117) 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])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -3.6e+38)
tmp = x * 2.0;
elseif (x <= 2.2e+117)
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. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.6e+38], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 2.2e+117], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+38}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+117}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -3.59999999999999969e38 or 2.20000000000000014e117 < x Initial program 94.4%
associate-+l-94.4%
fma-neg94.4%
neg-sub094.4%
associate-+l-94.4%
neg-sub094.4%
associate-*l*95.2%
associate-*l*95.2%
distribute-rgt-neg-in95.2%
fma-def96.1%
*-commutative96.1%
distribute-rgt-neg-in96.1%
metadata-eval96.1%
Simplified96.1%
Taylor expanded in x around inf 61.2%
if -3.59999999999999969e38 < x < 2.20000000000000014e117Initial program 92.8%
+-commutative92.8%
associate-*l*92.7%
fma-def92.7%
associate-*l*92.8%
*-commutative92.8%
associate-*l*92.7%
Simplified92.7%
add-cube-cbrt92.3%
pow392.3%
associate-*r*92.4%
Applied egg-rr92.4%
Taylor expanded in a around inf 38.9%
Final simplification48.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: 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(y < z && z < t);
assert(a < b);
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.
NOTE: 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 y < z && z < t;
assert a < b;
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]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
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. NOTE: 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}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.4%
associate-+l-93.4%
fma-neg93.4%
neg-sub093.4%
associate-+l-93.4%
neg-sub093.4%
associate-*l*93.8%
associate-*l*93.8%
distribute-rgt-neg-in93.8%
fma-def94.5%
*-commutative94.5%
distribute-rgt-neg-in94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in x around inf 31.5%
Final simplification31.5%
(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 2023255
(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)))