
(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. (FPCore (x y z t a b) :precision binary64 (if (<= t 4e+98) (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* t z)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* -9.0 (* y z)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 4e+98) {
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (-9.0 * (y * z)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 4e+98) tmp = Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(t * z)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(-9.0 * Float64(y * z))))); end return tmp end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 4e+98], N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4 \cdot 10^{+98}:\\
\;\;\;\;\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 3.99999999999999999e98Initial program 96.0%
sub-neg96.0%
sub-neg96.0%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
+-commutative96.0%
associate-+r-96.0%
associate-*l*96.0%
Applied egg-rr96.0%
if 3.99999999999999999e98 < t Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-*r*84.3%
distribute-lft-neg-in84.3%
*-commutative84.3%
cancel-sign-sub-inv84.3%
associate-+r-84.3%
associate-*l*84.3%
fma-def87.6%
cancel-sign-sub-inv87.6%
fma-def87.6%
distribute-lft-neg-in87.6%
distribute-rgt-neg-in87.6%
*-commutative87.6%
associate-*r*96.7%
distribute-rgt-neg-out96.7%
*-commutative96.7%
associate-*r*99.8%
Simplified99.8%
Final simplification96.5%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* -9.0 z))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (-9.0 * z)))));
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(-9.0 * z))))) end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right)
\end{array}
Initial program 95.7%
Simplified95.0%
Final simplification95.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 9.0 (* t (* y z)))) (t_2 (* b (* a 27.0))))
(if (or (<= t_2 -5e+150) (not (<= t_2 4e+170)))
(- (* 27.0 (* a b)) t_1)
(- (* x 2.0) t_1))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (t * (y * z));
double t_2 = b * (a * 27.0);
double tmp;
if ((t_2 <= -5e+150) || !(t_2 <= 4e+170)) {
tmp = (27.0 * (a * b)) - t_1;
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (t * (y * z))
t_2 = b * (a * 27.0d0)
if ((t_2 <= (-5d+150)) .or. (.not. (t_2 <= 4d+170))) then
tmp = (27.0d0 * (a * b)) - t_1
else
tmp = (x * 2.0d0) - t_1
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 9.0 * (t * (y * z));
double t_2 = b * (a * 27.0);
double tmp;
if ((t_2 <= -5e+150) || !(t_2 <= 4e+170)) {
tmp = (27.0 * (a * b)) - t_1;
} else {
tmp = (x * 2.0) - t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 9.0 * (t * (y * z)) t_2 = b * (a * 27.0) tmp = 0 if (t_2 <= -5e+150) or not (t_2 <= 4e+170): tmp = (27.0 * (a * b)) - t_1 else: tmp = (x * 2.0) - t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(9.0 * Float64(t * Float64(y * z))) t_2 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if ((t_2 <= -5e+150) || !(t_2 <= 4e+170)) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); else tmp = Float64(Float64(x * 2.0) - t_1); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 9.0 * (t * (y * z));
t_2 = b * (a * 27.0);
tmp = 0.0;
if ((t_2 <= -5e+150) || ~((t_2 <= 4e+170)))
tmp = (27.0 * (a * b)) - t_1;
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -5e+150], N[Not[LessEqual[t$95$2, 4e+170]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+150} \lor \neg \left(t_2 \leq 4 \cdot 10^{+170}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150 or 4.00000000000000014e170 < (*.f64 (*.f64 a 27) b) Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*90.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in x around 0 86.1%
if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 4.00000000000000014e170Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in a around 0 86.6%
Final simplification86.5%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0)))
(t_2 (* 27.0 (* a b)))
(t_3 (* 9.0 (* t (* y z)))))
(if (<= t_1 -5e+150)
(- t_2 (* 9.0 (* y (* t z))))
(if (<= t_1 4e+170) (- (* x 2.0) t_3) (- t_2 t_3)))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = 27.0 * (a * b);
double t_3 = 9.0 * (t * (y * z));
double tmp;
if (t_1 <= -5e+150) {
tmp = t_2 - (9.0 * (y * (t * z)));
} else if (t_1 <= 4e+170) {
tmp = (x * 2.0) - t_3;
} else {
tmp = t_2 - t_3;
}
return tmp;
}
NOTE: y, z, and t 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) :: t_3
real(8) :: tmp
t_1 = b * (a * 27.0d0)
t_2 = 27.0d0 * (a * b)
t_3 = 9.0d0 * (t * (y * z))
if (t_1 <= (-5d+150)) then
tmp = t_2 - (9.0d0 * (y * (t * z)))
else if (t_1 <= 4d+170) then
tmp = (x * 2.0d0) - t_3
else
tmp = t_2 - t_3
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double t_2 = 27.0 * (a * b);
double t_3 = 9.0 * (t * (y * z));
double tmp;
if (t_1 <= -5e+150) {
tmp = t_2 - (9.0 * (y * (t * z)));
} else if (t_1 <= 4e+170) {
tmp = (x * 2.0) - t_3;
} else {
tmp = t_2 - t_3;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) t_2 = 27.0 * (a * b) t_3 = 9.0 * (t * (y * z)) tmp = 0 if t_1 <= -5e+150: tmp = t_2 - (9.0 * (y * (t * z))) elif t_1 <= 4e+170: tmp = (x * 2.0) - t_3 else: tmp = t_2 - t_3 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) t_2 = Float64(27.0 * Float64(a * b)) t_3 = Float64(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (t_1 <= -5e+150) tmp = Float64(t_2 - Float64(9.0 * Float64(y * Float64(t * z)))); elseif (t_1 <= 4e+170) tmp = Float64(Float64(x * 2.0) - t_3); else tmp = Float64(t_2 - t_3); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
t_2 = 27.0 * (a * b);
t_3 = 9.0 * (t * (y * z));
tmp = 0.0;
if (t_1 <= -5e+150)
tmp = t_2 - (9.0 * (y * (t * z)));
elseif (t_1 <= 4e+170)
tmp = (x * 2.0) - t_3;
else
tmp = t_2 - t_3;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+150], N[(t$95$2 - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+170], N[(N[(x * 2.0), $MachinePrecision] - t$95$3), $MachinePrecision], N[(t$95$2 - t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
t_3 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;t_2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;x \cdot 2 - t_3\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*91.7%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in x around 0 89.0%
expm1-log1p-u18.7%
expm1-udef18.5%
*-commutative18.5%
*-commutative18.5%
associate-*l*18.5%
Applied egg-rr77.1%
expm1-def18.7%
expm1-log1p21.9%
*-commutative21.9%
associate-*l*19.2%
Simplified80.7%
if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 4.00000000000000014e170Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in a around 0 86.6%
if 4.00000000000000014e170 < (*.f64 (*.f64 a 27) b) Initial program 83.0%
sub-neg83.0%
sub-neg83.0%
associate-*l*88.3%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in x around 0 83.3%
Final simplification85.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* a 27.0))))
(if (<= t_1 -5e+150)
(+ (* 27.0 (* a b)) (* x 2.0))
(if (<= t_1 2e+201) (- (* x 2.0) (* 9.0 (* t (* y z)))) t_1))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (t_1 <= -5e+150) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if (t_1 <= 2e+201) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (t_1 <= (-5d+150)) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else if (t_1 <= 2d+201) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (t_1 <= -5e+150) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if (t_1 <= 2e+201) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if t_1 <= -5e+150: tmp = (27.0 * (a * b)) + (x * 2.0) elif t_1 <= 2e+201: tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t_1 <= -5e+150) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); elseif (t_1 <= 2e+201) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (t_1 <= -5e+150)
tmp = (27.0 * (a * b)) + (x * 2.0);
elseif (t_1 <= 2e+201)
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+150], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+201], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+201}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*91.7%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in y around 0 83.8%
if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 2.00000000000000008e201Initial program 96.3%
sub-neg96.3%
sub-neg96.3%
associate-*l*95.5%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 85.1%
if 2.00000000000000008e201 < (*.f64 (*.f64 a 27) b) Initial program 86.5%
sub-neg86.5%
sub-neg86.5%
associate-*l*86.4%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in a around inf 83.1%
associate-*r*83.1%
*-commutative83.1%
associate-*r*83.3%
Simplified83.3%
add-sqr-sqrt83.2%
pow283.2%
Applied egg-rr83.2%
unpow283.2%
add-sqr-sqrt83.3%
associate-*r*83.1%
Applied egg-rr83.1%
Final simplification84.7%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (* a 27.0)))) (if (<= t_1 -5e+150) (* 27.0 (* a b)) (if (<= t_1 4e+170) (* x 2.0) t_1))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (t_1 <= -5e+150) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 4e+170) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (t_1 <= (-5d+150)) then
tmp = 27.0d0 * (a * b)
else if (t_1 <= 4d+170) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (t_1 <= -5e+150) {
tmp = 27.0 * (a * b);
} else if (t_1 <= 4e+170) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if t_1 <= -5e+150: tmp = 27.0 * (a * b) elif t_1 <= 4e+170: tmp = x * 2.0 else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t_1 <= -5e+150) tmp = Float64(27.0 * Float64(a * b)); elseif (t_1 <= 4e+170) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (t_1 <= -5e+150)
tmp = 27.0 * (a * b);
elseif (t_1 <= 4e+170)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+150], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+170], N[(x * 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+150}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -5.00000000000000009e150Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*91.7%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in a around inf 72.9%
if -5.00000000000000009e150 < (*.f64 (*.f64 a 27) b) < 4.00000000000000014e170Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in x around inf 47.1%
if 4.00000000000000014e170 < (*.f64 (*.f64 a 27) b) Initial program 83.0%
sub-neg83.0%
sub-neg83.0%
associate-*l*88.3%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in a around inf 77.5%
associate-*r*77.6%
*-commutative77.6%
associate-*r*77.7%
Simplified77.7%
add-sqr-sqrt77.6%
pow277.6%
Applied egg-rr77.6%
unpow277.6%
add-sqr-sqrt77.7%
associate-*r*77.6%
Applied egg-rr77.6%
Final simplification54.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (* a (* 27.0 b)) (- (* x 2.0) (* (* t z) (* y 9.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return (a * (27.0 * b)) + ((x * 2.0) - ((t * z) * (y * 9.0)));
}
NOTE: y, z, and t 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 = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((t * z) * (y * 9.0d0)))
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
return (a * (27.0 * b)) + ((x * 2.0) - ((t * z) * (y * 9.0)));
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return (a * (27.0 * b)) + ((x * 2.0) - ((t * z) * (y * 9.0)))
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0)))) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = (a * (27.0 * b)) + ((x * 2.0) - ((t * z) * (y * 9.0)));
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right)
\end{array}
Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Final simplification93.9%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (- (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* 9.0 (* t z)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
}
NOTE: y, z, and t 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 = ((a * (27.0d0 * b)) + (x * 2.0d0)) - (y * (9.0d0 * (t * z)))
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)))
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(t * z)))) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((a * (27.0 * b)) + (x * 2.0)) - (y * (9.0 * (t * z)));
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(t \cdot z\right)\right)
\end{array}
Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
+-commutative93.9%
associate-+r-93.9%
associate-*l*94.3%
Applied egg-rr94.3%
Final simplification94.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= z -4800000000000.0)
t_1
(if (<= z 2.1e-236) (* x 2.0) (if (<= z 4e-68) (* b (* a 27.0)) t_1)))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -4800000000000.0) {
tmp = t_1;
} else if (z <= 2.1e-236) {
tmp = x * 2.0;
} else if (z <= 4e-68) {
tmp = b * (a * 27.0);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (z <= (-4800000000000.0d0)) then
tmp = t_1
else if (z <= 2.1d-236) then
tmp = x * 2.0d0
else if (z <= 4d-68) then
tmp = b * (a * 27.0d0)
else
tmp = t_1
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -4800000000000.0) {
tmp = t_1;
} else if (z <= 2.1e-236) {
tmp = x * 2.0;
} else if (z <= 4e-68) {
tmp = b * (a * 27.0);
} else {
tmp = t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) tmp = 0 if z <= -4800000000000.0: tmp = t_1 elif z <= 2.1e-236: tmp = x * 2.0 elif z <= 4e-68: tmp = b * (a * 27.0) else: tmp = t_1 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -4800000000000.0) tmp = t_1; elseif (z <= 2.1e-236) tmp = Float64(x * 2.0); elseif (z <= 4e-68) tmp = Float64(b * Float64(a * 27.0)); else tmp = t_1; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -4800000000000.0)
tmp = t_1;
elseif (z <= 2.1e-236)
tmp = x * 2.0;
elseif (z <= 4e-68)
tmp = b * (a * 27.0);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4800000000000.0], t$95$1, If[LessEqual[z, 2.1e-236], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4e-68], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -4800000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-236}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-68}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.8e12 or 4.00000000000000027e-68 < z Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in y around inf 48.2%
if -4.8e12 < z < 2.09999999999999979e-236Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in x around inf 44.7%
if 2.09999999999999979e-236 < z < 4.00000000000000027e-68Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 43.5%
associate-*r*43.5%
*-commutative43.5%
associate-*r*43.5%
Simplified43.5%
add-sqr-sqrt31.1%
pow231.1%
Applied egg-rr31.1%
unpow231.1%
add-sqr-sqrt43.5%
associate-*r*43.5%
Applied egg-rr43.5%
Final simplification46.6%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -8200000.0)
(* -9.0 (* y (* t z)))
(if (<= z 5.8e-237)
(* x 2.0)
(if (<= z 6.5e-63) (* b (* a 27.0)) (* -9.0 (* t (* y z)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8200000.0) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 5.8e-237) {
tmp = x * 2.0;
} else if (z <= 6.5e-63) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: y, z, and t 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 <= (-8200000.0d0)) then
tmp = (-9.0d0) * (y * (t * z))
else if (z <= 5.8d-237) then
tmp = x * 2.0d0
else if (z <= 6.5d-63) then
tmp = b * (a * 27.0d0)
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8200000.0) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 5.8e-237) {
tmp = x * 2.0;
} else if (z <= 6.5e-63) {
tmp = b * (a * 27.0);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -8200000.0: tmp = -9.0 * (y * (t * z)) elif z <= 5.8e-237: tmp = x * 2.0 elif z <= 6.5e-63: tmp = b * (a * 27.0) else: tmp = -9.0 * (t * (y * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8200000.0) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); elseif (z <= 5.8e-237) tmp = Float64(x * 2.0); elseif (z <= 6.5e-63) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -8200000.0)
tmp = -9.0 * (y * (t * z));
elseif (z <= 5.8e-237)
tmp = x * 2.0;
elseif (z <= 6.5e-63)
tmp = b * (a * 27.0);
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8200000.0], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-237], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.5e-63], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8200000:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-237}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-63}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -8.2e6Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around inf 55.5%
expm1-log1p-u26.4%
expm1-udef26.3%
*-commutative26.3%
*-commutative26.3%
associate-*l*26.3%
Applied egg-rr26.3%
expm1-def26.4%
expm1-log1p55.7%
*-commutative55.7%
associate-*l*45.9%
Simplified45.9%
if -8.2e6 < z < 5.80000000000000022e-237Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in x around inf 45.2%
if 5.80000000000000022e-237 < z < 6.4999999999999998e-63Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 43.5%
associate-*r*43.5%
*-commutative43.5%
associate-*r*43.5%
Simplified43.5%
add-sqr-sqrt31.1%
pow231.1%
Applied egg-rr31.1%
unpow231.1%
add-sqr-sqrt43.5%
associate-*r*43.5%
Applied egg-rr43.5%
if 6.4999999999999998e-63 < z Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*93.2%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around inf 43.9%
Final simplification44.8%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -450000000.0)
(* -9.0 (* y (* t z)))
(if (<= z 1.75e-248)
(* x 2.0)
(if (<= z 3.5e-65) (* b (* a 27.0)) (* t (* z (* y -9.0)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -450000000.0) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 1.75e-248) {
tmp = x * 2.0;
} else if (z <= 3.5e-65) {
tmp = b * (a * 27.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t 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 <= (-450000000.0d0)) then
tmp = (-9.0d0) * (y * (t * z))
else if (z <= 1.75d-248) then
tmp = x * 2.0d0
else if (z <= 3.5d-65) then
tmp = b * (a * 27.0d0)
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -450000000.0) {
tmp = -9.0 * (y * (t * z));
} else if (z <= 1.75e-248) {
tmp = x * 2.0;
} else if (z <= 3.5e-65) {
tmp = b * (a * 27.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -450000000.0: tmp = -9.0 * (y * (t * z)) elif z <= 1.75e-248: tmp = x * 2.0 elif z <= 3.5e-65: tmp = b * (a * 27.0) else: tmp = t * (z * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -450000000.0) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); elseif (z <= 1.75e-248) tmp = Float64(x * 2.0); elseif (z <= 3.5e-65) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -450000000.0)
tmp = -9.0 * (y * (t * z));
elseif (z <= 1.75e-248)
tmp = x * 2.0;
elseif (z <= 3.5e-65)
tmp = b * (a * 27.0);
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -450000000.0], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-248], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.5e-65], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -450000000:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-248}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-65}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -4.5e8Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around inf 55.5%
expm1-log1p-u26.4%
expm1-udef26.3%
*-commutative26.3%
*-commutative26.3%
associate-*l*26.3%
Applied egg-rr26.3%
expm1-def26.4%
expm1-log1p55.7%
*-commutative55.7%
associate-*l*45.9%
Simplified45.9%
if -4.5e8 < z < 1.74999999999999991e-248Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in x around inf 45.7%
if 1.74999999999999991e-248 < z < 3.50000000000000005e-65Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 45.6%
associate-*r*45.6%
*-commutative45.6%
associate-*r*45.6%
Simplified45.6%
add-sqr-sqrt33.6%
pow233.6%
Applied egg-rr33.6%
unpow233.6%
add-sqr-sqrt45.6%
associate-*r*45.6%
Applied egg-rr45.6%
if 3.50000000000000005e-65 < z Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*93.2%
associate-*l*93.3%
Simplified93.3%
+-commutative93.3%
associate-+r-93.3%
associate-*l*93.2%
Applied egg-rr93.2%
Taylor expanded in y around inf 43.9%
associate-*r*43.8%
associate-*r*46.0%
*-commutative46.0%
Simplified46.0%
Taylor expanded in t around 0 43.9%
associate-*r*46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*r*46.1%
associate-*l*43.9%
*-commutative43.9%
Simplified43.9%
Final simplification45.1%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -48000000.0)
(* z (* -9.0 (* y t)))
(if (<= z 3.4e-241)
(* x 2.0)
(if (<= z 1.7e-68) (* b (* a 27.0)) (* t (* z (* y -9.0)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -48000000.0) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 3.4e-241) {
tmp = x * 2.0;
} else if (z <= 1.7e-68) {
tmp = b * (a * 27.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t 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 <= (-48000000.0d0)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 3.4d-241) then
tmp = x * 2.0d0
else if (z <= 1.7d-68) then
tmp = b * (a * 27.0d0)
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -48000000.0) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 3.4e-241) {
tmp = x * 2.0;
} else if (z <= 1.7e-68) {
tmp = b * (a * 27.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -48000000.0: tmp = z * (-9.0 * (y * t)) elif z <= 3.4e-241: tmp = x * 2.0 elif z <= 1.7e-68: tmp = b * (a * 27.0) else: tmp = t * (z * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -48000000.0) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 3.4e-241) tmp = Float64(x * 2.0); elseif (z <= 1.7e-68) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -48000000.0)
tmp = z * (-9.0 * (y * t));
elseif (z <= 3.4e-241)
tmp = x * 2.0;
elseif (z <= 1.7e-68)
tmp = b * (a * 27.0);
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -48000000.0], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-241], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.7e-68], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -48000000:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-241}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-68}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -4.8e7Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
+-commutative84.9%
associate-+r-84.9%
associate-*l*85.0%
Applied egg-rr85.0%
Taylor expanded in y around inf 55.5%
associate-*r*55.5%
associate-*r*55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in t around 0 55.6%
if -4.8e7 < z < 3.3999999999999999e-241Initial program 98.8%
sub-neg98.8%
sub-neg98.8%
associate-*l*98.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in x around inf 45.7%
if 3.3999999999999999e-241 < z < 1.70000000000000009e-68Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 45.6%
associate-*r*45.6%
*-commutative45.6%
associate-*r*45.6%
Simplified45.6%
add-sqr-sqrt33.6%
pow233.6%
Applied egg-rr33.6%
unpow233.6%
add-sqr-sqrt45.6%
associate-*r*45.6%
Applied egg-rr45.6%
if 1.70000000000000009e-68 < z Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*93.2%
associate-*l*93.3%
Simplified93.3%
+-commutative93.3%
associate-+r-93.3%
associate-*l*93.2%
Applied egg-rr93.2%
Taylor expanded in y around inf 43.9%
associate-*r*43.8%
associate-*r*46.0%
*-commutative46.0%
Simplified46.0%
Taylor expanded in t around 0 43.9%
associate-*r*46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*r*46.1%
associate-*l*43.9%
*-commutative43.9%
Simplified43.9%
Final simplification47.3%
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.75e+60)
(* z (* -9.0 (* y t)))
(if (<= z 2.75e+104)
(+ (* 27.0 (* a b)) (* x 2.0))
(* t (* z (* y -9.0))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.75e+60) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 2.75e+104) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: y, z, and t 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.75d+60)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 2.75d+104) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.75e+60) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 2.75e+104) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.75e+60: tmp = z * (-9.0 * (y * t)) elif z <= 2.75e+104: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = t * (z * (y * -9.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.75e+60) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 2.75e+104) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.75e+60)
tmp = z * (-9.0 * (y * t));
elseif (z <= 2.75e+104)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.75e+60], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.75e+104], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+60}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{+104}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.7500000000000001e60Initial program 89.5%
sub-neg89.5%
sub-neg89.5%
associate-*l*81.8%
associate-*l*81.8%
Simplified81.8%
+-commutative81.8%
associate-+r-81.8%
associate-*l*81.9%
Applied egg-rr81.9%
Taylor expanded in y around inf 59.7%
associate-*r*59.7%
associate-*r*59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in t around 0 59.8%
if -1.7500000000000001e60 < z < 2.75000000000000008e104Initial program 99.3%
sub-neg99.3%
sub-neg99.3%
associate-*l*98.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 76.4%
if 2.75000000000000008e104 < z Initial program 88.6%
sub-neg88.6%
sub-neg88.6%
associate-*l*88.8%
associate-*l*88.9%
Simplified88.9%
+-commutative88.9%
associate-+r-88.9%
associate-*l*88.8%
Applied egg-rr88.8%
Taylor expanded in y around inf 57.3%
associate-*r*57.2%
associate-*r*61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in t around 0 57.3%
associate-*r*61.7%
associate-*r*61.7%
*-commutative61.7%
associate-*r*61.7%
associate-*l*57.3%
*-commutative57.3%
Simplified57.3%
Final simplification70.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.8e-23) (not (<= x 2.1e+43))) (* x 2.0) (* 27.0 (* a b))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.8e-23) || !(x <= 2.1e+43)) {
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.
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-23)) .or. (.not. (x <= 2.1d+43))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.8e-23) || !(x <= 2.1e+43)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.8e-23) or not (x <= 2.1e+43): tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.8e-23) || !(x <= 2.1e+43)) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x <= -4.8e-23) || ~((x <= 2.1e+43)))
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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.8e-23], N[Not[LessEqual[x, 2.1e+43]], $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-23} \lor \neg \left(x \leq 2.1 \cdot 10^{+43}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -4.79999999999999993e-23 or 2.10000000000000002e43 < x Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*96.8%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in x around inf 55.9%
if -4.79999999999999993e-23 < x < 2.10000000000000002e43Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around inf 44.0%
Final simplification50.0%
NOTE: y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -3e-29) (not (<= x 1.08e+42))) (* x 2.0) (* a (* 27.0 b))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -3e-29) || !(x <= 1.08e+42)) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
NOTE: y, z, and t 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 <= (-3d-29)) .or. (.not. (x <= 1.08d+42))) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert y < z && z < t;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -3e-29) || !(x <= 1.08e+42)) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -3e-29) or not (x <= 1.08e+42): tmp = x * 2.0 else: tmp = a * (27.0 * b) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -3e-29) || !(x <= 1.08e+42)) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * b)); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x <= -3e-29) || ~((x <= 1.08e+42)))
tmp = x * 2.0;
else
tmp = a * (27.0 * b);
end
tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -3e-29], N[Not[LessEqual[x, 1.08e+42]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{-29} \lor \neg \left(x \leq 1.08 \cdot 10^{+42}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if x < -3.0000000000000003e-29 or 1.08e42 < x Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*96.8%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in x around inf 55.9%
if -3.0000000000000003e-29 < x < 1.08e42Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around inf 44.0%
associate-*r*44.0%
*-commutative44.0%
associate-*r*44.0%
Simplified44.0%
Final simplification50.1%
NOTE: y, z, and t 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);
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.
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;
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]) def code(x, y, z, t, a, b): return x * 2.0
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
y, z, t = num2cell(sort([y, z, t])){:}
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. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
x \cdot 2
\end{array}
Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 36.6%
Final simplification36.6%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2023336
(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)))