
(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
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 5e+96)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(fma a (* 27.0 b) (- (* x 2.0) (* y (* 9.0 (* 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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+96) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (9.0 * (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(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+96) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); 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[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+96], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $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}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+96}:\\
\;\;\;\;\left(x \cdot 2 - t_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 5.0000000000000004e96Initial program 97.9%
if 5.0000000000000004e96 < (*.f64 (*.f64 y 9) z) Initial program 90.9%
+-commutative90.9%
cancel-sign-sub-inv90.9%
associate-+r+90.9%
distribute-rgt-neg-out90.9%
*-commutative90.9%
associate-*l*97.9%
cancel-sign-sub-inv97.9%
*-commutative97.9%
associate-+r-97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*96.3%
*-commutative96.3%
fma-def98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.2%
*-commutative98.2%
Simplified96.3%
fma-udef96.3%
associate-*r*96.3%
associate-*r*96.3%
*-commutative96.3%
metadata-eval96.3%
cancel-sign-sub-inv96.3%
associate-*l*96.4%
*-commutative96.4%
associate-*l*96.3%
associate-*l*96.4%
associate-*l*96.3%
Applied egg-rr96.3%
Final simplification97.5%
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 (* (* y 9.0) z)))
(if (<= t_1 5e+305)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(fma (* 27.0 b) a (* 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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+305) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = fma((27.0 * b), a, (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(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+305) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = fma(Float64(27.0 * b), a, Float64(y * Float64(z * Float64(t * -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_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+305], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * b), $MachinePrecision] * a + N[(y * N[(z * N[(t * -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 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\left(x \cdot 2 - t_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(27 \cdot b, a, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 5.00000000000000009e305Initial program 98.2%
if 5.00000000000000009e305 < (*.f64 (*.f64 y 9) z) Initial program 65.5%
+-commutative65.5%
cancel-sign-sub-inv65.5%
associate-+r+65.5%
distribute-rgt-neg-out65.5%
*-commutative65.5%
associate-*l*92.9%
cancel-sign-sub-inv92.9%
*-commutative92.9%
associate-+r-92.9%
+-commutative92.9%
Simplified65.5%
Taylor expanded in x around 0 65.5%
*-commutative65.5%
associate-*r*65.5%
*-commutative65.5%
*-commutative65.5%
associate-*l*79.2%
associate-*r*79.1%
*-commutative79.1%
fma-neg86.3%
distribute-rgt-neg-in86.3%
distribute-lft-neg-in86.3%
metadata-eval86.3%
*-commutative86.3%
associate-*r*86.4%
Applied egg-rr86.4%
Final simplification97.5%
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 (* (* y 9.0) z)))
(if (<= t_1 5e+96)
(+ (- (* x 2.0) (* t_1 t)) (* (* a 27.0) b))
(- (* x 2.0) (+ (* y (* 9.0 (* z t))) (* -27.0 (* a b)))))))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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+96) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) - ((y * (9.0 * (z * t))) + (-27.0 * (a * b)));
}
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 = (y * 9.0d0) * z
if (t_1 <= 5d+96) then
tmp = ((x * 2.0d0) - (t_1 * t)) + ((a * 27.0d0) * b)
else
tmp = (x * 2.0d0) - ((y * (9.0d0 * (z * t))) + ((-27.0d0) * (a * b)))
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+96) {
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
} else {
tmp = (x * 2.0) - ((y * (9.0 * (z * t))) + (-27.0 * (a * b)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+96: tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b) else: tmp = (x * 2.0) - ((y * (9.0 * (z * t))) + (-27.0 * (a * b))) 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(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+96) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(Float64(a * 27.0) * b)); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * Float64(9.0 * Float64(z * t))) + Float64(-27.0 * Float64(a * b)))); 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 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+96)
tmp = ((x * 2.0) - (t_1 * t)) + ((a * 27.0) * b);
else
tmp = (x * 2.0) - ((y * (9.0 * (z * t))) + (-27.0 * (a * b)));
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[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+96], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(a * b), $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 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+96}:\\
\;\;\;\;\left(x \cdot 2 - t_1 \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot \left(9 \cdot \left(z \cdot t\right)\right) + -27 \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 5.0000000000000004e96Initial program 97.9%
if 5.0000000000000004e96 < (*.f64 (*.f64 y 9) z) Initial program 90.9%
+-commutative90.9%
cancel-sign-sub-inv90.9%
associate-+r+90.9%
distribute-rgt-neg-out90.9%
*-commutative90.9%
associate-*l*97.9%
cancel-sign-sub-inv97.9%
*-commutative97.9%
associate-+r-97.9%
+-commutative97.9%
Simplified90.9%
associate-+l-90.9%
*-commutative90.9%
associate-*l*90.9%
cancel-sign-sub-inv90.9%
associate-*l*96.2%
associate-*l*96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Final simplification97.5%
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.28e+73) (* z (* -9.0 (* y t))) (+ (- (* x 2.0) (* t (* y (* 9.0 z)))) (* (* a 27.0) b))))
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.28e+73) {
tmp = z * (-9.0 * (y * t));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + ((a * 27.0) * b);
}
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.28d+73)) then
tmp = z * ((-9.0d0) * (y * t))
else
tmp = ((x * 2.0d0) - (t * (y * (9.0d0 * z)))) + ((a * 27.0d0) * b)
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.28e+73) {
tmp = z * (-9.0 * (y * t));
} else {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + ((a * 27.0) * b);
}
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.28e+73: tmp = z * (-9.0 * (y * t)) else: tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + ((a * 27.0) * b) 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.28e+73) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))) + Float64(Float64(a * 27.0) * b)); 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.28e+73)
tmp = z * (-9.0 * (y * t));
else
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + ((a * 27.0) * b);
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.28e+73], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $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.28 \cdot 10^{+73}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
if z < -1.2800000000000001e73Initial program 92.6%
+-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r+92.6%
distribute-rgt-neg-out92.6%
*-commutative92.6%
associate-*l*98.0%
cancel-sign-sub-inv98.0%
*-commutative98.0%
associate-+r-98.0%
+-commutative98.0%
Simplified92.7%
Taylor expanded in y around inf 51.8%
*-commutative51.8%
Simplified51.8%
add-exp-log_binary6418.6%
Applied rewrite-once18.6%
rem-exp-log51.8%
associate-*l*51.7%
Simplified51.7%
associate-*r*51.8%
*-commutative51.8%
metadata-eval51.8%
distribute-lft-neg-in51.8%
neg-sub051.8%
associate-*r*55.2%
*-commutative55.2%
associate-*r*55.2%
cancel-sign-sub-inv55.2%
*-commutative55.2%
Applied egg-rr55.2%
+-lft-identity55.2%
*-commutative55.2%
distribute-lft-neg-in55.2%
metadata-eval55.2%
Simplified55.2%
if -1.2800000000000001e73 < z Initial program 97.4%
+-commutative97.4%
cancel-sign-sub-inv97.4%
associate-+r+97.4%
distribute-rgt-neg-out97.4%
*-commutative97.4%
associate-*l*95.5%
cancel-sign-sub-inv95.5%
*-commutative95.5%
associate-+r-95.5%
+-commutative95.5%
Simplified97.4%
Final simplification88.5%
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 (or (<= x -6.2e+65) (not (<= x 2.1e-37))) (- (* x 2.0) (* 9.0 (* t (* y z)))) (+ (* (* a 27.0) b) (* t (* -9.0 (* y z))))))
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 <= -6.2e+65) || !(x <= 2.1e-37)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = ((a * 27.0) * b) + (t * (-9.0 * (y * z)));
}
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 <= (-6.2d+65)) .or. (.not. (x <= 2.1d-37))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = ((a * 27.0d0) * b) + (t * ((-9.0d0) * (y * z)))
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 <= -6.2e+65) || !(x <= 2.1e-37)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = ((a * 27.0) * b) + (t * (-9.0 * (y * z)));
}
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 <= -6.2e+65) or not (x <= 2.1e-37): tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = ((a * 27.0) * b) + (t * (-9.0 * (y * z))) 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 <= -6.2e+65) || !(x <= 2.1e-37)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(t * Float64(-9.0 * Float64(y * z)))); 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 <= -6.2e+65) || ~((x <= 2.1e-37)))
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = ((a * 27.0) * b) + (t * (-9.0 * (y * z)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -6.2e+65], N[Not[LessEqual[x, 2.1e-37]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(t * N[(-9.0 * N[(y * z), $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}\;x \leq -6.2 \cdot 10^{+65} \lor \neg \left(x \leq 2.1 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b + t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -6.19999999999999981e65 or 2.1000000000000001e-37 < x Initial program 96.7%
+-commutative96.7%
cancel-sign-sub-inv96.7%
associate-+r+96.7%
distribute-rgt-neg-out96.7%
*-commutative96.7%
associate-*l*94.3%
cancel-sign-sub-inv94.3%
*-commutative94.3%
associate-+r-94.3%
+-commutative94.3%
Simplified96.7%
Taylor expanded in a around 0 82.0%
if -6.19999999999999981e65 < x < 2.1000000000000001e-37Initial program 96.1%
+-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r+96.1%
distribute-rgt-neg-out96.1%
*-commutative96.1%
associate-*l*97.5%
cancel-sign-sub-inv97.5%
*-commutative97.5%
associate-+r-97.5%
+-commutative97.5%
Simplified96.1%
Taylor expanded in x around 0 86.5%
*-commutative86.5%
associate-*r*86.5%
*-commutative86.5%
*-commutative86.5%
associate-*l*85.6%
associate-*r*85.6%
*-commutative85.6%
fma-neg86.4%
distribute-rgt-neg-in86.4%
distribute-lft-neg-in86.4%
metadata-eval86.4%
*-commutative86.4%
associate-*r*86.4%
Applied egg-rr86.4%
fma-udef85.6%
*-commutative85.6%
+-commutative85.6%
associate-*r*86.5%
*-commutative86.5%
associate-*r*86.5%
associate-*r*86.5%
*-commutative86.5%
*-commutative86.5%
Applied egg-rr86.5%
Final simplification84.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 (* (* a 27.0) b)))
(if (<= t -3.5e-297)
(* x 2.0)
(if (<= t 4.4e-67)
t_1
(if (<= t 0.000165)
(* x 2.0)
(if (<= t 8e+117) t_1 (* t (* -9.0 (* y z)))))))))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 = (a * 27.0) * b;
double tmp;
if (t <= -3.5e-297) {
tmp = x * 2.0;
} else if (t <= 4.4e-67) {
tmp = t_1;
} else if (t <= 0.000165) {
tmp = x * 2.0;
} else if (t <= 8e+117) {
tmp = t_1;
} else {
tmp = t * (-9.0 * (y * z));
}
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 = (a * 27.0d0) * b
if (t <= (-3.5d-297)) then
tmp = x * 2.0d0
else if (t <= 4.4d-67) then
tmp = t_1
else if (t <= 0.000165d0) then
tmp = x * 2.0d0
else if (t <= 8d+117) then
tmp = t_1
else
tmp = t * ((-9.0d0) * (y * z))
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 = (a * 27.0) * b;
double tmp;
if (t <= -3.5e-297) {
tmp = x * 2.0;
} else if (t <= 4.4e-67) {
tmp = t_1;
} else if (t <= 0.000165) {
tmp = x * 2.0;
} else if (t <= 8e+117) {
tmp = t_1;
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if t <= -3.5e-297: tmp = x * 2.0 elif t <= 4.4e-67: tmp = t_1 elif t <= 0.000165: tmp = x * 2.0 elif t <= 8e+117: tmp = t_1 else: tmp = t * (-9.0 * (y * z)) 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(Float64(a * 27.0) * b) tmp = 0.0 if (t <= -3.5e-297) tmp = Float64(x * 2.0); elseif (t <= 4.4e-67) tmp = t_1; elseif (t <= 0.000165) tmp = Float64(x * 2.0); elseif (t <= 8e+117) tmp = t_1; else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); 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 = (a * 27.0) * b;
tmp = 0.0;
if (t <= -3.5e-297)
tmp = x * 2.0;
elseif (t <= 4.4e-67)
tmp = t_1;
elseif (t <= 0.000165)
tmp = x * 2.0;
elseif (t <= 8e+117)
tmp = t_1;
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t, -3.5e-297], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 4.4e-67], t$95$1, If[LessEqual[t, 0.000165], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 8e+117], t$95$1, N[(t * N[(-9.0 * N[(y * z), $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 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-297}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 0.000165:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -3.4999999999999999e-297 or 4.4000000000000002e-67 < t < 1.65e-4Initial program 96.0%
+-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r+96.0%
distribute-rgt-neg-out96.0%
*-commutative96.0%
associate-*l*96.6%
cancel-sign-sub-inv96.6%
*-commutative96.6%
associate-+r-96.6%
+-commutative96.6%
Simplified96.0%
Taylor expanded in x around inf 35.3%
if -3.4999999999999999e-297 < t < 4.4000000000000002e-67 or 1.65e-4 < t < 8.0000000000000004e117Initial program 97.2%
+-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r+97.2%
distribute-rgt-neg-out97.2%
*-commutative97.2%
associate-*l*95.9%
cancel-sign-sub-inv95.9%
*-commutative95.9%
associate-+r-95.9%
+-commutative95.9%
Simplified97.2%
Taylor expanded in x around 0 70.5%
cancel-sign-sub-inv70.5%
+-commutative70.5%
metadata-eval70.5%
*-commutative70.5%
*-commutative70.5%
associate-*r*70.5%
associate-*l*70.5%
*-commutative70.5%
associate-*r*69.4%
*-commutative69.4%
Applied egg-rr69.4%
Taylor expanded in z around 0 69.4%
*-commutative69.4%
associate-*l*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in y around 0 44.0%
associate-*r*44.1%
*-commutative44.1%
metadata-eval44.1%
distribute-rgt-neg-in44.1%
*-commutative44.1%
distribute-rgt-neg-in44.1%
metadata-eval44.1%
*-commutative44.1%
Simplified44.1%
if 8.0000000000000004e117 < t Initial program 96.5%
+-commutative96.5%
cancel-sign-sub-inv96.5%
associate-+r+96.5%
distribute-rgt-neg-out96.5%
*-commutative96.5%
associate-*l*93.1%
cancel-sign-sub-inv93.1%
*-commutative93.1%
associate-+r-93.1%
+-commutative93.1%
Simplified96.5%
Taylor expanded in y around inf 70.4%
*-commutative70.4%
Simplified70.4%
add-exp-log_binary6435.8%
Applied rewrite-once35.8%
rem-exp-log70.4%
associate-*l*70.4%
Simplified70.4%
Final simplification41.9%
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 (* (* a 27.0) b)))
(if (<= z -2.75e-42)
(* y (* z (* t -9.0)))
(if (<= z 3.3e-177)
t_1
(if (<= z 2.5e-116)
(* x 2.0)
(if (<= z 1.82e-87) t_1 (* t (* -9.0 (* y z)))))))))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 = (a * 27.0) * b;
double tmp;
if (z <= -2.75e-42) {
tmp = y * (z * (t * -9.0));
} else if (z <= 3.3e-177) {
tmp = t_1;
} else if (z <= 2.5e-116) {
tmp = x * 2.0;
} else if (z <= 1.82e-87) {
tmp = t_1;
} else {
tmp = t * (-9.0 * (y * z));
}
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 = (a * 27.0d0) * b
if (z <= (-2.75d-42)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 3.3d-177) then
tmp = t_1
else if (z <= 2.5d-116) then
tmp = x * 2.0d0
else if (z <= 1.82d-87) then
tmp = t_1
else
tmp = t * ((-9.0d0) * (y * z))
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 = (a * 27.0) * b;
double tmp;
if (z <= -2.75e-42) {
tmp = y * (z * (t * -9.0));
} else if (z <= 3.3e-177) {
tmp = t_1;
} else if (z <= 2.5e-116) {
tmp = x * 2.0;
} else if (z <= 1.82e-87) {
tmp = t_1;
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if z <= -2.75e-42: tmp = y * (z * (t * -9.0)) elif z <= 3.3e-177: tmp = t_1 elif z <= 2.5e-116: tmp = x * 2.0 elif z <= 1.82e-87: tmp = t_1 else: tmp = t * (-9.0 * (y * z)) 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(Float64(a * 27.0) * b) tmp = 0.0 if (z <= -2.75e-42) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 3.3e-177) tmp = t_1; elseif (z <= 2.5e-116) tmp = Float64(x * 2.0); elseif (z <= 1.82e-87) tmp = t_1; else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); 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 = (a * 27.0) * b;
tmp = 0.0;
if (z <= -2.75e-42)
tmp = y * (z * (t * -9.0));
elseif (z <= 3.3e-177)
tmp = t_1;
elseif (z <= 2.5e-116)
tmp = x * 2.0;
elseif (z <= 1.82e-87)
tmp = t_1;
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -2.75e-42], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-177], t$95$1, If[LessEqual[z, 2.5e-116], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.82e-87], t$95$1, N[(t * N[(-9.0 * N[(y * z), $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 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;z \leq -2.75 \cdot 10^{-42}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-116}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-87}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.75e-42Initial program 94.5%
+-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r+94.5%
distribute-rgt-neg-out94.5%
*-commutative94.5%
associate-*l*98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
associate-+r-98.5%
*-commutative98.5%
*-commutative98.5%
associate-*l*98.5%
*-commutative98.5%
fma-def99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
*-commutative99.9%
Simplified93.5%
fma-udef93.5%
associate-*r*93.5%
associate-*r*93.5%
*-commutative93.5%
metadata-eval93.5%
cancel-sign-sub-inv93.5%
associate-*l*93.4%
*-commutative93.4%
associate-*l*93.5%
associate-*l*93.5%
associate-*l*93.5%
Applied egg-rr93.5%
Taylor expanded in y around inf 49.3%
*-commutative49.3%
*-commutative49.3%
associate-*r*49.3%
associate-*r*48.0%
Simplified48.0%
if -2.75e-42 < z < 3.3e-177 or 2.5000000000000001e-116 < z < 1.81999999999999993e-87Initial program 98.6%
+-commutative98.6%
cancel-sign-sub-inv98.6%
associate-+r+98.6%
distribute-rgt-neg-out98.6%
*-commutative98.6%
associate-*l*89.9%
cancel-sign-sub-inv89.9%
*-commutative89.9%
associate-+r-89.9%
+-commutative89.9%
Simplified98.6%
Taylor expanded in x around 0 67.2%
cancel-sign-sub-inv67.2%
+-commutative67.2%
metadata-eval67.2%
*-commutative67.2%
*-commutative67.2%
associate-*r*65.8%
associate-*l*66.7%
*-commutative66.7%
associate-*r*66.7%
*-commutative66.7%
Applied egg-rr66.7%
Taylor expanded in z around 0 68.0%
*-commutative68.0%
associate-*l*67.9%
*-commutative67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in y around 0 50.1%
associate-*r*50.2%
*-commutative50.2%
metadata-eval50.2%
distribute-rgt-neg-in50.2%
*-commutative50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
*-commutative50.2%
Simplified50.2%
if 3.3e-177 < z < 2.5000000000000001e-116Initial program 99.7%
+-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r+99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
associate-*l*99.6%
cancel-sign-sub-inv99.6%
*-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
Simplified99.7%
Taylor expanded in x around inf 35.5%
if 1.81999999999999993e-87 < z Initial program 95.4%
+-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r+95.4%
distribute-rgt-neg-out95.4%
*-commutative95.4%
associate-*l*98.7%
cancel-sign-sub-inv98.7%
*-commutative98.7%
associate-+r-98.7%
+-commutative98.7%
Simplified95.3%
Taylor expanded in y around inf 58.2%
*-commutative58.2%
Simplified58.2%
add-exp-log_binary6425.3%
Applied rewrite-once25.3%
rem-exp-log58.2%
associate-*l*58.2%
Simplified58.2%
Final simplification51.2%
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 (* (* a 27.0) b)))
(if (<= z -1.46e-37)
(* z (* -9.0 (* y t)))
(if (<= z 2.25e-180)
t_1
(if (<= z 2.5e-116)
(* x 2.0)
(if (<= z 3.55e-88) t_1 (* t (* -9.0 (* y z)))))))))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 = (a * 27.0) * b;
double tmp;
if (z <= -1.46e-37) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 2.25e-180) {
tmp = t_1;
} else if (z <= 2.5e-116) {
tmp = x * 2.0;
} else if (z <= 3.55e-88) {
tmp = t_1;
} else {
tmp = t * (-9.0 * (y * z));
}
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 = (a * 27.0d0) * b
if (z <= (-1.46d-37)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 2.25d-180) then
tmp = t_1
else if (z <= 2.5d-116) then
tmp = x * 2.0d0
else if (z <= 3.55d-88) then
tmp = t_1
else
tmp = t * ((-9.0d0) * (y * z))
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 = (a * 27.0) * b;
double tmp;
if (z <= -1.46e-37) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 2.25e-180) {
tmp = t_1;
} else if (z <= 2.5e-116) {
tmp = x * 2.0;
} else if (z <= 3.55e-88) {
tmp = t_1;
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if z <= -1.46e-37: tmp = z * (-9.0 * (y * t)) elif z <= 2.25e-180: tmp = t_1 elif z <= 2.5e-116: tmp = x * 2.0 elif z <= 3.55e-88: tmp = t_1 else: tmp = t * (-9.0 * (y * z)) 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(Float64(a * 27.0) * b) tmp = 0.0 if (z <= -1.46e-37) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 2.25e-180) tmp = t_1; elseif (z <= 2.5e-116) tmp = Float64(x * 2.0); elseif (z <= 3.55e-88) tmp = t_1; else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); 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 = (a * 27.0) * b;
tmp = 0.0;
if (z <= -1.46e-37)
tmp = z * (-9.0 * (y * t));
elseif (z <= 2.25e-180)
tmp = t_1;
elseif (z <= 2.5e-116)
tmp = x * 2.0;
elseif (z <= 3.55e-88)
tmp = t_1;
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -1.46e-37], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e-180], t$95$1, If[LessEqual[z, 2.5e-116], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.55e-88], t$95$1, N[(t * N[(-9.0 * N[(y * z), $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 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;z \leq -1.46 \cdot 10^{-37}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-180}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-116}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.55 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.46e-37Initial program 94.5%
+-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r+94.5%
distribute-rgt-neg-out94.5%
*-commutative94.5%
associate-*l*98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
associate-+r-98.5%
+-commutative98.5%
Simplified94.6%
Taylor expanded in y around inf 49.3%
*-commutative49.3%
Simplified49.3%
add-exp-log_binary6416.9%
Applied rewrite-once16.9%
rem-exp-log49.3%
associate-*l*49.3%
Simplified49.3%
associate-*r*49.3%
*-commutative49.3%
metadata-eval49.3%
distribute-lft-neg-in49.3%
neg-sub049.3%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.8%
cancel-sign-sub-inv51.8%
*-commutative51.8%
Applied egg-rr51.8%
+-lft-identity51.8%
*-commutative51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
Simplified51.8%
if -1.46e-37 < z < 2.25000000000000005e-180 or 2.5000000000000001e-116 < z < 3.55e-88Initial program 98.6%
+-commutative98.6%
cancel-sign-sub-inv98.6%
associate-+r+98.6%
distribute-rgt-neg-out98.6%
*-commutative98.6%
associate-*l*89.7%
cancel-sign-sub-inv89.7%
*-commutative89.7%
associate-+r-89.7%
+-commutative89.7%
Simplified98.5%
Taylor expanded in x around 0 66.8%
cancel-sign-sub-inv66.8%
+-commutative66.8%
metadata-eval66.8%
*-commutative66.8%
*-commutative66.8%
associate-*r*65.4%
associate-*l*66.2%
*-commutative66.2%
associate-*r*66.3%
*-commutative66.3%
Applied egg-rr66.3%
Taylor expanded in z around 0 67.6%
*-commutative67.6%
associate-*l*67.5%
*-commutative67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in y around 0 49.5%
associate-*r*49.6%
*-commutative49.6%
metadata-eval49.6%
distribute-rgt-neg-in49.6%
*-commutative49.6%
distribute-rgt-neg-in49.6%
metadata-eval49.6%
*-commutative49.6%
Simplified49.6%
if 2.25000000000000005e-180 < z < 2.5000000000000001e-116Initial program 99.7%
+-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r+99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
associate-*l*99.6%
cancel-sign-sub-inv99.6%
*-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
Simplified99.7%
Taylor expanded in x around inf 33.9%
if 3.55e-88 < z Initial program 95.4%
+-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r+95.4%
distribute-rgt-neg-out95.4%
*-commutative95.4%
associate-*l*98.7%
cancel-sign-sub-inv98.7%
*-commutative98.7%
associate-+r-98.7%
+-commutative98.7%
Simplified95.3%
Taylor expanded in y around inf 58.2%
*-commutative58.2%
Simplified58.2%
add-exp-log_binary6425.3%
Applied rewrite-once25.3%
rem-exp-log58.2%
associate-*l*58.2%
Simplified58.2%
Final simplification51.9%
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 (* (* a 27.0) b)))
(if (<= z -4.2e-39)
(* z (* -9.0 (* y t)))
(if (<= z 5.2e-179)
t_1
(if (<= z 2.9e-116)
(* x 2.0)
(if (<= z 5.2e-88) t_1 (* (* t -9.0) (* y z))))))))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 = (a * 27.0) * b;
double tmp;
if (z <= -4.2e-39) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 5.2e-179) {
tmp = t_1;
} else if (z <= 2.9e-116) {
tmp = x * 2.0;
} else if (z <= 5.2e-88) {
tmp = t_1;
} else {
tmp = (t * -9.0) * (y * z);
}
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 = (a * 27.0d0) * b
if (z <= (-4.2d-39)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 5.2d-179) then
tmp = t_1
else if (z <= 2.9d-116) then
tmp = x * 2.0d0
else if (z <= 5.2d-88) then
tmp = t_1
else
tmp = (t * (-9.0d0)) * (y * z)
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 = (a * 27.0) * b;
double tmp;
if (z <= -4.2e-39) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 5.2e-179) {
tmp = t_1;
} else if (z <= 2.9e-116) {
tmp = x * 2.0;
} else if (z <= 5.2e-88) {
tmp = t_1;
} else {
tmp = (t * -9.0) * (y * z);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (a * 27.0) * b tmp = 0 if z <= -4.2e-39: tmp = z * (-9.0 * (y * t)) elif z <= 5.2e-179: tmp = t_1 elif z <= 2.9e-116: tmp = x * 2.0 elif z <= 5.2e-88: tmp = t_1 else: tmp = (t * -9.0) * (y * z) 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(Float64(a * 27.0) * b) tmp = 0.0 if (z <= -4.2e-39) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 5.2e-179) tmp = t_1; elseif (z <= 2.9e-116) tmp = Float64(x * 2.0); elseif (z <= 5.2e-88) tmp = t_1; else tmp = Float64(Float64(t * -9.0) * Float64(y * z)); 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 = (a * 27.0) * b;
tmp = 0.0;
if (z <= -4.2e-39)
tmp = z * (-9.0 * (y * t));
elseif (z <= 5.2e-179)
tmp = t_1;
elseif (z <= 2.9e-116)
tmp = x * 2.0;
elseif (z <= 5.2e-88)
tmp = t_1;
else
tmp = (t * -9.0) * (y * z);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -4.2e-39], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-179], t$95$1, If[LessEqual[z, 2.9e-116], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 5.2e-88], t$95$1, N[(N[(t * -9.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-39}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-179}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-116}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot -9\right) \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -4.19999999999999987e-39Initial program 94.5%
+-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r+94.5%
distribute-rgt-neg-out94.5%
*-commutative94.5%
associate-*l*98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
associate-+r-98.5%
+-commutative98.5%
Simplified94.6%
Taylor expanded in y around inf 49.3%
*-commutative49.3%
Simplified49.3%
add-exp-log_binary6416.9%
Applied rewrite-once16.9%
rem-exp-log49.3%
associate-*l*49.3%
Simplified49.3%
associate-*r*49.3%
*-commutative49.3%
metadata-eval49.3%
distribute-lft-neg-in49.3%
neg-sub049.3%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.8%
cancel-sign-sub-inv51.8%
*-commutative51.8%
Applied egg-rr51.8%
+-lft-identity51.8%
*-commutative51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
Simplified51.8%
if -4.19999999999999987e-39 < z < 5.20000000000000011e-179 or 2.8999999999999998e-116 < z < 5.20000000000000027e-88Initial program 98.6%
+-commutative98.6%
cancel-sign-sub-inv98.6%
associate-+r+98.6%
distribute-rgt-neg-out98.6%
*-commutative98.6%
associate-*l*89.9%
cancel-sign-sub-inv89.9%
*-commutative89.9%
associate-+r-89.9%
+-commutative89.9%
Simplified98.6%
Taylor expanded in x around 0 67.2%
cancel-sign-sub-inv67.2%
+-commutative67.2%
metadata-eval67.2%
*-commutative67.2%
*-commutative67.2%
associate-*r*65.8%
associate-*l*66.7%
*-commutative66.7%
associate-*r*66.7%
*-commutative66.7%
Applied egg-rr66.7%
Taylor expanded in z around 0 68.0%
*-commutative68.0%
associate-*l*67.9%
*-commutative67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in y around 0 50.1%
associate-*r*50.2%
*-commutative50.2%
metadata-eval50.2%
distribute-rgt-neg-in50.2%
*-commutative50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
*-commutative50.2%
Simplified50.2%
if 5.20000000000000011e-179 < z < 2.8999999999999998e-116Initial program 99.7%
+-commutative99.7%
cancel-sign-sub-inv99.7%
associate-+r+99.7%
distribute-rgt-neg-out99.7%
*-commutative99.7%
associate-*l*99.6%
cancel-sign-sub-inv99.6%
*-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
Simplified99.7%
Taylor expanded in x around inf 35.5%
if 5.20000000000000027e-88 < z Initial program 95.4%
+-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r+95.4%
distribute-rgt-neg-out95.4%
*-commutative95.4%
associate-*l*98.7%
cancel-sign-sub-inv98.7%
*-commutative98.7%
associate-+r-98.7%
+-commutative98.7%
Simplified95.3%
Taylor expanded in y around inf 58.2%
associate-*r*58.2%
*-commutative58.2%
*-commutative58.2%
Simplified58.2%
Final simplification52.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 (if (or (<= z -3.9e-33) (not (<= z 5.7e-111))) (+ (* x 2.0) (* t (* y (* z -9.0)))) (- (* x 2.0) (* 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 ((z <= -3.9e-33) || !(z <= 5.7e-111)) {
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
} else {
tmp = (x * 2.0) - (b * (a * -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 ((z <= (-3.9d-33)) .or. (.not. (z <= 5.7d-111))) then
tmp = (x * 2.0d0) + (t * (y * (z * (-9.0d0))))
else
tmp = (x * 2.0d0) - (b * (a * (-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 ((z <= -3.9e-33) || !(z <= 5.7e-111)) {
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
} else {
tmp = (x * 2.0) - (b * (a * -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 (z <= -3.9e-33) or not (z <= 5.7e-111): tmp = (x * 2.0) + (t * (y * (z * -9.0))) else: tmp = (x * 2.0) - (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 ((z <= -3.9e-33) || !(z <= 5.7e-111)) tmp = Float64(Float64(x * 2.0) + Float64(t * Float64(y * Float64(z * -9.0)))); else tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -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 ((z <= -3.9e-33) || ~((z <= 5.7e-111)))
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
else
tmp = (x * 2.0) - (b * (a * -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[Or[LessEqual[z, -3.9e-33], N[Not[LessEqual[z, 5.7e-111]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $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 -3.9 \cdot 10^{-33} \lor \neg \left(z \leq 5.7 \cdot 10^{-111}\right):\\
\;\;\;\;x \cdot 2 + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\end{array}
\end{array}
if z < -3.89999999999999974e-33 or 5.7e-111 < z Initial program 95.0%
+-commutative95.0%
cancel-sign-sub-inv95.0%
associate-+r+95.0%
distribute-rgt-neg-out95.0%
*-commutative95.0%
associate-*l*98.6%
cancel-sign-sub-inv98.6%
*-commutative98.6%
associate-+r-98.6%
+-commutative98.6%
Simplified95.0%
Taylor expanded in a around 0 79.7%
cancel-sign-sub-inv79.7%
+-commutative79.7%
metadata-eval79.7%
*-commutative79.7%
associate-*r*79.7%
associate-*l*79.7%
Applied egg-rr79.7%
if -3.89999999999999974e-33 < z < 5.7e-111Initial program 98.8%
+-commutative98.8%
cancel-sign-sub-inv98.8%
associate-+r+98.8%
distribute-rgt-neg-out98.8%
*-commutative98.8%
associate-*l*91.6%
cancel-sign-sub-inv91.6%
*-commutative91.6%
associate-+r-91.6%
+-commutative91.6%
Simplified98.7%
Taylor expanded in y around 0 84.2%
flip-+30.5%
div-sub30.5%
frac-2neg30.5%
frac-2neg30.5%
sub-div30.5%
Applied egg-rr30.5%
associate-*r*30.5%
Simplified30.5%
div-sub30.5%
frac-2neg30.5%
remove-double-neg30.5%
frac-2neg30.5%
remove-double-neg30.5%
sub-div30.5%
Applied egg-rr84.3%
Final simplification81.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 (if (<= z -4.6e-34) (* z (* -9.0 (* y t))) (if (<= z 3.7e-11) (+ (* x 2.0) (* 27.0 (* a b))) (* t (* -9.0 (* y z))))))
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 <= -4.6e-34) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 3.7e-11) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (-9.0 * (y * z));
}
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 <= (-4.6d-34)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 3.7d-11) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * ((-9.0d0) * (y * z))
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 <= -4.6e-34) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 3.7e-11) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (-9.0 * (y * z));
}
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 <= -4.6e-34: tmp = z * (-9.0 * (y * t)) elif z <= 3.7e-11: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * (-9.0 * (y * z)) 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 <= -4.6e-34) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 3.7e-11) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); 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 <= -4.6e-34)
tmp = z * (-9.0 * (y * t));
elseif (z <= 3.7e-11)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.6e-34], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-11], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(y * z), $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 -4.6 \cdot 10^{-34}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-11}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -4.60000000000000022e-34Initial program 94.5%
+-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r+94.5%
distribute-rgt-neg-out94.5%
*-commutative94.5%
associate-*l*98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
associate-+r-98.5%
+-commutative98.5%
Simplified94.5%
Taylor expanded in y around inf 49.9%
*-commutative49.9%
Simplified49.9%
add-exp-log_binary6417.1%
Applied rewrite-once17.1%
rem-exp-log49.9%
associate-*l*49.9%
Simplified49.9%
associate-*r*49.9%
*-commutative49.9%
metadata-eval49.9%
distribute-lft-neg-in49.9%
neg-sub049.9%
associate-*r*52.5%
*-commutative52.5%
associate-*r*52.5%
cancel-sign-sub-inv52.5%
*-commutative52.5%
Applied egg-rr52.5%
+-lft-identity52.5%
*-commutative52.5%
distribute-lft-neg-in52.5%
metadata-eval52.5%
Simplified52.5%
if -4.60000000000000022e-34 < z < 3.7000000000000001e-11Initial program 99.0%
+-commutative99.0%
cancel-sign-sub-inv99.0%
associate-+r+99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
associate-*l*93.2%
cancel-sign-sub-inv93.2%
*-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
Simplified99.0%
Taylor expanded in y around 0 79.1%
if 3.7000000000000001e-11 < z Initial program 93.9%
+-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r+93.9%
distribute-rgt-neg-out93.9%
*-commutative93.9%
associate-*l*98.3%
cancel-sign-sub-inv98.3%
*-commutative98.3%
associate-+r-98.3%
+-commutative98.3%
Simplified93.8%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
Simplified62.7%
add-exp-log_binary6427.5%
Applied rewrite-once27.5%
rem-exp-log62.7%
associate-*l*62.7%
Simplified62.7%
Final simplification67.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 (if (<= z -1.4e-31) (* z (* -9.0 (* y t))) (if (<= z 5e-11) (- (* x 2.0) (* a (* b -27.0))) (* t (* -9.0 (* y z))))))
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.4e-31) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 5e-11) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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.4d-31)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 5d-11) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = t * ((-9.0d0) * (y * z))
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.4e-31) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 5e-11) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = t * (-9.0 * (y * z));
}
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.4e-31: tmp = z * (-9.0 * (y * t)) elif z <= 5e-11: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = t * (-9.0 * (y * z)) 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.4e-31) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 5e-11) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); 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.4e-31)
tmp = z * (-9.0 * (y * t));
elseif (z <= 5e-11)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. 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.4e-31], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-11], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(y * z), $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.4 \cdot 10^{-31}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-11}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.3999999999999999e-31Initial program 94.5%
+-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r+94.5%
distribute-rgt-neg-out94.5%
*-commutative94.5%
associate-*l*98.5%
cancel-sign-sub-inv98.5%
*-commutative98.5%
associate-+r-98.5%
+-commutative98.5%
Simplified94.5%
Taylor expanded in y around inf 49.9%
*-commutative49.9%
Simplified49.9%
add-exp-log_binary6417.1%
Applied rewrite-once17.1%
rem-exp-log49.9%
associate-*l*49.9%
Simplified49.9%
associate-*r*49.9%
*-commutative49.9%
metadata-eval49.9%
distribute-lft-neg-in49.9%
neg-sub049.9%
associate-*r*52.5%
*-commutative52.5%
associate-*r*52.5%
cancel-sign-sub-inv52.5%
*-commutative52.5%
Applied egg-rr52.5%
+-lft-identity52.5%
*-commutative52.5%
distribute-lft-neg-in52.5%
metadata-eval52.5%
Simplified52.5%
if -1.3999999999999999e-31 < z < 5.00000000000000018e-11Initial program 99.0%
+-commutative99.0%
cancel-sign-sub-inv99.0%
associate-+r+99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
associate-*l*93.2%
cancel-sign-sub-inv93.2%
*-commutative93.2%
associate-+r-93.2%
+-commutative93.2%
Simplified99.0%
Taylor expanded in y around 0 79.1%
flip-+31.9%
div-sub31.9%
frac-2neg31.9%
frac-2neg31.9%
sub-div31.9%
Applied egg-rr31.9%
associate-*r*31.9%
Simplified31.9%
div-sub31.9%
frac-2neg31.9%
remove-double-neg31.9%
frac-2neg31.9%
remove-double-neg31.9%
sub-div31.9%
Applied egg-rr79.1%
if 5.00000000000000018e-11 < z Initial program 93.9%
+-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r+93.9%
distribute-rgt-neg-out93.9%
*-commutative93.9%
associate-*l*98.3%
cancel-sign-sub-inv98.3%
*-commutative98.3%
associate-+r-98.3%
+-commutative98.3%
Simplified93.8%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
Simplified62.7%
add-exp-log_binary6427.5%
Applied rewrite-once27.5%
rem-exp-log62.7%
associate-*l*62.7%
Simplified62.7%
Final simplification67.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 (if (<= z -2.5e-30) (* z (* -9.0 (* y t))) (if (<= z 9.5e-11) (- (* x 2.0) (* b (* a -27.0))) (* t (* -9.0 (* y z))))))
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 <= -2.5e-30) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 9.5e-11) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 <= (-2.5d-30)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 9.5d-11) then
tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
else
tmp = t * ((-9.0d0) * (y * z))
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 <= -2.5e-30) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 9.5e-11) {
tmp = (x * 2.0) - (b * (a * -27.0));
} else {
tmp = t * (-9.0 * (y * z));
}
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 <= -2.5e-30: tmp = z * (-9.0 * (y * t)) elif z <= 9.5e-11: tmp = (x * 2.0) - (b * (a * -27.0)) else: tmp = t * (-9.0 * (y * z)) 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 <= -2.5e-30) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 9.5e-11) tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0))); else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); 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 <= -2.5e-30)
tmp = z * (-9.0 * (y * t));
elseif (z <= 9.5e-11)
tmp = (x * 2.0) - (b * (a * -27.0));
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.5e-30], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-11], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(y * z), $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 -2.5 \cdot 10^{-30}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-11}:\\
\;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.49999999999999986e-30Initial program 94.4%
+-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r+94.4%
distribute-rgt-neg-out94.4%
*-commutative94.4%
associate-*l*98.4%
cancel-sign-sub-inv98.4%
*-commutative98.4%
associate-+r-98.4%
+-commutative98.4%
Simplified94.4%
Taylor expanded in y around inf 50.5%
*-commutative50.5%
Simplified50.5%
add-exp-log_binary6417.3%
Applied rewrite-once17.3%
rem-exp-log50.5%
associate-*l*50.5%
Simplified50.5%
associate-*r*50.5%
*-commutative50.5%
metadata-eval50.5%
distribute-lft-neg-in50.5%
neg-sub050.5%
associate-*r*53.1%
*-commutative53.1%
associate-*r*53.1%
cancel-sign-sub-inv53.1%
*-commutative53.1%
Applied egg-rr53.1%
+-lft-identity53.1%
*-commutative53.1%
distribute-lft-neg-in53.1%
metadata-eval53.1%
Simplified53.1%
if -2.49999999999999986e-30 < z < 9.49999999999999951e-11Initial program 99.0%
+-commutative99.0%
cancel-sign-sub-inv99.0%
associate-+r+99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
associate-*l*93.3%
cancel-sign-sub-inv93.3%
*-commutative93.3%
associate-+r-93.3%
+-commutative93.3%
Simplified99.0%
Taylor expanded in y around 0 79.3%
flip-+32.5%
div-sub32.5%
frac-2neg32.5%
frac-2neg32.5%
sub-div32.5%
Applied egg-rr32.5%
associate-*r*32.5%
Simplified32.5%
div-sub32.5%
frac-2neg32.5%
remove-double-neg32.5%
frac-2neg32.5%
remove-double-neg32.5%
sub-div32.5%
Applied egg-rr79.3%
if 9.49999999999999951e-11 < z Initial program 93.9%
+-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r+93.9%
distribute-rgt-neg-out93.9%
*-commutative93.9%
associate-*l*98.3%
cancel-sign-sub-inv98.3%
*-commutative98.3%
associate-+r-98.3%
+-commutative98.3%
Simplified93.8%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
Simplified62.7%
add-exp-log_binary6427.5%
Applied rewrite-once27.5%
rem-exp-log62.7%
associate-*l*62.7%
Simplified62.7%
Final simplification67.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 (or (<= x -4.8e+65) (not (<= x 2.2e-37))) (* x 2.0) (* 27.0 (* a b))))
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 <= -4.8e+65) || !(x <= 2.2e-37)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
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 <= (-4.8d+65)) .or. (.not. (x <= 2.2d-37))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
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 <= -4.8e+65) || !(x <= 2.2e-37)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
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 <= -4.8e+65) or not (x <= 2.2e-37): tmp = x * 2.0 else: tmp = 27.0 * (a * b) 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 <= -4.8e+65) || !(x <= 2.2e-37)) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); 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 <= -4.8e+65) || ~((x <= 2.2e-37)))
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
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[Or[LessEqual[x, -4.8e+65], N[Not[LessEqual[x, 2.2e-37]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $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 \leq -4.8 \cdot 10^{+65} \lor \neg \left(x \leq 2.2 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -4.8000000000000003e65 or 2.20000000000000002e-37 < x Initial program 96.7%
+-commutative96.7%
cancel-sign-sub-inv96.7%
associate-+r+96.7%
distribute-rgt-neg-out96.7%
*-commutative96.7%
associate-*l*94.3%
cancel-sign-sub-inv94.3%
*-commutative94.3%
associate-+r-94.3%
+-commutative94.3%
Simplified96.7%
Taylor expanded in x around inf 50.7%
if -4.8000000000000003e65 < x < 2.20000000000000002e-37Initial program 96.1%
+-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r+96.1%
distribute-rgt-neg-out96.1%
*-commutative96.1%
associate-*l*97.5%
cancel-sign-sub-inv97.5%
*-commutative97.5%
associate-+r-97.5%
+-commutative97.5%
Simplified96.1%
Taylor expanded in a around inf 46.7%
Final simplification48.6%
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 -9.5e+65) (* x 2.0) (if (<= x 8.2e-38) (* (* a 27.0) 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 <= -9.5e+65) {
tmp = x * 2.0;
} else if (x <= 8.2e-38) {
tmp = (a * 27.0) * b;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 <= (-9.5d+65)) then
tmp = x * 2.0d0
else if (x <= 8.2d-38) then
tmp = (a * 27.0d0) * 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 <= -9.5e+65) {
tmp = x * 2.0;
} else if (x <= 8.2e-38) {
tmp = (a * 27.0) * 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 <= -9.5e+65: tmp = x * 2.0 elif x <= 8.2e-38: tmp = (a * 27.0) * 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 <= -9.5e+65) tmp = Float64(x * 2.0); elseif (x <= 8.2e-38) tmp = Float64(Float64(a * 27.0) * 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 <= -9.5e+65)
tmp = x * 2.0;
elseif (x <= 8.2e-38)
tmp = (a * 27.0) * b;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.5e+65], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 8.2e-38], N[(N[(a * 27.0), $MachinePrecision] * b), $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 -9.5 \cdot 10^{+65}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-38}:\\
\;\;\;\;\left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -9.5000000000000005e65 or 8.1999999999999996e-38 < x Initial program 96.7%
+-commutative96.7%
cancel-sign-sub-inv96.7%
associate-+r+96.7%
distribute-rgt-neg-out96.7%
*-commutative96.7%
associate-*l*94.3%
cancel-sign-sub-inv94.3%
*-commutative94.3%
associate-+r-94.3%
+-commutative94.3%
Simplified96.7%
Taylor expanded in x around inf 50.7%
if -9.5000000000000005e65 < x < 8.1999999999999996e-38Initial program 96.1%
+-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r+96.1%
distribute-rgt-neg-out96.1%
*-commutative96.1%
associate-*l*97.5%
cancel-sign-sub-inv97.5%
*-commutative97.5%
associate-+r-97.5%
+-commutative97.5%
Simplified96.1%
Taylor expanded in x around 0 86.5%
cancel-sign-sub-inv86.5%
+-commutative86.5%
metadata-eval86.5%
*-commutative86.5%
*-commutative86.5%
associate-*r*86.4%
associate-*l*85.5%
*-commutative85.5%
associate-*r*85.6%
*-commutative85.6%
Applied egg-rr85.6%
Taylor expanded in z around 0 85.6%
*-commutative85.6%
associate-*l*85.6%
*-commutative85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y around 0 46.7%
associate-*r*46.7%
*-commutative46.7%
metadata-eval46.7%
distribute-rgt-neg-in46.7%
*-commutative46.7%
distribute-rgt-neg-in46.7%
metadata-eval46.7%
*-commutative46.7%
Simplified46.7%
Final simplification48.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 (* 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 96.4%
+-commutative96.4%
cancel-sign-sub-inv96.4%
associate-+r+96.4%
distribute-rgt-neg-out96.4%
*-commutative96.4%
associate-*l*96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
associate-+r-96.0%
+-commutative96.0%
Simplified96.4%
Taylor expanded in x around inf 30.8%
Final simplification30.8%
(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 2023297
(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)))