
(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 12 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
(if (<= z -2.4e+188)
(+ (* a (* -4.0 (/ t c))) (/ b (* c z)))
(if (<= z 8.5e+136)
(/ (+ b (- (* y (* x 9.0)) (* a (* (* z 4.0) t)))) (* c z))
(/ (+ (* (* t a) -4.0) (/ 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 (z <= -2.4e+188) {
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
} else if (z <= 8.5e+136) {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c * z);
} else {
tmp = (((t * a) * -4.0) + (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 (z <= (-2.4d+188)) then
tmp = (a * ((-4.0d0) * (t / c))) + (b / (c * z))
else if (z <= 8.5d+136) then
tmp = (b + ((y * (x * 9.0d0)) - (a * ((z * 4.0d0) * t)))) / (c * z)
else
tmp = (((t * a) * (-4.0d0)) + (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 (z <= -2.4e+188) {
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
} else if (z <= 8.5e+136) {
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c * z);
} else {
tmp = (((t * a) * -4.0) + (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 z <= -2.4e+188: tmp = (a * (-4.0 * (t / c))) + (b / (c * z)) elif z <= 8.5e+136: tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c * z) else: tmp = (((t * a) * -4.0) + (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 (z <= -2.4e+188) tmp = Float64(Float64(a * Float64(-4.0 * Float64(t / c))) + Float64(b / Float64(c * z))); elseif (z <= 8.5e+136) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(Float64(z * 4.0) * t)))) / Float64(c * z)); else tmp = Float64(Float64(Float64(Float64(t * a) * -4.0) + Float64(b / 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 <= -2.4e+188)
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
elseif (z <= 8.5e+136)
tmp = (b + ((y * (x * 9.0)) - (a * ((z * 4.0) * t)))) / (c * z);
else
tmp = (((t * a) * -4.0) + (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[z, -2.4e+188], N[(N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+136], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / z), $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}\;z \leq -2.4 \cdot 10^{+188}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c}\right) + \frac{b}{c \cdot z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(\left(z \cdot 4\right) \cdot t\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t \cdot a\right) \cdot -4 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -2.3999999999999999e188Initial program 47.3%
associate-+l-47.3%
*-commutative47.3%
associate-*r*43.3%
*-commutative43.3%
associate-+l-43.3%
associate-*l*43.3%
associate-*l*47.3%
*-commutative47.3%
Simplified47.3%
Taylor expanded in x around inf 70.6%
Taylor expanded in x around 0 81.5%
cancel-sign-sub-inv81.5%
metadata-eval81.5%
associate-*r/81.5%
*-commutative81.5%
associate-*r*81.5%
associate-/l*81.7%
*-commutative81.7%
associate-*r/81.7%
Simplified81.7%
if -2.3999999999999999e188 < z < 8.49999999999999966e136Initial program 90.6%
if 8.49999999999999966e136 < z Initial program 42.4%
associate-+l-42.4%
*-commutative42.4%
associate-*r*62.1%
*-commutative62.1%
associate-+l-62.1%
associate-*l*64.9%
associate-*l*64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in x around inf 60.1%
Taylor expanded in x around 0 85.6%
cancel-sign-sub-inv85.6%
metadata-eval85.6%
associate-*r/85.6%
*-commutative85.6%
associate-*r*85.6%
associate-/l*85.4%
*-commutative85.4%
associate-*r/85.4%
Simplified85.4%
Taylor expanded in c around 0 91.1%
Final simplification89.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 (<= c 1.45e-51)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c z))
(*
b
(+
(/ (fma 9.0 (* y (/ (/ x c) z)) (* a (/ (* t -4.0) c))) b)
(/ (/ 1.0 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 tmp;
if (c <= 1.45e-51) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c * z);
} else {
tmp = b * ((fma(9.0, (y * ((x / c) / z)), (a * ((t * -4.0) / c))) / b) + ((1.0 / 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) tmp = 0.0 if (c <= 1.45e-51) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c * z)); else tmp = Float64(b * Float64(Float64(fma(9.0, Float64(y * Float64(Float64(x / c) / z)), Float64(a * Float64(Float64(t * -4.0) / c))) / b) + Float64(Float64(1.0 / c) / z))); 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_] := If[LessEqual[c, 1.45e-51], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(N[(9.0 * N[(y * N[(N[(x / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(t * -4.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] + N[(N[(1.0 / c), $MachinePrecision] / z), $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}\;c \leq 1.45 \cdot 10^{-51}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{\mathsf{fma}\left(9, y \cdot \frac{\frac{x}{c}}{z}, a \cdot \frac{t \cdot -4}{c}\right)}{b} + \frac{\frac{1}{c}}{z}\right)\\
\end{array}
\end{array}
if c < 1.44999999999999986e-51Initial program 85.0%
associate-+l-85.0%
*-commutative85.0%
associate-*r*86.6%
*-commutative86.6%
associate-+l-86.6%
associate-*l*87.2%
associate-*l*86.7%
*-commutative86.7%
Simplified86.7%
if 1.44999999999999986e-51 < c Initial program 67.9%
associate-+l-67.9%
*-commutative67.9%
associate-*r*71.5%
*-commutative71.5%
associate-+l-71.5%
associate-*l*71.5%
associate-*l*71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in b around inf 74.3%
Simplified87.6%
Final simplification87.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
(if (<= z -3.2e+190)
(+ (* a (* -4.0 (/ t c))) (/ b (* c z)))
(if (<= z 5.8e+134)
(/ (+ (- (* x (* 9.0 y)) (* (* z 4.0) (* t a))) b) (* c z))
(/ (+ (* (* t a) -4.0) (/ 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 (z <= -3.2e+190) {
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
} else if (z <= 5.8e+134) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c * z);
} else {
tmp = (((t * a) * -4.0) + (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 (z <= (-3.2d+190)) then
tmp = (a * ((-4.0d0) * (t / c))) + (b / (c * z))
else if (z <= 5.8d+134) then
tmp = (((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a))) + b) / (c * z)
else
tmp = (((t * a) * (-4.0d0)) + (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 (z <= -3.2e+190) {
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
} else if (z <= 5.8e+134) {
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c * z);
} else {
tmp = (((t * a) * -4.0) + (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 z <= -3.2e+190: tmp = (a * (-4.0 * (t / c))) + (b / (c * z)) elif z <= 5.8e+134: tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c * z) else: tmp = (((t * a) * -4.0) + (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 (z <= -3.2e+190) tmp = Float64(Float64(a * Float64(-4.0 * Float64(t / c))) + Float64(b / Float64(c * z))); elseif (z <= 5.8e+134) tmp = Float64(Float64(Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(c * z)); else tmp = Float64(Float64(Float64(Float64(t * a) * -4.0) + Float64(b / 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 <= -3.2e+190)
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
elseif (z <= 5.8e+134)
tmp = (((x * (9.0 * y)) - ((z * 4.0) * (t * a))) + b) / (c * z);
else
tmp = (((t * a) * -4.0) + (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[z, -3.2e+190], N[(N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+134], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / z), $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}\;z \leq -3.2 \cdot 10^{+190}:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c}\right) + \frac{b}{c \cdot z}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+134}:\\
\;\;\;\;\frac{\left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t \cdot a\right) \cdot -4 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -3.2000000000000001e190Initial program 47.3%
associate-+l-47.3%
*-commutative47.3%
associate-*r*43.3%
*-commutative43.3%
associate-+l-43.3%
associate-*l*43.3%
associate-*l*47.3%
*-commutative47.3%
Simplified47.3%
Taylor expanded in x around inf 70.6%
Taylor expanded in x around 0 81.5%
cancel-sign-sub-inv81.5%
metadata-eval81.5%
associate-*r/81.5%
*-commutative81.5%
associate-*r*81.5%
associate-/l*81.7%
*-commutative81.7%
associate-*r/81.7%
Simplified81.7%
if -3.2000000000000001e190 < z < 5.80000000000000023e134Initial program 90.6%
associate-+l-90.6%
*-commutative90.6%
associate-*r*90.5%
*-commutative90.5%
associate-+l-90.5%
associate-*l*90.5%
associate-*l*89.6%
*-commutative89.6%
Simplified89.6%
if 5.80000000000000023e134 < z Initial program 42.4%
associate-+l-42.4%
*-commutative42.4%
associate-*r*62.1%
*-commutative62.1%
associate-+l-62.1%
associate-*l*64.9%
associate-*l*64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in x around inf 60.1%
Taylor expanded in x around 0 85.6%
cancel-sign-sub-inv85.6%
metadata-eval85.6%
associate-*r/85.6%
*-commutative85.6%
associate-*r*85.6%
associate-/l*85.4%
*-commutative85.4%
associate-*r/85.4%
Simplified85.4%
Taylor expanded in c around 0 91.1%
Final simplification89.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
(if (<= t -330000000.0)
(* -4.0 (* a (/ t c)))
(if (<= t -3.1e-284)
(* b (/ 1.0 (* c z)))
(if (<= t 4.6e-263)
(* (* x 9.0) (/ y (* c z)))
(if (<= t 1.02e-73) (/ b (* c z)) (* t (* -4.0 (/ 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 (t <= -330000000.0) {
tmp = -4.0 * (a * (t / c));
} else if (t <= -3.1e-284) {
tmp = b * (1.0 / (c * z));
} else if (t <= 4.6e-263) {
tmp = (x * 9.0) * (y / (c * z));
} else if (t <= 1.02e-73) {
tmp = b / (c * z);
} else {
tmp = t * (-4.0 * (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 (t <= (-330000000.0d0)) then
tmp = (-4.0d0) * (a * (t / c))
else if (t <= (-3.1d-284)) then
tmp = b * (1.0d0 / (c * z))
else if (t <= 4.6d-263) then
tmp = (x * 9.0d0) * (y / (c * z))
else if (t <= 1.02d-73) then
tmp = b / (c * z)
else
tmp = t * ((-4.0d0) * (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 (t <= -330000000.0) {
tmp = -4.0 * (a * (t / c));
} else if (t <= -3.1e-284) {
tmp = b * (1.0 / (c * z));
} else if (t <= 4.6e-263) {
tmp = (x * 9.0) * (y / (c * z));
} else if (t <= 1.02e-73) {
tmp = b / (c * z);
} else {
tmp = t * (-4.0 * (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 t <= -330000000.0: tmp = -4.0 * (a * (t / c)) elif t <= -3.1e-284: tmp = b * (1.0 / (c * z)) elif t <= 4.6e-263: tmp = (x * 9.0) * (y / (c * z)) elif t <= 1.02e-73: tmp = b / (c * z) else: tmp = t * (-4.0 * (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 (t <= -330000000.0) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (t <= -3.1e-284) tmp = Float64(b * Float64(1.0 / Float64(c * z))); elseif (t <= 4.6e-263) tmp = Float64(Float64(x * 9.0) * Float64(y / Float64(c * z))); elseif (t <= 1.02e-73) tmp = Float64(b / Float64(c * z)); else tmp = Float64(t * Float64(-4.0 * 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 (t <= -330000000.0)
tmp = -4.0 * (a * (t / c));
elseif (t <= -3.1e-284)
tmp = b * (1.0 / (c * z));
elseif (t <= 4.6e-263)
tmp = (x * 9.0) * (y / (c * z));
elseif (t <= 1.02e-73)
tmp = b / (c * z);
else
tmp = t * (-4.0 * (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[t, -330000000.0], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.1e-284], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-263], N[(N[(x * 9.0), $MachinePrecision] * N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e-73], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(t * N[(-4.0 * 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}\;t \leq -330000000:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-284}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-263}:\\
\;\;\;\;\left(x \cdot 9\right) \cdot \frac{y}{c \cdot z}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-73}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if t < -3.3e8Initial program 79.5%
associate-+l-79.5%
*-commutative79.5%
associate-*r*81.2%
*-commutative81.2%
associate-+l-81.2%
associate-*l*81.2%
associate-*l*79.8%
*-commutative79.8%
Simplified79.8%
Taylor expanded in z around inf 59.1%
*-commutative59.1%
associate-/l*65.0%
Simplified65.0%
if -3.3e8 < t < -3.0999999999999998e-284Initial program 82.3%
associate-+l-82.3%
*-commutative82.3%
associate-*r*83.6%
*-commutative83.6%
associate-+l-83.6%
associate-*l*85.0%
associate-*l*85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in b around inf 42.0%
*-commutative42.0%
Simplified42.0%
div-inv42.0%
*-commutative42.0%
Applied egg-rr42.0%
if -3.0999999999999998e-284 < t < 4.60000000000000006e-263Initial program 80.8%
associate-+l-80.8%
*-commutative80.8%
associate-*r*70.6%
*-commutative70.6%
associate-+l-70.6%
associate-*l*70.6%
associate-*l*80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in z around 0 71.3%
associate-/l*80.3%
Applied egg-rr80.3%
Taylor expanded in x around inf 22.3%
associate-/l*41.1%
associate-*r*41.1%
*-commutative41.1%
Simplified41.1%
if 4.60000000000000006e-263 < t < 1.0199999999999999e-73Initial program 84.3%
associate-+l-84.3%
*-commutative84.3%
associate-*r*84.1%
*-commutative84.1%
associate-+l-84.1%
associate-*l*84.1%
associate-*l*87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in b around inf 50.3%
*-commutative50.3%
Simplified50.3%
if 1.0199999999999999e-73 < t Initial program 76.3%
associate-+l-76.3%
*-commutative76.3%
associate-*r*81.7%
*-commutative81.7%
associate-+l-81.7%
associate-*l*81.7%
associate-*l*79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in b around 0 56.4%
Taylor expanded in t around inf 62.9%
Taylor expanded in a around inf 42.0%
Final simplification48.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 (<= z -4.1e+27)
(* -4.0 (* a (/ t c)))
(if (<= z -1.35e-277)
(/ b (* c z))
(if (<= z 6e-181)
(* 9.0 (/ (* x y) (* c z)))
(if (<= z 4.6e-76) (/ 1.0 (/ (* c z) b)) (* -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 (z <= -4.1e+27) {
tmp = -4.0 * (a * (t / c));
} else if (z <= -1.35e-277) {
tmp = b / (c * z);
} else if (z <= 6e-181) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (z <= 4.6e-76) {
tmp = 1.0 / ((c * z) / b);
} 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 (z <= (-4.1d+27)) then
tmp = (-4.0d0) * (a * (t / c))
else if (z <= (-1.35d-277)) then
tmp = b / (c * z)
else if (z <= 6d-181) then
tmp = 9.0d0 * ((x * y) / (c * z))
else if (z <= 4.6d-76) then
tmp = 1.0d0 / ((c * z) / b)
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 (z <= -4.1e+27) {
tmp = -4.0 * (a * (t / c));
} else if (z <= -1.35e-277) {
tmp = b / (c * z);
} else if (z <= 6e-181) {
tmp = 9.0 * ((x * y) / (c * z));
} else if (z <= 4.6e-76) {
tmp = 1.0 / ((c * z) / b);
} 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 z <= -4.1e+27: tmp = -4.0 * (a * (t / c)) elif z <= -1.35e-277: tmp = b / (c * z) elif z <= 6e-181: tmp = 9.0 * ((x * y) / (c * z)) elif z <= 4.6e-76: tmp = 1.0 / ((c * z) / b) 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 (z <= -4.1e+27) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (z <= -1.35e-277) tmp = Float64(b / Float64(c * z)); elseif (z <= 6e-181) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(c * z))); elseif (z <= 4.6e-76) tmp = Float64(1.0 / Float64(Float64(c * z) / b)); else tmp = Float64(-4.0 * Float64(Float64(t * 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 (z <= -4.1e+27)
tmp = -4.0 * (a * (t / c));
elseif (z <= -1.35e-277)
tmp = b / (c * z);
elseif (z <= 6e-181)
tmp = 9.0 * ((x * y) / (c * z));
elseif (z <= 4.6e-76)
tmp = 1.0 / ((c * z) / b);
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[z, -4.1e+27], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.35e-277], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-181], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e-76], N[(1.0 / N[(N[(c * z), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $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 -4.1 \cdot 10^{+27}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-277}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-181}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{c \cdot z}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-76}:\\
\;\;\;\;\frac{1}{\frac{c \cdot z}{b}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\end{array}
\end{array}
if z < -4.1000000000000002e27Initial program 68.6%
associate-+l-68.6%
*-commutative68.6%
associate-*r*68.6%
*-commutative68.6%
associate-+l-68.6%
associate-*l*68.6%
associate-*l*70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 56.5%
*-commutative56.5%
associate-/l*58.1%
Simplified58.1%
if -4.1000000000000002e27 < z < -1.34999999999999988e-277Initial program 92.1%
associate-+l-92.1%
*-commutative92.1%
associate-*r*88.8%
*-commutative88.8%
associate-+l-88.8%
associate-*l*88.8%
associate-*l*92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in b around inf 56.4%
*-commutative56.4%
Simplified56.4%
if -1.34999999999999988e-277 < z < 5.99999999999999948e-181Initial program 94.1%
associate-+l-94.1%
*-commutative94.1%
associate-*r*96.9%
*-commutative96.9%
associate-+l-96.9%
associate-*l*97.0%
associate-*l*86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around inf 63.7%
if 5.99999999999999948e-181 < z < 4.60000000000000012e-76Initial program 95.1%
associate-+l-95.1%
*-commutative95.1%
associate-*r*99.7%
*-commutative99.7%
associate-+l-99.7%
associate-*l*99.6%
associate-*l*94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in b around inf 70.9%
*-commutative70.9%
Simplified70.9%
clear-num70.9%
inv-pow70.9%
*-commutative70.9%
Applied egg-rr70.9%
unpow-170.9%
associate-/l*61.5%
Simplified61.5%
Taylor expanded in c around 0 70.9%
if 4.60000000000000012e-76 < z Initial program 68.7%
associate-+l-68.7%
*-commutative68.7%
associate-*r*76.0%
*-commutative76.0%
associate-+l-76.0%
associate-*l*77.2%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in z around inf 59.0%
Final simplification59.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 9.0) -1e+189)
(* 9.0 (/ (* y (/ x c)) z))
(if (<= (* x 9.0) 2e-7)
(/ (+ (* (* t a) -4.0) (/ b z)) c)
(* (* x (/ 9.0 z)) (/ y 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 ((x * 9.0) <= -1e+189) {
tmp = 9.0 * ((y * (x / c)) / z);
} else if ((x * 9.0) <= 2e-7) {
tmp = (((t * a) * -4.0) + (b / z)) / c;
} else {
tmp = (x * (9.0 / z)) * (y / 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 ((x * 9.0d0) <= (-1d+189)) then
tmp = 9.0d0 * ((y * (x / c)) / z)
else if ((x * 9.0d0) <= 2d-7) then
tmp = (((t * a) * (-4.0d0)) + (b / z)) / c
else
tmp = (x * (9.0d0 / z)) * (y / 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 ((x * 9.0) <= -1e+189) {
tmp = 9.0 * ((y * (x / c)) / z);
} else if ((x * 9.0) <= 2e-7) {
tmp = (((t * a) * -4.0) + (b / z)) / c;
} else {
tmp = (x * (9.0 / z)) * (y / 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 (x * 9.0) <= -1e+189: tmp = 9.0 * ((y * (x / c)) / z) elif (x * 9.0) <= 2e-7: tmp = (((t * a) * -4.0) + (b / z)) / c else: tmp = (x * (9.0 / z)) * (y / 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 (Float64(x * 9.0) <= -1e+189) tmp = Float64(9.0 * Float64(Float64(y * Float64(x / c)) / z)); elseif (Float64(x * 9.0) <= 2e-7) tmp = Float64(Float64(Float64(Float64(t * a) * -4.0) + Float64(b / z)) / c); else tmp = Float64(Float64(x * Float64(9.0 / z)) * Float64(y / 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 ((x * 9.0) <= -1e+189)
tmp = 9.0 * ((y * (x / c)) / z);
elseif ((x * 9.0) <= 2e-7)
tmp = (((t * a) * -4.0) + (b / z)) / c;
else
tmp = (x * (9.0 / z)) * (y / 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[N[(x * 9.0), $MachinePrecision], -1e+189], N[(9.0 * N[(N[(y * N[(x / c), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * 9.0), $MachinePrecision], 2e-7], N[(N[(N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(x * N[(9.0 / z), $MachinePrecision]), $MachinePrecision] * N[(y / 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}\;x \cdot 9 \leq -1 \cdot 10^{+189}:\\
\;\;\;\;9 \cdot \frac{y \cdot \frac{x}{c}}{z}\\
\mathbf{elif}\;x \cdot 9 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\frac{\left(t \cdot a\right) \cdot -4 + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \frac{9}{z}\right) \cdot \frac{y}{c}\\
\end{array}
\end{array}
if (*.f64 x #s(literal 9 binary64)) < -1e189Initial program 70.5%
associate-+l-70.5%
*-commutative70.5%
associate-*r*78.8%
*-commutative78.8%
associate-+l-78.8%
associate-*l*82.8%
associate-*l*82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in b around inf 62.0%
Simplified74.7%
Taylor expanded in y around inf 70.1%
associate-/r*70.2%
*-commutative70.2%
associate-*r/78.1%
Simplified78.1%
if -1e189 < (*.f64 x #s(literal 9 binary64)) < 1.9999999999999999e-7Initial program 81.5%
associate-+l-81.5%
*-commutative81.5%
associate-*r*83.6%
*-commutative83.6%
associate-+l-83.6%
associate-*l*83.6%
associate-*l*83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in x around inf 59.3%
Taylor expanded in x around 0 80.4%
cancel-sign-sub-inv80.4%
metadata-eval80.4%
associate-*r/80.4%
*-commutative80.4%
associate-*r*80.4%
associate-/l*77.5%
*-commutative77.5%
associate-*r/77.5%
Simplified77.5%
Taylor expanded in c around 0 78.3%
if 1.9999999999999999e-7 < (*.f64 x #s(literal 9 binary64)) Initial program 78.2%
associate-+l-78.2%
*-commutative78.2%
associate-*r*78.3%
*-commutative78.3%
associate-+l-78.3%
associate-*l*78.3%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in x around inf 34.7%
associate-*r/34.8%
*-commutative34.8%
times-frac36.3%
associate-/l*41.1%
associate-*r*44.3%
Simplified44.3%
Final simplification70.6%
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 -3900.0) (not (<= z 4.6e-72))) (/ (+ (* (* t a) -4.0) (/ b z)) c) (/ (+ (* x (* 9.0 y)) b) (* 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 tmp;
if ((z <= -3900.0) || !(z <= 4.6e-72)) {
tmp = (((t * a) * -4.0) + (b / z)) / c;
} else {
tmp = ((x * (9.0 * y)) + b) / (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) :: tmp
if ((z <= (-3900.0d0)) .or. (.not. (z <= 4.6d-72))) then
tmp = (((t * a) * (-4.0d0)) + (b / z)) / c
else
tmp = ((x * (9.0d0 * y)) + b) / (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 tmp;
if ((z <= -3900.0) || !(z <= 4.6e-72)) {
tmp = (((t * a) * -4.0) + (b / z)) / c;
} else {
tmp = ((x * (9.0 * y)) + b) / (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): tmp = 0 if (z <= -3900.0) or not (z <= 4.6e-72): tmp = (((t * a) * -4.0) + (b / z)) / c else: tmp = ((x * (9.0 * y)) + b) / (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) tmp = 0.0 if ((z <= -3900.0) || !(z <= 4.6e-72)) tmp = Float64(Float64(Float64(Float64(t * a) * -4.0) + Float64(b / z)) / c); else tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(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)
tmp = 0.0;
if ((z <= -3900.0) || ~((z <= 4.6e-72)))
tmp = (((t * a) * -4.0) + (b / z)) / c;
else
tmp = ((x * (9.0 * y)) + b) / (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_] := If[Or[LessEqual[z, -3900.0], N[Not[LessEqual[z, 4.6e-72]], $MachinePrecision]], N[(N[(N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c * 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}
\mathbf{if}\;z \leq -3900 \lor \neg \left(z \leq 4.6 \cdot 10^{-72}\right):\\
\;\;\;\;\frac{\left(t \cdot a\right) \cdot -4 + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c \cdot z}\\
\end{array}
\end{array}
if z < -3900 or 4.59999999999999989e-72 < z Initial program 68.1%
associate-+l-68.1%
*-commutative68.1%
associate-*r*72.1%
*-commutative72.1%
associate-+l-72.1%
associate-*l*72.7%
associate-*l*74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in x around inf 69.0%
Taylor expanded in x around 0 78.1%
cancel-sign-sub-inv78.1%
metadata-eval78.1%
associate-*r/78.1%
*-commutative78.1%
associate-*r*78.1%
associate-/l*76.1%
*-commutative76.1%
associate-*r/76.1%
Simplified76.1%
Taylor expanded in c around 0 80.1%
if -3900 < z < 4.59999999999999989e-72Initial program 94.7%
associate-+l-94.7%
*-commutative94.7%
associate-*r*94.6%
*-commutative94.6%
associate-+l-94.6%
associate-*l*94.6%
associate-*l*92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in x around inf 83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*r*83.0%
Simplified83.0%
Final simplification81.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 (<= z -280.0)
(+ (* a (* -4.0 (/ t c))) (/ b (* c z)))
(if (<= z 1.65e-72)
(/ (+ (* x (* 9.0 y)) b) (* c z))
(/ (+ (* (* t a) -4.0) (/ 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 (z <= -280.0) {
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
} else if (z <= 1.65e-72) {
tmp = ((x * (9.0 * y)) + b) / (c * z);
} else {
tmp = (((t * a) * -4.0) + (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 (z <= (-280.0d0)) then
tmp = (a * ((-4.0d0) * (t / c))) + (b / (c * z))
else if (z <= 1.65d-72) then
tmp = ((x * (9.0d0 * y)) + b) / (c * z)
else
tmp = (((t * a) * (-4.0d0)) + (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 (z <= -280.0) {
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
} else if (z <= 1.65e-72) {
tmp = ((x * (9.0 * y)) + b) / (c * z);
} else {
tmp = (((t * a) * -4.0) + (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 z <= -280.0: tmp = (a * (-4.0 * (t / c))) + (b / (c * z)) elif z <= 1.65e-72: tmp = ((x * (9.0 * y)) + b) / (c * z) else: tmp = (((t * a) * -4.0) + (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 (z <= -280.0) tmp = Float64(Float64(a * Float64(-4.0 * Float64(t / c))) + Float64(b / Float64(c * z))); elseif (z <= 1.65e-72) tmp = Float64(Float64(Float64(x * Float64(9.0 * y)) + b) / Float64(c * z)); else tmp = Float64(Float64(Float64(Float64(t * a) * -4.0) + Float64(b / 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 <= -280.0)
tmp = (a * (-4.0 * (t / c))) + (b / (c * z));
elseif (z <= 1.65e-72)
tmp = ((x * (9.0 * y)) + b) / (c * z);
else
tmp = (((t * a) * -4.0) + (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[z, -280.0], N[(N[(a * N[(-4.0 * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-72], N[(N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision] + N[(b / z), $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}\;z \leq -280:\\
\;\;\;\;a \cdot \left(-4 \cdot \frac{t}{c}\right) + \frac{b}{c \cdot z}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-72}:\\
\;\;\;\;\frac{x \cdot \left(9 \cdot y\right) + b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t \cdot a\right) \cdot -4 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if z < -280Initial program 68.5%
associate-+l-68.5%
*-commutative68.5%
associate-*r*68.4%
*-commutative68.4%
associate-+l-68.4%
associate-*l*68.4%
associate-*l*70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in x around inf 67.4%
Taylor expanded in x around 0 74.4%
cancel-sign-sub-inv74.4%
metadata-eval74.4%
associate-*r/74.4%
*-commutative74.4%
associate-*r*74.4%
associate-/l*73.1%
*-commutative73.1%
associate-*r/73.1%
Simplified73.1%
if -280 < z < 1.65e-72Initial program 94.7%
associate-+l-94.7%
*-commutative94.7%
associate-*r*94.6%
*-commutative94.6%
associate-+l-94.6%
associate-*l*94.6%
associate-*l*92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in x around inf 83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*r*83.0%
Simplified83.0%
if 1.65e-72 < z Initial program 67.8%
associate-+l-67.8%
*-commutative67.8%
associate-*r*75.4%
*-commutative75.4%
associate-+l-75.4%
associate-*l*76.6%
associate-*l*77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in x around inf 70.4%
Taylor expanded in x around 0 81.3%
cancel-sign-sub-inv81.3%
metadata-eval81.3%
associate-*r/81.3%
*-commutative81.3%
associate-*r*81.3%
associate-/l*78.8%
*-commutative78.8%
associate-*r/78.8%
Simplified78.8%
Taylor expanded in c around 0 85.2%
Final simplification81.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 (if (or (<= z -320000.0) (not (<= z 9.5e-76))) (* -4.0 (/ (* t a) c)) (/ b (* 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 tmp;
if ((z <= -320000.0) || !(z <= 9.5e-76)) {
tmp = -4.0 * ((t * a) / c);
} else {
tmp = b / (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) :: tmp
if ((z <= (-320000.0d0)) .or. (.not. (z <= 9.5d-76))) then
tmp = (-4.0d0) * ((t * a) / c)
else
tmp = b / (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 tmp;
if ((z <= -320000.0) || !(z <= 9.5e-76)) {
tmp = -4.0 * ((t * a) / c);
} else {
tmp = b / (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): tmp = 0 if (z <= -320000.0) or not (z <= 9.5e-76): tmp = -4.0 * ((t * a) / c) else: tmp = b / (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) tmp = 0.0 if ((z <= -320000.0) || !(z <= 9.5e-76)) tmp = Float64(-4.0 * Float64(Float64(t * a) / c)); else tmp = Float64(b / Float64(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)
tmp = 0.0;
if ((z <= -320000.0) || ~((z <= 9.5e-76)))
tmp = -4.0 * ((t * a) / c);
else
tmp = b / (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_] := If[Or[LessEqual[z, -320000.0], N[Not[LessEqual[z, 9.5e-76]], $MachinePrecision]], N[(-4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * 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}
\mathbf{if}\;z \leq -320000 \lor \neg \left(z \leq 9.5 \cdot 10^{-76}\right):\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if z < -3.2e5 or 9.49999999999999984e-76 < z Initial program 69.0%
associate-+l-69.0%
*-commutative69.0%
associate-*r*73.0%
*-commutative73.0%
associate-+l-73.0%
associate-*l*73.6%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in z around inf 58.0%
if -3.2e5 < z < 9.49999999999999984e-76Initial program 93.8%
associate-+l-93.8%
*-commutative93.8%
associate-*r*93.7%
*-commutative93.7%
associate-+l-93.7%
associate-*l*93.7%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in b around inf 55.8%
*-commutative55.8%
Simplified55.8%
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 (if (<= z -3.2e+31) (* -4.0 (* a (/ t c))) (if (<= z 1.02e-75) (/ b (* c z)) (* -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 (z <= -3.2e+31) {
tmp = -4.0 * (a * (t / c));
} else if (z <= 1.02e-75) {
tmp = b / (c * z);
} 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 (z <= (-3.2d+31)) then
tmp = (-4.0d0) * (a * (t / c))
else if (z <= 1.02d-75) then
tmp = b / (c * z)
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 (z <= -3.2e+31) {
tmp = -4.0 * (a * (t / c));
} else if (z <= 1.02e-75) {
tmp = b / (c * z);
} 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 z <= -3.2e+31: tmp = -4.0 * (a * (t / c)) elif z <= 1.02e-75: tmp = b / (c * z) 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 (z <= -3.2e+31) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (z <= 1.02e-75) tmp = Float64(b / Float64(c * z)); else tmp = Float64(-4.0 * Float64(Float64(t * 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 (z <= -3.2e+31)
tmp = -4.0 * (a * (t / c));
elseif (z <= 1.02e-75)
tmp = b / (c * z);
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[z, -3.2e+31], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-75], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $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 -3.2 \cdot 10^{+31}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-75}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\end{array}
\end{array}
if z < -3.2000000000000001e31Initial program 68.6%
associate-+l-68.6%
*-commutative68.6%
associate-*r*68.6%
*-commutative68.6%
associate-+l-68.6%
associate-*l*68.6%
associate-*l*70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 56.5%
*-commutative56.5%
associate-/l*58.1%
Simplified58.1%
if -3.2000000000000001e31 < z < 1.01999999999999997e-75Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
associate-*r*93.1%
*-commutative93.1%
associate-+l-93.1%
associate-*l*93.1%
associate-*l*90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in b around inf 54.4%
*-commutative54.4%
Simplified54.4%
if 1.01999999999999997e-75 < z Initial program 68.7%
associate-+l-68.7%
*-commutative68.7%
associate-*r*76.0%
*-commutative76.0%
associate-+l-76.0%
associate-*l*77.2%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in z around inf 59.0%
Final simplification56.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 (<= z -116000.0) (* t (* -4.0 (/ a c))) (if (<= z 1e-75) (/ b (* c z)) (* -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 (z <= -116000.0) {
tmp = t * (-4.0 * (a / c));
} else if (z <= 1e-75) {
tmp = b / (c * z);
} 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 (z <= (-116000.0d0)) then
tmp = t * ((-4.0d0) * (a / c))
else if (z <= 1d-75) then
tmp = b / (c * z)
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 (z <= -116000.0) {
tmp = t * (-4.0 * (a / c));
} else if (z <= 1e-75) {
tmp = b / (c * z);
} 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 z <= -116000.0: tmp = t * (-4.0 * (a / c)) elif z <= 1e-75: tmp = b / (c * z) 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 (z <= -116000.0) tmp = Float64(t * Float64(-4.0 * Float64(a / c))); elseif (z <= 1e-75) tmp = Float64(b / Float64(c * z)); else tmp = Float64(-4.0 * Float64(Float64(t * 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 (z <= -116000.0)
tmp = t * (-4.0 * (a / c));
elseif (z <= 1e-75)
tmp = b / (c * z);
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[z, -116000.0], N[(t * N[(-4.0 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-75], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $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 -116000:\\
\;\;\;\;t \cdot \left(-4 \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 10^{-75}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t \cdot a}{c}\\
\end{array}
\end{array}
if z < -116000Initial program 69.5%
associate-+l-69.5%
*-commutative69.5%
associate-*r*69.4%
*-commutative69.4%
associate-+l-69.4%
associate-*l*69.4%
associate-*l*71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in b around 0 52.2%
Taylor expanded in t around inf 71.0%
Taylor expanded in a around inf 59.7%
if -116000 < z < 9.9999999999999996e-76Initial program 93.8%
associate-+l-93.8%
*-commutative93.8%
associate-*r*93.7%
*-commutative93.7%
associate-+l-93.7%
associate-*l*93.7%
associate-*l*91.2%
*-commutative91.2%
Simplified91.2%
Taylor expanded in b around inf 55.8%
*-commutative55.8%
Simplified55.8%
if 9.9999999999999996e-76 < z Initial program 68.7%
associate-+l-68.7%
*-commutative68.7%
associate-*r*76.0%
*-commutative76.0%
associate-+l-76.0%
associate-*l*77.2%
associate-*l*78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in z around inf 59.0%
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 (/ b (* 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) {
return b / (c * z);
}
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 / (c * z)
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 / (c * z);
}
[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 / (c * z)
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(c * z)) 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 / (c * z);
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[(c * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 79.8%
associate-+l-79.8%
*-commutative79.8%
associate-*r*81.9%
*-commutative81.9%
associate-+l-81.9%
associate-*l*82.3%
associate-*l*82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in b around inf 39.9%
*-commutative39.9%
Simplified39.9%
Final simplification39.9%
(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 2024101
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:alt
(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)))