
(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 18 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 (<= (* (* y 9.0) z) 1e+136) (fma x 2.0 (fma t (* (* y z) -9.0) (* b (* a 27.0)))) (fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 1e+136) {
tmp = fma(x, 2.0, fma(t, ((y * z) * -9.0), (b * (a * 27.0))));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= 1e+136) tmp = fma(x, 2.0, fma(t, Float64(Float64(y * z) * -9.0), Float64(b * Float64(a * 27.0)))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); 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[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 1e+136], N[(x * 2.0 + N[(t * N[(N[(y * z), $MachinePrecision] * -9.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(t, \left(y \cdot z\right) \cdot -9, b \cdot \left(a \cdot 27\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.00000000000000006e136Initial program 96.8%
associate-+l-96.8%
fma-neg96.8%
neg-sub096.8%
associate-+l-96.8%
neg-sub096.8%
*-commutative96.8%
distribute-rgt-neg-in96.8%
fma-def96.8%
*-commutative96.8%
associate-*r*96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
metadata-eval96.8%
Simplified96.8%
if 1.00000000000000006e136 < (*.f64 (*.f64 y 9) z) Initial program 85.0%
+-commutative85.0%
associate-*l*85.0%
fma-def88.2%
associate-*l*99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification97.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 (* (* y 9.0) z)))
(if (<= t_1 1e+136)
(+ (* b (* a 27.0)) (- (* x 2.0) (* t_1 t)))
(fma a (* 27.0 b) (- (* x 2.0) (* 9.0 (* y (* z t))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+136) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t_1 * t));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (9.0 * (y * (z * t)))));
}
return tmp;
}
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 1e+136) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t_1 * t))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))))); 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_] := Block[{t$95$1 = N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+136], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 10^{+136}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t_1 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.00000000000000006e136Initial program 96.8%
if 1.00000000000000006e136 < (*.f64 (*.f64 y 9) z) Initial program 85.0%
+-commutative85.0%
associate-*l*85.0%
fma-def88.2%
associate-*l*99.9%
*-commutative99.9%
associate-*l*99.9%
Simplified99.9%
Final simplification97.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 (* t (* y z)))))
(if (<= z -2.7e+59)
(* -9.0 (* y (* z t)))
(if (<= z -6800000000000.0)
(* x 2.0)
(if (<= z -6.8e-46)
t_1
(if (<= z -8.2e-75)
(* 27.0 (* a b))
(if (<= z -9e-148)
t_1
(if (<= z -2.5e-266)
(* b (* a 27.0))
(if (<= z 1.4e-287)
(* x 2.0)
(if (<= z 2500000000000.0) (* a (* 27.0 b)) 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 <= -2.7e+59) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -6800000000000.0) {
tmp = x * 2.0;
} else if (z <= -6.8e-46) {
tmp = t_1;
} else if (z <= -8.2e-75) {
tmp = 27.0 * (a * b);
} else if (z <= -9e-148) {
tmp = t_1;
} else if (z <= -2.5e-266) {
tmp = b * (a * 27.0);
} else if (z <= 1.4e-287) {
tmp = x * 2.0;
} else if (z <= 2500000000000.0) {
tmp = a * (27.0 * b);
} 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 <= (-2.7d+59)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-6800000000000.0d0)) then
tmp = x * 2.0d0
else if (z <= (-6.8d-46)) then
tmp = t_1
else if (z <= (-8.2d-75)) then
tmp = 27.0d0 * (a * b)
else if (z <= (-9d-148)) then
tmp = t_1
else if (z <= (-2.5d-266)) then
tmp = b * (a * 27.0d0)
else if (z <= 1.4d-287) then
tmp = x * 2.0d0
else if (z <= 2500000000000.0d0) then
tmp = a * (27.0d0 * b)
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 <= -2.7e+59) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -6800000000000.0) {
tmp = x * 2.0;
} else if (z <= -6.8e-46) {
tmp = t_1;
} else if (z <= -8.2e-75) {
tmp = 27.0 * (a * b);
} else if (z <= -9e-148) {
tmp = t_1;
} else if (z <= -2.5e-266) {
tmp = b * (a * 27.0);
} else if (z <= 1.4e-287) {
tmp = x * 2.0;
} else if (z <= 2500000000000.0) {
tmp = a * (27.0 * b);
} 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 <= -2.7e+59: tmp = -9.0 * (y * (z * t)) elif z <= -6800000000000.0: tmp = x * 2.0 elif z <= -6.8e-46: tmp = t_1 elif z <= -8.2e-75: tmp = 27.0 * (a * b) elif z <= -9e-148: tmp = t_1 elif z <= -2.5e-266: tmp = b * (a * 27.0) elif z <= 1.4e-287: tmp = x * 2.0 elif z <= 2500000000000.0: tmp = a * (27.0 * b) 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 <= -2.7e+59) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -6800000000000.0) tmp = Float64(x * 2.0); elseif (z <= -6.8e-46) tmp = t_1; elseif (z <= -8.2e-75) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= -9e-148) tmp = t_1; elseif (z <= -2.5e-266) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.4e-287) tmp = Float64(x * 2.0); elseif (z <= 2500000000000.0) tmp = Float64(a * Float64(27.0 * b)); 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 <= -2.7e+59)
tmp = -9.0 * (y * (z * t));
elseif (z <= -6800000000000.0)
tmp = x * 2.0;
elseif (z <= -6.8e-46)
tmp = t_1;
elseif (z <= -8.2e-75)
tmp = 27.0 * (a * b);
elseif (z <= -9e-148)
tmp = t_1;
elseif (z <= -2.5e-266)
tmp = b * (a * 27.0);
elseif (z <= 1.4e-287)
tmp = x * 2.0;
elseif (z <= 2500000000000.0)
tmp = a * (27.0 * b);
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, -2.7e+59], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6800000000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -6.8e-46], t$95$1, If[LessEqual[z, -8.2e-75], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-148], t$95$1, If[LessEqual[z, -2.5e-266], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-287], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2500000000000.0], N[(a * N[(27.0 * b), $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 -2.7 \cdot 10^{+59}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -6800000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-75}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-266}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-287}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2500000000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.7000000000000001e59Initial program 90.3%
Taylor expanded in y around inf 48.6%
if -2.7000000000000001e59 < z < -6.8e12 or -2.49999999999999996e-266 < z < 1.4000000000000001e-287Initial program 99.9%
Taylor expanded in x around inf 49.3%
if -6.8e12 < z < -6.79999999999999992e-46 or -8.20000000000000005e-75 < z < -9.00000000000000029e-148 or 2.5e12 < z Initial program 92.9%
Taylor expanded in y around 0 88.2%
*-commutative88.2%
*-commutative88.2%
associate-*l*88.2%
associate-*r*88.1%
associate-*l*96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in z around inf 38.4%
*-commutative38.4%
*-commutative38.4%
associate-*l*38.5%
*-commutative38.5%
associate-*r*38.4%
Simplified38.4%
Taylor expanded in y around 0 38.4%
associate-*r*45.5%
*-commutative45.5%
associate-*l*41.7%
Simplified41.7%
if -6.79999999999999992e-46 < z < -8.20000000000000005e-75Initial program 99.7%
Taylor expanded in a around inf 40.6%
if -9.00000000000000029e-148 < z < -2.49999999999999996e-266Initial program 99.7%
Taylor expanded in x around 0 73.0%
fma-neg73.0%
*-commutative73.0%
*-commutative73.0%
associate-*l*73.0%
distribute-lft-neg-in73.0%
distribute-lft-neg-in73.0%
metadata-eval73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in a around inf 54.6%
associate-*r*54.7%
Simplified54.7%
if 1.4000000000000001e-287 < z < 2.5e12Initial program 100.0%
Taylor expanded in x around 0 59.5%
fma-neg59.5%
*-commutative59.5%
*-commutative59.5%
associate-*l*59.5%
distribute-lft-neg-in59.5%
distribute-lft-neg-in59.5%
metadata-eval59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in a around inf 49.9%
*-commutative49.9%
associate-*l*49.9%
Simplified49.9%
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
(let* ((t_1 (* -9.0 (* t (* y z)))) (t_2 (* y (* -9.0 (* z t)))))
(if (<= z -2.7e+59)
t_2
(if (<= z -6800000000000.0)
(* x 2.0)
(if (<= z -9.2e-49)
t_2
(if (<= z -7e-75)
(* 27.0 (* a b))
(if (<= z -2.4e-148)
t_1
(if (<= z -2.2e-266)
(* b (* a 27.0))
(if (<= z 7e-286)
(* x 2.0)
(if (<= z 2500000000000.0) (* a (* 27.0 b)) 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 = y * (-9.0 * (z * t));
double tmp;
if (z <= -2.7e+59) {
tmp = t_2;
} else if (z <= -6800000000000.0) {
tmp = x * 2.0;
} else if (z <= -9.2e-49) {
tmp = t_2;
} else if (z <= -7e-75) {
tmp = 27.0 * (a * b);
} else if (z <= -2.4e-148) {
tmp = t_1;
} else if (z <= -2.2e-266) {
tmp = b * (a * 27.0);
} else if (z <= 7e-286) {
tmp = x * 2.0;
} else if (z <= 2500000000000.0) {
tmp = a * (27.0 * b);
} 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) :: t_2
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
t_2 = y * ((-9.0d0) * (z * t))
if (z <= (-2.7d+59)) then
tmp = t_2
else if (z <= (-6800000000000.0d0)) then
tmp = x * 2.0d0
else if (z <= (-9.2d-49)) then
tmp = t_2
else if (z <= (-7d-75)) then
tmp = 27.0d0 * (a * b)
else if (z <= (-2.4d-148)) then
tmp = t_1
else if (z <= (-2.2d-266)) then
tmp = b * (a * 27.0d0)
else if (z <= 7d-286) then
tmp = x * 2.0d0
else if (z <= 2500000000000.0d0) then
tmp = a * (27.0d0 * b)
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 t_2 = y * (-9.0 * (z * t));
double tmp;
if (z <= -2.7e+59) {
tmp = t_2;
} else if (z <= -6800000000000.0) {
tmp = x * 2.0;
} else if (z <= -9.2e-49) {
tmp = t_2;
} else if (z <= -7e-75) {
tmp = 27.0 * (a * b);
} else if (z <= -2.4e-148) {
tmp = t_1;
} else if (z <= -2.2e-266) {
tmp = b * (a * 27.0);
} else if (z <= 7e-286) {
tmp = x * 2.0;
} else if (z <= 2500000000000.0) {
tmp = a * (27.0 * b);
} 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)) t_2 = y * (-9.0 * (z * t)) tmp = 0 if z <= -2.7e+59: tmp = t_2 elif z <= -6800000000000.0: tmp = x * 2.0 elif z <= -9.2e-49: tmp = t_2 elif z <= -7e-75: tmp = 27.0 * (a * b) elif z <= -2.4e-148: tmp = t_1 elif z <= -2.2e-266: tmp = b * (a * 27.0) elif z <= 7e-286: tmp = x * 2.0 elif z <= 2500000000000.0: tmp = a * (27.0 * b) 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))) t_2 = Float64(y * Float64(-9.0 * Float64(z * t))) tmp = 0.0 if (z <= -2.7e+59) tmp = t_2; elseif (z <= -6800000000000.0) tmp = Float64(x * 2.0); elseif (z <= -9.2e-49) tmp = t_2; elseif (z <= -7e-75) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= -2.4e-148) tmp = t_1; elseif (z <= -2.2e-266) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 7e-286) tmp = Float64(x * 2.0); elseif (z <= 2500000000000.0) tmp = Float64(a * Float64(27.0 * b)); 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));
t_2 = y * (-9.0 * (z * t));
tmp = 0.0;
if (z <= -2.7e+59)
tmp = t_2;
elseif (z <= -6800000000000.0)
tmp = x * 2.0;
elseif (z <= -9.2e-49)
tmp = t_2;
elseif (z <= -7e-75)
tmp = 27.0 * (a * b);
elseif (z <= -2.4e-148)
tmp = t_1;
elseif (z <= -2.2e-266)
tmp = b * (a * 27.0);
elseif (z <= 7e-286)
tmp = x * 2.0;
elseif (z <= 2500000000000.0)
tmp = a * (27.0 * b);
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]}, Block[{t$95$2 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+59], t$95$2, If[LessEqual[z, -6800000000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -9.2e-49], t$95$2, If[LessEqual[z, -7e-75], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-148], t$95$1, If[LessEqual[z, -2.2e-266], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-286], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2500000000000.0], N[(a * N[(27.0 * b), $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)\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6800000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-75}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-266}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-286}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2500000000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.7000000000000001e59 or -6.8e12 < z < -9.1999999999999996e-49Initial program 92.5%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
*-commutative44.0%
associate-*l*44.1%
*-commutative44.1%
*-commutative44.1%
Simplified44.1%
if -2.7000000000000001e59 < z < -6.8e12 or -2.2e-266 < z < 6.99999999999999977e-286Initial program 99.9%
Taylor expanded in x around inf 49.3%
if -9.1999999999999996e-49 < z < -6.9999999999999997e-75Initial program 99.7%
Taylor expanded in a around inf 40.6%
if -6.9999999999999997e-75 < z < -2.4000000000000001e-148 or 2.5e12 < z Initial program 91.6%
Taylor expanded in y around 0 86.1%
*-commutative86.1%
*-commutative86.1%
associate-*l*86.1%
associate-*r*86.0%
associate-*l*96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 40.2%
*-commutative40.2%
*-commutative40.2%
associate-*l*40.3%
*-commutative40.3%
associate-*r*40.2%
Simplified40.2%
Taylor expanded in y around 0 40.2%
associate-*r*47.5%
*-commutative47.5%
associate-*l*44.1%
Simplified44.1%
if -2.4000000000000001e-148 < z < -2.2e-266Initial program 99.7%
Taylor expanded in x around 0 73.0%
fma-neg73.0%
*-commutative73.0%
*-commutative73.0%
associate-*l*73.0%
distribute-lft-neg-in73.0%
distribute-lft-neg-in73.0%
metadata-eval73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in a around inf 54.6%
associate-*r*54.7%
Simplified54.7%
if 6.99999999999999977e-286 < z < 2.5e12Initial program 100.0%
Taylor expanded in x around 0 59.5%
fma-neg59.5%
*-commutative59.5%
*-commutative59.5%
associate-*l*59.5%
distribute-lft-neg-in59.5%
distribute-lft-neg-in59.5%
metadata-eval59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in a around inf 49.9%
*-commutative49.9%
associate-*l*49.9%
Simplified49.9%
Final simplification46.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 (* -9.0 (* t (* y z)))) (t_2 (* (* z t) (* y -9.0))))
(if (<= z -2.7e+59)
t_2
(if (<= z -230000000000.0)
(* x 2.0)
(if (<= z -1.55e-48)
t_2
(if (<= z -6.6e-76)
(* 27.0 (* a b))
(if (<= z -3.5e-149)
t_1
(if (<= z -4.6e-267)
(* b (* a 27.0))
(if (<= z 9.5e-288)
(* x 2.0)
(if (<= z 25000000.0) (* a (* 27.0 b)) 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 = (z * t) * (y * -9.0);
double tmp;
if (z <= -2.7e+59) {
tmp = t_2;
} else if (z <= -230000000000.0) {
tmp = x * 2.0;
} else if (z <= -1.55e-48) {
tmp = t_2;
} else if (z <= -6.6e-76) {
tmp = 27.0 * (a * b);
} else if (z <= -3.5e-149) {
tmp = t_1;
} else if (z <= -4.6e-267) {
tmp = b * (a * 27.0);
} else if (z <= 9.5e-288) {
tmp = x * 2.0;
} else if (z <= 25000000.0) {
tmp = a * (27.0 * b);
} 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) :: t_2
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
t_2 = (z * t) * (y * (-9.0d0))
if (z <= (-2.7d+59)) then
tmp = t_2
else if (z <= (-230000000000.0d0)) then
tmp = x * 2.0d0
else if (z <= (-1.55d-48)) then
tmp = t_2
else if (z <= (-6.6d-76)) then
tmp = 27.0d0 * (a * b)
else if (z <= (-3.5d-149)) then
tmp = t_1
else if (z <= (-4.6d-267)) then
tmp = b * (a * 27.0d0)
else if (z <= 9.5d-288) then
tmp = x * 2.0d0
else if (z <= 25000000.0d0) then
tmp = a * (27.0d0 * b)
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 t_2 = (z * t) * (y * -9.0);
double tmp;
if (z <= -2.7e+59) {
tmp = t_2;
} else if (z <= -230000000000.0) {
tmp = x * 2.0;
} else if (z <= -1.55e-48) {
tmp = t_2;
} else if (z <= -6.6e-76) {
tmp = 27.0 * (a * b);
} else if (z <= -3.5e-149) {
tmp = t_1;
} else if (z <= -4.6e-267) {
tmp = b * (a * 27.0);
} else if (z <= 9.5e-288) {
tmp = x * 2.0;
} else if (z <= 25000000.0) {
tmp = a * (27.0 * b);
} 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)) t_2 = (z * t) * (y * -9.0) tmp = 0 if z <= -2.7e+59: tmp = t_2 elif z <= -230000000000.0: tmp = x * 2.0 elif z <= -1.55e-48: tmp = t_2 elif z <= -6.6e-76: tmp = 27.0 * (a * b) elif z <= -3.5e-149: tmp = t_1 elif z <= -4.6e-267: tmp = b * (a * 27.0) elif z <= 9.5e-288: tmp = x * 2.0 elif z <= 25000000.0: tmp = a * (27.0 * b) 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))) t_2 = Float64(Float64(z * t) * Float64(y * -9.0)) tmp = 0.0 if (z <= -2.7e+59) tmp = t_2; elseif (z <= -230000000000.0) tmp = Float64(x * 2.0); elseif (z <= -1.55e-48) tmp = t_2; elseif (z <= -6.6e-76) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= -3.5e-149) tmp = t_1; elseif (z <= -4.6e-267) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 9.5e-288) tmp = Float64(x * 2.0); elseif (z <= 25000000.0) tmp = Float64(a * Float64(27.0 * b)); 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));
t_2 = (z * t) * (y * -9.0);
tmp = 0.0;
if (z <= -2.7e+59)
tmp = t_2;
elseif (z <= -230000000000.0)
tmp = x * 2.0;
elseif (z <= -1.55e-48)
tmp = t_2;
elseif (z <= -6.6e-76)
tmp = 27.0 * (a * b);
elseif (z <= -3.5e-149)
tmp = t_1;
elseif (z <= -4.6e-267)
tmp = b * (a * 27.0);
elseif (z <= 9.5e-288)
tmp = x * 2.0;
elseif (z <= 25000000.0)
tmp = a * (27.0 * b);
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]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+59], t$95$2, If[LessEqual[z, -230000000000.0], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.55e-48], t$95$2, If[LessEqual[z, -6.6e-76], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e-149], t$95$1, If[LessEqual[z, -4.6e-267], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-288], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 25000000.0], N[(a * N[(27.0 * b), $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)\\
t_2 := \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -230000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-76}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-267}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 25000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.7000000000000001e59 or -2.3e11 < z < -1.55000000000000008e-48Initial program 92.5%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
*-commutative44.0%
associate-*l*44.1%
*-commutative44.1%
*-commutative44.1%
Simplified44.1%
Taylor expanded in y around 0 44.0%
associate-*r*44.1%
Simplified44.1%
if -2.7000000000000001e59 < z < -2.3e11 or -4.6000000000000001e-267 < z < 9.49999999999999955e-288Initial program 99.9%
Taylor expanded in x around inf 49.3%
if -1.55000000000000008e-48 < z < -6.59999999999999967e-76Initial program 99.7%
Taylor expanded in a around inf 40.6%
if -6.59999999999999967e-76 < z < -3.5e-149 or 2.5e7 < z Initial program 91.6%
Taylor expanded in y around 0 86.1%
*-commutative86.1%
*-commutative86.1%
associate-*l*86.1%
associate-*r*86.0%
associate-*l*96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in z around inf 40.2%
*-commutative40.2%
*-commutative40.2%
associate-*l*40.3%
*-commutative40.3%
associate-*r*40.2%
Simplified40.2%
Taylor expanded in y around 0 40.2%
associate-*r*47.5%
*-commutative47.5%
associate-*l*44.1%
Simplified44.1%
if -3.5e-149 < z < -4.6000000000000001e-267Initial program 99.7%
Taylor expanded in x around 0 73.0%
fma-neg73.0%
*-commutative73.0%
*-commutative73.0%
associate-*l*73.0%
distribute-lft-neg-in73.0%
distribute-lft-neg-in73.0%
metadata-eval73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in a around inf 54.6%
associate-*r*54.7%
Simplified54.7%
if 9.49999999999999955e-288 < z < 2.5e7Initial program 100.0%
Taylor expanded in x around 0 59.5%
fma-neg59.5%
*-commutative59.5%
*-commutative59.5%
associate-*l*59.5%
distribute-lft-neg-in59.5%
distribute-lft-neg-in59.5%
metadata-eval59.5%
*-commutative59.5%
Simplified59.5%
Taylor expanded in a around inf 49.9%
*-commutative49.9%
associate-*l*49.9%
Simplified49.9%
Final simplification46.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 (* (* y 9.0) z)))
(if (<= t_1 5e+302)
(+ (* b (* a 27.0)) (- (* x 2.0) (* t_1 t)))
(* y (* -9.0 (* z t))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+302) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t_1 * t));
} else {
tmp = y * (-9.0 * (z * t));
}
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 = (y * 9.0d0) * z
if (t_1 <= 5d+302) then
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t_1 * t))
else
tmp = y * ((-9.0d0) * (z * t))
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+302) {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t_1 * t));
} else {
tmp = y * (-9.0 * (z * t));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+302: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t_1 * t)) else: tmp = y * (-9.0 * (z * t)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+302) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t_1 * t))); else tmp = Float64(y * Float64(-9.0 * Float64(z * t))); end return tmp end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+302)
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t_1 * t));
else
tmp = y * (-9.0 * (z * t));
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[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+302], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t_1 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 5e302Initial program 97.0%
if 5e302 < (*.f64 (*.f64 y 9) z) Initial program 65.9%
Taylor expanded in y around inf 92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*92.9%
*-commutative92.9%
*-commutative92.9%
Simplified92.9%
Final simplification96.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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* t (* y z)))))
(if (<= t -1.35e-125)
t_2
(if (<= t 1.7e-182)
(* a (* 27.0 b))
(if (<= t 1.5e-134)
(* x 2.0)
(if (<= t 2.5e-46)
t_1
(if (<= t 8e-18)
(* x 2.0)
(if (<= t 2.25e+44) t_1 (if (<= t 3e+92) (* x 2.0) 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 * (t * (y * z));
double tmp;
if (t <= -1.35e-125) {
tmp = t_2;
} else if (t <= 1.7e-182) {
tmp = a * (27.0 * b);
} else if (t <= 1.5e-134) {
tmp = x * 2.0;
} else if (t <= 2.5e-46) {
tmp = t_1;
} else if (t <= 8e-18) {
tmp = x * 2.0;
} else if (t <= 2.25e+44) {
tmp = t_1;
} else if (t <= 3e+92) {
tmp = x * 2.0;
} 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) * (t * (y * z))
if (t <= (-1.35d-125)) then
tmp = t_2
else if (t <= 1.7d-182) then
tmp = a * (27.0d0 * b)
else if (t <= 1.5d-134) then
tmp = x * 2.0d0
else if (t <= 2.5d-46) then
tmp = t_1
else if (t <= 8d-18) then
tmp = x * 2.0d0
else if (t <= 2.25d+44) then
tmp = t_1
else if (t <= 3d+92) then
tmp = x * 2.0d0
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 * (t * (y * z));
double tmp;
if (t <= -1.35e-125) {
tmp = t_2;
} else if (t <= 1.7e-182) {
tmp = a * (27.0 * b);
} else if (t <= 1.5e-134) {
tmp = x * 2.0;
} else if (t <= 2.5e-46) {
tmp = t_1;
} else if (t <= 8e-18) {
tmp = x * 2.0;
} else if (t <= 2.25e+44) {
tmp = t_1;
} else if (t <= 3e+92) {
tmp = x * 2.0;
} 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 * (t * (y * z)) tmp = 0 if t <= -1.35e-125: tmp = t_2 elif t <= 1.7e-182: tmp = a * (27.0 * b) elif t <= 1.5e-134: tmp = x * 2.0 elif t <= 2.5e-46: tmp = t_1 elif t <= 8e-18: tmp = x * 2.0 elif t <= 2.25e+44: tmp = t_1 elif t <= 3e+92: tmp = x * 2.0 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(t * Float64(y * z))) tmp = 0.0 if (t <= -1.35e-125) tmp = t_2; elseif (t <= 1.7e-182) tmp = Float64(a * Float64(27.0 * b)); elseif (t <= 1.5e-134) tmp = Float64(x * 2.0); elseif (t <= 2.5e-46) tmp = t_1; elseif (t <= 8e-18) tmp = Float64(x * 2.0); elseif (t <= 2.25e+44) tmp = t_1; elseif (t <= 3e+92) tmp = Float64(x * 2.0); 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 * (t * (y * z));
tmp = 0.0;
if (t <= -1.35e-125)
tmp = t_2;
elseif (t <= 1.7e-182)
tmp = a * (27.0 * b);
elseif (t <= 1.5e-134)
tmp = x * 2.0;
elseif (t <= 2.5e-46)
tmp = t_1;
elseif (t <= 8e-18)
tmp = x * 2.0;
elseif (t <= 2.25e+44)
tmp = t_1;
elseif (t <= 3e+92)
tmp = x * 2.0;
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[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-125], t$95$2, If[LessEqual[t, 1.7e-182], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-134], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 2.5e-46], t$95$1, If[LessEqual[t, 8e-18], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 2.25e+44], t$95$1, If[LessEqual[t, 3e+92], N[(x * 2.0), $MachinePrecision], 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(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-125}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-182}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-134}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+92}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -1.3499999999999999e-125 or 3.00000000000000013e92 < t Initial program 97.1%
Taylor expanded in y around 0 88.2%
*-commutative88.2%
*-commutative88.2%
associate-*l*88.2%
associate-*r*88.2%
associate-*l*93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in z around inf 41.7%
*-commutative41.7%
*-commutative41.7%
associate-*l*41.8%
*-commutative41.8%
associate-*r*41.8%
Simplified41.8%
Taylor expanded in y around 0 41.7%
associate-*r*49.3%
*-commutative49.3%
associate-*l*49.4%
Simplified49.4%
if -1.3499999999999999e-125 < t < 1.69999999999999995e-182Initial program 90.9%
Taylor expanded in x around 0 52.9%
fma-neg53.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*53.0%
distribute-lft-neg-in53.0%
distribute-lft-neg-in53.0%
metadata-eval53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in a around inf 41.1%
*-commutative41.1%
associate-*l*41.1%
Simplified41.1%
if 1.69999999999999995e-182 < t < 1.5e-134 or 2.49999999999999996e-46 < t < 8.0000000000000006e-18 or 2.25e44 < t < 3.00000000000000013e92Initial program 90.8%
Taylor expanded in x around inf 45.3%
if 1.5e-134 < t < 2.49999999999999996e-46 or 8.0000000000000006e-18 < t < 2.25e44Initial program 100.0%
Taylor expanded in a around inf 61.1%
Final simplification48.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 (+ (* a (* 27.0 b)) (* -9.0 (* z (* y t))))))
(if (<= z -4.8e-47)
(- (* x 2.0) (* y (* t (* 9.0 z))))
(if (<= z -2.6e-75)
t_1
(if (<= z -7e-148)
(- (* x 2.0) (* t (* y (* 9.0 z))))
(if (<= z 1.3e-71) (- (* x 2.0) (* a (* b -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 = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
double tmp;
if (z <= -4.8e-47) {
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
} else if (z <= -2.6e-75) {
tmp = t_1;
} else if (z <= -7e-148) {
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
} else if (z <= 1.3e-71) {
tmp = (x * 2.0) - (a * (b * -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 = (a * (27.0d0 * b)) + ((-9.0d0) * (z * (y * t)))
if (z <= (-4.8d-47)) then
tmp = (x * 2.0d0) - (y * (t * (9.0d0 * z)))
else if (z <= (-2.6d-75)) then
tmp = t_1
else if (z <= (-7d-148)) then
tmp = (x * 2.0d0) - (t * (y * (9.0d0 * z)))
else if (z <= 1.3d-71) then
tmp = (x * 2.0d0) - (a * (b * (-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 = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
double tmp;
if (z <= -4.8e-47) {
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
} else if (z <= -2.6e-75) {
tmp = t_1;
} else if (z <= -7e-148) {
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
} else if (z <= 1.3e-71) {
tmp = (x * 2.0) - (a * (b * -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 = (a * (27.0 * b)) + (-9.0 * (z * (y * t))) tmp = 0 if z <= -4.8e-47: tmp = (x * 2.0) - (y * (t * (9.0 * z))) elif z <= -2.6e-75: tmp = t_1 elif z <= -7e-148: tmp = (x * 2.0) - (t * (y * (9.0 * z))) elif z <= 1.3e-71: tmp = (x * 2.0) - (a * (b * -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(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(z * Float64(y * t)))) tmp = 0.0 if (z <= -4.8e-47) tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(9.0 * z)))); elseif (z <= -2.6e-75) tmp = t_1; elseif (z <= -7e-148) tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))); elseif (z <= 1.3e-71) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -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 = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
tmp = 0.0;
if (z <= -4.8e-47)
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
elseif (z <= -2.6e-75)
tmp = t_1;
elseif (z <= -7e-148)
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
elseif (z <= 1.3e-71)
tmp = (x * 2.0) - (a * (b * -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[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-47], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-75], t$95$1, If[LessEqual[z, -7e-148], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-71], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right) + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-47}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(t \cdot \left(9 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-148}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-71}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.7999999999999999e-47Initial program 93.5%
associate-+l-93.5%
sub-neg93.5%
neg-mul-193.5%
metadata-eval93.5%
metadata-eval93.5%
cancel-sign-sub-inv93.5%
metadata-eval93.5%
*-lft-identity93.5%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
sub-neg89.8%
*-commutative89.8%
associate-*r*89.7%
associate-*r*93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
distribute-rgt-neg-in93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in y around inf 65.2%
*-commutative65.2%
associate-*r*73.7%
associate-*r*73.8%
associate-*l*65.3%
Simplified65.3%
if -4.7999999999999999e-47 < z < -2.6e-75 or 1.2999999999999999e-71 < z Initial program 93.6%
Taylor expanded in x around 0 62.4%
cancel-sign-sub-inv62.4%
*-commutative62.4%
associate-*r*62.4%
metadata-eval62.4%
associate-*r*68.5%
Applied egg-rr68.5%
if -2.6e-75 < z < -7.0000000000000001e-148Initial program 91.9%
associate-+l-91.9%
sub-neg91.9%
neg-mul-191.9%
metadata-eval91.9%
metadata-eval91.9%
cancel-sign-sub-inv91.9%
metadata-eval91.9%
*-lft-identity91.9%
associate-*l*84.7%
associate-*l*84.7%
Simplified84.7%
sub-neg84.7%
*-commutative84.7%
associate-*r*84.7%
associate-*r*92.2%
distribute-rgt-neg-in92.2%
*-commutative92.2%
distribute-rgt-neg-in92.2%
metadata-eval92.2%
Applied egg-rr92.2%
flip-+62.6%
div-inv62.6%
Applied egg-rr61.7%
Taylor expanded in y around inf 70.8%
associate-*r*66.5%
*-commutative66.5%
associate-*r*66.6%
*-commutative66.6%
associate-*l*73.4%
Simplified73.4%
if -7.0000000000000001e-148 < z < 1.2999999999999999e-71Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
neg-mul-199.9%
metadata-eval99.9%
metadata-eval99.9%
cancel-sign-sub-inv99.9%
metadata-eval99.9%
*-lft-identity99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 91.8%
*-commutative91.8%
associate-*r*91.8%
Simplified91.8%
Final simplification74.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 -3e-45)
(- (* x 2.0) (* y (* t (* 9.0 z))))
(if (<= z -1.65e-79)
(- (* 27.0 (* a b)) (* 9.0 (* y (* z t))))
(if (<= z -8.6e-148)
(- (* x 2.0) (* t (* y (* 9.0 z))))
(if (<= z 1e-63)
(- (* x 2.0) (* a (* b -27.0)))
(+ (* a (* 27.0 b)) (* -9.0 (* z (* y t)))))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e-45) {
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
} else if (z <= -1.65e-79) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else if (z <= -8.6e-148) {
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
} else if (z <= 1e-63) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
}
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 <= (-3d-45)) then
tmp = (x * 2.0d0) - (y * (t * (9.0d0 * z)))
else if (z <= (-1.65d-79)) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (y * (z * t)))
else if (z <= (-8.6d-148)) then
tmp = (x * 2.0d0) - (t * (y * (9.0d0 * z)))
else if (z <= 1d-63) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * (z * (y * t)))
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 <= -3e-45) {
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
} else if (z <= -1.65e-79) {
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
} else if (z <= -8.6e-148) {
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
} else if (z <= 1e-63) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3e-45: tmp = (x * 2.0) - (y * (t * (9.0 * z))) elif z <= -1.65e-79: tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t))) elif z <= -8.6e-148: tmp = (x * 2.0) - (t * (y * (9.0 * z))) elif z <= 1e-63: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3e-45) tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(9.0 * z)))); elseif (z <= -1.65e-79) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (z <= -8.6e-148) tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))); elseif (z <= 1e-63) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * Float64(z * Float64(y * t)))); 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 <= -3e-45)
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
elseif (z <= -1.65e-79)
tmp = (27.0 * (a * b)) - (9.0 * (y * (z * t)));
elseif (z <= -8.6e-148)
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
elseif (z <= 1e-63)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (a * (27.0 * b)) + (-9.0 * (z * (y * t)));
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, -3e-45], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.65e-79], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.6e-148], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-63], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-45}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(t \cdot \left(9 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-79}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-148}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 10^{-63}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.00000000000000011e-45Initial program 93.5%
associate-+l-93.5%
sub-neg93.5%
neg-mul-193.5%
metadata-eval93.5%
metadata-eval93.5%
cancel-sign-sub-inv93.5%
metadata-eval93.5%
*-lft-identity93.5%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
sub-neg89.8%
*-commutative89.8%
associate-*r*89.7%
associate-*r*93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
distribute-rgt-neg-in93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in y around inf 65.2%
*-commutative65.2%
associate-*r*73.7%
associate-*r*73.8%
associate-*l*65.3%
Simplified65.3%
if -3.00000000000000011e-45 < z < -1.6499999999999999e-79Initial program 99.6%
Taylor expanded in x around 0 82.8%
if -1.6499999999999999e-79 < z < -8.5999999999999997e-148Initial program 91.3%
associate-+l-91.3%
sub-neg91.3%
neg-mul-191.3%
metadata-eval91.3%
metadata-eval91.3%
cancel-sign-sub-inv91.3%
metadata-eval91.3%
*-lft-identity91.3%
associate-*l*83.4%
associate-*l*83.4%
Simplified83.4%
sub-neg83.4%
*-commutative83.4%
associate-*r*83.4%
associate-*r*91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
metadata-eval91.5%
Applied egg-rr91.5%
flip-+59.5%
div-inv59.5%
Applied egg-rr58.5%
Taylor expanded in y around inf 68.3%
associate-*r*63.9%
*-commutative63.9%
associate-*r*63.9%
*-commutative63.9%
associate-*l*71.3%
Simplified71.3%
if -8.5999999999999997e-148 < z < 1.00000000000000007e-63Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
neg-mul-199.9%
metadata-eval99.9%
metadata-eval99.9%
cancel-sign-sub-inv99.9%
metadata-eval99.9%
*-lft-identity99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 91.8%
*-commutative91.8%
associate-*r*91.8%
Simplified91.8%
if 1.00000000000000007e-63 < z Initial program 93.1%
Taylor expanded in x around 0 61.2%
cancel-sign-sub-inv61.2%
*-commutative61.2%
associate-*r*61.2%
metadata-eval61.2%
associate-*r*67.7%
Applied egg-rr67.7%
Final simplification74.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
(let* ((t_1 (- (* x 2.0) (* a (* b -27.0)))))
(if (<= z -4.1e+114)
(* y (* -9.0 (* z t)))
(if (<= z -1950.0)
t_1
(if (<= z -9.2e-39)
(* (* z t) (* y -9.0))
(if (<= z 700000000000.0) t_1 (* -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 t_1 = (x * 2.0) - (a * (b * -27.0));
double tmp;
if (z <= -4.1e+114) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -1950.0) {
tmp = t_1;
} else if (z <= -9.2e-39) {
tmp = (z * t) * (y * -9.0);
} else if (z <= 700000000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) - (a * (b * (-27.0d0)))
if (z <= (-4.1d+114)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-1950.0d0)) then
tmp = t_1
else if (z <= (-9.2d-39)) then
tmp = (z * t) * (y * (-9.0d0))
else if (z <= 700000000000.0d0) then
tmp = t_1
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 t_1 = (x * 2.0) - (a * (b * -27.0));
double tmp;
if (z <= -4.1e+114) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -1950.0) {
tmp = t_1;
} else if (z <= -9.2e-39) {
tmp = (z * t) * (y * -9.0);
} else if (z <= 700000000000.0) {
tmp = t_1;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) - (a * (b * -27.0)) tmp = 0 if z <= -4.1e+114: tmp = y * (-9.0 * (z * t)) elif z <= -1950.0: tmp = t_1 elif z <= -9.2e-39: tmp = (z * t) * (y * -9.0) elif z <= 700000000000.0: tmp = t_1 else: tmp = -9.0 * (t * (y * z)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))) tmp = 0.0 if (z <= -4.1e+114) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -1950.0) tmp = t_1; elseif (z <= -9.2e-39) tmp = Float64(Float64(z * t) * Float64(y * -9.0)); elseif (z <= 700000000000.0) tmp = t_1; 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)
t_1 = (x * 2.0) - (a * (b * -27.0));
tmp = 0.0;
if (z <= -4.1e+114)
tmp = y * (-9.0 * (z * t));
elseif (z <= -1950.0)
tmp = t_1;
elseif (z <= -9.2e-39)
tmp = (z * t) * (y * -9.0);
elseif (z <= 700000000000.0)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+114], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1950.0], t$95$1, If[LessEqual[z, -9.2e-39], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 700000000000.0], t$95$1, 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}
t_1 := x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+114}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1950:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-39}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 700000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -4.1000000000000001e114Initial program 87.2%
Taylor expanded in y around inf 53.7%
*-commutative53.7%
*-commutative53.7%
associate-*l*53.9%
*-commutative53.9%
*-commutative53.9%
Simplified53.9%
if -4.1000000000000001e114 < z < -1950 or -9.20000000000000033e-39 < z < 7e11Initial program 99.1%
associate-+l-99.1%
sub-neg99.1%
neg-mul-199.1%
metadata-eval99.1%
metadata-eval99.1%
cancel-sign-sub-inv99.1%
metadata-eval99.1%
*-lft-identity99.1%
associate-*l*98.5%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 81.9%
*-commutative81.9%
associate-*r*81.9%
Simplified81.9%
if -1950 < z < -9.20000000000000033e-39Initial program 100.0%
Taylor expanded in y around inf 60.5%
*-commutative60.5%
*-commutative60.5%
associate-*l*60.5%
*-commutative60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in y around 0 60.5%
associate-*r*60.2%
Simplified60.2%
if 7e11 < z Initial program 91.6%
Taylor expanded in y around 0 86.3%
*-commutative86.3%
*-commutative86.3%
associate-*l*86.3%
associate-*r*86.3%
associate-*l*98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in z around inf 40.2%
*-commutative40.2%
*-commutative40.2%
associate-*l*40.3%
*-commutative40.3%
associate-*r*40.2%
Simplified40.2%
Taylor expanded in y around 0 40.2%
associate-*r*49.7%
*-commutative49.7%
associate-*l*44.3%
Simplified44.3%
Final simplification67.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 (+ (* b (* a 27.0)) (- (* 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 (b * (a * 27.0)) + ((x * 2.0) - ((y * t) * (9.0 * 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 = (b * (a * 27.0d0)) + ((x * 2.0d0) - ((y * t) * (9.0d0 * 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 (b * (a * 27.0)) + ((x * 2.0) - ((y * t) * (9.0 * z)));
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): return (b * (a * 27.0)) + ((x * 2.0) - ((y * t) * (9.0 * z)))
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(9.0 * z)))) end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
tmp = (b * (a * 27.0)) + ((x * 2.0) - ((y * t) * (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[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(9 \cdot z\right)\right)
\end{array}
Initial program 95.3%
Taylor expanded in y around 0 92.4%
*-commutative92.4%
*-commutative92.4%
associate-*l*92.4%
associate-*r*92.4%
associate-*l*96.4%
*-commutative96.4%
Simplified96.4%
Final simplification96.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 (if (or (<= t -1.05e-148) (not (<= t 1.3e+56))) (- (* x 2.0) (* 9.0 (* y (* z t)))) (- (* x 2.0) (* a (* b -27.0)))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.05e-148) || !(t <= 1.3e+56)) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (a * (b * -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 ((t <= (-1.05d-148)) .or. (.not. (t <= 1.3d+56))) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else
tmp = (x * 2.0d0) - (a * (b * (-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 ((t <= -1.05e-148) || !(t <= 1.3e+56)) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else {
tmp = (x * 2.0) - (a * (b * -27.0));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.05e-148) or not (t <= 1.3e+56): tmp = (x * 2.0) - (9.0 * (y * (z * t))) else: tmp = (x * 2.0) - (a * (b * -27.0)) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.05e-148) || !(t <= 1.3e+56)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -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 ((t <= -1.05e-148) || ~((t <= 1.3e+56)))
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
else
tmp = (x * 2.0) - (a * (b * -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[Or[LessEqual[t, -1.05e-148], N[Not[LessEqual[t, 1.3e+56]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-148} \lor \neg \left(t \leq 1.3 \cdot 10^{+56}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\end{array}
\end{array}
if t < -1.05e-148 or 1.30000000000000005e56 < t Initial program 96.7%
Taylor expanded in a around 0 65.1%
if -1.05e-148 < t < 1.30000000000000005e56Initial program 93.0%
associate-+l-93.0%
sub-neg93.0%
neg-mul-193.0%
metadata-eval93.0%
metadata-eval93.0%
cancel-sign-sub-inv93.0%
metadata-eval93.0%
*-lft-identity93.0%
associate-*l*98.9%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 83.6%
*-commutative83.6%
associate-*r*83.6%
Simplified83.6%
Final simplification72.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 (<= t -1.05e-148)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= t 3.4e+67)
(- (* x 2.0) (* a (* b -27.0)))
(- (* x 2.0) (* t (* y (* 9.0 z)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.05e-148) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (t <= 3.4e+67) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (x * 2.0) - (t * (y * (9.0 * 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 (t <= (-1.05d-148)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (t <= 3.4d+67) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (x * 2.0d0) - (t * (y * (9.0d0 * 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 (t <= -1.05e-148) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (t <= 3.4e+67) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if t <= -1.05e-148: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif t <= 3.4e+67: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (x * 2.0) - (t * (y * (9.0 * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.05e-148) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (t <= 3.4e+67) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * 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 (t <= -1.05e-148)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (t <= 3.4e+67)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (x * 2.0) - (t * (y * (9.0 * 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[t, -1.05e-148], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+67], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-148}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+67}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -1.05e-148Initial program 95.3%
Taylor expanded in a around 0 64.0%
if -1.05e-148 < t < 3.4000000000000002e67Initial program 93.1%
associate-+l-93.1%
sub-neg93.1%
neg-mul-193.1%
metadata-eval93.1%
metadata-eval93.1%
cancel-sign-sub-inv93.1%
metadata-eval93.1%
*-lft-identity93.1%
associate-*l*98.9%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 83.8%
*-commutative83.8%
associate-*r*83.8%
Simplified83.8%
if 3.4000000000000002e67 < t Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*80.7%
associate-*l*80.7%
Simplified80.7%
sub-neg80.7%
*-commutative80.7%
associate-*r*80.8%
associate-*r*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Applied egg-rr99.8%
flip-+30.4%
div-inv30.3%
Applied egg-rr32.4%
Taylor expanded in y around inf 66.9%
associate-*r*86.1%
*-commutative86.1%
associate-*r*86.0%
*-commutative86.0%
associate-*l*84.2%
Simplified84.2%
Final simplification75.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
(if (<= t -1.05e-148)
(- (* x 2.0) (* y (* t (* 9.0 z))))
(if (<= t 2e+66)
(- (* x 2.0) (* a (* b -27.0)))
(- (* x 2.0) (* t (* y (* 9.0 z)))))))assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.05e-148) {
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
} else if (t <= 2e+66) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (x * 2.0) - (t * (y * (9.0 * 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 (t <= (-1.05d-148)) then
tmp = (x * 2.0d0) - (y * (t * (9.0d0 * z)))
else if (t <= 2d+66) then
tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
else
tmp = (x * 2.0d0) - (t * (y * (9.0d0 * 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 (t <= -1.05e-148) {
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
} else if (t <= 2e+66) {
tmp = (x * 2.0) - (a * (b * -27.0));
} else {
tmp = (x * 2.0) - (t * (y * (9.0 * z)));
}
return tmp;
}
[y, z, t] = sort([y, z, t]) def code(x, y, z, t, a, b): tmp = 0 if t <= -1.05e-148: tmp = (x * 2.0) - (y * (t * (9.0 * z))) elif t <= 2e+66: tmp = (x * 2.0) - (a * (b * -27.0)) else: tmp = (x * 2.0) - (t * (y * (9.0 * z))) return tmp
y, z, t = sort([y, z, t]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.05e-148) tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(9.0 * z)))); elseif (t <= 2e+66) tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0))); else tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * 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 (t <= -1.05e-148)
tmp = (x * 2.0) - (y * (t * (9.0 * z)));
elseif (t <= 2e+66)
tmp = (x * 2.0) - (a * (b * -27.0));
else
tmp = (x * 2.0) - (t * (y * (9.0 * 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[t, -1.05e-148], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+66], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-148}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(t \cdot \left(9 \cdot z\right)\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+66}:\\
\;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -1.05e-148Initial program 95.3%
associate-+l-95.3%
sub-neg95.3%
neg-mul-195.3%
metadata-eval95.3%
metadata-eval95.3%
cancel-sign-sub-inv95.3%
metadata-eval95.3%
*-lft-identity95.3%
associate-*l*91.8%
associate-*l*91.7%
Simplified91.7%
sub-neg91.7%
*-commutative91.7%
associate-*r*91.7%
associate-*r*94.4%
distribute-rgt-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
metadata-eval94.4%
Applied egg-rr94.4%
Taylor expanded in y around inf 64.0%
*-commutative64.0%
associate-*r*65.7%
associate-*r*65.8%
associate-*l*64.0%
Simplified64.0%
if -1.05e-148 < t < 1.99999999999999989e66Initial program 93.1%
associate-+l-93.1%
sub-neg93.1%
neg-mul-193.1%
metadata-eval93.1%
metadata-eval93.1%
cancel-sign-sub-inv93.1%
metadata-eval93.1%
*-lft-identity93.1%
associate-*l*98.9%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 83.8%
*-commutative83.8%
associate-*r*83.8%
Simplified83.8%
if 1.99999999999999989e66 < t Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
neg-mul-199.8%
metadata-eval99.8%
metadata-eval99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
*-lft-identity99.8%
associate-*l*80.7%
associate-*l*80.7%
Simplified80.7%
sub-neg80.7%
*-commutative80.7%
associate-*r*80.8%
associate-*r*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Applied egg-rr99.8%
flip-+30.4%
div-inv30.3%
Applied egg-rr32.4%
Taylor expanded in y around inf 66.9%
associate-*r*86.1%
*-commutative86.1%
associate-*r*86.0%
*-commutative86.0%
associate-*l*84.2%
Simplified84.2%
Final simplification75.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 (if (or (<= a -7.2e+18) (not (<= a 1.2e-79))) (* 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 ((a <= -7.2e+18) || !(a <= 1.2e-79)) {
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 ((a <= (-7.2d+18)) .or. (.not. (a <= 1.2d-79))) 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 ((a <= -7.2e+18) || !(a <= 1.2e-79)) {
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 (a <= -7.2e+18) or not (a <= 1.2e-79): 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 ((a <= -7.2e+18) || !(a <= 1.2e-79)) 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 ((a <= -7.2e+18) || ~((a <= 1.2e-79)))
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[Or[LessEqual[a, -7.2e+18], N[Not[LessEqual[a, 1.2e-79]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{+18} \lor \neg \left(a \leq 1.2 \cdot 10^{-79}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -7.2e18 or 1.20000000000000003e-79 < a Initial program 94.6%
Taylor expanded in a around inf 52.8%
if -7.2e18 < a < 1.20000000000000003e-79Initial program 96.3%
Taylor expanded in x around inf 45.6%
Final simplification49.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 (<= a -5.8e+19) (* 27.0 (* a b)) (if (<= a 1.9e-82) (* 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 (a <= -5.8e+19) {
tmp = 27.0 * (a * b);
} else if (a <= 1.9e-82) {
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 (a <= (-5.8d+19)) then
tmp = 27.0d0 * (a * b)
else if (a <= 1.9d-82) 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 (a <= -5.8e+19) {
tmp = 27.0 * (a * b);
} else if (a <= 1.9e-82) {
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 a <= -5.8e+19: tmp = 27.0 * (a * b) elif a <= 1.9e-82: 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 (a <= -5.8e+19) tmp = Float64(27.0 * Float64(a * b)); elseif (a <= 1.9e-82) 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 (a <= -5.8e+19)
tmp = 27.0 * (a * b);
elseif (a <= 1.9e-82)
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[LessEqual[a, -5.8e+19], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.9e-82], 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}\;a \leq -5.8 \cdot 10^{+19}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{-82}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -5.8e19Initial program 95.6%
Taylor expanded in a around inf 52.0%
if -5.8e19 < a < 1.9000000000000001e-82Initial program 96.3%
Taylor expanded in x around inf 45.1%
if 1.9000000000000001e-82 < a Initial program 93.7%
Taylor expanded in x around 0 68.6%
fma-neg68.6%
*-commutative68.6%
*-commutative68.6%
associate-*l*68.6%
distribute-lft-neg-in68.6%
distribute-lft-neg-in68.6%
metadata-eval68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in a around inf 53.0%
*-commutative53.0%
associate-*l*53.0%
Simplified53.0%
Final simplification49.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 (if (<= a -5.4e+20) (* b (* a 27.0)) (if (<= a 9.8e-83) (* 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 (a <= -5.4e+20) {
tmp = b * (a * 27.0);
} else if (a <= 9.8e-83) {
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 (a <= (-5.4d+20)) then
tmp = b * (a * 27.0d0)
else if (a <= 9.8d-83) 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 (a <= -5.4e+20) {
tmp = b * (a * 27.0);
} else if (a <= 9.8e-83) {
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 a <= -5.4e+20: tmp = b * (a * 27.0) elif a <= 9.8e-83: 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 (a <= -5.4e+20) tmp = Float64(b * Float64(a * 27.0)); elseif (a <= 9.8e-83) 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 (a <= -5.4e+20)
tmp = b * (a * 27.0);
elseif (a <= 9.8e-83)
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[LessEqual[a, -5.4e+20], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.8e-83], 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}\;a \leq -5.4 \cdot 10^{+20}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;a \leq 9.8 \cdot 10^{-83}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -5.4e20Initial program 95.6%
Taylor expanded in x around 0 74.3%
fma-neg74.3%
*-commutative74.3%
*-commutative74.3%
associate-*l*74.4%
distribute-lft-neg-in74.4%
distribute-lft-neg-in74.4%
metadata-eval74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in a around inf 52.0%
associate-*r*52.1%
Simplified52.1%
if -5.4e20 < a < 9.8e-83Initial program 96.3%
Taylor expanded in x around inf 45.1%
if 9.8e-83 < a Initial program 93.7%
Taylor expanded in x around 0 68.6%
fma-neg68.6%
*-commutative68.6%
*-commutative68.6%
associate-*l*68.6%
distribute-lft-neg-in68.6%
distribute-lft-neg-in68.6%
metadata-eval68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in a around inf 53.0%
*-commutative53.0%
associate-*l*53.0%
Simplified53.0%
Final simplification49.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 95.3%
Taylor expanded in x around inf 31.9%
Final simplification31.9%
(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 2023199
(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)))