
(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 17 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 and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= c -3e-41) (not (<= c 2.5e+14))) (fma -4.0 (/ a (/ c t)) (fma 9.0 (* (/ x c) (/ y z)) (/ b (* c z)))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((c <= -3e-41) || !(c <= 2.5e+14)) {
tmp = fma(-4.0, (a / (c / t)), fma(9.0, ((x / c) * (y / z)), (b / (c * z))));
} else {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((c <= -3e-41) || !(c <= 2.5e+14)) tmp = fma(-4.0, Float64(a / Float64(c / t)), fma(9.0, Float64(Float64(x / c) * Float64(y / z)), Float64(b / Float64(c * z)))); else tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[c, -3e-41], N[Not[LessEqual[c, 2.5e+14]], $MachinePrecision]], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{-41} \lor \neg \left(c \leq 2.5 \cdot 10^{+14}\right):\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{a}{\frac{c}{t}}, \mathsf{fma}\left(9, \frac{x}{c} \cdot \frac{y}{z}, \frac{b}{c \cdot z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\end{array}
\end{array}
if c < -2.99999999999999989e-41 or 2.5e14 < c Initial program 69.5%
Taylor expanded in x around 0 79.6%
cancel-sign-sub-inv79.6%
metadata-eval79.6%
+-commutative79.6%
fma-def79.6%
associate-/l*84.4%
fma-def84.4%
times-frac89.0%
*-commutative89.0%
Simplified89.0%
if -2.99999999999999989e-41 < c < 2.5e14Initial program 92.4%
associate-/r*94.0%
associate-+l-94.0%
associate-*r*94.0%
associate-*r*94.8%
div-inv94.8%
associate--r-94.8%
fma-neg94.8%
associate-*r*94.0%
distribute-rgt-neg-in94.0%
associate-*l*94.9%
Applied egg-rr94.9%
Taylor expanded in x around 0 96.4%
Final simplification92.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -800.0) (not (<= z 3.1e-71))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c)) (* (/ 1.0 z) (/ (fma x (* 9.0 y) (fma t (* z (* -4.0 a)) b)) c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -800.0) || !(z <= 3.1e-71)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (1.0 / z) * (fma(x, (9.0 * y), fma(t, (z * (-4.0 * a)), b)) / c);
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -800.0) || !(z <= 3.1e-71)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); else tmp = Float64(Float64(1.0 / z) * Float64(fma(x, Float64(9.0 * y), fma(t, Float64(z * Float64(-4.0 * a)), b)) / c)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -800.0], N[Not[LessEqual[z, 3.1e-71]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / z), $MachinePrecision] * N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(t * N[(z * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -800 \lor \neg \left(z \leq 3.1 \cdot 10^{-71}\right):\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{\mathsf{fma}\left(x, 9 \cdot y, \mathsf{fma}\left(t, z \cdot \left(-4 \cdot a\right), b\right)\right)}{c}\\
\end{array}
\end{array}
if z < -800 or 3.10000000000000002e-71 < z Initial program 66.1%
associate-/r*73.4%
associate-+l-73.3%
associate-*r*73.4%
associate-*r*77.5%
div-inv77.5%
associate--r-77.5%
fma-neg77.5%
associate-*r*73.4%
distribute-rgt-neg-in73.4%
associate-*l*74.1%
Applied egg-rr74.1%
Taylor expanded in x around 0 86.9%
if -800 < z < 3.10000000000000002e-71Initial program 96.4%
Simplified95.6%
*-un-lft-identity95.6%
times-frac95.9%
+-commutative95.9%
fma-def95.9%
Applied egg-rr95.9%
Final simplification90.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -2.5e+157) (not (<= z 1e-13))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c)) (/ (fma x (* 9.0 y) (+ b (* t (* z (* -4.0 a))))) (* c z))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.5e+157) || !(z <= 1e-13)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = fma(x, (9.0 * y), (b + (t * (z * (-4.0 * a))))) / (c * z);
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.5e+157) || !(z <= 1e-13)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); else tmp = Float64(fma(x, Float64(9.0 * y), Float64(b + Float64(t * Float64(z * Float64(-4.0 * a))))) / Float64(c * z)); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -2.5e+157], N[Not[LessEqual[z, 1e-13]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(9.0 * y), $MachinePrecision] + N[(b + N[(t * N[(z * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+157} \lor \neg \left(z \leq 10^{-13}\right):\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 9 \cdot y, b + t \cdot \left(z \cdot \left(-4 \cdot a\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -2.49999999999999988e157 or 1e-13 < z Initial program 59.7%
associate-/r*69.1%
associate-+l-69.1%
associate-*r*69.1%
associate-*r*74.4%
div-inv74.4%
associate--r-74.5%
fma-neg74.5%
associate-*r*69.1%
distribute-rgt-neg-in69.1%
associate-*l*70.0%
Applied egg-rr70.0%
Taylor expanded in x around 0 86.6%
if -2.49999999999999988e157 < z < 1e-13Initial program 94.6%
Simplified94.0%
Final simplification90.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -3.2e+102) (not (<= z 2.2e-13))) (* (+ (* -4.0 (* a t)) (+ (* 9.0 (/ (* x y) z)) (/ b z))) (/ 1.0 c)) (/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c z))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.2e+102) || !(z <= 2.2e-13)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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+102)) .or. (.not. (z <= 2.2d-13))) then
tmp = (((-4.0d0) * (a * t)) + ((9.0d0 * ((x * y) / z)) + (b / z))) * (1.0d0 / c)
else
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.2e+102) || !(z <= 2.2e-13)) {
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
} else {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.2e+102) or not (z <= 2.2e-13): tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c) else: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.2e+102) || !(z <= 2.2e-13)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(Float64(9.0 * Float64(Float64(x * y) / z)) + Float64(b / z))) * Float64(1.0 / c)); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -3.2e+102) || ~((z <= 2.2e-13)))
tmp = ((-4.0 * (a * t)) + ((9.0 * ((x * y) / z)) + (b / z))) * (1.0 / c);
else
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -3.2e+102], N[Not[LessEqual[z, 2.2e-13]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+102} \lor \neg \left(z \leq 2.2 \cdot 10^{-13}\right):\\
\;\;\;\;\left(-4 \cdot \left(a \cdot t\right) + \left(9 \cdot \frac{x \cdot y}{z} + \frac{b}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -3.1999999999999999e102 or 2.19999999999999997e-13 < z Initial program 62.2%
associate-/r*70.9%
associate-+l-70.9%
associate-*r*70.9%
associate-*r*75.8%
div-inv75.8%
associate--r-75.8%
fma-neg75.8%
associate-*r*70.9%
distribute-rgt-neg-in70.9%
associate-*l*71.7%
Applied egg-rr71.7%
Taylor expanded in x around 0 86.9%
if -3.1999999999999999e102 < z < 2.19999999999999997e-13Initial program 94.9%
Final simplification91.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a t))))
(if (<= z -2e+186)
(/ (+ t_1 (/ b z)) c)
(if (<= z 1.3e+106)
(/ (+ b (- (* y (* 9.0 x)) (* a (* t (* z 4.0))))) (* c z))
(/ (+ t_1 (* 9.0 (/ (* x y) z))) c)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (z <= -2e+186) {
tmp = (t_1 + (b / z)) / c;
} else if (z <= 1.3e+106) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) :: tmp
t_1 = (-4.0d0) * (a * t)
if (z <= (-2d+186)) then
tmp = (t_1 + (b / z)) / c
else if (z <= 1.3d+106) then
tmp = (b + ((y * (9.0d0 * x)) - (a * (t * (z * 4.0d0))))) / (c * z)
else
tmp = (t_1 + (9.0d0 * ((x * y) / z))) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (z <= -2e+186) {
tmp = (t_1 + (b / z)) / c;
} else if (z <= 1.3e+106) {
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
} else {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) tmp = 0 if z <= -2e+186: tmp = (t_1 + (b / z)) / c elif z <= 1.3e+106: tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z) else: tmp = (t_1 + (9.0 * ((x * y) / z))) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (z <= -2e+186) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); elseif (z <= 1.3e+106) tmp = Float64(Float64(b + Float64(Float64(y * Float64(9.0 * x)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(c * z)); else tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (z <= -2e+186)
tmp = (t_1 + (b / z)) / c;
elseif (z <= 1.3e+106)
tmp = (b + ((y * (9.0 * x)) - (a * (t * (z * 4.0))))) / (c * z);
else
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+186], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.3e+106], N[(N[(b + N[(N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+186}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(9 \cdot x\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\end{array}
\end{array}
if z < -1.99999999999999996e186Initial program 51.1%
associate-/r*77.7%
associate-+l-77.7%
associate-*r*77.7%
associate-*r*81.0%
div-inv81.0%
associate--r-81.0%
fma-neg81.0%
associate-*r*77.7%
distribute-rgt-neg-in77.7%
associate-*l*77.7%
Applied egg-rr77.7%
Taylor expanded in x around 0 93.4%
Taylor expanded in x around 0 81.3%
if -1.99999999999999996e186 < z < 1.3000000000000001e106Initial program 90.4%
if 1.3000000000000001e106 < z Initial program 53.6%
associate-/r*58.6%
associate-+l-58.6%
associate-*r*58.7%
associate-*r*63.3%
div-inv63.3%
associate--r-63.3%
fma-neg63.3%
associate-*r*58.7%
distribute-rgt-neg-in58.7%
associate-*l*61.0%
Applied egg-rr61.0%
Taylor expanded in x around 0 81.5%
Taylor expanded in b around 0 72.4%
Final simplification86.4%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* -4.0 (* a t))))
(if (<= b -7e+69)
(/ (+ b (* y (* 9.0 x))) (* c z))
(if (<= b 4.2e-33)
(/ (+ t_1 (* 9.0 (/ (* x y) z))) c)
(/ (+ t_1 (/ b z)) c)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (b <= -7e+69) {
tmp = (b + (y * (9.0 * x))) / (c * z);
} else if (b <= 4.2e-33) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) :: tmp
t_1 = (-4.0d0) * (a * t)
if (b <= (-7d+69)) then
tmp = (b + (y * (9.0d0 * x))) / (c * z)
else if (b <= 4.2d-33) then
tmp = (t_1 + (9.0d0 * ((x * y) / z))) / c
else
tmp = (t_1 + (b / z)) / c
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = -4.0 * (a * t);
double tmp;
if (b <= -7e+69) {
tmp = (b + (y * (9.0 * x))) / (c * z);
} else if (b <= 4.2e-33) {
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
} else {
tmp = (t_1 + (b / z)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = -4.0 * (a * t) tmp = 0 if b <= -7e+69: tmp = (b + (y * (9.0 * x))) / (c * z) elif b <= 4.2e-33: tmp = (t_1 + (9.0 * ((x * y) / z))) / c else: tmp = (t_1 + (b / z)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(-4.0 * Float64(a * t)) tmp = 0.0 if (b <= -7e+69) tmp = Float64(Float64(b + Float64(y * Float64(9.0 * x))) / Float64(c * z)); elseif (b <= 4.2e-33) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(Float64(x * y) / z))) / c); else tmp = Float64(Float64(t_1 + Float64(b / z)) / c); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = -4.0 * (a * t);
tmp = 0.0;
if (b <= -7e+69)
tmp = (b + (y * (9.0 * x))) / (c * z);
elseif (b <= 4.2e-33)
tmp = (t_1 + (9.0 * ((x * y) / z))) / c;
else
tmp = (t_1 + (b / z)) / c;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7e+69], N[(N[(b + N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e-33], N[(N[(t$95$1 + N[(9.0 * N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(a \cdot t\right)\\
\mathbf{if}\;b \leq -7 \cdot 10^{+69}:\\
\;\;\;\;\frac{b + y \cdot \left(9 \cdot x\right)}{c \cdot z}\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{-33}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{x \cdot y}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -6.99999999999999974e69Initial program 84.6%
Taylor expanded in z around 0 80.2%
associate-*r*80.3%
*-commutative80.3%
Simplified80.3%
if -6.99999999999999974e69 < b < 4.2e-33Initial program 81.1%
associate-/r*83.5%
associate-+l-83.5%
associate-*r*83.5%
associate-*r*85.6%
div-inv85.6%
associate--r-85.6%
fma-neg85.6%
associate-*r*83.5%
distribute-rgt-neg-in83.5%
associate-*l*83.5%
Applied egg-rr83.5%
Taylor expanded in x around 0 89.6%
Taylor expanded in b around 0 81.3%
if 4.2e-33 < b Initial program 74.1%
associate-/r*69.4%
associate-+l-69.4%
associate-*r*69.4%
associate-*r*73.4%
div-inv73.3%
associate--r-73.3%
fma-neg73.3%
associate-*r*69.3%
distribute-rgt-neg-in69.3%
associate-*l*70.6%
Applied egg-rr70.6%
Taylor expanded in x around 0 78.6%
Taylor expanded in x around 0 74.6%
Final simplification79.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 9.0 (* (/ x c) (/ y z)))))
(if (<= a 3.4e-242)
t_1
(if (<= a 5.2e-163)
(* b (/ 1.0 (* c z)))
(if (<= a 1.18e-17) t_1 (* -4.0 (/ a (/ c t))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((x / c) * (y / z));
double tmp;
if (a <= 3.4e-242) {
tmp = t_1;
} else if (a <= 5.2e-163) {
tmp = b * (1.0 / (c * z));
} else if (a <= 1.18e-17) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) :: tmp
t_1 = 9.0d0 * ((x / c) * (y / z))
if (a <= 3.4d-242) then
tmp = t_1
else if (a <= 5.2d-163) then
tmp = b * (1.0d0 / (c * z))
else if (a <= 1.18d-17) then
tmp = t_1
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((x / c) * (y / z));
double tmp;
if (a <= 3.4e-242) {
tmp = t_1;
} else if (a <= 5.2e-163) {
tmp = b * (1.0 / (c * z));
} else if (a <= 1.18e-17) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * ((x / c) * (y / z)) tmp = 0 if a <= 3.4e-242: tmp = t_1 elif a <= 5.2e-163: tmp = b * (1.0 / (c * z)) elif a <= 1.18e-17: tmp = t_1 else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))) tmp = 0.0 if (a <= 3.4e-242) tmp = t_1; elseif (a <= 5.2e-163) tmp = Float64(b * Float64(1.0 / Float64(c * z))); elseif (a <= 1.18e-17) tmp = t_1; else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * ((x / c) * (y / z));
tmp = 0.0;
if (a <= 3.4e-242)
tmp = t_1;
elseif (a <= 5.2e-163)
tmp = b * (1.0 / (c * z));
elseif (a <= 1.18e-17)
tmp = t_1;
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 3.4e-242], t$95$1, If[LessEqual[a, 5.2e-163], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.18e-17], t$95$1, N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{if}\;a \leq 3.4 \cdot 10^{-242}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-163}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{elif}\;a \leq 1.18 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if a < 3.4000000000000001e-242 or 5.20000000000000003e-163 < a < 1.18000000000000004e-17Initial program 79.0%
Taylor expanded in x around inf 44.9%
times-frac47.7%
Simplified47.7%
if 3.4000000000000001e-242 < a < 5.20000000000000003e-163Initial program 81.5%
Taylor expanded in b around inf 43.7%
*-commutative43.7%
Simplified43.7%
div-inv48.2%
Applied egg-rr48.2%
if 1.18000000000000004e-17 < a Initial program 80.8%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*66.0%
Simplified66.0%
Final simplification52.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a 3.55e-237)
(* 9.0 (* y (/ (/ x c) z)))
(if (<= a 3e-163)
(* b (/ 1.0 (* c z)))
(if (<= a 9.5e-19) (* 9.0 (* (/ x c) (/ y z))) (* -4.0 (/ a (/ c t)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 3.55e-237) {
tmp = 9.0 * (y * ((x / c) / z));
} else if (a <= 3e-163) {
tmp = b * (1.0 / (c * z));
} else if (a <= 9.5e-19) {
tmp = 9.0 * ((x / c) * (y / z));
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.55d-237) then
tmp = 9.0d0 * (y * ((x / c) / z))
else if (a <= 3d-163) then
tmp = b * (1.0d0 / (c * z))
else if (a <= 9.5d-19) then
tmp = 9.0d0 * ((x / c) * (y / z))
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 3.55e-237) {
tmp = 9.0 * (y * ((x / c) / z));
} else if (a <= 3e-163) {
tmp = b * (1.0 / (c * z));
} else if (a <= 9.5e-19) {
tmp = 9.0 * ((x / c) * (y / z));
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= 3.55e-237: tmp = 9.0 * (y * ((x / c) / z)) elif a <= 3e-163: tmp = b * (1.0 / (c * z)) elif a <= 9.5e-19: tmp = 9.0 * ((x / c) * (y / z)) else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= 3.55e-237) tmp = Float64(9.0 * Float64(y * Float64(Float64(x / c) / z))); elseif (a <= 3e-163) tmp = Float64(b * Float64(1.0 / Float64(c * z))); elseif (a <= 9.5e-19) tmp = Float64(9.0 * Float64(Float64(x / c) * Float64(y / z))); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= 3.55e-237)
tmp = 9.0 * (y * ((x / c) / z));
elseif (a <= 3e-163)
tmp = b * (1.0 / (c * z));
elseif (a <= 9.5e-19)
tmp = 9.0 * ((x / c) * (y / z));
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 3.55e-237], N[(9.0 * N[(y * N[(N[(x / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e-163], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-19], N[(9.0 * N[(N[(x / c), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.55 \cdot 10^{-237}:\\
\;\;\;\;9 \cdot \left(y \cdot \frac{\frac{x}{c}}{z}\right)\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-163}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-19}:\\
\;\;\;\;9 \cdot \left(\frac{x}{c} \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if a < 3.5499999999999999e-237Initial program 80.6%
Simplified80.0%
*-un-lft-identity80.0%
times-frac82.4%
+-commutative82.4%
fma-def82.4%
Applied egg-rr82.4%
Taylor expanded in x around inf 46.7%
times-frac47.3%
associate-*r/48.8%
associate-/l*47.4%
associate-/r/48.3%
Simplified48.3%
if 3.5499999999999999e-237 < a < 3.0000000000000002e-163Initial program 81.5%
Taylor expanded in b around inf 43.7%
*-commutative43.7%
Simplified43.7%
div-inv48.2%
Applied egg-rr48.2%
if 3.0000000000000002e-163 < a < 9.4999999999999995e-19Initial program 72.6%
Taylor expanded in x around inf 37.9%
times-frac49.4%
Simplified49.4%
if 9.4999999999999995e-19 < a Initial program 80.8%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*66.0%
Simplified66.0%
Final simplification53.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a 3.4e-237)
(* 9.0 (* y (/ (/ x c) z)))
(if (<= a 1.02e-162)
(* b (/ 1.0 (* c z)))
(if (<= a 1.3e-20) (* 9.0 (/ x (* c (/ z y)))) (* -4.0 (/ a (/ c t)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 3.4e-237) {
tmp = 9.0 * (y * ((x / c) / z));
} else if (a <= 1.02e-162) {
tmp = b * (1.0 / (c * z));
} else if (a <= 1.3e-20) {
tmp = 9.0 * (x / (c * (z / y)));
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.4d-237) then
tmp = 9.0d0 * (y * ((x / c) / z))
else if (a <= 1.02d-162) then
tmp = b * (1.0d0 / (c * z))
else if (a <= 1.3d-20) then
tmp = 9.0d0 * (x / (c * (z / y)))
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 3.4e-237) {
tmp = 9.0 * (y * ((x / c) / z));
} else if (a <= 1.02e-162) {
tmp = b * (1.0 / (c * z));
} else if (a <= 1.3e-20) {
tmp = 9.0 * (x / (c * (z / y)));
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= 3.4e-237: tmp = 9.0 * (y * ((x / c) / z)) elif a <= 1.02e-162: tmp = b * (1.0 / (c * z)) elif a <= 1.3e-20: tmp = 9.0 * (x / (c * (z / y))) else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= 3.4e-237) tmp = Float64(9.0 * Float64(y * Float64(Float64(x / c) / z))); elseif (a <= 1.02e-162) tmp = Float64(b * Float64(1.0 / Float64(c * z))); elseif (a <= 1.3e-20) tmp = Float64(9.0 * Float64(x / Float64(c * Float64(z / y)))); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= 3.4e-237)
tmp = 9.0 * (y * ((x / c) / z));
elseif (a <= 1.02e-162)
tmp = b * (1.0 / (c * z));
elseif (a <= 1.3e-20)
tmp = 9.0 * (x / (c * (z / y)));
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 3.4e-237], N[(9.0 * N[(y * N[(N[(x / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e-162], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3e-20], N[(9.0 * N[(x / N[(c * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.4 \cdot 10^{-237}:\\
\;\;\;\;9 \cdot \left(y \cdot \frac{\frac{x}{c}}{z}\right)\\
\mathbf{elif}\;a \leq 1.02 \cdot 10^{-162}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{-20}:\\
\;\;\;\;9 \cdot \frac{x}{c \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if a < 3.4000000000000002e-237Initial program 80.6%
Simplified80.0%
*-un-lft-identity80.0%
times-frac82.4%
+-commutative82.4%
fma-def82.4%
Applied egg-rr82.4%
Taylor expanded in x around inf 46.7%
times-frac47.3%
associate-*r/48.8%
associate-/l*47.4%
associate-/r/48.3%
Simplified48.3%
if 3.4000000000000002e-237 < a < 1.01999999999999998e-162Initial program 81.5%
Taylor expanded in b around inf 43.7%
*-commutative43.7%
Simplified43.7%
div-inv48.2%
Applied egg-rr48.2%
if 1.01999999999999998e-162 < a < 1.29999999999999997e-20Initial program 72.6%
associate-/r*68.0%
associate-+l-68.0%
associate-*r*68.1%
associate-*r*71.0%
div-inv71.2%
associate--r-71.2%
fma-neg71.2%
associate-*r*68.2%
distribute-rgt-neg-in68.2%
associate-*l*68.2%
Applied egg-rr68.2%
Taylor expanded in x around 0 77.1%
Taylor expanded in x around inf 37.9%
associate-/l*52.1%
associate-*r/55.1%
Simplified55.1%
if 1.29999999999999997e-20 < a Initial program 80.8%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*66.0%
Simplified66.0%
Final simplification54.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= a 5.3e-239)
(* 9.0 (* y (/ (/ x c) z)))
(if (<= a 2.3e-163)
(* b (/ 1.0 (* c z)))
(if (<= a 5.5e-22) (/ (* 9.0 x) (* c (/ z y))) (* -4.0 (/ a (/ c t)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 5.3e-239) {
tmp = 9.0 * (y * ((x / c) / z));
} else if (a <= 2.3e-163) {
tmp = b * (1.0 / (c * z));
} else if (a <= 5.5e-22) {
tmp = (9.0 * x) / (c * (z / y));
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.3d-239) then
tmp = 9.0d0 * (y * ((x / c) / z))
else if (a <= 2.3d-163) then
tmp = b * (1.0d0 / (c * z))
else if (a <= 5.5d-22) then
tmp = (9.0d0 * x) / (c * (z / y))
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= 5.3e-239) {
tmp = 9.0 * (y * ((x / c) / z));
} else if (a <= 2.3e-163) {
tmp = b * (1.0 / (c * z));
} else if (a <= 5.5e-22) {
tmp = (9.0 * x) / (c * (z / y));
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= 5.3e-239: tmp = 9.0 * (y * ((x / c) / z)) elif a <= 2.3e-163: tmp = b * (1.0 / (c * z)) elif a <= 5.5e-22: tmp = (9.0 * x) / (c * (z / y)) else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= 5.3e-239) tmp = Float64(9.0 * Float64(y * Float64(Float64(x / c) / z))); elseif (a <= 2.3e-163) tmp = Float64(b * Float64(1.0 / Float64(c * z))); elseif (a <= 5.5e-22) tmp = Float64(Float64(9.0 * x) / Float64(c * Float64(z / y))); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (a <= 5.3e-239)
tmp = 9.0 * (y * ((x / c) / z));
elseif (a <= 2.3e-163)
tmp = b * (1.0 / (c * z));
elseif (a <= 5.5e-22)
tmp = (9.0 * x) / (c * (z / y));
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, 5.3e-239], N[(9.0 * N[(y * N[(N[(x / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-163], N[(b * N[(1.0 / N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e-22], N[(N[(9.0 * x), $MachinePrecision] / N[(c * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.3 \cdot 10^{-239}:\\
\;\;\;\;9 \cdot \left(y \cdot \frac{\frac{x}{c}}{z}\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-163}:\\
\;\;\;\;b \cdot \frac{1}{c \cdot z}\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{9 \cdot x}{c \cdot \frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if a < 5.2999999999999997e-239Initial program 80.6%
Simplified80.0%
*-un-lft-identity80.0%
times-frac82.4%
+-commutative82.4%
fma-def82.4%
Applied egg-rr82.4%
Taylor expanded in x around inf 46.7%
times-frac47.3%
associate-*r/48.8%
associate-/l*47.4%
associate-/r/48.3%
Simplified48.3%
if 5.2999999999999997e-239 < a < 2.2999999999999999e-163Initial program 81.5%
Taylor expanded in b around inf 43.7%
*-commutative43.7%
Simplified43.7%
div-inv48.2%
Applied egg-rr48.2%
if 2.2999999999999999e-163 < a < 5.5000000000000001e-22Initial program 72.6%
associate-/r*68.0%
associate-+l-68.0%
associate-*r*68.1%
associate-*r*71.0%
div-inv71.2%
associate--r-71.2%
fma-neg71.2%
associate-*r*68.2%
distribute-rgt-neg-in68.2%
associate-*l*68.2%
Applied egg-rr68.2%
Taylor expanded in x around 0 77.1%
Taylor expanded in x around inf 37.9%
associate-/l*52.1%
associate-*r/55.1%
Simplified55.1%
associate-*r/55.2%
Applied egg-rr55.2%
if 5.5000000000000001e-22 < a Initial program 80.8%
Taylor expanded in z around inf 58.0%
*-commutative58.0%
associate-/l*66.0%
Simplified66.0%
Final simplification54.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -3.5e+35) (not (<= z 3.6e-13))) (/ (+ (* -4.0 (* a t)) (/ b z)) c) (/ (+ b (* y (* 9.0 x))) (* c z))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.5e+35) || !(z <= 3.6e-13)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + (y * (9.0 * x))) / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.5d+35)) .or. (.not. (z <= 3.6d-13))) then
tmp = (((-4.0d0) * (a * t)) + (b / z)) / c
else
tmp = (b + (y * (9.0d0 * x))) / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -3.5e+35) || !(z <= 3.6e-13)) {
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
} else {
tmp = (b + (y * (9.0 * x))) / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -3.5e+35) or not (z <= 3.6e-13): tmp = ((-4.0 * (a * t)) + (b / z)) / c else: tmp = (b + (y * (9.0 * x))) / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -3.5e+35) || !(z <= 3.6e-13)) tmp = Float64(Float64(Float64(-4.0 * Float64(a * t)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(y * Float64(9.0 * x))) / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -3.5e+35) || ~((z <= 3.6e-13)))
tmp = ((-4.0 * (a * t)) + (b / z)) / c;
else
tmp = (b + (y * (9.0 * x))) / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[z, -3.5e+35], N[Not[LessEqual[z, 3.6e-13]], $MachinePrecision]], N[(N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+35} \lor \neg \left(z \leq 3.6 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{-4 \cdot \left(a \cdot t\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + y \cdot \left(9 \cdot x\right)}{c \cdot z}\\
\end{array}
\end{array}
if z < -3.5000000000000001e35 or 3.5999999999999998e-13 < z Initial program 63.5%
associate-/r*71.8%
associate-+l-71.8%
associate-*r*71.8%
associate-*r*76.5%
div-inv76.5%
associate--r-76.5%
fma-neg76.5%
associate-*r*71.8%
distribute-rgt-neg-in71.8%
associate-*l*72.6%
Applied egg-rr72.6%
Taylor expanded in x around 0 87.3%
Taylor expanded in x around 0 73.4%
if -3.5000000000000001e35 < z < 3.5999999999999998e-13Initial program 94.8%
Taylor expanded in z around 0 81.9%
associate-*r*81.9%
*-commutative81.9%
Simplified81.9%
Final simplification77.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -1.28e+39)
(/ (* -4.0 a) (/ c t))
(if (<= z 6.8e-13)
(/ (+ b (* y (* 9.0 x))) (* c z))
(* -4.0 (/ a (/ c t))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.28e+39) {
tmp = (-4.0 * a) / (c / t);
} else if (z <= 6.8e-13) {
tmp = (b + (y * (9.0 * x))) / (c * z);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-1.28d+39)) then
tmp = ((-4.0d0) * a) / (c / t)
else if (z <= 6.8d-13) then
tmp = (b + (y * (9.0d0 * x))) / (c * z)
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -1.28e+39) {
tmp = (-4.0 * a) / (c / t);
} else if (z <= 6.8e-13) {
tmp = (b + (y * (9.0 * x))) / (c * z);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -1.28e+39: tmp = (-4.0 * a) / (c / t) elif z <= 6.8e-13: tmp = (b + (y * (9.0 * x))) / (c * z) else: tmp = -4.0 * (a / (c / t)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -1.28e+39) tmp = Float64(Float64(-4.0 * a) / Float64(c / t)); elseif (z <= 6.8e-13) tmp = Float64(Float64(b + Float64(y * Float64(9.0 * x))) / Float64(c * z)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -1.28e+39)
tmp = (-4.0 * a) / (c / t);
elseif (z <= 6.8e-13)
tmp = (b + (y * (9.0 * x))) / (c * z);
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[z, -1.28e+39], N[(N[(-4.0 * a), $MachinePrecision] / N[(c / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-13], N[(N[(b + N[(y * N[(9.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c * z), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.28 \cdot 10^{+39}:\\
\;\;\;\;\frac{-4 \cdot a}{\frac{c}{t}}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{b + y \cdot \left(9 \cdot x\right)}{c \cdot z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -1.27999999999999994e39Initial program 64.1%
Taylor expanded in z around inf 57.1%
*-commutative57.1%
associate-/l*61.0%
Simplified61.0%
associate-*l/61.0%
Applied egg-rr61.0%
if -1.27999999999999994e39 < z < 6.80000000000000031e-13Initial program 94.8%
Taylor expanded in z around 0 81.9%
associate-*r*81.9%
*-commutative81.9%
Simplified81.9%
if 6.80000000000000031e-13 < z Initial program 63.0%
Taylor expanded in z around inf 55.1%
*-commutative55.1%
associate-/l*57.7%
Simplified57.7%
Final simplification70.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= b -1.7e+24) (/ (/ b c) z) (if (<= b 4e+121) (* -4.0 (/ (* a t) c)) (/ b (* c z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.7e+24) {
tmp = (b / c) / z;
} else if (b <= 4e+121) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-1.7d+24)) then
tmp = (b / c) / z
else if (b <= 4d+121) then
tmp = (-4.0d0) * ((a * t) / c)
else
tmp = b / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.7e+24) {
tmp = (b / c) / z;
} else if (b <= 4e+121) {
tmp = -4.0 * ((a * t) / c);
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1.7e+24: tmp = (b / c) / z elif b <= 4e+121: tmp = -4.0 * ((a * t) / c) else: tmp = b / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.7e+24) tmp = Float64(Float64(b / c) / z); elseif (b <= 4e+121) tmp = Float64(-4.0 * Float64(Float64(a * t) / c)); else tmp = Float64(b / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -1.7e+24)
tmp = (b / c) / z;
elseif (b <= 4e+121)
tmp = -4.0 * ((a * t) / c);
else
tmp = b / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1.7e+24], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 4e+121], N[(-4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+24}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+121}:\\
\;\;\;\;-4 \cdot \frac{a \cdot t}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if b < -1.7e24Initial program 82.3%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.8%
associate-*r*72.8%
div-inv72.7%
associate--r-72.7%
fma-neg72.7%
associate-*r*74.7%
distribute-rgt-neg-in74.7%
associate-*l*74.7%
Applied egg-rr74.7%
Taylor expanded in b around inf 55.4%
associate-*l/65.3%
un-div-inv65.3%
Applied egg-rr65.3%
if -1.7e24 < b < 4.00000000000000015e121Initial program 79.4%
Taylor expanded in z around inf 45.6%
if 4.00000000000000015e121 < b Initial program 78.0%
Taylor expanded in b around inf 59.0%
*-commutative59.0%
Simplified59.0%
Final simplification51.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= b -3e+28) (/ (/ b c) z) (if (<= b 6.4e+103) (* (/ a c) (* -4.0 t)) (/ b (* c z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3e+28) {
tmp = (b / c) / z;
} else if (b <= 6.4e+103) {
tmp = (a / c) * (-4.0 * t);
} else {
tmp = b / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-3d+28)) then
tmp = (b / c) / z
else if (b <= 6.4d+103) then
tmp = (a / c) * ((-4.0d0) * t)
else
tmp = b / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -3e+28) {
tmp = (b / c) / z;
} else if (b <= 6.4e+103) {
tmp = (a / c) * (-4.0 * t);
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -3e+28: tmp = (b / c) / z elif b <= 6.4e+103: tmp = (a / c) * (-4.0 * t) else: tmp = b / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -3e+28) tmp = Float64(Float64(b / c) / z); elseif (b <= 6.4e+103) tmp = Float64(Float64(a / c) * Float64(-4.0 * t)); else tmp = Float64(b / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -3e+28)
tmp = (b / c) / z;
elseif (b <= 6.4e+103)
tmp = (a / c) * (-4.0 * t);
else
tmp = b / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -3e+28], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 6.4e+103], N[(N[(a / c), $MachinePrecision] * N[(-4.0 * t), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+28}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{+103}:\\
\;\;\;\;\frac{a}{c} \cdot \left(-4 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if b < -3.0000000000000001e28Initial program 82.3%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.8%
associate-*r*72.8%
div-inv72.7%
associate--r-72.7%
fma-neg72.7%
associate-*r*74.7%
distribute-rgt-neg-in74.7%
associate-*l*74.7%
Applied egg-rr74.7%
Taylor expanded in b around inf 55.4%
associate-*l/65.3%
un-div-inv65.3%
Applied egg-rr65.3%
if -3.0000000000000001e28 < b < 6.39999999999999985e103Initial program 79.3%
associate-/r*79.2%
associate-+l-79.1%
associate-*r*79.2%
associate-*r*81.7%
div-inv81.7%
associate--r-81.7%
fma-neg81.7%
associate-*r*79.2%
distribute-rgt-neg-in79.2%
associate-*l*79.2%
Applied egg-rr79.2%
Taylor expanded in x around 0 87.1%
Taylor expanded in a around inf 44.9%
associate-/l*48.5%
*-commutative48.5%
associate-/r/46.7%
associate-*l*46.7%
Simplified46.7%
if 6.39999999999999985e103 < b Initial program 78.6%
Taylor expanded in b around inf 58.2%
*-commutative58.2%
Simplified58.2%
Final simplification52.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= b -1e+28) (/ (/ b c) z) (if (<= b 3.8e+121) (* -4.0 (/ a (/ c t))) (/ b (* c z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1e+28) {
tmp = (b / c) / z;
} else if (b <= 3.8e+121) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-1d+28)) then
tmp = (b / c) / z
else if (b <= 3.8d+121) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = b / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1e+28) {
tmp = (b / c) / z;
} else if (b <= 3.8e+121) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1e+28: tmp = (b / c) / z elif b <= 3.8e+121: tmp = -4.0 * (a / (c / t)) else: tmp = b / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1e+28) tmp = Float64(Float64(b / c) / z); elseif (b <= 3.8e+121) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(b / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -1e+28)
tmp = (b / c) / z;
elseif (b <= 3.8e+121)
tmp = -4.0 * (a / (c / t));
else
tmp = b / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1e+28], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 3.8e+121], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+28}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+121}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if b < -9.99999999999999958e27Initial program 82.3%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.8%
associate-*r*72.8%
div-inv72.7%
associate--r-72.7%
fma-neg72.7%
associate-*r*74.7%
distribute-rgt-neg-in74.7%
associate-*l*74.7%
Applied egg-rr74.7%
Taylor expanded in b around inf 55.4%
associate-*l/65.3%
un-div-inv65.3%
Applied egg-rr65.3%
if -9.99999999999999958e27 < b < 3.8e121Initial program 79.4%
Taylor expanded in z around inf 45.6%
*-commutative45.6%
associate-/l*49.1%
Simplified49.1%
if 3.8e121 < b Initial program 78.0%
Taylor expanded in b around inf 59.0%
*-commutative59.0%
Simplified59.0%
Final simplification53.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= b -1.25e+27) (/ (/ b c) z) (if (<= b 2.8e+121) (/ (* -4.0 a) (/ c t)) (/ b (* c z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.25e+27) {
tmp = (b / c) / z;
} else if (b <= 2.8e+121) {
tmp = (-4.0 * a) / (c / t);
} else {
tmp = b / (c * z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-1.25d+27)) then
tmp = (b / c) / z
else if (b <= 2.8d+121) then
tmp = ((-4.0d0) * a) / (c / t)
else
tmp = b / (c * z)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (b <= -1.25e+27) {
tmp = (b / c) / z;
} else if (b <= 2.8e+121) {
tmp = (-4.0 * a) / (c / t);
} else {
tmp = b / (c * z);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if b <= -1.25e+27: tmp = (b / c) / z elif b <= 2.8e+121: tmp = (-4.0 * a) / (c / t) else: tmp = b / (c * z) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (b <= -1.25e+27) tmp = Float64(Float64(b / c) / z); elseif (b <= 2.8e+121) tmp = Float64(Float64(-4.0 * a) / Float64(c / t)); else tmp = Float64(b / Float64(c * z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (b <= -1.25e+27)
tmp = (b / c) / z;
elseif (b <= 2.8e+121)
tmp = (-4.0 * a) / (c / t);
else
tmp = b / (c * z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[b, -1.25e+27], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[b, 2.8e+121], N[(N[(-4.0 * a), $MachinePrecision] / N[(c / t), $MachinePrecision]), $MachinePrecision], N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+121}:\\
\;\;\;\;\frac{-4 \cdot a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c \cdot z}\\
\end{array}
\end{array}
if b < -1.24999999999999995e27Initial program 82.3%
associate-/r*74.8%
associate-+l-74.8%
associate-*r*74.8%
associate-*r*72.8%
div-inv72.7%
associate--r-72.7%
fma-neg72.7%
associate-*r*74.7%
distribute-rgt-neg-in74.7%
associate-*l*74.7%
Applied egg-rr74.7%
Taylor expanded in b around inf 55.4%
associate-*l/65.3%
un-div-inv65.3%
Applied egg-rr65.3%
if -1.24999999999999995e27 < b < 2.80000000000000006e121Initial program 79.4%
Taylor expanded in z around inf 45.6%
*-commutative45.6%
associate-/l*49.1%
Simplified49.1%
associate-*l/49.1%
Applied egg-rr49.1%
if 2.80000000000000006e121 < b Initial program 78.0%
Taylor expanded in b around inf 59.0%
*-commutative59.0%
Simplified59.0%
Final simplification53.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a 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);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (c * z);
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (c * z)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(c * z)) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (c * z);
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a 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] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{c \cdot z}
\end{array}
Initial program 79.7%
Taylor expanded in b around inf 35.1%
*-commutative35.1%
Simplified35.1%
Final simplification35.1%
(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 2023318
(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)))