
(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: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -2e+76) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (fma x 2.0 (fma t (* (* y z) -9.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 ((y * 9.0) <= -2e+76) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = fma(x, 2.0, fma(t, ((y * z) * -9.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 (Float64(y * 9.0) <= -2e+76) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = fma(x, 2.0, fma(t, Float64(Float64(y * z) * -9.0), Float64(b * Float64(a * 27.0)))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -2e+76], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 2.0 + N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -2 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, b \cdot \left(a \cdot 27\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -2.0000000000000001e76Initial program 88.4%
+-commutative88.4%
associate-*l*88.4%
fma-def88.4%
associate-*l*99.7%
*-commutative99.7%
associate-*l*99.9%
Simplified99.9%
if -2.0000000000000001e76 < (*.f64 y 9) Initial program 96.1%
associate-+l-96.1%
fma-neg96.1%
neg-sub096.1%
associate-+l-96.1%
neg-sub096.1%
*-commutative96.1%
distribute-rgt-neg-in96.1%
fma-def96.1%
*-commutative96.1%
associate-*r*96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
metadata-eval96.1%
Simplified96.1%
Final simplification96.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -2e+76) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))) (+ (- (* x 2.0) (* t (* 9.0 (* y z)))) (* b (* a 27.0)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -2e+76) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0));
}
return tmp;
}
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -2e+76) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(y * z)))) + Float64(b * Float64(a * 27.0))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -2e+76], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;y \cdot 9 \leq -2 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -2.0000000000000001e76Initial program 88.4%
+-commutative88.4%
associate-*l*88.4%
fma-def88.4%
associate-*l*99.7%
*-commutative99.7%
associate-*l*99.9%
Simplified99.9%
if -2.0000000000000001e76 < (*.f64 y 9) Initial program 96.1%
Taylor expanded in y around 0 96.1%
Final simplification96.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 2e+304)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(- (* x 2.0) (* z (* (* y 9.0) 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 <= 2e+304) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - (z * ((y * 9.0) * t));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (y * 9.0d0) * z
if (t_1 <= 2d+304) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 27.0d0))
else
tmp = (x * 2.0d0) - (z * ((y * 9.0d0) * t))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 2e+304) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - (z * ((y * 9.0) * t));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 2e+304: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0)) else: tmp = (x * 2.0) - (z * ((y * 9.0) * 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 <= 2e+304) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(Float64(y * 9.0) * t))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 2e+304)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
else
tmp = (x * 2.0) - (z * ((y * 9.0) * t));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+304], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(N[(y * 9.0), $MachinePrecision] * t), $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 2 \cdot 10^{+304}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(\left(y \cdot 9\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.9999999999999999e304Initial program 97.4%
if 1.9999999999999999e304 < (*.f64 (*.f64 y 9) z) Initial program 57.5%
Taylor expanded in y around 0 57.5%
associate-+l-57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*r*57.5%
associate-*l*88.7%
*-commutative88.7%
*-commutative88.7%
associate-*r*88.7%
associate-*r*88.7%
Applied egg-rr88.7%
Taylor expanded in y around inf 94.3%
associate-*r*94.3%
associate-*r*94.2%
*-commutative94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
Simplified94.2%
Final simplification97.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 (* 27.0 (* a b))) (t_2 (* -9.0 (* y (* z t)))))
(if (<= x -1.45e+69)
(* x 2.0)
(if (<= x -3.4e-107)
t_2
(if (<= x -1.2e-289)
t_1
(if (<= x 2.8e-171)
t_2
(if (<= x 1.02e-104)
(* b (* a 27.0))
(if (<= x 4.4e+21) t_2 (if (<= x 3.5e+56) t_1 (* x 2.0))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (x <= -1.45e+69) {
tmp = x * 2.0;
} else if (x <= -3.4e-107) {
tmp = t_2;
} else if (x <= -1.2e-289) {
tmp = t_1;
} else if (x <= 2.8e-171) {
tmp = t_2;
} else if (x <= 1.02e-104) {
tmp = b * (a * 27.0);
} else if (x <= 4.4e+21) {
tmp = t_2;
} else if (x <= 3.5e+56) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (y * (z * t))
if (x <= (-1.45d+69)) then
tmp = x * 2.0d0
else if (x <= (-3.4d-107)) then
tmp = t_2
else if (x <= (-1.2d-289)) then
tmp = t_1
else if (x <= 2.8d-171) then
tmp = t_2
else if (x <= 1.02d-104) then
tmp = b * (a * 27.0d0)
else if (x <= 4.4d+21) then
tmp = t_2
else if (x <= 3.5d+56) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (x <= -1.45e+69) {
tmp = x * 2.0;
} else if (x <= -3.4e-107) {
tmp = t_2;
} else if (x <= -1.2e-289) {
tmp = t_1;
} else if (x <= 2.8e-171) {
tmp = t_2;
} else if (x <= 1.02e-104) {
tmp = b * (a * 27.0);
} else if (x <= 4.4e+21) {
tmp = t_2;
} else if (x <= 3.5e+56) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (y * (z * t)) tmp = 0 if x <= -1.45e+69: tmp = x * 2.0 elif x <= -3.4e-107: tmp = t_2 elif x <= -1.2e-289: tmp = t_1 elif x <= 2.8e-171: tmp = t_2 elif x <= 1.02e-104: tmp = b * (a * 27.0) elif x <= 4.4e+21: tmp = t_2 elif x <= 3.5e+56: tmp = t_1 else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (x <= -1.45e+69) tmp = Float64(x * 2.0); elseif (x <= -3.4e-107) tmp = t_2; elseif (x <= -1.2e-289) tmp = t_1; elseif (x <= 2.8e-171) tmp = t_2; elseif (x <= 1.02e-104) tmp = Float64(b * Float64(a * 27.0)); elseif (x <= 4.4e+21) tmp = t_2; elseif (x <= 3.5e+56) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (y * (z * t));
tmp = 0.0;
if (x <= -1.45e+69)
tmp = x * 2.0;
elseif (x <= -3.4e-107)
tmp = t_2;
elseif (x <= -1.2e-289)
tmp = t_1;
elseif (x <= 2.8e-171)
tmp = t_2;
elseif (x <= 1.02e-104)
tmp = b * (a * 27.0);
elseif (x <= 4.4e+21)
tmp = t_2;
elseif (x <= 3.5e+56)
tmp = t_1;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+69], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -3.4e-107], t$95$2, If[LessEqual[x, -1.2e-289], t$95$1, If[LessEqual[x, 2.8e-171], t$95$2, If[LessEqual[x, 1.02e-104], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e+21], t$95$2, If[LessEqual[x, 3.5e+56], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+69}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-107}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-289}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-171}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-104}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+21}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.4499999999999999e69 or 3.49999999999999999e56 < x Initial program 93.8%
Taylor expanded in x around inf 61.8%
if -1.4499999999999999e69 < x < -3.39999999999999994e-107 or -1.19999999999999997e-289 < x < 2.80000000000000023e-171 or 1.02000000000000001e-104 < x < 4.4e21Initial program 93.7%
Taylor expanded in y around inf 56.5%
if -3.39999999999999994e-107 < x < -1.19999999999999997e-289 or 4.4e21 < x < 3.49999999999999999e56Initial program 99.6%
Taylor expanded in a around inf 67.8%
if 2.80000000000000023e-171 < x < 1.02000000000000001e-104Initial program 92.2%
Taylor expanded in x around 0 80.0%
cancel-sign-sub-inv80.0%
associate-*r*80.2%
*-commutative80.2%
associate-*r*80.1%
metadata-eval80.1%
associate-*r*87.0%
Applied egg-rr87.0%
add-sqr-sqrt48.7%
sqrt-unprod79.3%
swap-sqr79.3%
metadata-eval79.3%
metadata-eval79.3%
swap-sqr79.3%
sqrt-unprod41.0%
add-sqr-sqrt56.5%
metadata-eval56.5%
cancel-sign-sub-inv56.5%
add-sqr-sqrt25.8%
sqrt-unprod56.8%
swap-sqr56.8%
metadata-eval56.8%
metadata-eval56.8%
swap-sqr56.8%
sqrt-unprod48.7%
Applied egg-rr80.1%
Taylor expanded in a around inf 64.5%
*-commutative64.5%
*-commutative64.5%
associate-*l*64.7%
*-commutative64.7%
Simplified64.7%
Final simplification60.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 (* 27.0 (* a b))) (t_2 (* y (* -9.0 (* z t)))))
(if (<= x -1.35e+69)
(* x 2.0)
(if (<= x -6.8e-108)
t_2
(if (<= x -2.4e-288)
t_1
(if (<= x 3.4e-181)
t_2
(if (<= x 2.5e-105)
(* b (* a 27.0))
(if (<= x 4.4e+21)
(* -9.0 (* y (* z t)))
(if (<= x 5.5e+55) t_1 (* x 2.0))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = y * (-9.0 * (z * t));
double tmp;
if (x <= -1.35e+69) {
tmp = x * 2.0;
} else if (x <= -6.8e-108) {
tmp = t_2;
} else if (x <= -2.4e-288) {
tmp = t_1;
} else if (x <= 3.4e-181) {
tmp = t_2;
} else if (x <= 2.5e-105) {
tmp = b * (a * 27.0);
} else if (x <= 4.4e+21) {
tmp = -9.0 * (y * (z * t));
} else if (x <= 5.5e+55) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = y * ((-9.0d0) * (z * t))
if (x <= (-1.35d+69)) then
tmp = x * 2.0d0
else if (x <= (-6.8d-108)) then
tmp = t_2
else if (x <= (-2.4d-288)) then
tmp = t_1
else if (x <= 3.4d-181) then
tmp = t_2
else if (x <= 2.5d-105) then
tmp = b * (a * 27.0d0)
else if (x <= 4.4d+21) then
tmp = (-9.0d0) * (y * (z * t))
else if (x <= 5.5d+55) then
tmp = t_1
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = y * (-9.0 * (z * t));
double tmp;
if (x <= -1.35e+69) {
tmp = x * 2.0;
} else if (x <= -6.8e-108) {
tmp = t_2;
} else if (x <= -2.4e-288) {
tmp = t_1;
} else if (x <= 3.4e-181) {
tmp = t_2;
} else if (x <= 2.5e-105) {
tmp = b * (a * 27.0);
} else if (x <= 4.4e+21) {
tmp = -9.0 * (y * (z * t));
} else if (x <= 5.5e+55) {
tmp = t_1;
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = y * (-9.0 * (z * t)) tmp = 0 if x <= -1.35e+69: tmp = x * 2.0 elif x <= -6.8e-108: tmp = t_2 elif x <= -2.4e-288: tmp = t_1 elif x <= 3.4e-181: tmp = t_2 elif x <= 2.5e-105: tmp = b * (a * 27.0) elif x <= 4.4e+21: tmp = -9.0 * (y * (z * t)) elif x <= 5.5e+55: tmp = t_1 else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(y * Float64(-9.0 * Float64(z * t))) tmp = 0.0 if (x <= -1.35e+69) tmp = Float64(x * 2.0); elseif (x <= -6.8e-108) tmp = t_2; elseif (x <= -2.4e-288) tmp = t_1; elseif (x <= 3.4e-181) tmp = t_2; elseif (x <= 2.5e-105) tmp = Float64(b * Float64(a * 27.0)); elseif (x <= 4.4e+21) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (x <= 5.5e+55) tmp = t_1; else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = y * (-9.0 * (z * t));
tmp = 0.0;
if (x <= -1.35e+69)
tmp = x * 2.0;
elseif (x <= -6.8e-108)
tmp = t_2;
elseif (x <= -2.4e-288)
tmp = t_1;
elseif (x <= 3.4e-181)
tmp = t_2;
elseif (x <= 2.5e-105)
tmp = b * (a * 27.0);
elseif (x <= 4.4e+21)
tmp = -9.0 * (y * (z * t));
elseif (x <= 5.5e+55)
tmp = t_1;
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+69], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -6.8e-108], t$95$2, If[LessEqual[x, -2.4e-288], t$95$1, If[LessEqual[x, 3.4e-181], t$95$2, If[LessEqual[x, 2.5e-105], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e+21], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e+55], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+69}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-108}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-288}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-181}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-105}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+21}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -1.3499999999999999e69 or 5.5000000000000004e55 < x Initial program 93.8%
Taylor expanded in x around inf 61.8%
if -1.3499999999999999e69 < x < -6.80000000000000004e-108 or -2.3999999999999998e-288 < x < 3.4e-181Initial program 94.2%
Taylor expanded in y around inf 57.8%
*-commutative57.8%
*-commutative57.8%
associate-*l*57.9%
*-commutative57.9%
*-commutative57.9%
Simplified57.9%
if -6.80000000000000004e-108 < x < -2.3999999999999998e-288 or 4.4e21 < x < 5.5000000000000004e55Initial program 99.6%
Taylor expanded in a around inf 67.8%
if 3.4e-181 < x < 2.49999999999999982e-105Initial program 92.2%
Taylor expanded in x around 0 80.0%
cancel-sign-sub-inv80.0%
associate-*r*80.2%
*-commutative80.2%
associate-*r*80.1%
metadata-eval80.1%
associate-*r*87.0%
Applied egg-rr87.0%
add-sqr-sqrt48.7%
sqrt-unprod79.3%
swap-sqr79.3%
metadata-eval79.3%
metadata-eval79.3%
swap-sqr79.3%
sqrt-unprod41.0%
add-sqr-sqrt56.5%
metadata-eval56.5%
cancel-sign-sub-inv56.5%
add-sqr-sqrt25.8%
sqrt-unprod56.8%
swap-sqr56.8%
metadata-eval56.8%
metadata-eval56.8%
swap-sqr56.8%
sqrt-unprod48.7%
Applied egg-rr80.1%
Taylor expanded in a around inf 64.5%
*-commutative64.5%
*-commutative64.5%
associate-*l*64.7%
*-commutative64.7%
Simplified64.7%
if 2.49999999999999982e-105 < x < 4.4e21Initial program 92.2%
Taylor expanded in y around inf 52.9%
Final simplification61.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.5e-79)
(* y (* -9.0 (* z t)))
(if (<= z -5.6e-216)
(* x 2.0)
(if (<= z 3.5e-307)
(* b (* a 27.0))
(if (<= z 1.4e-208)
(* x 2.0)
(if (<= z 1.3e-140)
(* y (* z (* t -9.0)))
(if (<= z 1.85e+60) (* x 2.0) (* z (* t (* y -9.0))))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.5e-79) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -5.6e-216) {
tmp = x * 2.0;
} else if (z <= 3.5e-307) {
tmp = b * (a * 27.0);
} else if (z <= 1.4e-208) {
tmp = x * 2.0;
} else if (z <= 1.3e-140) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1.85e+60) {
tmp = x * 2.0;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.5d-79)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-5.6d-216)) then
tmp = x * 2.0d0
else if (z <= 3.5d-307) then
tmp = b * (a * 27.0d0)
else if (z <= 1.4d-208) then
tmp = x * 2.0d0
else if (z <= 1.3d-140) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 1.85d+60) then
tmp = x * 2.0d0
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.5e-79) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -5.6e-216) {
tmp = x * 2.0;
} else if (z <= 3.5e-307) {
tmp = b * (a * 27.0);
} else if (z <= 1.4e-208) {
tmp = x * 2.0;
} else if (z <= 1.3e-140) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1.85e+60) {
tmp = x * 2.0;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.5e-79: tmp = y * (-9.0 * (z * t)) elif z <= -5.6e-216: tmp = x * 2.0 elif z <= 3.5e-307: tmp = b * (a * 27.0) elif z <= 1.4e-208: tmp = x * 2.0 elif z <= 1.3e-140: tmp = y * (z * (t * -9.0)) elif z <= 1.85e+60: tmp = x * 2.0 else: tmp = z * (t * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.5e-79) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -5.6e-216) tmp = Float64(x * 2.0); elseif (z <= 3.5e-307) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.4e-208) tmp = Float64(x * 2.0); elseif (z <= 1.3e-140) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 1.85e+60) tmp = Float64(x * 2.0); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.5e-79)
tmp = y * (-9.0 * (z * t));
elseif (z <= -5.6e-216)
tmp = x * 2.0;
elseif (z <= 3.5e-307)
tmp = b * (a * 27.0);
elseif (z <= 1.4e-208)
tmp = x * 2.0;
elseif (z <= 1.3e-140)
tmp = y * (z * (t * -9.0));
elseif (z <= 1.85e+60)
tmp = x * 2.0;
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.5e-79], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.6e-216], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.5e-307], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-208], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.3e-140], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+60], N[(x * 2.0), $MachinePrecision], N[(z * N[(t * N[(y * -9.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.5 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-216}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-307}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-208}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-140}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+60}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -3.5000000000000003e-79Initial program 94.4%
Taylor expanded in y around inf 45.4%
*-commutative45.4%
*-commutative45.4%
associate-*l*45.4%
*-commutative45.4%
*-commutative45.4%
Simplified45.4%
if -3.5000000000000003e-79 < z < -5.6e-216 or 3.5000000000000002e-307 < z < 1.40000000000000001e-208 or 1.2999999999999999e-140 < z < 1.84999999999999994e60Initial program 99.9%
Taylor expanded in x around inf 48.5%
if -5.6e-216 < z < 3.5000000000000002e-307Initial program 99.7%
Taylor expanded in x around 0 53.5%
cancel-sign-sub-inv53.5%
associate-*r*53.5%
*-commutative53.5%
associate-*r*53.4%
metadata-eval53.4%
associate-*r*49.0%
Applied egg-rr49.0%
add-sqr-sqrt25.6%
sqrt-unprod48.7%
swap-sqr48.7%
metadata-eval48.7%
metadata-eval48.7%
swap-sqr48.7%
sqrt-unprod43.4%
add-sqr-sqrt48.7%
metadata-eval48.7%
cancel-sign-sub-inv48.7%
add-sqr-sqrt25.6%
sqrt-unprod49.0%
swap-sqr49.0%
metadata-eval49.0%
metadata-eval49.0%
swap-sqr49.0%
sqrt-unprod43.7%
Applied egg-rr53.4%
Taylor expanded in a around inf 53.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*53.1%
*-commutative53.1%
Simplified53.1%
if 1.40000000000000001e-208 < z < 1.2999999999999999e-140Initial program 99.8%
Taylor expanded in y around inf 28.2%
*-commutative28.2%
*-commutative28.2%
associate-*l*28.2%
*-commutative28.2%
*-commutative28.2%
Simplified28.2%
expm1-log1p-u28.1%
expm1-udef12.6%
*-commutative12.6%
Applied egg-rr12.6%
expm1-def28.1%
expm1-log1p28.2%
*-commutative28.2%
*-commutative28.2%
associate-*l*28.4%
Simplified28.4%
Taylor expanded in y around 0 28.2%
associate-*r*28.4%
*-commutative28.4%
Simplified28.4%
Taylor expanded in y around 0 28.2%
*-commutative28.2%
*-commutative28.2%
associate-*l*28.2%
associate-*l*28.3%
Simplified28.3%
if 1.84999999999999994e60 < z Initial program 84.3%
Taylor expanded in y around 0 84.4%
Taylor expanded in y around inf 42.1%
associate-*r*48.8%
associate-*r*48.8%
*-commutative48.8%
associate-*r*48.7%
*-commutative48.7%
Simplified48.7%
Final simplification46.4%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x 2.0) (* (* a b) -27.0))))
(if (<= z -1.42e+54)
(* -9.0 (* y (* z t)))
(if (<= z -1e-38)
t_1
(if (<= z -8.5e-80)
(* y (* -9.0 (* z t)))
(if (<= z 4.5e+60) t_1 (* z (* t (* y -9.0)))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - ((a * b) * -27.0);
double tmp;
if (z <= -1.42e+54) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1e-38) {
tmp = t_1;
} else if (z <= -8.5e-80) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 4.5e+60) {
tmp = t_1;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) - ((a * b) * (-27.0d0))
if (z <= (-1.42d+54)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-1d-38)) then
tmp = t_1
else if (z <= (-8.5d-80)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 4.5d+60) then
tmp = t_1
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) - ((a * b) * -27.0);
double tmp;
if (z <= -1.42e+54) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1e-38) {
tmp = t_1;
} else if (z <= -8.5e-80) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 4.5e+60) {
tmp = t_1;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - ((a * b) * -27.0) tmp = 0 if z <= -1.42e+54: tmp = -9.0 * (y * (z * t)) elif z <= -1e-38: tmp = t_1 elif z <= -8.5e-80: tmp = y * (-9.0 * (z * t)) elif z <= 4.5e+60: tmp = t_1 else: tmp = z * (t * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)) tmp = 0.0 if (z <= -1.42e+54) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -1e-38) tmp = t_1; elseif (z <= -8.5e-80) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 4.5e+60) tmp = t_1; else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) - ((a * b) * -27.0);
tmp = 0.0;
if (z <= -1.42e+54)
tmp = -9.0 * (y * (z * t));
elseif (z <= -1e-38)
tmp = t_1;
elseif (z <= -8.5e-80)
tmp = y * (-9.0 * (z * t));
elseif (z <= 4.5e+60)
tmp = t_1;
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.42e+54], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-38], t$95$1, If[LessEqual[z, -8.5e-80], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+60], t$95$1, N[(z * N[(t * N[(y * -9.0), $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 := x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{if}\;z \leq -1.42 \cdot 10^{+54}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-80}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.41999999999999995e54Initial program 92.0%
Taylor expanded in y around inf 48.6%
if -1.41999999999999995e54 < z < -9.9999999999999996e-39 or -8.49999999999999939e-80 < z < 4.50000000000000013e60Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 79.0%
*-commutative79.0%
Simplified79.0%
if -9.9999999999999996e-39 < z < -8.49999999999999939e-80Initial program 99.8%
Taylor expanded in y around inf 59.7%
*-commutative59.7%
*-commutative59.7%
associate-*l*59.8%
*-commutative59.8%
*-commutative59.8%
Simplified59.8%
if 4.50000000000000013e60 < z Initial program 84.3%
Taylor expanded in y around 0 84.4%
Taylor expanded in y around inf 42.1%
associate-*r*48.8%
associate-*r*48.8%
*-commutative48.8%
associate-*r*48.7%
*-commutative48.7%
Simplified48.7%
Final simplification64.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.6e+53)
(* -9.0 (* y (* z t)))
(if (<= z -1.08e-38)
(- (* x 2.0) (* (* a b) -27.0))
(if (<= z -2.3e-79)
(* y (* -9.0 (* z t)))
(if (<= z 1.85e+60)
(+ (* x 2.0) (* a (* 27.0 b)))
(* z (* t (* y -9.0))))))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.6e+53) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1.08e-38) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else if (z <= -2.3e-79) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1.85e+60) {
tmp = (x * 2.0) + (a * (27.0 * b));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.6d+53)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-1.08d-38)) then
tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
else if (z <= (-2.3d-79)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 1.85d+60) then
tmp = (x * 2.0d0) + (a * (27.0d0 * b))
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.6e+53) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1.08e-38) {
tmp = (x * 2.0) - ((a * b) * -27.0);
} else if (z <= -2.3e-79) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 1.85e+60) {
tmp = (x * 2.0) + (a * (27.0 * b));
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.6e+53: tmp = -9.0 * (y * (z * t)) elif z <= -1.08e-38: tmp = (x * 2.0) - ((a * b) * -27.0) elif z <= -2.3e-79: tmp = y * (-9.0 * (z * t)) elif z <= 1.85e+60: tmp = (x * 2.0) + (a * (27.0 * b)) else: tmp = z * (t * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.6e+53) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -1.08e-38) tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0)); elseif (z <= -2.3e-79) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 1.85e+60) tmp = Float64(Float64(x * 2.0) + Float64(a * Float64(27.0 * b))); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.6e+53)
tmp = -9.0 * (y * (z * t));
elseif (z <= -1.08e-38)
tmp = (x * 2.0) - ((a * b) * -27.0);
elseif (z <= -2.3e-79)
tmp = y * (-9.0 * (z * t));
elseif (z <= 1.85e+60)
tmp = (x * 2.0) + (a * (27.0 * b));
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.6e+53], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.08e-38], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-79], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+60], N[(N[(x * 2.0), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.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 -1.6 \cdot 10^{+53}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{-38}:\\
\;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+60}:\\
\;\;\;\;x \cdot 2 + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.6e53Initial program 92.0%
Taylor expanded in y around inf 48.6%
if -1.6e53 < z < -1.08e-38Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
cancel-sign-sub-inv99.6%
metadata-eval99.6%
*-lft-identity99.6%
associate-*l*94.1%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around 0 71.2%
*-commutative71.2%
Simplified71.2%
if -1.08e-38 < z < -2.30000000000000012e-79Initial program 99.8%
Taylor expanded in y around inf 59.7%
*-commutative59.7%
*-commutative59.7%
associate-*l*59.8%
*-commutative59.8%
*-commutative59.8%
Simplified59.8%
if -2.30000000000000012e-79 < z < 1.84999999999999994e60Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 80.1%
*-commutative80.1%
Simplified80.1%
associate-*l*80.1%
metadata-eval80.1%
distribute-rgt-neg-in80.1%
*-commutative80.1%
distribute-rgt-neg-in80.1%
Applied egg-rr80.1%
if 1.84999999999999994e60 < z Initial program 84.3%
Taylor expanded in y around 0 84.4%
Taylor expanded in y around inf 42.1%
associate-*r*48.8%
associate-*r*48.8%
*-commutative48.8%
associate-*r*48.7%
*-commutative48.7%
Simplified48.7%
Final simplification64.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 (+ (- (* x 2.0) (* t (* 9.0 (* y z)))) (* 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) {
return ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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) - (t * (9.0d0 * (y * z)))) + (b * (a * 27.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) - (t * (9.0 * (y * z)))) + (b * (a * 27.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) - (t * (9.0 * (y * z)))) + (b * (a * 27.0))
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(y * z)))) + Float64(b * Float64(a * 27.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) - (t * (9.0 * (y * z)))) + (b * (a * 27.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[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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])\\
\\
\left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right) + b \cdot \left(a \cdot 27\right)
\end{array}
Initial program 94.6%
Taylor expanded in y around 0 94.6%
Final simplification94.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 (or (<= b -9.5e-82) (not (<= b 6.6e+39))) (+ (* x 2.0) (* a (* 27.0 b))) (- (* x 2.0) (* 9.0 (* y (* z t))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e-82) || !(b <= 6.6e+39)) {
tmp = (x * 2.0) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-9.5d-82)) .or. (.not. (b <= 6.6d+39))) then
tmp = (x * 2.0d0) + (a * (27.0d0 * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e-82) || !(b <= 6.6e+39)) {
tmp = (x * 2.0) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -9.5e-82) or not (b <= 6.6e+39): tmp = (x * 2.0) + (a * (27.0 * b)) else: tmp = (x * 2.0) - (9.0 * (y * (z * t))) return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.5e-82) || !(b <= 6.6e+39)) tmp = Float64(Float64(x * 2.0) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -9.5e-82) || ~((b <= 6.6e+39)))
tmp = (x * 2.0) + (a * (27.0 * b));
else
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.5e-82], N[Not[LessEqual[b, 6.6e+39]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{-82} \lor \neg \left(b \leq 6.6 \cdot 10^{+39}\right):\\
\;\;\;\;x \cdot 2 + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if b < -9.4999999999999996e-82 or 6.60000000000000042e39 < b Initial program 95.9%
associate-+l-95.9%
sub-neg95.9%
neg-mul-195.9%
metadata-eval95.9%
metadata-eval95.9%
cancel-sign-sub-inv95.9%
metadata-eval95.9%
*-lft-identity95.9%
associate-*l*94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in y around 0 71.2%
*-commutative71.2%
Simplified71.2%
associate-*l*71.2%
metadata-eval71.2%
distribute-rgt-neg-in71.2%
*-commutative71.2%
distribute-rgt-neg-in71.2%
Applied egg-rr71.2%
if -9.4999999999999996e-82 < b < 6.60000000000000042e39Initial program 93.4%
Taylor expanded in a around 0 80.3%
Final simplification75.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 (<= b -7.5e-62)
(+ t_1 (* -9.0 (* z (* y t))))
(if (<= b 1.75e+39)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(+ (* x 2.0) t_1)))))assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (b <= -7.5e-62) {
tmp = t_1 + (-9.0 * (z * (y * t)));
} else if (b <= 1.75e+39) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) + t_1;
}
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 (b <= (-7.5d-62)) then
tmp = t_1 + ((-9.0d0) * (z * (y * t)))
else if (b <= 1.75d+39) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) + t_1
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 (b <= -7.5e-62) {
tmp = t_1 + (-9.0 * (z * (y * t)));
} else if (b <= 1.75e+39) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) + t_1;
}
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 b <= -7.5e-62: tmp = t_1 + (-9.0 * (z * (y * t))) elif b <= 1.75e+39: tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) + t_1 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (b <= -7.5e-62) tmp = Float64(t_1 + Float64(-9.0 * Float64(z * Float64(y * t)))); elseif (b <= 1.75e+39) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) + t_1); 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 (b <= -7.5e-62)
tmp = t_1 + (-9.0 * (z * (y * t)));
elseif (b <= 1.75e+39)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) + t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7.5e-62], N[(t$95$1 + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.75e+39], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;b \leq -7.5 \cdot 10^{-62}:\\
\;\;\;\;t_1 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t_1\\
\end{array}
\end{array}
if b < -7.5000000000000003e-62Initial program 99.8%
Taylor expanded in x around 0 68.7%
cancel-sign-sub-inv68.7%
associate-*r*68.6%
*-commutative68.6%
associate-*r*68.6%
metadata-eval68.6%
associate-*r*67.3%
Applied egg-rr67.3%
if -7.5000000000000003e-62 < b < 1.7500000000000001e39Initial program 92.9%
Taylor expanded in a around 0 79.2%
if 1.7500000000000001e39 < b Initial program 92.1%
associate-+l-92.1%
sub-neg92.1%
neg-mul-192.1%
metadata-eval92.1%
metadata-eval92.1%
cancel-sign-sub-inv92.1%
metadata-eval92.1%
*-lft-identity92.1%
associate-*l*94.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around 0 80.3%
*-commutative80.3%
Simplified80.3%
associate-*l*80.5%
metadata-eval80.5%
distribute-rgt-neg-in80.5%
*-commutative80.5%
distribute-rgt-neg-in80.5%
Applied egg-rr80.5%
Final simplification76.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 (* 9.0 (* y (* z t)))))
(if (<= b -1.7e-56)
(- (* 27.0 (* a b)) t_1)
(if (<= b 4.3e+39) (- (* x 2.0) t_1) (+ (* x 2.0) (* 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 t_1 = 9.0 * (y * (z * t));
double tmp;
if (b <= -1.7e-56) {
tmp = (27.0 * (a * b)) - t_1;
} else if (b <= 4.3e+39) {
tmp = (x * 2.0) - t_1;
} else {
tmp = (x * 2.0) + (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) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * (y * (z * t))
if (b <= (-1.7d-56)) then
tmp = (27.0d0 * (a * b)) - t_1
else if (b <= 4.3d+39) then
tmp = (x * 2.0d0) - t_1
else
tmp = (x * 2.0d0) + (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 t_1 = 9.0 * (y * (z * t));
double tmp;
if (b <= -1.7e-56) {
tmp = (27.0 * (a * b)) - t_1;
} else if (b <= 4.3e+39) {
tmp = (x * 2.0) - t_1;
} else {
tmp = (x * 2.0) + (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): t_1 = 9.0 * (y * (z * t)) tmp = 0 if b <= -1.7e-56: tmp = (27.0 * (a * b)) - t_1 elif b <= 4.3e+39: tmp = (x * 2.0) - t_1 else: tmp = (x * 2.0) + (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) t_1 = Float64(9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (b <= -1.7e-56) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); elseif (b <= 4.3e+39) tmp = Float64(Float64(x * 2.0) - t_1); else tmp = Float64(Float64(x * 2.0) + Float64(a * Float64(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)
t_1 = 9.0 * (y * (z * t));
tmp = 0.0;
if (b <= -1.7e-56)
tmp = (27.0 * (a * b)) - t_1;
elseif (b <= 4.3e+39)
tmp = (x * 2.0) - t_1;
else
tmp = (x * 2.0) + (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_] := Block[{t$95$1 = N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.7e-56], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[b, 4.3e+39], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(a * N[(27.0 * b), $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 := 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{-56}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -1.69999999999999991e-56Initial program 99.8%
Taylor expanded in x around 0 68.2%
if -1.69999999999999991e-56 < b < 4.3e39Initial program 92.9%
Taylor expanded in a around 0 79.3%
if 4.3e39 < b Initial program 92.1%
associate-+l-92.1%
sub-neg92.1%
neg-mul-192.1%
metadata-eval92.1%
metadata-eval92.1%
cancel-sign-sub-inv92.1%
metadata-eval92.1%
*-lft-identity92.1%
associate-*l*94.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around 0 80.3%
*-commutative80.3%
Simplified80.3%
associate-*l*80.5%
metadata-eval80.5%
distribute-rgt-neg-in80.5%
*-commutative80.5%
distribute-rgt-neg-in80.5%
Applied egg-rr80.5%
Final simplification76.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 (or (<= a -3.9e+62) (not (<= a 5.5e-73))) (* 27.0 (* a b)) (* x 2.0)))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e+62) || !(a <= 5.5e-73)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-3.9d+62)) .or. (.not. (a <= 5.5d-73))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e+62) || !(a <= 5.5e-73)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) [a, b] = sort([a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.9e+62) or not (a <= 5.5e-73): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) a, b = sort([a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.9e+62) || !(a <= 5.5e-73)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -3.9e+62) || ~((a <= 5.5e-73)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.9e+62], N[Not[LessEqual[a, 5.5e-73]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{+62} \lor \neg \left(a \leq 5.5 \cdot 10^{-73}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.9e62 or 5.50000000000000006e-73 < a Initial program 96.5%
Taylor expanded in a around inf 52.8%
if -3.9e62 < a < 5.50000000000000006e-73Initial program 93.0%
Taylor expanded in x around inf 44.2%
Final simplification48.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 (if (or (<= a -3.1e+62) (not (<= a 6.6e-81))) (* b (* a 27.0)) (* 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 ((a <= -3.1e+62) || !(a <= 6.6e-81)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
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 ((a <= (-3.1d+62)) .or. (.not. (a <= 6.6d-81))) then
tmp = b * (a * 27.0d0)
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 ((a <= -3.1e+62) || !(a <= 6.6e-81)) {
tmp = b * (a * 27.0);
} 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 (a <= -3.1e+62) or not (a <= 6.6e-81): tmp = b * (a * 27.0) 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 ((a <= -3.1e+62) || !(a <= 6.6e-81)) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(x * 2.0); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -3.1e+62) || ~((a <= 6.6e-81)))
tmp = b * (a * 27.0);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.1e+62], N[Not[LessEqual[a, 6.6e-81]], $MachinePrecision]], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+62} \lor \neg \left(a \leq 6.6 \cdot 10^{-81}\right):\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.10000000000000014e62 or 6.59999999999999975e-81 < a Initial program 96.5%
Taylor expanded in x around 0 72.0%
cancel-sign-sub-inv72.0%
associate-*r*72.0%
*-commutative72.0%
associate-*r*72.0%
metadata-eval72.0%
associate-*r*75.1%
Applied egg-rr75.1%
add-sqr-sqrt40.1%
sqrt-unprod54.4%
swap-sqr54.4%
metadata-eval54.4%
metadata-eval54.4%
swap-sqr54.4%
sqrt-unprod34.5%
add-sqr-sqrt50.3%
metadata-eval50.3%
cancel-sign-sub-inv50.3%
add-sqr-sqrt32.7%
sqrt-unprod59.2%
swap-sqr59.2%
metadata-eval59.2%
metadata-eval59.2%
swap-sqr59.2%
sqrt-unprod51.9%
Applied egg-rr72.0%
Taylor expanded in a around inf 52.4%
*-commutative52.4%
*-commutative52.4%
associate-*l*52.4%
*-commutative52.4%
Simplified52.4%
if -3.10000000000000014e62 < a < 6.59999999999999975e-81Initial program 92.9%
Taylor expanded in x around inf 43.8%
Final simplification47.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* 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 94.6%
Taylor expanded in x around inf 34.5%
Final simplification34.5%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2023230
(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)))