
(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 15 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 (<= z -1e-35) (- (+ (* x 2.0) (* b (* a 27.0))) (* y (* (* z 9.0) t))) (fma a (* b 27.0) (fma x 2.0 (* t (* y (* z -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 <= -1e-35) {
tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * ((z * 9.0) * t));
} else {
tmp = fma(a, (b * 27.0), fma(x, 2.0, (t * (y * (z * -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 <= -1e-35) tmp = Float64(Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))) - Float64(y * Float64(Float64(z * 9.0) * t))); else tmp = fma(a, Float64(b * 27.0), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); 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[z, -1e-35], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * 27.0), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $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 -1 \cdot 10^{-35}:\\
\;\;\;\;\left(x \cdot 2 + b \cdot \left(a \cdot 27\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot 27, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.00000000000000001e-35Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*87.3%
associate-*l*88.6%
Simplified88.6%
+-commutative88.6%
associate-+r-88.6%
associate-*r*87.3%
*-commutative87.3%
associate-*l*87.3%
associate-*r*87.2%
Applied egg-rr87.2%
if -1.00000000000000001e-35 < z Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*92.5%
distribute-lft-neg-in92.5%
*-commutative92.5%
cancel-sign-sub-inv92.5%
associate-+r-92.5%
associate-*l*93.1%
fma-def93.6%
cancel-sign-sub-inv93.6%
fma-def93.6%
*-commutative93.6%
distribute-rgt-neg-in93.6%
distribute-lft-neg-out93.6%
associate-*r*96.7%
associate-*l*96.2%
Simplified96.2%
Final simplification93.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 (if (<= (* y 9.0) -0.02) (fma a (* b 27.0) (- (* x 2.0) (* y (* (* z 9.0) t)))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 ((y * 9.0) <= -0.02) {
tmp = fma(a, (b * 27.0), ((x * 2.0) - (y * ((z * 9.0) * t))));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 (Float64(y * 9.0) <= -0.02) tmp = fma(a, Float64(b * 27.0), Float64(Float64(x * 2.0) - Float64(y * Float64(Float64(z * 9.0) * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); 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], -0.02], N[(a * N[(b * 27.0), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $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}\;y \cdot 9 \leq -0.02:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot 27, x \cdot 2 - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -0.0200000000000000004Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-*r*88.5%
distribute-lft-neg-in88.5%
*-commutative88.5%
cancel-sign-sub-inv88.5%
associate-+r-88.5%
associate-*l*89.9%
fma-def91.1%
cancel-sign-sub-inv91.1%
fma-def91.1%
*-commutative91.1%
distribute-rgt-neg-in91.1%
distribute-lft-neg-out91.1%
associate-*r*94.8%
associate-*l*94.9%
Simplified94.9%
*-commutative94.9%
associate-*l*98.5%
*-commutative98.5%
associate-*r*98.5%
*-commutative98.5%
*-commutative98.5%
associate-*r*98.4%
associate-*l*98.5%
metadata-eval98.5%
distribute-lft-neg-in98.5%
*-commutative98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
fma-neg98.5%
associate-*l*98.4%
associate-*r*98.5%
Applied egg-rr98.5%
if -0.0200000000000000004 < (*.f64 y 9) Initial program 96.7%
Final simplification97.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 (* b (* a 27.0))) (t_2 (* z (* y 9.0))))
(if (<= t_2 2e+251)
(+ (- (* x 2.0) (* t t_2)) t_1)
(- (+ (* x 2.0) t_1) (* y (* (* z 9.0) t))))))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 = b * (a * 27.0);
double t_2 = z * (y * 9.0);
double tmp;
if (t_2 <= 2e+251) {
tmp = ((x * 2.0) - (t * t_2)) + t_1;
} else {
tmp = ((x * 2.0) + t_1) - (y * ((z * 9.0) * t));
}
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 = b * (a * 27.0d0)
t_2 = z * (y * 9.0d0)
if (t_2 <= 2d+251) then
tmp = ((x * 2.0d0) - (t * t_2)) + t_1
else
tmp = ((x * 2.0d0) + t_1) - (y * ((z * 9.0d0) * t))
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 = b * (a * 27.0);
double t_2 = z * (y * 9.0);
double tmp;
if (t_2 <= 2e+251) {
tmp = ((x * 2.0) - (t * t_2)) + t_1;
} else {
tmp = ((x * 2.0) + t_1) - (y * ((z * 9.0) * t));
}
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 = b * (a * 27.0) t_2 = z * (y * 9.0) tmp = 0 if t_2 <= 2e+251: tmp = ((x * 2.0) - (t * t_2)) + t_1 else: tmp = ((x * 2.0) + t_1) - (y * ((z * 9.0) * t)) 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(b * Float64(a * 27.0)) t_2 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_2 <= 2e+251) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_2)) + t_1); else tmp = Float64(Float64(Float64(x * 2.0) + t_1) - Float64(y * Float64(Float64(z * 9.0) * t))); 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 = b * (a * 27.0);
t_2 = z * (y * 9.0);
tmp = 0.0;
if (t_2 <= 2e+251)
tmp = ((x * 2.0) - (t * t_2)) + t_1;
else
tmp = ((x * 2.0) + t_1) - (y * ((z * 9.0) * t));
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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+251], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $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 := b \cdot \left(a \cdot 27\right)\\
t_2 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_2 \leq 2 \cdot 10^{+251}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_2\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 + t_1\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 2.0000000000000001e251Initial program 96.6%
if 2.0000000000000001e251 < (*.f64 (*.f64 y 9) z) Initial program 80.1%
sub-neg80.1%
sub-neg80.1%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
+-commutative99.9%
associate-+r-99.9%
associate-*r*99.9%
*-commutative99.9%
associate-*l*99.8%
associate-*r*99.9%
Applied egg-rr99.9%
Final simplification96.8%
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 10800000.0) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* b 27.0))) (- (* x 2.0) (* 9.0 (* t (* z y))))))
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 <= 10800000.0) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
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 <= 10800000.0d0) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (b * 27.0d0))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
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 <= 10800000.0) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
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 <= 10800000.0: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) 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 <= 10800000.0) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(b * 27.0))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); 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 <= 10800000.0)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
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, 10800000.0], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $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 10800000:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(b \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.08e7Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*94.1%
associate-*l*95.1%
Simplified95.1%
if 1.08e7 < z Initial program 88.7%
sub-neg88.7%
sub-neg88.7%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in a around 0 72.6%
Final simplification89.8%
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 -5e-51) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* b 27.0))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 <= -5e-51) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= (-5d-51)) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (b * 27.0d0))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (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 <= -5e-51) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= -5e-51: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= -5e-51) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(b * 27.0))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + 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 <= -5e-51)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (b * 27.0));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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, -5e-51], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $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 -5 \cdot 10^{-51}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(b \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -5.00000000000000004e-51Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*87.7%
associate-*l*88.9%
Simplified88.9%
if -5.00000000000000004e-51 < z Initial program 95.5%
Final simplification93.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 (* z y)))) (t_2 (* b (* a 27.0))))
(if (<= b -1.08e-57)
t_2
(if (<= b 2.05e-263)
t_1
(if (<= b 6.2e-97) (* x 2.0) (if (<= b 9.2e+91) t_1 t_2))))))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 * (z * y));
double t_2 = b * (a * 27.0);
double tmp;
if (b <= -1.08e-57) {
tmp = t_2;
} else if (b <= 2.05e-263) {
tmp = t_1;
} else if (b <= 6.2e-97) {
tmp = x * 2.0;
} else if (b <= 9.2e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * (z * y))
t_2 = b * (a * 27.0d0)
if (b <= (-1.08d-57)) then
tmp = t_2
else if (b <= 2.05d-263) then
tmp = t_1
else if (b <= 6.2d-97) then
tmp = x * 2.0d0
else if (b <= 9.2d+91) then
tmp = t_1
else
tmp = t_2
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 * (z * y));
double t_2 = b * (a * 27.0);
double tmp;
if (b <= -1.08e-57) {
tmp = t_2;
} else if (b <= 2.05e-263) {
tmp = t_1;
} else if (b <= 6.2e-97) {
tmp = x * 2.0;
} else if (b <= 9.2e+91) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * (z * y)) t_2 = b * (a * 27.0) tmp = 0 if b <= -1.08e-57: tmp = t_2 elif b <= 2.05e-263: tmp = t_1 elif b <= 6.2e-97: tmp = x * 2.0 elif b <= 9.2e+91: tmp = t_1 else: tmp = t_2 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(z * y))) t_2 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -1.08e-57) tmp = t_2; elseif (b <= 2.05e-263) tmp = t_1; elseif (b <= 6.2e-97) tmp = Float64(x * 2.0); elseif (b <= 9.2e+91) tmp = t_1; else tmp = t_2; 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 * (z * y));
t_2 = b * (a * 27.0);
tmp = 0.0;
if (b <= -1.08e-57)
tmp = t_2;
elseif (b <= 2.05e-263)
tmp = t_1;
elseif (b <= 6.2e-97)
tmp = x * 2.0;
elseif (b <= 9.2e+91)
tmp = t_1;
else
tmp = t_2;
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[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.08e-57], t$95$2, If[LessEqual[b, 2.05e-263], t$95$1, If[LessEqual[b, 6.2e-97], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 9.2e+91], t$95$1, t$95$2]]]]]]
\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(z \cdot y\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -1.08 \cdot 10^{-57}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 2.05 \cdot 10^{-263}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-97}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -1.08e-57 or 9.19999999999999965e91 < b Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.5%
fma-def96.4%
cancel-sign-sub-inv96.4%
fma-def96.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
distribute-lft-neg-out96.4%
associate-*r*97.3%
associate-*l*96.5%
Simplified96.5%
*-commutative96.5%
associate-*l*93.0%
*-commutative93.0%
associate-*r*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*r*93.8%
associate-*l*93.8%
metadata-eval93.8%
distribute-lft-neg-in93.8%
*-commutative93.8%
distribute-rgt-neg-in93.8%
*-commutative93.8%
fma-neg93.8%
associate-*l*93.8%
associate-*r*93.0%
Applied egg-rr93.0%
Taylor expanded in a around inf 60.2%
associate-*r*60.2%
Simplified60.2%
if -1.08e-57 < b < 2.0499999999999998e-263 or 6.20000000000000004e-97 < b < 9.19999999999999965e91Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*95.4%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around inf 45.4%
if 2.0499999999999998e-263 < b < 6.20000000000000004e-97Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around inf 56.5%
Final simplification53.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 (* b (* a 27.0))))
(if (<= b -5.8e-63)
t_1
(if (<= b 7e-263)
(* -9.0 (* t (* z y)))
(if (<= b 6e-97)
(* x 2.0)
(if (<= b 2.55e+93) (* t (* -9.0 (* z y))) 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 = b * (a * 27.0);
double tmp;
if (b <= -5.8e-63) {
tmp = t_1;
} else if (b <= 7e-263) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 6e-97) {
tmp = x * 2.0;
} else if (b <= 2.55e+93) {
tmp = t * (-9.0 * (z * y));
} 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) :: tmp
t_1 = b * (a * 27.0d0)
if (b <= (-5.8d-63)) then
tmp = t_1
else if (b <= 7d-263) then
tmp = (-9.0d0) * (t * (z * y))
else if (b <= 6d-97) then
tmp = x * 2.0d0
else if (b <= 2.55d+93) then
tmp = t * ((-9.0d0) * (z * y))
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 = b * (a * 27.0);
double tmp;
if (b <= -5.8e-63) {
tmp = t_1;
} else if (b <= 7e-263) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 6e-97) {
tmp = x * 2.0;
} else if (b <= 2.55e+93) {
tmp = t * (-9.0 * (z * y));
} 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 = b * (a * 27.0) tmp = 0 if b <= -5.8e-63: tmp = t_1 elif b <= 7e-263: tmp = -9.0 * (t * (z * y)) elif b <= 6e-97: tmp = x * 2.0 elif b <= 2.55e+93: tmp = t * (-9.0 * (z * y)) 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(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -5.8e-63) tmp = t_1; elseif (b <= 7e-263) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (b <= 6e-97) tmp = Float64(x * 2.0); elseif (b <= 2.55e+93) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); 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 = b * (a * 27.0);
tmp = 0.0;
if (b <= -5.8e-63)
tmp = t_1;
elseif (b <= 7e-263)
tmp = -9.0 * (t * (z * y));
elseif (b <= 6e-97)
tmp = x * 2.0;
elseif (b <= 2.55e+93)
tmp = t * (-9.0 * (z * y));
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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.8e-63], t$95$1, If[LessEqual[b, 7e-263], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-97], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.55e+93], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-263}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-97}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.55 \cdot 10^{+93}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -5.7999999999999995e-63 or 2.5499999999999998e93 < b Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.5%
fma-def96.4%
cancel-sign-sub-inv96.4%
fma-def96.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
distribute-lft-neg-out96.4%
associate-*r*97.3%
associate-*l*96.5%
Simplified96.5%
*-commutative96.5%
associate-*l*93.0%
*-commutative93.0%
associate-*r*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*r*93.8%
associate-*l*93.8%
metadata-eval93.8%
distribute-lft-neg-in93.8%
*-commutative93.8%
distribute-rgt-neg-in93.8%
*-commutative93.8%
fma-neg93.8%
associate-*l*93.8%
associate-*r*93.0%
Applied egg-rr93.0%
Taylor expanded in a around inf 60.2%
associate-*r*60.2%
Simplified60.2%
if -5.7999999999999995e-63 < b < 6.99999999999999938e-263Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*93.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around inf 43.6%
if 6.99999999999999938e-263 < b < 6.00000000000000048e-97Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around inf 56.5%
if 6.00000000000000048e-97 < b < 2.5499999999999998e93Initial program 93.0%
+-commutative93.0%
associate-+r-93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.6%
fma-def93.6%
cancel-sign-sub-inv93.6%
fma-def93.6%
*-commutative93.6%
distribute-rgt-neg-in93.6%
distribute-lft-neg-out93.6%
associate-*r*92.9%
associate-*l*93.0%
Simplified93.0%
*-commutative93.0%
associate-*l*97.5%
*-commutative97.5%
associate-*r*97.5%
*-commutative97.5%
*-commutative97.5%
associate-*r*97.6%
associate-*l*97.6%
metadata-eval97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
*-commutative97.6%
fma-neg97.6%
associate-*l*97.6%
associate-*r*97.5%
Applied egg-rr97.5%
Taylor expanded in y around inf 48.1%
*-commutative48.1%
*-commutative48.1%
associate-*r*52.8%
associate-*l*52.7%
*-commutative52.7%
associate-*l*52.7%
Simplified52.7%
Taylor expanded in y around 0 48.1%
*-commutative48.1%
associate-*r*48.1%
*-commutative48.1%
associate-*l*48.0%
*-commutative48.0%
Simplified48.0%
Final simplification53.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 (* b (* a 27.0))))
(if (<= b -1.02e-57)
t_1
(if (<= b 6.2e-263)
(* (* z y) (* t -9.0))
(if (<= b 2.3e-96)
(* x 2.0)
(if (<= b 5.9e+93) (* t (* -9.0 (* z y))) 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 = b * (a * 27.0);
double tmp;
if (b <= -1.02e-57) {
tmp = t_1;
} else if (b <= 6.2e-263) {
tmp = (z * y) * (t * -9.0);
} else if (b <= 2.3e-96) {
tmp = x * 2.0;
} else if (b <= 5.9e+93) {
tmp = t * (-9.0 * (z * y));
} 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) :: tmp
t_1 = b * (a * 27.0d0)
if (b <= (-1.02d-57)) then
tmp = t_1
else if (b <= 6.2d-263) then
tmp = (z * y) * (t * (-9.0d0))
else if (b <= 2.3d-96) then
tmp = x * 2.0d0
else if (b <= 5.9d+93) then
tmp = t * ((-9.0d0) * (z * y))
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 = b * (a * 27.0);
double tmp;
if (b <= -1.02e-57) {
tmp = t_1;
} else if (b <= 6.2e-263) {
tmp = (z * y) * (t * -9.0);
} else if (b <= 2.3e-96) {
tmp = x * 2.0;
} else if (b <= 5.9e+93) {
tmp = t * (-9.0 * (z * y));
} 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 = b * (a * 27.0) tmp = 0 if b <= -1.02e-57: tmp = t_1 elif b <= 6.2e-263: tmp = (z * y) * (t * -9.0) elif b <= 2.3e-96: tmp = x * 2.0 elif b <= 5.9e+93: tmp = t * (-9.0 * (z * y)) 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(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -1.02e-57) tmp = t_1; elseif (b <= 6.2e-263) tmp = Float64(Float64(z * y) * Float64(t * -9.0)); elseif (b <= 2.3e-96) tmp = Float64(x * 2.0); elseif (b <= 5.9e+93) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); 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 = b * (a * 27.0);
tmp = 0.0;
if (b <= -1.02e-57)
tmp = t_1;
elseif (b <= 6.2e-263)
tmp = (z * y) * (t * -9.0);
elseif (b <= 2.3e-96)
tmp = x * 2.0;
elseif (b <= 5.9e+93)
tmp = t * (-9.0 * (z * y));
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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.02e-57], t$95$1, If[LessEqual[b, 6.2e-263], N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-96], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.9e+93], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -1.02 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-263}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-96}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.9 \cdot 10^{+93}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -1.02e-57 or 5.90000000000000008e93 < b Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.5%
fma-def96.4%
cancel-sign-sub-inv96.4%
fma-def96.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
distribute-lft-neg-out96.4%
associate-*r*97.3%
associate-*l*96.5%
Simplified96.5%
*-commutative96.5%
associate-*l*93.0%
*-commutative93.0%
associate-*r*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*r*93.8%
associate-*l*93.8%
metadata-eval93.8%
distribute-lft-neg-in93.8%
*-commutative93.8%
distribute-rgt-neg-in93.8%
*-commutative93.8%
fma-neg93.8%
associate-*l*93.8%
associate-*r*93.0%
Applied egg-rr93.0%
Taylor expanded in a around inf 60.2%
associate-*r*60.2%
Simplified60.2%
if -1.02e-57 < b < 6.20000000000000008e-263Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*93.9%
associate-*l*96.9%
Simplified96.9%
+-commutative96.9%
associate-+r-96.9%
associate-*r*93.9%
*-commutative93.9%
associate-*l*93.9%
associate-*r*93.9%
Applied egg-rr93.9%
Taylor expanded in y around inf 43.6%
associate-*r*43.7%
Simplified43.7%
if 6.20000000000000008e-263 < b < 2.3e-96Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around inf 56.5%
if 2.3e-96 < b < 5.90000000000000008e93Initial program 93.0%
+-commutative93.0%
associate-+r-93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.6%
fma-def93.6%
cancel-sign-sub-inv93.6%
fma-def93.6%
*-commutative93.6%
distribute-rgt-neg-in93.6%
distribute-lft-neg-out93.6%
associate-*r*92.9%
associate-*l*93.0%
Simplified93.0%
*-commutative93.0%
associate-*l*97.5%
*-commutative97.5%
associate-*r*97.5%
*-commutative97.5%
*-commutative97.5%
associate-*r*97.6%
associate-*l*97.6%
metadata-eval97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
*-commutative97.6%
fma-neg97.6%
associate-*l*97.6%
associate-*r*97.5%
Applied egg-rr97.5%
Taylor expanded in y around inf 48.1%
*-commutative48.1%
*-commutative48.1%
associate-*r*52.8%
associate-*l*52.7%
*-commutative52.7%
associate-*l*52.7%
Simplified52.7%
Taylor expanded in y around 0 48.1%
*-commutative48.1%
associate-*r*48.1%
*-commutative48.1%
associate-*l*48.0%
*-commutative48.0%
Simplified48.0%
Final simplification53.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 (if (or (<= z -2.9e-73) (not (<= z 3.3e-97))) (- (* x 2.0) (* 9.0 (* t (* z y)))) (+ (* a (* b 27.0)) (* 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 ((z <= -2.9e-73) || !(z <= 3.3e-97)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (a * (b * 27.0)) + (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 ((z <= (-2.9d-73)) .or. (.not. (z <= 3.3d-97))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else
tmp = (a * (b * 27.0d0)) + (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 ((z <= -2.9e-73) || !(z <= 3.3e-97)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (a * (b * 27.0)) + (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 (z <= -2.9e-73) or not (z <= 3.3e-97): tmp = (x * 2.0) - (9.0 * (t * (z * y))) else: tmp = (a * (b * 27.0)) + (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 ((z <= -2.9e-73) || !(z <= 3.3e-97)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(a * Float64(b * 27.0)) + 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 ((z <= -2.9e-73) || ~((z <= 3.3e-97)))
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
else
tmp = (a * (b * 27.0)) + (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[z, -2.9e-73], N[Not[LessEqual[z, 3.3e-97]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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 -2.9 \cdot 10^{-73} \lor \neg \left(z \leq 3.3 \cdot 10^{-97}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot 27\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -2.9e-73 or 3.3000000000000001e-97 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*89.8%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 70.9%
if -2.9e-73 < z < 3.3000000000000001e-97Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.0%
+-commutative87.0%
*-commutative87.0%
*-commutative87.0%
fma-def87.0%
Applied egg-rr87.0%
fma-udef87.0%
*-commutative87.0%
associate-*r*87.0%
*-commutative87.0%
+-commutative87.0%
*-commutative87.0%
*-commutative87.0%
Applied egg-rr87.0%
Final simplification77.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
(if (<= z -4e-75)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= z 1e-97)
(+ (* a (* b 27.0)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))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 <= -4e-75) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 1e-97) {
tmp = (a * (b * 27.0)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
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 <= (-4d-75)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (z <= 1d-97) then
tmp = (a * (b * 27.0d0)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
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 <= -4e-75) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (z <= 1e-97) {
tmp = (a * (b * 27.0)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
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 <= -4e-75: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif z <= 1e-97: tmp = (a * (b * 27.0)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) 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 <= -4e-75) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= 1e-97) tmp = Float64(Float64(a * Float64(b * 27.0)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); 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 <= -4e-75)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (z <= 1e-97)
tmp = (a * (b * 27.0)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
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, -4e-75], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-97], N[(N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $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 -4 \cdot 10^{-75}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 10^{-97}:\\
\;\;\;\;a \cdot \left(b \cdot 27\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.9999999999999998e-75Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*88.5%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in a around 0 72.6%
expm1-log1p-u46.8%
expm1-udef41.2%
*-commutative41.2%
associate-*l*40.1%
Applied egg-rr40.1%
expm1-def45.8%
expm1-log1p67.0%
*-commutative67.0%
Simplified67.0%
if -3.9999999999999998e-75 < z < 1.00000000000000004e-97Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.0%
+-commutative87.0%
*-commutative87.0%
*-commutative87.0%
fma-def87.0%
Applied egg-rr87.0%
fma-udef87.0%
*-commutative87.0%
associate-*r*87.0%
*-commutative87.0%
+-commutative87.0%
*-commutative87.0%
*-commutative87.0%
Applied egg-rr87.0%
if 1.00000000000000004e-97 < z Initial program 91.1%
sub-neg91.1%
sub-neg91.1%
associate-*l*91.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in a around 0 69.1%
Final simplification75.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 (if (<= z -1.55e-52) (* -9.0 (* y (* z t))) (if (<= z 1.42e+26) (+ (* x 2.0) (* 27.0 (* b a))) (* -9.0 (* z (* y t))))))
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 <= -1.55e-52) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.42e+26) {
tmp = (x * 2.0) + (27.0 * (b * a));
} else {
tmp = -9.0 * (z * (y * t));
}
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 <= (-1.55d-52)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 1.42d+26) then
tmp = (x * 2.0d0) + (27.0d0 * (b * a))
else
tmp = (-9.0d0) * (z * (y * t))
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 <= -1.55e-52) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.42e+26) {
tmp = (x * 2.0) + (27.0 * (b * a));
} else {
tmp = -9.0 * (z * (y * t));
}
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 <= -1.55e-52: tmp = -9.0 * (y * (z * t)) elif z <= 1.42e+26: tmp = (x * 2.0) + (27.0 * (b * a)) else: tmp = -9.0 * (z * (y * t)) 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 <= -1.55e-52) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 1.42e+26) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))); else tmp = Float64(-9.0 * Float64(z * Float64(y * t))); 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 <= -1.55e-52)
tmp = -9.0 * (y * (z * t));
elseif (z <= 1.42e+26)
tmp = (x * 2.0) + (27.0 * (b * a));
else
tmp = -9.0 * (z * (y * t));
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, -1.55e-52], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e+26], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(z * N[(y * t), $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 -1.55 \cdot 10^{-52}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+26}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -1.5499999999999999e-52Initial program 94.9%
+-commutative94.9%
associate-+r-94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-*r*97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
cancel-sign-sub-inv97.6%
associate-+r-97.6%
associate-*l*98.9%
fma-def98.9%
cancel-sign-sub-inv98.9%
fma-def98.9%
*-commutative98.9%
distribute-rgt-neg-in98.9%
distribute-lft-neg-out98.9%
associate-*r*96.2%
associate-*l*96.1%
Simplified96.1%
*-commutative96.1%
associate-*l*89.0%
*-commutative89.0%
associate-*r*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*r*89.0%
associate-*l*89.0%
metadata-eval89.0%
distribute-lft-neg-in89.0%
*-commutative89.0%
distribute-rgt-neg-in89.0%
*-commutative89.0%
fma-neg89.0%
associate-*l*89.0%
associate-*r*89.0%
Applied egg-rr89.0%
Taylor expanded in y around inf 56.9%
*-commutative56.9%
associate-*r*51.4%
*-commutative51.4%
Simplified51.4%
if -1.5499999999999999e-52 < z < 1.42e26Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*98.2%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 82.5%
if 1.42e26 < z Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*89.8%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in y around inf 45.3%
*-commutative45.3%
associate-*r*53.5%
Simplified53.5%
Final simplification66.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 -3e-51) (* -9.0 (* y (* z t))) (if (<= z 1.85e+15) (+ (* a (* b 27.0)) (* x 2.0)) (* -9.0 (* z (* y t))))))
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 <= -3e-51) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.85e+15) {
tmp = (a * (b * 27.0)) + (x * 2.0);
} else {
tmp = -9.0 * (z * (y * t));
}
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 <= (-3d-51)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 1.85d+15) then
tmp = (a * (b * 27.0d0)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (z * (y * t))
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 <= -3e-51) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.85e+15) {
tmp = (a * (b * 27.0)) + (x * 2.0);
} else {
tmp = -9.0 * (z * (y * t));
}
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 <= -3e-51: tmp = -9.0 * (y * (z * t)) elif z <= 1.85e+15: tmp = (a * (b * 27.0)) + (x * 2.0) else: tmp = -9.0 * (z * (y * t)) 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 <= -3e-51) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 1.85e+15) tmp = Float64(Float64(a * Float64(b * 27.0)) + Float64(x * 2.0)); else tmp = Float64(-9.0 * Float64(z * Float64(y * t))); 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 <= -3e-51)
tmp = -9.0 * (y * (z * t));
elseif (z <= 1.85e+15)
tmp = (a * (b * 27.0)) + (x * 2.0);
else
tmp = -9.0 * (z * (y * t));
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, -3e-51], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+15], N[(N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(z * N[(y * t), $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 -3 \cdot 10^{-51}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+15}:\\
\;\;\;\;a \cdot \left(b \cdot 27\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.00000000000000002e-51Initial program 94.9%
+-commutative94.9%
associate-+r-94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-*r*97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
cancel-sign-sub-inv97.6%
associate-+r-97.6%
associate-*l*98.9%
fma-def98.9%
cancel-sign-sub-inv98.9%
fma-def98.9%
*-commutative98.9%
distribute-rgt-neg-in98.9%
distribute-lft-neg-out98.9%
associate-*r*96.2%
associate-*l*96.1%
Simplified96.1%
*-commutative96.1%
associate-*l*89.0%
*-commutative89.0%
associate-*r*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*r*89.0%
associate-*l*89.0%
metadata-eval89.0%
distribute-lft-neg-in89.0%
*-commutative89.0%
distribute-rgt-neg-in89.0%
*-commutative89.0%
fma-neg89.0%
associate-*l*89.0%
associate-*r*89.0%
Applied egg-rr89.0%
Taylor expanded in y around inf 56.9%
*-commutative56.9%
associate-*r*51.4%
*-commutative51.4%
Simplified51.4%
if -3.00000000000000002e-51 < z < 1.85e15Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*98.2%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 83.2%
+-commutative83.2%
*-commutative83.2%
*-commutative83.2%
fma-def83.1%
Applied egg-rr83.1%
fma-udef83.2%
*-commutative83.2%
associate-*r*83.2%
*-commutative83.2%
+-commutative83.2%
*-commutative83.2%
*-commutative83.2%
Applied egg-rr83.2%
if 1.85e15 < z Initial program 88.3%
sub-neg88.3%
sub-neg88.3%
associate-*l*90.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in y around inf 46.2%
*-commutative46.2%
associate-*r*54.3%
Simplified54.3%
Final simplification67.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 (or (<= x -2.3e+118) (not (<= x 5.8e+95))) (* x 2.0) (* 27.0 (* b a))))
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 ((x <= -2.3e+118) || !(x <= 5.8e+95)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (b * a);
}
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 ((x <= (-2.3d+118)) .or. (.not. (x <= 5.8d+95))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (b * a)
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 ((x <= -2.3e+118) || !(x <= 5.8e+95)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (b * a);
}
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 (x <= -2.3e+118) or not (x <= 5.8e+95): tmp = x * 2.0 else: tmp = 27.0 * (b * a) 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 ((x <= -2.3e+118) || !(x <= 5.8e+95)) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(b * a)); 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 ((x <= -2.3e+118) || ~((x <= 5.8e+95)))
tmp = x * 2.0;
else
tmp = 27.0 * (b * a);
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[x, -2.3e+118], N[Not[LessEqual[x, 5.8e+95]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+118} \lor \neg \left(x \leq 5.8 \cdot 10^{+95}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right)\\
\end{array}
\end{array}
if x < -2.30000000000000016e118 or 5.80000000000000027e95 < x Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in x around inf 62.5%
if -2.30000000000000016e118 < x < 5.80000000000000027e95Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-+r-93.5%
associate-*l*94.6%
fma-def95.2%
cancel-sign-sub-inv95.2%
fma-def95.2%
*-commutative95.2%
distribute-rgt-neg-in95.2%
distribute-lft-neg-out95.2%
associate-*r*95.0%
associate-*l*95.1%
Simplified95.1%
*-commutative95.1%
associate-*l*93.0%
*-commutative93.0%
associate-*r*92.9%
*-commutative92.9%
*-commutative92.9%
associate-*r*92.9%
associate-*l*92.9%
metadata-eval92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
fma-neg92.9%
associate-*l*92.9%
associate-*r*93.0%
Applied egg-rr93.0%
Taylor expanded in a around inf 44.7%
Final simplification50.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 (or (<= x -3.9e+118) (not (<= x 3.7e+95))) (* x 2.0) (* a (* b 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 ((x <= -3.9e+118) || !(x <= 3.7e+95)) {
tmp = x * 2.0;
} else {
tmp = a * (b * 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 ((x <= (-3.9d+118)) .or. (.not. (x <= 3.7d+95))) then
tmp = x * 2.0d0
else
tmp = a * (b * 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 ((x <= -3.9e+118) || !(x <= 3.7e+95)) {
tmp = x * 2.0;
} else {
tmp = a * (b * 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 (x <= -3.9e+118) or not (x <= 3.7e+95): tmp = x * 2.0 else: tmp = a * (b * 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 ((x <= -3.9e+118) || !(x <= 3.7e+95)) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(b * 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 ((x <= -3.9e+118) || ~((x <= 3.7e+95)))
tmp = x * 2.0;
else
tmp = a * (b * 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[Or[LessEqual[x, -3.9e+118], N[Not[LessEqual[x, 3.7e+95]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{+118} \lor \neg \left(x \leq 3.7 \cdot 10^{+95}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b \cdot 27\right)\\
\end{array}
\end{array}
if x < -3.9e118 or 3.7000000000000001e95 < x Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in x around inf 62.5%
if -3.9e118 < x < 3.7000000000000001e95Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*91.3%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in y around 0 58.1%
+-commutative58.1%
*-commutative58.1%
*-commutative58.1%
fma-def58.1%
Applied egg-rr58.1%
Taylor expanded in a around inf 44.7%
*-commutative44.7%
associate-*r*44.8%
*-commutative44.8%
Simplified44.8%
Final simplification50.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 (* 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 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*93.2%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 29.6%
Final simplification29.6%
(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 2023338
(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)))