
(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 14 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 (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 93.9%
+-commutative93.9%
associate-+r-93.9%
cancel-sign-sub-inv93.9%
*-commutative93.9%
distribute-rgt-neg-out93.9%
associate-*r*96.5%
*-commutative96.5%
distribute-rgt-neg-in96.5%
associate-+r+96.5%
sub-neg96.5%
associate-*l*96.5%
fma-def96.9%
fma-neg96.9%
associate-*l*96.9%
*-commutative96.9%
associate-*r*96.5%
distribute-rgt-neg-in96.5%
Simplified96.5%
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
(let* ((t_1 (* 9.0 (* y (* t z)))) (t_2 (* b (* a 27.0))))
(if (<= t_2 -2e+145)
(- (* 27.0 (* a b)) t_1)
(if (<= t_2 1e-58) (- (* x 2.0) t_1) (- (* (* 9.0 (* a b)) 3.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 * (y * (t * z));
double t_2 = b * (a * 27.0);
double tmp;
if (t_2 <= -2e+145) {
tmp = (27.0 * (a * b)) - t_1;
} else if (t_2 <= 1e-58) {
tmp = (x * 2.0) - t_1;
} else {
tmp = ((9.0 * (a * b)) * 3.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 * (y * (t * z))
t_2 = b * (a * 27.0d0)
if (t_2 <= (-2d+145)) then
tmp = (27.0d0 * (a * b)) - t_1
else if (t_2 <= 1d-58) then
tmp = (x * 2.0d0) - t_1
else
tmp = ((9.0d0 * (a * b)) * 3.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 * (y * (t * z));
double t_2 = b * (a * 27.0);
double tmp;
if (t_2 <= -2e+145) {
tmp = (27.0 * (a * b)) - t_1;
} else if (t_2 <= 1e-58) {
tmp = (x * 2.0) - t_1;
} else {
tmp = ((9.0 * (a * b)) * 3.0) - t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 9.0 * (y * (t * z)) t_2 = b * (a * 27.0) tmp = 0 if t_2 <= -2e+145: tmp = (27.0 * (a * b)) - t_1 elif t_2 <= 1e-58: tmp = (x * 2.0) - t_1 else: tmp = ((9.0 * (a * b)) * 3.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(y * Float64(t * z))) t_2 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t_2 <= -2e+145) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); elseif (t_2 <= 1e-58) tmp = Float64(Float64(x * 2.0) - t_1); else tmp = Float64(Float64(Float64(9.0 * Float64(a * b)) * 3.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 * (y * (t * z));
t_2 = b * (a * 27.0);
tmp = 0.0;
if (t_2 <= -2e+145)
tmp = (27.0 * (a * b)) - t_1;
elseif (t_2 <= 1e-58)
tmp = (x * 2.0) - t_1;
else
tmp = ((9.0 * (a * b)) * 3.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[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+145], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e-58], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(9.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] * 3.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(y \cdot \left(t \cdot z\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+145}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{elif}\;t_2 \leq 10^{-58}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(a \cdot b\right)\right) \cdot 3 - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -2e145Initial program 87.4%
sub-neg87.4%
distribute-lft-neg-in87.4%
associate-*l*87.4%
*-commutative87.4%
*-commutative87.4%
cancel-sign-sub-inv87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.4%
associate-*l*89.9%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in x around 0 85.1%
if -2e145 < (*.f64 (*.f64 a 27) b) < 1e-58Initial program 93.9%
sub-neg93.9%
distribute-lft-neg-in93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in a around 0 85.5%
if 1e-58 < (*.f64 (*.f64 a 27) b) Initial program 97.2%
sub-neg97.2%
distribute-lft-neg-in97.2%
associate-*l*97.3%
*-commutative97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
*-commutative97.3%
*-commutative97.3%
associate-*l*97.2%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around 0 87.6%
add-cbrt-cube56.0%
pow356.0%
unpow-prod-down56.0%
metadata-eval56.0%
Applied egg-rr56.0%
Applied egg-rr87.7%
Final simplification86.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
(let* ((t_1 (* 9.0 (* y (* t z)))) (t_2 (* b (* a 27.0))))
(if (<= t_2 -2e+145)
(- (* 27.0 (* a b)) t_1)
(if (<= t_2 1e-58) (- (* x 2.0) t_1) (- t_2 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 * (y * (t * z));
double t_2 = b * (a * 27.0);
double tmp;
if (t_2 <= -2e+145) {
tmp = (27.0 * (a * b)) - t_1;
} else if (t_2 <= 1e-58) {
tmp = (x * 2.0) - t_1;
} else {
tmp = t_2 - 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 * (y * (t * z))
t_2 = b * (a * 27.0d0)
if (t_2 <= (-2d+145)) then
tmp = (27.0d0 * (a * b)) - t_1
else if (t_2 <= 1d-58) then
tmp = (x * 2.0d0) - t_1
else
tmp = t_2 - 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 * (y * (t * z));
double t_2 = b * (a * 27.0);
double tmp;
if (t_2 <= -2e+145) {
tmp = (27.0 * (a * b)) - t_1;
} else if (t_2 <= 1e-58) {
tmp = (x * 2.0) - t_1;
} else {
tmp = t_2 - t_1;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 9.0 * (y * (t * z)) t_2 = b * (a * 27.0) tmp = 0 if t_2 <= -2e+145: tmp = (27.0 * (a * b)) - t_1 elif t_2 <= 1e-58: tmp = (x * 2.0) - t_1 else: tmp = t_2 - 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(y * Float64(t * z))) t_2 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (t_2 <= -2e+145) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); elseif (t_2 <= 1e-58) tmp = Float64(Float64(x * 2.0) - t_1); else tmp = Float64(t_2 - 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 * (y * (t * z));
t_2 = b * (a * 27.0);
tmp = 0.0;
if (t_2 <= -2e+145)
tmp = (27.0 * (a * b)) - t_1;
elseif (t_2 <= 1e-58)
tmp = (x * 2.0) - t_1;
else
tmp = t_2 - 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[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+145], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e-58], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+145}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t_1\\
\mathbf{elif}\;t_2 \leq 10^{-58}:\\
\;\;\;\;x \cdot 2 - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 a 27) b) < -2e145Initial program 87.4%
sub-neg87.4%
distribute-lft-neg-in87.4%
associate-*l*87.4%
*-commutative87.4%
*-commutative87.4%
cancel-sign-sub-inv87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.4%
associate-*l*89.9%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in x around 0 85.1%
if -2e145 < (*.f64 (*.f64 a 27) b) < 1e-58Initial program 93.9%
sub-neg93.9%
distribute-lft-neg-in93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in a around 0 85.5%
if 1e-58 < (*.f64 (*.f64 a 27) b) Initial program 97.2%
sub-neg97.2%
distribute-lft-neg-in97.2%
associate-*l*97.3%
*-commutative97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
*-commutative97.3%
*-commutative97.3%
associate-*l*97.2%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around 0 87.6%
add-cbrt-cube56.0%
pow356.0%
unpow-prod-down56.0%
metadata-eval56.0%
Applied egg-rr56.0%
Applied egg-rr87.7%
Final simplification86.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 -8.5e+35) (- (* 27.0 (* a b)) (* 9.0 (* y (* t z)))) (+ (- (* x 2.0) (* t (* 9.0 (* y z)))) (* b (* a 27.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.5e+35) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (t * z)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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 <= (-8.5d+35)) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (t * z)))
else
tmp = ((x * 2.0d0) - (t * (9.0d0 * (y * z)))) + (b * (a * 27.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 <= -8.5e+35) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (t * z)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -8.5e+35: tmp = (27.0 * (a * b)) - (9.0 * (y * (t * z))) else: tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.5e+35) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(t * z)))); 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
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -8.5e+35)
tmp = (27.0 * (a * b)) - (9.0 * (y * (t * z)));
else
tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.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, -8.5e+35], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+35}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(t \cdot z\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 z < -8.4999999999999995e35Initial program 87.2%
sub-neg87.2%
distribute-lft-neg-in87.2%
associate-*l*87.2%
*-commutative87.2%
*-commutative87.2%
cancel-sign-sub-inv87.2%
*-commutative87.2%
*-commutative87.2%
associate-*l*87.2%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in x around 0 75.7%
if -8.4999999999999995e35 < z Initial program 96.7%
Taylor expanded in y around 0 96.7%
Final simplification90.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 (if (or (<= z -8.5e-87) (not (<= z 6e-65))) (+ (* a (* 27.0 b)) (* z (* -9.0 (* y t)))) (+ (* 27.0 (* a b)) (* x 2.0))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e-87) || !(z <= 6e-65)) {
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.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 <= (-8.5d-87)) .or. (.not. (z <= 6d-65))) then
tmp = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
else
tmp = (27.0d0 * (a * b)) + (x * 2.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 <= -8.5e-87) || !(z <= 6e-65)) {
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e-87) or not (z <= 6e-65): tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t))) else: tmp = (27.0 * (a * b)) + (x * 2.0) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e-87) || !(z <= 6e-65)) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.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 <= -8.5e-87) || ~((z <= 6e-65)))
tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
else
tmp = (27.0 * (a * b)) + (x * 2.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[Or[LessEqual[z, -8.5e-87], N[Not[LessEqual[z, 6e-65]], $MachinePrecision]], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-87} \lor \neg \left(z \leq 6 \cdot 10^{-65}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -8.5000000000000001e-87 or 5.99999999999999996e-65 < z Initial program 92.4%
sub-neg92.4%
distribute-lft-neg-in92.4%
associate-*l*92.4%
*-commutative92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.4%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around 0 78.2%
add-cbrt-cube56.2%
pow356.2%
unpow-prod-down56.2%
metadata-eval56.2%
Applied egg-rr56.2%
Applied egg-rr81.4%
if -8.5000000000000001e-87 < z < 5.99999999999999996e-65Initial program 97.4%
sub-neg97.4%
distribute-lft-neg-in97.4%
associate-*l*97.4%
*-commutative97.4%
*-commutative97.4%
cancel-sign-sub-inv97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*97.4%
associate-*l*98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in y around 0 84.1%
Final simplification82.2%
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 (* y (* t z)))) (t_2 (* 27.0 (* a b))))
(if (<= x -4e+82)
(+ t_2 (* x 2.0))
(if (<= x 5.8) (- t_2 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 * (y * (t * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (x <= -4e+82) {
tmp = t_2 + (x * 2.0);
} else if (x <= 5.8) {
tmp = t_2 - 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 * (y * (t * z))
t_2 = 27.0d0 * (a * b)
if (x <= (-4d+82)) then
tmp = t_2 + (x * 2.0d0)
else if (x <= 5.8d0) then
tmp = t_2 - 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 * (y * (t * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (x <= -4e+82) {
tmp = t_2 + (x * 2.0);
} else if (x <= 5.8) {
tmp = t_2 - 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 * (y * (t * z)) t_2 = 27.0 * (a * b) tmp = 0 if x <= -4e+82: tmp = t_2 + (x * 2.0) elif x <= 5.8: tmp = t_2 - 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(y * Float64(t * z))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (x <= -4e+82) tmp = Float64(t_2 + Float64(x * 2.0)); elseif (x <= 5.8) tmp = Float64(t_2 - 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 * (y * (t * z));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (x <= -4e+82)
tmp = t_2 + (x * 2.0);
elseif (x <= 5.8)
tmp = t_2 - 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[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e+82], N[(t$95$2 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8], N[(t$95$2 - 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(y \cdot \left(t \cdot z\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{+82}:\\
\;\;\;\;t_2 + x \cdot 2\\
\mathbf{elif}\;x \leq 5.8:\\
\;\;\;\;t_2 - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t_1\\
\end{array}
\end{array}
if x < -3.9999999999999999e82Initial program 95.7%
sub-neg95.7%
distribute-lft-neg-in95.7%
associate-*l*95.7%
*-commutative95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*95.7%
associate-*l*91.4%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in y around 0 81.2%
if -3.9999999999999999e82 < x < 5.79999999999999982Initial program 92.6%
sub-neg92.6%
distribute-lft-neg-in92.6%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*92.6%
associate-*l*96.1%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around 0 87.0%
if 5.79999999999999982 < x Initial program 96.2%
sub-neg96.2%
distribute-lft-neg-in96.2%
associate-*l*96.2%
*-commutative96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
*-commutative96.2%
*-commutative96.2%
associate-*l*96.2%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around 0 83.1%
Final simplification85.2%
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) (* (* y 9.0) (* t z))) (* a (* 27.0 b))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
}
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) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
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 * 9.0) * (t * z))) + (a * (27.0 * b));
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b))
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b))) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
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[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 93.9%
sub-neg93.9%
distribute-lft-neg-in93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Final simplification96.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 (* 27.0 (* a b))) (t_2 (* -9.0 (* y (* t z)))))
(if (<= z -4.3e-68)
t_2
(if (<= z -5.8e-147)
t_1
(if (<= z -3.3e-283) (* x 2.0) (if (<= z 1.4e-19) t_1 t_2))))))assert(y < z && z < t);
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 * (t * z));
double tmp;
if (z <= -4.3e-68) {
tmp = t_2;
} else if (z <= -5.8e-147) {
tmp = t_1;
} else if (z <= -3.3e-283) {
tmp = x * 2.0;
} else if (z <= 1.4e-19) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (y * (t * z))
if (z <= (-4.3d-68)) then
tmp = t_2
else if (z <= (-5.8d-147)) then
tmp = t_1
else if (z <= (-3.3d-283)) then
tmp = x * 2.0d0
else if (z <= 1.4d-19) then
tmp = t_1
else
tmp = t_2
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 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (t * z));
double tmp;
if (z <= -4.3e-68) {
tmp = t_2;
} else if (z <= -5.8e-147) {
tmp = t_1;
} else if (z <= -3.3e-283) {
tmp = x * 2.0;
} else if (z <= 1.4e-19) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (y * (t * z)) tmp = 0 if z <= -4.3e-68: tmp = t_2 elif z <= -5.8e-147: tmp = t_1 elif z <= -3.3e-283: tmp = x * 2.0 elif z <= 1.4e-19: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(y * Float64(t * z))) tmp = 0.0 if (z <= -4.3e-68) tmp = t_2; elseif (z <= -5.8e-147) tmp = t_1; elseif (z <= -3.3e-283) tmp = Float64(x * 2.0); elseif (z <= 1.4e-19) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (y * (t * z));
tmp = 0.0;
if (z <= -4.3e-68)
tmp = t_2;
elseif (z <= -5.8e-147)
tmp = t_1;
elseif (z <= -3.3e-283)
tmp = x * 2.0;
elseif (z <= 1.4e-19)
tmp = t_1;
else
tmp = t_2;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e-68], t$95$2, If[LessEqual[z, -5.8e-147], t$95$1, If[LessEqual[z, -3.3e-283], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-19], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{-68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-283}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.3000000000000001e-68 or 1.40000000000000001e-19 < z Initial program 91.9%
sub-neg91.9%
distribute-lft-neg-in91.9%
associate-*l*91.9%
*-commutative91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
*-commutative91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 50.2%
if -4.3000000000000001e-68 < z < -5.8000000000000002e-147 or -3.30000000000000019e-283 < z < 1.40000000000000001e-19Initial program 97.1%
sub-neg97.1%
distribute-lft-neg-in97.1%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-*l*98.3%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in x around 0 65.7%
Taylor expanded in a around inf 47.2%
if -5.8000000000000002e-147 < z < -3.30000000000000019e-283Initial program 99.7%
sub-neg99.7%
distribute-lft-neg-in99.7%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.7%
associate-*l*99.6%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in x around inf 38.7%
Final simplification48.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 (* 27.0 (* a b))))
(if (<= z -8.3e-66)
(* y (* t (* -9.0 z)))
(if (<= z -2.2e-147)
t_1
(if (<= z -3.3e-283)
(* x 2.0)
(if (<= z 8.5e-21) t_1 (* -9.0 (* y (* t z)))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -8.3e-66) {
tmp = y * (t * (-9.0 * z));
} else if (z <= -2.2e-147) {
tmp = t_1;
} else if (z <= -3.3e-283) {
tmp = x * 2.0;
} else if (z <= 8.5e-21) {
tmp = t_1;
} else {
tmp = -9.0 * (y * (t * 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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-8.3d-66)) then
tmp = y * (t * ((-9.0d0) * z))
else if (z <= (-2.2d-147)) then
tmp = t_1
else if (z <= (-3.3d-283)) then
tmp = x * 2.0d0
else if (z <= 8.5d-21) then
tmp = t_1
else
tmp = (-9.0d0) * (y * (t * 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -8.3e-66) {
tmp = y * (t * (-9.0 * z));
} else if (z <= -2.2e-147) {
tmp = t_1;
} else if (z <= -3.3e-283) {
tmp = x * 2.0;
} else if (z <= 8.5e-21) {
tmp = t_1;
} else {
tmp = -9.0 * (y * (t * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -8.3e-66: tmp = y * (t * (-9.0 * z)) elif z <= -2.2e-147: tmp = t_1 elif z <= -3.3e-283: tmp = x * 2.0 elif z <= 8.5e-21: tmp = t_1 else: tmp = -9.0 * (y * (t * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -8.3e-66) tmp = Float64(y * Float64(t * Float64(-9.0 * z))); elseif (z <= -2.2e-147) tmp = t_1; elseif (z <= -3.3e-283) tmp = Float64(x * 2.0); elseif (z <= 8.5e-21) tmp = t_1; else tmp = Float64(-9.0 * Float64(y * Float64(t * z))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -8.3e-66)
tmp = y * (t * (-9.0 * z));
elseif (z <= -2.2e-147)
tmp = t_1;
elseif (z <= -3.3e-283)
tmp = x * 2.0;
elseif (z <= 8.5e-21)
tmp = t_1;
else
tmp = -9.0 * (y * (t * 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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.3e-66], N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-147], t$95$1, If[LessEqual[z, -3.3e-283], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 8.5e-21], t$95$1, N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -8.3 \cdot 10^{-66}:\\
\;\;\;\;y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-283}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -8.2999999999999995e-66Initial program 89.4%
sub-neg89.4%
distribute-lft-neg-in89.4%
associate-*l*89.4%
*-commutative89.4%
*-commutative89.4%
cancel-sign-sub-inv89.4%
*-commutative89.4%
*-commutative89.4%
associate-*l*89.4%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in y around inf 53.1%
*-commutative53.1%
associate-*r*53.0%
associate-*r*53.1%
associate-*l*53.1%
Simplified53.1%
if -8.2999999999999995e-66 < z < -2.2000000000000001e-147 or -3.30000000000000019e-283 < z < 8.4999999999999993e-21Initial program 97.1%
sub-neg97.1%
distribute-lft-neg-in97.1%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-*l*98.3%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in x around 0 65.7%
Taylor expanded in a around inf 47.2%
if -2.2000000000000001e-147 < z < -3.30000000000000019e-283Initial program 99.7%
sub-neg99.7%
distribute-lft-neg-in99.7%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.7%
associate-*l*99.6%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in x around inf 38.7%
if 8.4999999999999993e-21 < z Initial program 94.8%
sub-neg94.8%
distribute-lft-neg-in94.8%
associate-*l*94.8%
*-commutative94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
*-commutative94.8%
*-commutative94.8%
associate-*l*94.8%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in y around inf 46.8%
Final simplification48.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 (* 27.0 (* a b))) (t_2 (* z (* t (* y -9.0)))))
(if (<= z -2.2e-63)
t_2
(if (<= z -3.1e-147)
t_1
(if (<= z -3.3e-283) (* x 2.0) (if (<= z 1.45e-20) t_1 t_2))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = z * (t * (y * -9.0));
double tmp;
if (z <= -2.2e-63) {
tmp = t_2;
} else if (z <= -3.1e-147) {
tmp = t_1;
} else if (z <= -3.3e-283) {
tmp = x * 2.0;
} else if (z <= 1.45e-20) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = 27.0d0 * (a * b)
t_2 = z * (t * (y * (-9.0d0)))
if (z <= (-2.2d-63)) then
tmp = t_2
else if (z <= (-3.1d-147)) then
tmp = t_1
else if (z <= (-3.3d-283)) then
tmp = x * 2.0d0
else if (z <= 1.45d-20) then
tmp = t_1
else
tmp = t_2
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 = 27.0 * (a * b);
double t_2 = z * (t * (y * -9.0));
double tmp;
if (z <= -2.2e-63) {
tmp = t_2;
} else if (z <= -3.1e-147) {
tmp = t_1;
} else if (z <= -3.3e-283) {
tmp = x * 2.0;
} else if (z <= 1.45e-20) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = z * (t * (y * -9.0)) tmp = 0 if z <= -2.2e-63: tmp = t_2 elif z <= -3.1e-147: tmp = t_1 elif z <= -3.3e-283: tmp = x * 2.0 elif z <= 1.45e-20: tmp = t_1 else: tmp = t_2 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(z * Float64(t * Float64(y * -9.0))) tmp = 0.0 if (z <= -2.2e-63) tmp = t_2; elseif (z <= -3.1e-147) tmp = t_1; elseif (z <= -3.3e-283) tmp = Float64(x * 2.0); elseif (z <= 1.45e-20) tmp = t_1; else tmp = t_2; end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = z * (t * (y * -9.0));
tmp = 0.0;
if (z <= -2.2e-63)
tmp = t_2;
elseif (z <= -3.1e-147)
tmp = t_1;
elseif (z <= -3.3e-283)
tmp = x * 2.0;
elseif (z <= 1.45e-20)
tmp = t_1;
else
tmp = t_2;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-63], t$95$2, If[LessEqual[z, -3.1e-147], t$95$1, If[LessEqual[z, -3.3e-283], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.45e-20], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-283}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.2e-63 or 1.45e-20 < z Initial program 91.9%
sub-neg91.9%
distribute-lft-neg-in91.9%
associate-*l*91.9%
*-commutative91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
*-commutative91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 50.2%
associate-*r*50.2%
*-commutative50.2%
*-commutative50.2%
*-commutative50.2%
associate-*l*51.3%
Simplified51.3%
if -2.2e-63 < z < -3.1000000000000003e-147 or -3.30000000000000019e-283 < z < 1.45e-20Initial program 97.1%
sub-neg97.1%
distribute-lft-neg-in97.1%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-*l*98.3%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in x around 0 65.7%
Taylor expanded in a around inf 47.2%
if -3.1000000000000003e-147 < z < -3.30000000000000019e-283Initial program 99.7%
sub-neg99.7%
distribute-lft-neg-in99.7%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.7%
associate-*l*99.6%
associate-*l*99.5%
Simplified99.5%
Taylor expanded in x around inf 38.7%
Final simplification49.2%
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 (<= z -2.05e-69) (not (<= z 2e-18))) (- (* x 2.0) (* 9.0 (* y (* t z)))) (+ (* 27.0 (* a b)) (* x 2.0))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.05e-69) || !(z <= 2e-18)) {
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.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 <= (-2.05d-69)) .or. (.not. (z <= 2d-18))) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (t * z)))
else
tmp = (27.0d0 * (a * b)) + (x * 2.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 <= -2.05e-69) || !(z <= 2e-18)) {
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.05e-69) or not (z <= 2e-18): tmp = (x * 2.0) - (9.0 * (y * (t * z))) else: tmp = (27.0 * (a * b)) + (x * 2.0) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.05e-69) || !(z <= 2e-18)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.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 <= -2.05e-69) || ~((z <= 2e-18)))
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
else
tmp = (27.0 * (a * b)) + (x * 2.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[Or[LessEqual[z, -2.05e-69], N[Not[LessEqual[z, 2e-18]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-69} \lor \neg \left(z \leq 2 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -2.04999999999999995e-69 or 2.0000000000000001e-18 < z Initial program 91.9%
sub-neg91.9%
distribute-lft-neg-in91.9%
associate-*l*91.9%
*-commutative91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
*-commutative91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 67.2%
if -2.04999999999999995e-69 < z < 2.0000000000000001e-18Initial program 97.7%
sub-neg97.7%
distribute-lft-neg-in97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-*l*98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in y around 0 80.6%
Final simplification71.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 -1.06e+49) (* z (* y (* t -9.0))) (if (<= z 2.3e-19) (+ (* 27.0 (* a b)) (* x 2.0)) (* z (* t (* 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.06e+49) {
tmp = z * (y * (t * -9.0));
} else if (z <= 2.3e-19) {
tmp = (27.0 * (a * b)) + (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.
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.06d+49)) then
tmp = z * (y * (t * (-9.0d0)))
else if (z <= 2.3d-19) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = z * (t * (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.06e+49) {
tmp = z * (y * (t * -9.0));
} else if (z <= 2.3e-19) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = z * (t * (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.06e+49: tmp = z * (y * (t * -9.0)) elif z <= 2.3e-19: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = z * (t * (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.06e+49) tmp = Float64(z * Float64(y * Float64(t * -9.0))); elseif (z <= 2.3e-19) tmp = Float64(Float64(27.0 * Float64(a * b)) + 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.06e+49)
tmp = z * (y * (t * -9.0));
elseif (z <= 2.3e-19)
tmp = (27.0 * (a * b)) + (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.06e+49], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-19], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * 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.06 \cdot 10^{+49}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-19}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.06e49Initial program 87.0%
sub-neg87.0%
distribute-lft-neg-in87.0%
associate-*l*87.0%
*-commutative87.0%
*-commutative87.0%
cancel-sign-sub-inv87.0%
*-commutative87.0%
*-commutative87.0%
associate-*l*87.0%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around inf 60.6%
associate-*r*60.7%
*-commutative60.7%
*-commutative60.7%
*-commutative60.7%
associate-*l*60.6%
Simplified60.6%
Taylor expanded in t around 0 60.6%
associate-*r*60.6%
*-commutative60.6%
associate-*l*60.6%
Simplified60.6%
if -1.06e49 < z < 2.2999999999999998e-19Initial program 98.0%
sub-neg98.0%
distribute-lft-neg-in98.0%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
*-commutative98.0%
*-commutative98.0%
associate-*l*98.0%
associate-*l*98.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 81.0%
if 2.2999999999999998e-19 < z Initial program 94.8%
sub-neg94.8%
distribute-lft-neg-in94.8%
associate-*l*94.8%
*-commutative94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
*-commutative94.8%
*-commutative94.8%
associate-*l*94.8%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in y around inf 46.8%
associate-*r*46.8%
*-commutative46.8%
*-commutative46.8%
*-commutative46.8%
associate-*l*49.2%
Simplified49.2%
Final simplification65.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 (if (<= x -7.6e+82) (* x 2.0) (if (<= x 8.0) (* 27.0 (* a b)) (* x 2.0))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.6e+82) {
tmp = x * 2.0;
} else if (x <= 8.0) {
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.
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 <= (-7.6d+82)) then
tmp = x * 2.0d0
else if (x <= 8.0d0) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.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 (x <= -7.6e+82) {
tmp = x * 2.0;
} else if (x <= 8.0) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if x <= -7.6e+82: tmp = x * 2.0 elif x <= 8.0: tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.6e+82) tmp = Float64(x * 2.0); elseif (x <= 8.0) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -7.6e+82)
tmp = x * 2.0;
elseif (x <= 8.0)
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.6e+82], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 8.0], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{+82}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;x \leq 8:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if x < -7.60000000000000067e82 or 8 < x Initial program 96.0%
sub-neg96.0%
distribute-lft-neg-in96.0%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.0%
associate-*l*95.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in x around inf 48.7%
if -7.60000000000000067e82 < x < 8Initial program 92.6%
sub-neg92.6%
distribute-lft-neg-in92.6%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*92.6%
associate-*l*96.1%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around 0 87.0%
Taylor expanded in a around inf 48.3%
Final simplification48.4%
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 93.9%
sub-neg93.9%
distribute-lft-neg-in93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 25.0%
Final simplification25.0%
(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 2023274
(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)))