
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* z c))))
(if (<= z -1.95e+183)
(/ (+ (* -4.0 (* a t)) (* 9.0 (* x (/ y z)))) c)
(if (<= z -5.8e-69)
(fma -4.0 (* t (/ a c)) (fma 9.0 (* (/ y z) (/ x c)) t_1))
(if (<= z 9e+79)
(* (+ b (fma x (* 9.0 y) (* a (* (* t 4.0) (- z))))) (/ 1.0 (* z c)))
(- (+ t_1 (* 9.0 (/ (* x y) (* z c)))) (* 4.0 (/ (* a t) c))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -1.95e+183) {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
} else if (z <= -5.8e-69) {
tmp = fma(-4.0, (t * (a / c)), fma(9.0, ((y / z) * (x / c)), t_1));
} else if (z <= 9e+79) {
tmp = (b + fma(x, (9.0 * y), (a * ((t * 4.0) * -z)))) * (1.0 / (z * c));
} else {
tmp = (t_1 + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((a * t) / c));
}
return tmp;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(z * c)) tmp = 0.0 if (z <= -1.95e+183) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(x * Float64(y / z)))) / c); elseif (z <= -5.8e-69) tmp = fma(-4.0, Float64(t * Float64(a / c)), fma(9.0, Float64(Float64(y / z) * Float64(x / c)), t_1)); elseif (z <= 9e+79) tmp = Float64(Float64(b + fma(x, Float64(9.0 * y), Float64(a * Float64(Float64(t * 4.0) * Float64(-z))))) * Float64(1.0 / Float64(z * c))); else tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / Float64(z * c)))) - Float64(4.0 * Float64(Float64(a * t) / c))); end return tmp end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.95e+183], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -5.8e-69], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+79], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision] + N[(a * N[(N[(t * 4.0), $MachinePrecision] * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c}\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+183}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + 9 \cdot \left(x \cdot \frac{y}{z}\right)}{c}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-69}:\\
\;\;\;\;\mathsf{fma}\left(-4, t \cdot \frac{a}{c}, \mathsf{fma}\left(9, \frac{y}{z} \cdot \frac{x}{c}, t\_1\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+79}:\\
\;\;\;\;\left(b + \mathsf{fma}\left(x, 9 \cdot y, a \cdot \left(\left(t \cdot 4\right) \cdot \left(-z\right)\right)\right)\right) \cdot \frac{1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -1.9499999999999999e183Initial program 60.0%
Taylor expanded in b around 0 52.8%
Taylor expanded in x around 0 81.6%
Taylor expanded in c around 0 81.8%
add081.8%
associate-/l*92.5%
Applied egg-rr92.5%
associate-/l*81.8%
associate-*r/92.5%
add092.5%
Simplified92.5%
if -1.9499999999999999e183 < z < -5.7999999999999997e-69Initial program 82.9%
add082.9%
associate-*l*86.4%
Applied egg-rr86.4%
Taylor expanded in x around 0 86.9%
cancel-sign-sub-inv86.9%
metadata-eval86.9%
+-commutative86.9%
fma-define86.9%
associate-/l*83.2%
associate-/r/88.8%
fma-define88.8%
times-frac94.2%
*-commutative94.2%
Simplified94.2%
if -5.7999999999999997e-69 < z < 8.99999999999999987e79Initial program 95.1%
div-inv95.0%
associate-*l*95.0%
fma-neg95.0%
distribute-rgt-neg-in95.0%
associate-*l*95.0%
Applied egg-rr95.0%
if 8.99999999999999987e79 < z Initial program 56.0%
Taylor expanded in x around 0 87.8%
Final simplification93.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ c b))))
(t_2 (* 9.0 (* (/ y z) (/ x c))))
(t_3 (* -4.0 (/ (* a t) c))))
(if (<= x -2.1e+107)
t_2
(if (<= x -6.4e-15)
t_1
(if (<= x -5.4e-166)
t_3
(if (<= x 6.9e-270)
(/ (/ b c) z)
(if (<= x 4.3e-142) t_3 (if (<= x 3.1e-97) t_1 t_2))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = 9.0 * ((y / z) * (x / c));
double t_3 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = t_2;
} else if (x <= -6.4e-15) {
tmp = t_1;
} else if (x <= -5.4e-166) {
tmp = t_3;
} else if (x <= 6.9e-270) {
tmp = (b / c) / z;
} else if (x <= 4.3e-142) {
tmp = t_3;
} else if (x <= 3.1e-97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (z * (c / b))
t_2 = 9.0d0 * ((y / z) * (x / c))
t_3 = (-4.0d0) * ((a * t) / c)
if (x <= (-2.1d+107)) then
tmp = t_2
else if (x <= (-6.4d-15)) then
tmp = t_1
else if (x <= (-5.4d-166)) then
tmp = t_3
else if (x <= 6.9d-270) then
tmp = (b / c) / z
else if (x <= 4.3d-142) then
tmp = t_3
else if (x <= 3.1d-97) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = 9.0 * ((y / z) * (x / c));
double t_3 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = t_2;
} else if (x <= -6.4e-15) {
tmp = t_1;
} else if (x <= -5.4e-166) {
tmp = t_3;
} else if (x <= 6.9e-270) {
tmp = (b / c) / z;
} else if (x <= 4.3e-142) {
tmp = t_3;
} else if (x <= 3.1e-97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (z * (c / b)) t_2 = 9.0 * ((y / z) * (x / c)) t_3 = -4.0 * ((a * t) / c) tmp = 0 if x <= -2.1e+107: tmp = t_2 elif x <= -6.4e-15: tmp = t_1 elif x <= -5.4e-166: tmp = t_3 elif x <= 6.9e-270: tmp = (b / c) / z elif x <= 4.3e-142: tmp = t_3 elif x <= 3.1e-97: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(z * Float64(c / b))) t_2 = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))) t_3 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (x <= -2.1e+107) tmp = t_2; elseif (x <= -6.4e-15) tmp = t_1; elseif (x <= -5.4e-166) tmp = t_3; elseif (x <= 6.9e-270) tmp = Float64(Float64(b / c) / z); elseif (x <= 4.3e-142) tmp = t_3; elseif (x <= 3.1e-97) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (z * (c / b));
t_2 = 9.0 * ((y / z) * (x / c));
t_3 = -4.0 * ((a * t) / c);
tmp = 0.0;
if (x <= -2.1e+107)
tmp = t_2;
elseif (x <= -6.4e-15)
tmp = t_1;
elseif (x <= -5.4e-166)
tmp = t_3;
elseif (x <= 6.9e-270)
tmp = (b / c) / z;
elseif (x <= 4.3e-142)
tmp = t_3;
elseif (x <= 3.1e-97)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+107], t$95$2, If[LessEqual[x, -6.4e-15], t$95$1, If[LessEqual[x, -5.4e-166], t$95$3, If[LessEqual[x, 6.9e-270], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 4.3e-142], t$95$3, If[LessEqual[x, 3.1e-97], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{c}{b}}\\
t_2 := 9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
t_3 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+107}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-166}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 6.9 \cdot 10^{-270}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-142}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.1e107 or 3.10000000000000002e-97 < x Initial program 80.4%
Taylor expanded in x around inf 56.4%
times-frac59.3%
Simplified59.3%
if -2.1e107 < x < -6.3999999999999999e-15 or 4.2999999999999997e-142 < x < 3.10000000000000002e-97Initial program 83.0%
div-inv83.2%
associate-*l*83.2%
fma-neg85.6%
distribute-rgt-neg-in85.6%
associate-*l*85.6%
Applied egg-rr85.6%
Taylor expanded in b around inf 47.8%
*-commutative47.8%
associate-/r*48.0%
Simplified48.0%
div-inv47.9%
Applied egg-rr47.9%
associate-*l/50.0%
div-inv50.1%
div-inv50.1%
clear-num50.2%
frac-times50.2%
metadata-eval50.2%
Applied egg-rr50.2%
if -6.3999999999999999e-15 < x < -5.40000000000000013e-166 or 6.90000000000000041e-270 < x < 4.2999999999999997e-142Initial program 87.7%
Taylor expanded in z around inf 55.4%
if -5.40000000000000013e-166 < x < 6.90000000000000041e-270Initial program 82.3%
add082.3%
associate-*l*86.0%
Applied egg-rr86.0%
Taylor expanded in b around inf 59.5%
associate-/r*59.6%
Simplified59.6%
Final simplification57.0%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ c b)))) (t_2 (* -4.0 (/ (* a t) c))))
(if (<= x -2.1e+107)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= x -6.6e-15)
t_1
(if (<= x -9e-163)
t_2
(if (<= x 4.5e-271)
(/ (/ b c) z)
(if (<= x 2.1e-141)
t_2
(if (<= x 7.5e-97) t_1 (* 9.0 (/ (* x y) (* z c)))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -6.6e-15) {
tmp = t_1;
} else if (x <= -9e-163) {
tmp = t_2;
} else if (x <= 4.5e-271) {
tmp = (b / c) / z;
} else if (x <= 2.1e-141) {
tmp = t_2;
} else if (x <= 7.5e-97) {
tmp = t_1;
} else {
tmp = 9.0 * ((x * y) / (z * c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (z * (c / b))
t_2 = (-4.0d0) * ((a * t) / c)
if (x <= (-2.1d+107)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (x <= (-6.6d-15)) then
tmp = t_1
else if (x <= (-9d-163)) then
tmp = t_2
else if (x <= 4.5d-271) then
tmp = (b / c) / z
else if (x <= 2.1d-141) then
tmp = t_2
else if (x <= 7.5d-97) then
tmp = t_1
else
tmp = 9.0d0 * ((x * y) / (z * c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -6.6e-15) {
tmp = t_1;
} else if (x <= -9e-163) {
tmp = t_2;
} else if (x <= 4.5e-271) {
tmp = (b / c) / z;
} else if (x <= 2.1e-141) {
tmp = t_2;
} else if (x <= 7.5e-97) {
tmp = t_1;
} else {
tmp = 9.0 * ((x * y) / (z * c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (z * (c / b)) t_2 = -4.0 * ((a * t) / c) tmp = 0 if x <= -2.1e+107: tmp = 9.0 * ((y / z) * (x / c)) elif x <= -6.6e-15: tmp = t_1 elif x <= -9e-163: tmp = t_2 elif x <= 4.5e-271: tmp = (b / c) / z elif x <= 2.1e-141: tmp = t_2 elif x <= 7.5e-97: tmp = t_1 else: tmp = 9.0 * ((x * y) / (z * c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(z * Float64(c / b))) t_2 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (x <= -2.1e+107) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (x <= -6.6e-15) tmp = t_1; elseif (x <= -9e-163) tmp = t_2; elseif (x <= 4.5e-271) tmp = Float64(Float64(b / c) / z); elseif (x <= 2.1e-141) tmp = t_2; elseif (x <= 7.5e-97) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (z * (c / b));
t_2 = -4.0 * ((a * t) / c);
tmp = 0.0;
if (x <= -2.1e+107)
tmp = 9.0 * ((y / z) * (x / c));
elseif (x <= -6.6e-15)
tmp = t_1;
elseif (x <= -9e-163)
tmp = t_2;
elseif (x <= 4.5e-271)
tmp = (b / c) / z;
elseif (x <= 2.1e-141)
tmp = t_2;
elseif (x <= 7.5e-97)
tmp = t_1;
else
tmp = 9.0 * ((x * y) / (z * c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+107], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.6e-15], t$95$1, If[LessEqual[x, -9e-163], t$95$2, If[LessEqual[x, 4.5e-271], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 2.1e-141], t$95$2, If[LessEqual[x, 7.5e-97], t$95$1, N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{c}{b}}\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+107}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-163}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-271}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-141}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\end{array}
\end{array}
if x < -2.1e107Initial program 78.6%
Taylor expanded in x around inf 64.2%
times-frac74.2%
Simplified74.2%
if -2.1e107 < x < -6.6e-15 or 2.0999999999999999e-141 < x < 7.5e-97Initial program 83.0%
div-inv83.2%
associate-*l*83.2%
fma-neg85.6%
distribute-rgt-neg-in85.6%
associate-*l*85.6%
Applied egg-rr85.6%
Taylor expanded in b around inf 47.8%
*-commutative47.8%
associate-/r*48.0%
Simplified48.0%
div-inv47.9%
Applied egg-rr47.9%
associate-*l/50.0%
div-inv50.1%
div-inv50.1%
clear-num50.2%
frac-times50.2%
metadata-eval50.2%
Applied egg-rr50.2%
if -6.6e-15 < x < -8.9999999999999995e-163 or 4.4999999999999998e-271 < x < 2.0999999999999999e-141Initial program 87.7%
Taylor expanded in z around inf 55.4%
if -8.9999999999999995e-163 < x < 4.4999999999999998e-271Initial program 82.3%
add082.3%
associate-*l*86.0%
Applied egg-rr86.0%
Taylor expanded in b around inf 59.5%
associate-/r*59.6%
Simplified59.6%
if 7.5e-97 < x Initial program 81.5%
Taylor expanded in x around inf 52.0%
Final simplification57.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ c b)))) (t_2 (* -4.0 (/ (* a t) c))))
(if (<= x -2.1e+107)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= x -3.8e-15)
t_1
(if (<= x -9.5e-164)
t_2
(if (<= x 1.85e-270)
(/ (/ b c) z)
(if (<= x 4.9e-142)
t_2
(if (<= x 1.5e-97) t_1 (* 9.0 (/ (/ (* x y) c) z))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -3.8e-15) {
tmp = t_1;
} else if (x <= -9.5e-164) {
tmp = t_2;
} else if (x <= 1.85e-270) {
tmp = (b / c) / z;
} else if (x <= 4.9e-142) {
tmp = t_2;
} else if (x <= 1.5e-97) {
tmp = t_1;
} else {
tmp = 9.0 * (((x * y) / c) / z);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (z * (c / b))
t_2 = (-4.0d0) * ((a * t) / c)
if (x <= (-2.1d+107)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (x <= (-3.8d-15)) then
tmp = t_1
else if (x <= (-9.5d-164)) then
tmp = t_2
else if (x <= 1.85d-270) then
tmp = (b / c) / z
else if (x <= 4.9d-142) then
tmp = t_2
else if (x <= 1.5d-97) then
tmp = t_1
else
tmp = 9.0d0 * (((x * y) / c) / z)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -3.8e-15) {
tmp = t_1;
} else if (x <= -9.5e-164) {
tmp = t_2;
} else if (x <= 1.85e-270) {
tmp = (b / c) / z;
} else if (x <= 4.9e-142) {
tmp = t_2;
} else if (x <= 1.5e-97) {
tmp = t_1;
} else {
tmp = 9.0 * (((x * y) / c) / z);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (z * (c / b)) t_2 = -4.0 * ((a * t) / c) tmp = 0 if x <= -2.1e+107: tmp = 9.0 * ((y / z) * (x / c)) elif x <= -3.8e-15: tmp = t_1 elif x <= -9.5e-164: tmp = t_2 elif x <= 1.85e-270: tmp = (b / c) / z elif x <= 4.9e-142: tmp = t_2 elif x <= 1.5e-97: tmp = t_1 else: tmp = 9.0 * (((x * y) / c) / z) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(z * Float64(c / b))) t_2 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (x <= -2.1e+107) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (x <= -3.8e-15) tmp = t_1; elseif (x <= -9.5e-164) tmp = t_2; elseif (x <= 1.85e-270) tmp = Float64(Float64(b / c) / z); elseif (x <= 4.9e-142) tmp = t_2; elseif (x <= 1.5e-97) tmp = t_1; else tmp = Float64(9.0 * Float64(Float64(Float64(x * y) / c) / z)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (z * (c / b));
t_2 = -4.0 * ((a * t) / c);
tmp = 0.0;
if (x <= -2.1e+107)
tmp = 9.0 * ((y / z) * (x / c));
elseif (x <= -3.8e-15)
tmp = t_1;
elseif (x <= -9.5e-164)
tmp = t_2;
elseif (x <= 1.85e-270)
tmp = (b / c) / z;
elseif (x <= 4.9e-142)
tmp = t_2;
elseif (x <= 1.5e-97)
tmp = t_1;
else
tmp = 9.0 * (((x * y) / c) / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+107], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.8e-15], t$95$1, If[LessEqual[x, -9.5e-164], t$95$2, If[LessEqual[x, 1.85e-270], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 4.9e-142], t$95$2, If[LessEqual[x, 1.5e-97], t$95$1, N[(9.0 * N[(N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{c}{b}}\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+107}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-270}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{\frac{x \cdot y}{c}}{z}\\
\end{array}
\end{array}
if x < -2.1e107Initial program 78.6%
Taylor expanded in x around inf 64.2%
times-frac74.2%
Simplified74.2%
if -2.1e107 < x < -3.8000000000000002e-15 or 4.9000000000000003e-142 < x < 1.50000000000000012e-97Initial program 83.0%
div-inv83.2%
associate-*l*83.2%
fma-neg85.6%
distribute-rgt-neg-in85.6%
associate-*l*85.6%
Applied egg-rr85.6%
Taylor expanded in b around inf 47.8%
*-commutative47.8%
associate-/r*48.0%
Simplified48.0%
div-inv47.9%
Applied egg-rr47.9%
associate-*l/50.0%
div-inv50.1%
div-inv50.1%
clear-num50.2%
frac-times50.2%
metadata-eval50.2%
Applied egg-rr50.2%
if -3.8000000000000002e-15 < x < -9.5000000000000001e-164 or 1.8500000000000001e-270 < x < 4.9000000000000003e-142Initial program 87.7%
Taylor expanded in z around inf 55.4%
if -9.5000000000000001e-164 < x < 1.8500000000000001e-270Initial program 82.3%
add082.3%
associate-*l*86.0%
Applied egg-rr86.0%
Taylor expanded in b around inf 59.5%
associate-/r*59.6%
Simplified59.6%
if 1.50000000000000012e-97 < x Initial program 81.5%
Taylor expanded in x around inf 52.0%
div-inv51.9%
*-commutative51.9%
Applied egg-rr51.9%
*-commutative51.9%
div-inv52.0%
associate-/r*51.1%
Applied egg-rr51.1%
Final simplification57.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ c b)))) (t_2 (* -4.0 (/ (* a t) c))))
(if (<= x -2.1e+107)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= x -7.6e-15)
t_1
(if (<= x -8e-165)
t_2
(if (<= x 6e-270)
(/ (/ b c) z)
(if (<= x 3.7e-142)
t_2
(if (<= x 7.6e-97) t_1 (* (* y (/ x c)) (/ 9.0 z))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -7.6e-15) {
tmp = t_1;
} else if (x <= -8e-165) {
tmp = t_2;
} else if (x <= 6e-270) {
tmp = (b / c) / z;
} else if (x <= 3.7e-142) {
tmp = t_2;
} else if (x <= 7.6e-97) {
tmp = t_1;
} else {
tmp = (y * (x / c)) * (9.0 / z);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (z * (c / b))
t_2 = (-4.0d0) * ((a * t) / c)
if (x <= (-2.1d+107)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (x <= (-7.6d-15)) then
tmp = t_1
else if (x <= (-8d-165)) then
tmp = t_2
else if (x <= 6d-270) then
tmp = (b / c) / z
else if (x <= 3.7d-142) then
tmp = t_2
else if (x <= 7.6d-97) then
tmp = t_1
else
tmp = (y * (x / c)) * (9.0d0 / z)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -2.1e+107) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -7.6e-15) {
tmp = t_1;
} else if (x <= -8e-165) {
tmp = t_2;
} else if (x <= 6e-270) {
tmp = (b / c) / z;
} else if (x <= 3.7e-142) {
tmp = t_2;
} else if (x <= 7.6e-97) {
tmp = t_1;
} else {
tmp = (y * (x / c)) * (9.0 / z);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (z * (c / b)) t_2 = -4.0 * ((a * t) / c) tmp = 0 if x <= -2.1e+107: tmp = 9.0 * ((y / z) * (x / c)) elif x <= -7.6e-15: tmp = t_1 elif x <= -8e-165: tmp = t_2 elif x <= 6e-270: tmp = (b / c) / z elif x <= 3.7e-142: tmp = t_2 elif x <= 7.6e-97: tmp = t_1 else: tmp = (y * (x / c)) * (9.0 / z) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(z * Float64(c / b))) t_2 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (x <= -2.1e+107) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (x <= -7.6e-15) tmp = t_1; elseif (x <= -8e-165) tmp = t_2; elseif (x <= 6e-270) tmp = Float64(Float64(b / c) / z); elseif (x <= 3.7e-142) tmp = t_2; elseif (x <= 7.6e-97) tmp = t_1; else tmp = Float64(Float64(y * Float64(x / c)) * Float64(9.0 / z)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (z * (c / b));
t_2 = -4.0 * ((a * t) / c);
tmp = 0.0;
if (x <= -2.1e+107)
tmp = 9.0 * ((y / z) * (x / c));
elseif (x <= -7.6e-15)
tmp = t_1;
elseif (x <= -8e-165)
tmp = t_2;
elseif (x <= 6e-270)
tmp = (b / c) / z;
elseif (x <= 3.7e-142)
tmp = t_2;
elseif (x <= 7.6e-97)
tmp = t_1;
else
tmp = (y * (x / c)) * (9.0 / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+107], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.6e-15], t$95$1, If[LessEqual[x, -8e-165], t$95$2, If[LessEqual[x, 6e-270], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 3.7e-142], t$95$2, If[LessEqual[x, 7.6e-97], t$95$1, N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{c}{b}}\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+107}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-165}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-270}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \frac{x}{c}\right) \cdot \frac{9}{z}\\
\end{array}
\end{array}
if x < -2.1e107Initial program 78.6%
Taylor expanded in x around inf 64.2%
times-frac74.2%
Simplified74.2%
if -2.1e107 < x < -7.6000000000000004e-15 or 3.69999999999999986e-142 < x < 7.6000000000000001e-97Initial program 83.0%
div-inv83.2%
associate-*l*83.2%
fma-neg85.6%
distribute-rgt-neg-in85.6%
associate-*l*85.6%
Applied egg-rr85.6%
Taylor expanded in b around inf 47.8%
*-commutative47.8%
associate-/r*48.0%
Simplified48.0%
div-inv47.9%
Applied egg-rr47.9%
associate-*l/50.0%
div-inv50.1%
div-inv50.1%
clear-num50.2%
frac-times50.2%
metadata-eval50.2%
Applied egg-rr50.2%
if -7.6000000000000004e-15 < x < -8.0000000000000001e-165 or 6.00000000000000025e-270 < x < 3.69999999999999986e-142Initial program 87.7%
Taylor expanded in z around inf 55.4%
if -8.0000000000000001e-165 < x < 6.00000000000000025e-270Initial program 82.3%
add082.3%
associate-*l*86.0%
Applied egg-rr86.0%
Taylor expanded in b around inf 59.5%
associate-/r*59.6%
Simplified59.6%
if 7.6000000000000001e-97 < x Initial program 81.5%
add081.5%
associate-*l*82.8%
Applied egg-rr82.8%
Taylor expanded in x around inf 52.0%
associate-*r/52.0%
*-commutative52.0%
times-frac51.0%
associate-/l*53.4%
Simplified53.4%
associate-/r/54.6%
Applied egg-rr54.6%
Final simplification58.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ 1.0 (* z (/ c b)))) (t_2 (* -4.0 (/ (* a t) c))))
(if (<= x -6.6e+108)
(* (/ y z) (/ (* 9.0 x) c))
(if (<= x -3.4e-15)
t_1
(if (<= x -9e-164)
t_2
(if (<= x 7.5e-272)
(/ (/ b c) z)
(if (<= x 5.1e-142)
t_2
(if (<= x 7.6e-97) t_1 (* (* y (/ x c)) (/ 9.0 z))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -6.6e+108) {
tmp = (y / z) * ((9.0 * x) / c);
} else if (x <= -3.4e-15) {
tmp = t_1;
} else if (x <= -9e-164) {
tmp = t_2;
} else if (x <= 7.5e-272) {
tmp = (b / c) / z;
} else if (x <= 5.1e-142) {
tmp = t_2;
} else if (x <= 7.6e-97) {
tmp = t_1;
} else {
tmp = (y * (x / c)) * (9.0 / z);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (z * (c / b))
t_2 = (-4.0d0) * ((a * t) / c)
if (x <= (-6.6d+108)) then
tmp = (y / z) * ((9.0d0 * x) / c)
else if (x <= (-3.4d-15)) then
tmp = t_1
else if (x <= (-9d-164)) then
tmp = t_2
else if (x <= 7.5d-272) then
tmp = (b / c) / z
else if (x <= 5.1d-142) then
tmp = t_2
else if (x <= 7.6d-97) then
tmp = t_1
else
tmp = (y * (x / c)) * (9.0d0 / z)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 1.0 / (z * (c / b));
double t_2 = -4.0 * ((a * t) / c);
double tmp;
if (x <= -6.6e+108) {
tmp = (y / z) * ((9.0 * x) / c);
} else if (x <= -3.4e-15) {
tmp = t_1;
} else if (x <= -9e-164) {
tmp = t_2;
} else if (x <= 7.5e-272) {
tmp = (b / c) / z;
} else if (x <= 5.1e-142) {
tmp = t_2;
} else if (x <= 7.6e-97) {
tmp = t_1;
} else {
tmp = (y * (x / c)) * (9.0 / z);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): t_1 = 1.0 / (z * (c / b)) t_2 = -4.0 * ((a * t) / c) tmp = 0 if x <= -6.6e+108: tmp = (y / z) * ((9.0 * x) / c) elif x <= -3.4e-15: tmp = t_1 elif x <= -9e-164: tmp = t_2 elif x <= 7.5e-272: tmp = (b / c) / z elif x <= 5.1e-142: tmp = t_2 elif x <= 7.6e-97: tmp = t_1 else: tmp = (y * (x / c)) * (9.0 / z) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) t_1 = Float64(1.0 / Float64(z * Float64(c / b))) t_2 = Float64(-4.0 * Float64(Float64(a * t) / c)) tmp = 0.0 if (x <= -6.6e+108) tmp = Float64(Float64(y / z) * Float64(Float64(9.0 * x) / c)); elseif (x <= -3.4e-15) tmp = t_1; elseif (x <= -9e-164) tmp = t_2; elseif (x <= 7.5e-272) tmp = Float64(Float64(b / c) / z); elseif (x <= 5.1e-142) tmp = t_2; elseif (x <= 7.6e-97) tmp = t_1; else tmp = Float64(Float64(y * Float64(x / c)) * Float64(9.0 / z)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 1.0 / (z * (c / b));
t_2 = -4.0 * ((a * t) / c);
tmp = 0.0;
if (x <= -6.6e+108)
tmp = (y / z) * ((9.0 * x) / c);
elseif (x <= -3.4e-15)
tmp = t_1;
elseif (x <= -9e-164)
tmp = t_2;
elseif (x <= 7.5e-272)
tmp = (b / c) / z;
elseif (x <= 5.1e-142)
tmp = t_2;
elseif (x <= 7.6e-97)
tmp = t_1;
else
tmp = (y * (x / c)) * (9.0 / z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.6e+108], N[(N[(y / z), $MachinePrecision] * N[(N[(9.0 * x), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.4e-15], t$95$1, If[LessEqual[x, -9e-164], t$95$2, If[LessEqual[x, 7.5e-272], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[x, 5.1e-142], t$95$2, If[LessEqual[x, 7.6e-97], t$95$1, N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{c}{b}}\\
t_2 := -4 \cdot \frac{a \cdot t}{c}\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{+108}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{9 \cdot x}{c}\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-272}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \frac{x}{c}\right) \cdot \frac{9}{z}\\
\end{array}
\end{array}
if x < -6.60000000000000038e108Initial program 78.6%
Taylor expanded in x around inf 64.2%
associate-*r/64.2%
*-commutative64.2%
*-commutative64.2%
associate-*l*64.2%
*-commutative64.2%
times-frac74.2%
*-commutative74.2%
Simplified74.2%
if -6.60000000000000038e108 < x < -3.4e-15 or 5.1000000000000001e-142 < x < 7.6000000000000001e-97Initial program 83.0%
div-inv83.2%
associate-*l*83.2%
fma-neg85.6%
distribute-rgt-neg-in85.6%
associate-*l*85.6%
Applied egg-rr85.6%
Taylor expanded in b around inf 47.8%
*-commutative47.8%
associate-/r*48.0%
Simplified48.0%
div-inv47.9%
Applied egg-rr47.9%
associate-*l/50.0%
div-inv50.1%
div-inv50.1%
clear-num50.2%
frac-times50.2%
metadata-eval50.2%
Applied egg-rr50.2%
if -3.4e-15 < x < -8.9999999999999995e-164 or 7.50000000000000005e-272 < x < 5.1000000000000001e-142Initial program 87.9%
Taylor expanded in z around inf 54.5%
if -8.9999999999999995e-164 < x < 7.50000000000000005e-272Initial program 81.7%
add081.7%
associate-*l*85.5%
Applied egg-rr85.5%
Taylor expanded in b around inf 58.2%
associate-/r*58.4%
Simplified58.4%
if 7.6000000000000001e-97 < x Initial program 81.5%
add081.5%
associate-*l*82.8%
Applied egg-rr82.8%
Taylor expanded in x around inf 52.0%
associate-*r/52.0%
*-commutative52.0%
times-frac51.0%
associate-/l*53.4%
Simplified53.4%
associate-/r/54.6%
Applied egg-rr54.6%
Final simplification57.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -8e+134)
(/ (+ (* -4.0 (* a t)) (* 9.0 (* x (/ y z)))) c)
(if (<= z 2e+72)
(/ (+ b (- (* y (* 9.0 x)) (* t (* a (* z 4.0))))) (* z c))
(- (+ (/ b (* z c)) (* 9.0 (/ (* x y) (* z c)))) (* 4.0 (/ (* a t) c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -8e+134) {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
} else if (z <= 2e+72) {
tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((a * t) / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (z <= (-8d+134)) then
tmp = (((-4.0d0) * (a * t)) + (9.0d0 * (x * (y / z)))) / c
else if (z <= 2d+72) then
tmp = (b + ((y * (9.0d0 * x)) - (t * (a * (z * 4.0d0))))) / (z * c)
else
tmp = ((b / (z * c)) + (9.0d0 * ((x * y) / (z * c)))) - (4.0d0 * ((a * t) / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -8e+134) {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
} else if (z <= 2e+72) {
tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c);
} else {
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((a * t) / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -8e+134: tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c elif z <= 2e+72: tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c) else: tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((a * t) / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -8e+134) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(x * Float64(y / z)))) / c); elseif (z <= 2e+72) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(t * Float64(a * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(b / Float64(z * c)) + Float64(9.0 * Float64(Float64(x * y) / Float64(z * c)))) - Float64(4.0 * Float64(Float64(a * t) / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -8e+134)
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
elseif (z <= 2e+72)
tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c);
else
tmp = ((b / (z * c)) + (9.0 * ((x * y) / (z * c)))) - (4.0 * ((a * t) / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -8e+134], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 2e+72], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+134}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + 9 \cdot \left(x \cdot \frac{y}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+72}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - t \cdot \left(a \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -7.99999999999999937e134Initial program 57.2%
Taylor expanded in b around 0 51.2%
Taylor expanded in x around 0 78.4%
Taylor expanded in c around 0 78.5%
add078.5%
associate-/l*90.7%
Applied egg-rr90.7%
associate-/l*78.5%
associate-*r/90.7%
add090.7%
Simplified90.7%
if -7.99999999999999937e134 < z < 1.99999999999999989e72Initial program 93.0%
Taylor expanded in z around 0 93.0%
*-commutative93.0%
associate-*r*89.3%
*-commutative89.3%
associate-*r*89.3%
associate-*l*93.5%
*-commutative93.5%
Simplified93.5%
if 1.99999999999999989e72 < z Initial program 56.0%
Taylor expanded in x around 0 87.8%
Final simplification92.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -4.5e+134) (not (<= z 1.4e+151))) (/ (+ (* -4.0 (* a t)) (* 9.0 (* x (/ y z)))) c) (/ (+ b (- (* y (* 9.0 x)) (* t (* a (* z 4.0))))) (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -4.5e+134) || !(z <= 1.4e+151)) {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
} else {
tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((z <= (-4.5d+134)) .or. (.not. (z <= 1.4d+151))) then
tmp = (((-4.0d0) * (a * t)) + (9.0d0 * (x * (y / z)))) / c
else
tmp = (b + ((y * (9.0d0 * x)) - (t * (a * (z * 4.0d0))))) / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -4.5e+134) || !(z <= 1.4e+151)) {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
} else {
tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -4.5e+134) or not (z <= 1.4e+151): tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c else: tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -4.5e+134) || !(z <= 1.4e+151)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(x * Float64(y / z)))) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(t * Float64(a * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -4.5e+134) || ~((z <= 1.4e+151)))
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
else
tmp = (b + ((y * (9.0 * x)) - (t * (a * (z * 4.0))))) / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -4.5e+134], N[Not[LessEqual[z, 1.4e+151]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+134} \lor \neg \left(z \leq 1.4 \cdot 10^{+151}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + 9 \cdot \left(x \cdot \frac{y}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - t \cdot \left(a \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.4999999999999997e134 or 1.39999999999999994e151 < z Initial program 51.9%
Taylor expanded in b around 0 43.2%
Taylor expanded in x around 0 76.1%
Taylor expanded in c around 0 77.7%
add077.7%
associate-/l*83.8%
Applied egg-rr83.8%
associate-/l*77.7%
associate-*r/83.8%
add083.8%
Simplified83.8%
if -4.4999999999999997e134 < z < 1.39999999999999994e151Initial program 93.2%
Taylor expanded in z around 0 93.2%
*-commutative93.2%
associate-*r*89.7%
*-commutative89.7%
associate-*r*89.7%
associate-*l*93.7%
*-commutative93.7%
Simplified93.7%
Final simplification91.2%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a -3.25e-83)
(* -4.0 (/ a (/ c t)))
(if (<= a 1.02e+146)
(/ (+ b (* x (* 9.0 y))) (* z c))
(/ (+ (* -4.0 (* a t)) (* 9.0 (* x (/ y z)))) c))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -3.25e-83) {
tmp = -4.0 * (a / (c / t));
} else if (a <= 1.02e+146) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (a <= (-3.25d-83)) then
tmp = (-4.0d0) * (a / (c / t))
else if (a <= 1.02d+146) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else
tmp = (((-4.0d0) * (a * t)) + (9.0d0 * (x * (y / z)))) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -3.25e-83) {
tmp = -4.0 * (a / (c / t));
} else if (a <= 1.02e+146) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -3.25e-83: tmp = -4.0 * (a / (c / t)) elif a <= 1.02e+146: tmp = (b + (x * (9.0 * y))) / (z * c) else: tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -3.25e-83) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (a <= 1.02e+146) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); else tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(x * Float64(y / z)))) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= -3.25e-83)
tmp = -4.0 * (a / (c / t));
elseif (a <= 1.02e+146)
tmp = (b + (x * (9.0 * y))) / (z * c);
else
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, -3.25e-83], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e+146], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.25 \cdot 10^{-83}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{+146}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + 9 \cdot \left(x \cdot \frac{y}{z}\right)}{c}\\
\end{array}
\end{array}
if a < -3.25e-83Initial program 84.2%
Taylor expanded in z around inf 46.6%
*-commutative46.6%
associate-/l*51.0%
Simplified51.0%
if -3.25e-83 < a < 1.01999999999999997e146Initial program 83.0%
Taylor expanded in x around inf 73.8%
associate-*r*73.8%
*-commutative73.8%
associate-*r*73.7%
Simplified73.7%
if 1.01999999999999997e146 < a Initial program 76.9%
Taylor expanded in b around 0 70.1%
Taylor expanded in x around 0 73.0%
Taylor expanded in c around 0 69.8%
add069.8%
associate-/l*76.7%
Applied egg-rr76.7%
associate-/l*69.8%
associate-*r/76.7%
add076.7%
Simplified76.7%
Final simplification66.4%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a -5.8e-121)
(+ (* 9.0 (/ (* x y) (* z c))) (* -4.0 (* t (/ a c))))
(if (<= a 1.6e+146)
(/ (+ b (* x (* 9.0 y))) (* z c))
(/ (+ (* -4.0 (* a t)) (* 9.0 (* x (/ y z)))) c))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -5.8e-121) {
tmp = (9.0 * ((x * y) / (z * c))) + (-4.0 * (t * (a / c)));
} else if (a <= 1.6e+146) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (a <= (-5.8d-121)) then
tmp = (9.0d0 * ((x * y) / (z * c))) + ((-4.0d0) * (t * (a / c)))
else if (a <= 1.6d+146) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else
tmp = (((-4.0d0) * (a * t)) + (9.0d0 * (x * (y / z)))) / c
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -5.8e-121) {
tmp = (9.0 * ((x * y) / (z * c))) + (-4.0 * (t * (a / c)));
} else if (a <= 1.6e+146) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -5.8e-121: tmp = (9.0 * ((x * y) / (z * c))) + (-4.0 * (t * (a / c))) elif a <= 1.6e+146: tmp = (b + (x * (9.0 * y))) / (z * c) else: tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -5.8e-121) tmp = Float64(Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))) + Float64(-4.0 * Float64(t * Float64(a / c)))); elseif (a <= 1.6e+146) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); else tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(9.0 * Float64(x * Float64(y / z)))) / c); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= -5.8e-121)
tmp = (9.0 * ((x * y) / (z * c))) + (-4.0 * (t * (a / c)));
elseif (a <= 1.6e+146)
tmp = (b + (x * (9.0 * y))) / (z * c);
else
tmp = ((-4.0 * (a * t)) + (9.0 * (x * (y / z)))) / c;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, -5.8e-121], N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+146], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-121}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c} + -4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+146}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + 9 \cdot \left(x \cdot \frac{y}{z}\right)}{c}\\
\end{array}
\end{array}
if a < -5.8e-121Initial program 85.4%
Taylor expanded in b around 0 60.6%
Taylor expanded in x around 0 58.5%
add058.5%
associate-/l*61.4%
Applied egg-rr61.4%
associate-/r/62.7%
add062.7%
Simplified62.7%
if -5.8e-121 < a < 1.6e146Initial program 82.1%
Taylor expanded in x around inf 73.1%
associate-*r*73.1%
*-commutative73.1%
associate-*r*73.1%
Simplified73.1%
if 1.6e146 < a Initial program 76.9%
Taylor expanded in b around 0 70.1%
Taylor expanded in x around 0 73.0%
Taylor expanded in c around 0 69.8%
add069.8%
associate-/l*76.7%
Applied egg-rr76.7%
associate-/l*69.8%
associate-*r/76.7%
add076.7%
Simplified76.7%
Final simplification69.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= x -2e-25)
(/ (+ b (* x (* 9.0 y))) (* z c))
(if (<= x 3.1e+93)
(/ (- b (* 4.0 (* a (* z t)))) (* z c))
(* 9.0 (/ 1.0 (* (/ z x) (/ c y)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -2e-25) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else if (x <= 3.1e+93) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = 9.0 * (1.0 / ((z / x) * (c / y)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (x <= (-2d-25)) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else if (x <= 3.1d+93) then
tmp = (b - (4.0d0 * (a * (z * t)))) / (z * c)
else
tmp = 9.0d0 * (1.0d0 / ((z / x) * (c / y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (x <= -2e-25) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else if (x <= 3.1e+93) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else {
tmp = 9.0 * (1.0 / ((z / x) * (c / y)));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if x <= -2e-25: tmp = (b + (x * (9.0 * y))) / (z * c) elif x <= 3.1e+93: tmp = (b - (4.0 * (a * (z * t)))) / (z * c) else: tmp = 9.0 * (1.0 / ((z / x) * (c / y))) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (x <= -2e-25) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); elseif (x <= 3.1e+93) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); else tmp = Float64(9.0 * Float64(1.0 / Float64(Float64(z / x) * Float64(c / y)))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (x <= -2e-25)
tmp = (b + (x * (9.0 * y))) / (z * c);
elseif (x <= 3.1e+93)
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
else
tmp = 9.0 * (1.0 / ((z / x) * (c / y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -2e-25], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e+93], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(1.0 / N[(N[(z / x), $MachinePrecision] * N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-25}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+93}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{1}{\frac{z}{x} \cdot \frac{c}{y}}\\
\end{array}
\end{array}
if x < -2.00000000000000008e-25Initial program 79.7%
Taylor expanded in x around inf 73.7%
associate-*r*73.7%
*-commutative73.7%
associate-*r*73.7%
Simplified73.7%
if -2.00000000000000008e-25 < x < 3.10000000000000019e93Initial program 86.9%
Taylor expanded in x around 0 73.4%
if 3.10000000000000019e93 < x Initial program 74.6%
Taylor expanded in x around inf 58.5%
clear-num58.5%
inv-pow58.5%
*-commutative58.5%
Applied egg-rr58.5%
unpow-158.5%
times-frac65.1%
Simplified65.1%
Final simplification72.1%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -7.8e+33)
(/ (* -4.0 (* a t)) c)
(if (<= z 1.52e+153)
(/ (+ b (* x (* 9.0 y))) (* z c))
(* -4.0 (/ (* a t) c)))))assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -7.8e+33) {
tmp = (-4.0 * (a * t)) / c;
} else if (z <= 1.52e+153) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (z <= (-7.8d+33)) then
tmp = ((-4.0d0) * (a * t)) / c
else if (z <= 1.52d+153) then
tmp = (b + (x * (9.0d0 * y))) / (z * c)
else
tmp = (-4.0d0) * ((a * t) / c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -7.8e+33) {
tmp = (-4.0 * (a * t)) / c;
} else if (z <= 1.52e+153) {
tmp = (b + (x * (9.0 * y))) / (z * c);
} else {
tmp = -4.0 * ((a * t) / c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -7.8e+33: tmp = (-4.0 * (a * t)) / c elif z <= 1.52e+153: tmp = (b + (x * (9.0 * y))) / (z * c) else: tmp = -4.0 * ((a * t) / c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -7.8e+33) tmp = Float64(Float64(-4.0 * Float64(a * t)) / c); elseif (z <= 1.52e+153) tmp = Float64(Float64(b + Float64(x * Float64(9.0 * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -7.8e+33)
tmp = (-4.0 * (a * t)) / c;
elseif (z <= 1.52e+153)
tmp = (b + (x * (9.0 * y))) / (z * c);
else
tmp = -4.0 * ((a * t) / c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -7.8e+33], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.52e+153], N[(N[(b + N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+33}:\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right)}{c}\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{+153}:\\
\;\;\;\;\frac{b + x \cdot \left(9 \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\end{array}
\end{array}
if z < -7.8000000000000004e33Initial program 67.3%
Taylor expanded in b around 0 56.0%
Taylor expanded in x around 0 75.0%
Taylor expanded in c around 0 75.2%
Taylor expanded in a around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -7.8000000000000004e33 < z < 1.52e153Initial program 94.2%
Taylor expanded in x around inf 80.4%
associate-*r*80.4%
*-commutative80.4%
associate-*r*80.3%
Simplified80.3%
if 1.52e153 < z Initial program 46.7%
Taylor expanded in z around inf 58.1%
Final simplification74.5%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= a -8.5e-120) (not (<= a 1.05e+129))) (* -4.0 (* t (/ a c))) (/ b (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -8.5e-120) || !(a <= 1.05e+129)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if ((a <= (-8.5d-120)) .or. (.not. (a <= 1.05d+129))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = b / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((a <= -8.5e-120) || !(a <= 1.05e+129)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if (a <= -8.5e-120) or not (a <= 1.05e+129): tmp = -4.0 * (t * (a / c)) else: tmp = b / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((a <= -8.5e-120) || !(a <= 1.05e+129)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(b / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((a <= -8.5e-120) || ~((a <= 1.05e+129)))
tmp = -4.0 * (t * (a / c));
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -8.5e-120], N[Not[LessEqual[a, 1.05e+129]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-120} \lor \neg \left(a \leq 1.05 \cdot 10^{+129}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if a < -8.50000000000000059e-120 or 1.04999999999999998e129 < a Initial program 83.9%
Taylor expanded in b around 0 63.3%
Taylor expanded in x around 0 61.6%
Taylor expanded in c around 0 64.9%
Taylor expanded in a around inf 45.0%
associate-*l/50.5%
*-commutative50.5%
Simplified50.5%
if -8.50000000000000059e-120 < a < 1.04999999999999998e129Initial program 81.6%
Taylor expanded in b around inf 42.9%
*-commutative42.9%
Simplified42.9%
Final simplification46.7%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= a -8e-120) (* -4.0 (/ a (/ c t))) (if (<= a 5.3e+129) (/ b (* z c)) (* -4.0 (* t (/ a c))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -8e-120) {
tmp = -4.0 * (a / (c / t));
} else if (a <= 5.3e+129) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (a <= (-8d-120)) then
tmp = (-4.0d0) * (a / (c / t))
else if (a <= 5.3d+129) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (t * (a / c))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -8e-120) {
tmp = -4.0 * (a / (c / t));
} else if (a <= 5.3e+129) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -8e-120: tmp = -4.0 * (a / (c / t)) elif a <= 5.3e+129: tmp = b / (z * c) else: tmp = -4.0 * (t * (a / c)) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -8e-120) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); elseif (a <= 5.3e+129) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t * Float64(a / c))); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= -8e-120)
tmp = -4.0 * (a / (c / t));
elseif (a <= 5.3e+129)
tmp = b / (z * c);
else
tmp = -4.0 * (t * (a / c));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, -8e-120], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.3e+129], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-120}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{elif}\;a \leq 5.3 \cdot 10^{+129}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if a < -7.99999999999999983e-120Initial program 85.4%
Taylor expanded in z around inf 44.4%
*-commutative44.4%
associate-/l*48.5%
Simplified48.5%
if -7.99999999999999983e-120 < a < 5.2999999999999999e129Initial program 81.6%
Taylor expanded in b around inf 42.9%
*-commutative42.9%
Simplified42.9%
if 5.2999999999999999e129 < a Initial program 79.7%
Taylor expanded in b around 0 71.0%
Taylor expanded in x around 0 70.6%
Taylor expanded in c around 0 67.7%
Taylor expanded in a around inf 46.6%
associate-*l/49.7%
*-commutative49.7%
Simplified49.7%
Final simplification45.8%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= b -3.65e+146) (/ (/ b c) z) (/ b (* z c))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.65e+146) {
tmp = (b / c) / z;
} else {
tmp = b / (z * c);
}
return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: tmp
if (b <= (-3.65d+146)) then
tmp = (b / c) / z
else
tmp = b / (z * c)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3.65e+146) {
tmp = (b / c) / z;
} else {
tmp = b / (z * c);
}
return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -3.65e+146: tmp = (b / c) / z else: tmp = b / (z * c) return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -3.65e+146) tmp = Float64(Float64(b / c) / z); else tmp = Float64(b / Float64(z * c)); end return tmp end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -3.65e+146)
tmp = (b / c) / z;
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3.65e+146], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.65 \cdot 10^{+146}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if b < -3.65000000000000017e146Initial program 79.3%
add079.3%
associate-*l*79.1%
Applied egg-rr79.1%
Taylor expanded in b around inf 54.3%
associate-/r*66.7%
Simplified66.7%
if -3.65000000000000017e146 < b Initial program 83.3%
Taylor expanded in b around inf 38.3%
*-commutative38.3%
Simplified38.3%
Final simplification42.5%
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
code = b / (z * c)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 82.7%
Taylor expanded in b around inf 40.7%
*-commutative40.7%
Simplified40.7%
Final simplification40.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t\_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t\_4}{z \cdot c}\\
t_6 := \frac{\left(t\_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t\_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 0:\\
\;\;\;\;\frac{\frac{t\_4}{z}}{c}\\
\mathbf{elif}\;t\_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t\_1\right) - t\_2\\
\mathbf{elif}\;t\_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t\_1\right) - t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024034
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))