
(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 20 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: 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 (fma x (* 9.0 y) b)))
(if (<= z -4e-8)
(/ (fma t (* a -4.0) (/ t_1 z)) c)
(if (<= z 5e-57)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (fma t_1 (/ 1.0 z) (* t (* a -4.0))) c)))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(x, (9.0 * y), b);
double tmp;
if (z <= -4e-8) {
tmp = fma(t, (a * -4.0), (t_1 / z)) / c;
} else if (z <= 5e-57) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = fma(t_1, (1.0 / z), (t * (a * -4.0))) / c;
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = fma(x, Float64(9.0 * y), b) tmp = 0.0 if (z <= -4e-8) tmp = Float64(fma(t, Float64(a * -4.0), Float64(t_1 / z)) / c); elseif (z <= 5e-57) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(fma(t_1, Float64(1.0 / z), Float64(t * Float64(a * -4.0))) / c); end return tmp end
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[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision]}, If[LessEqual[z, -4e-8], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 5e-57], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(1.0 / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, 9 \cdot y, b\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{-8}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{t_1}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t_1, \frac{1}{z}, t \cdot \left(a \cdot -4\right)\right)}{c}\\
\end{array}
\end{array}
if z < -4.0000000000000001e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
if -4.0000000000000001e-8 < z < 5.0000000000000002e-57Initial program 97.4%
if 5.0000000000000002e-57 < z Initial program 71.8%
associate-/r*82.7%
Simplified91.2%
div-inv91.3%
fma-def91.3%
Applied egg-rr91.3%
Final simplification92.7%
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 (fma x (* 9.0 y) b)))
(if (<= z -2e-8)
(/ (fma t (* a -4.0) (/ t_1 z)) c)
(if (<= z 1.9e-57)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (+ (* t (* a -4.0)) (* t_1 (/ 1.0 z))) c)))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(x, (9.0 * y), b);
double tmp;
if (z <= -2e-8) {
tmp = fma(t, (a * -4.0), (t_1 / z)) / c;
} else if (z <= 1.9e-57) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((t * (a * -4.0)) + (t_1 * (1.0 / z))) / c;
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = fma(x, Float64(9.0 * y), b) tmp = 0.0 if (z <= -2e-8) tmp = Float64(fma(t, Float64(a * -4.0), Float64(t_1 / z)) / c); elseif (z <= 1.9e-57) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(t_1 * Float64(1.0 / z))) / c); end return tmp end
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[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision]}, If[LessEqual[z, -2e-8], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1.9e-57], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, 9 \cdot y, b\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{t_1}{z}\right)}{c}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-57}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + t_1 \cdot \frac{1}{z}}{c}\\
\end{array}
\end{array}
if z < -2e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
if -2e-8 < z < 1.8999999999999999e-57Initial program 97.4%
if 1.8999999999999999e-57 < z Initial program 71.8%
associate-/r*82.7%
Simplified91.2%
div-inv91.3%
Applied egg-rr91.3%
Final simplification92.7%
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 (* t (* a -4.0))) (t_2 (fma x (* 9.0 y) b)))
(if (<= z -4.6e-8)
(/ (+ (/ t_2 z) t_1) c)
(if (<= z 1e-63)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (+ t_1 (* t_2 (/ 1.0 z))) c)))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double t_2 = fma(x, (9.0 * y), b);
double tmp;
if (z <= -4.6e-8) {
tmp = ((t_2 / z) + t_1) / c;
} else if (z <= 1e-63) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (t_1 + (t_2 * (1.0 / z))) / c;
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) t_2 = fma(x, Float64(9.0 * y), b) tmp = 0.0 if (z <= -4.6e-8) tmp = Float64(Float64(Float64(t_2 / z) + t_1) / c); elseif (z <= 1e-63) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(t_1 + Float64(t_2 * Float64(1.0 / z))) / c); end return tmp end
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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision]}, If[LessEqual[z, -4.6e-8], N[(N[(N[(t$95$2 / z), $MachinePrecision] + t$95$1), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 1e-63], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(t$95$2 * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := \mathsf{fma}\left(x, 9 \cdot y, b\right)\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{t_2}{z} + t_1}{c}\\
\mathbf{elif}\;z \leq 10^{-63}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + t_2 \cdot \frac{1}{z}}{c}\\
\end{array}
\end{array}
if z < -4.6000000000000002e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
if -4.6000000000000002e-8 < z < 1.00000000000000007e-63Initial program 97.4%
if 1.00000000000000007e-63 < z Initial program 71.8%
associate-/r*82.7%
Simplified91.2%
div-inv91.3%
Applied egg-rr91.3%
Final simplification92.7%
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-8) (not (<= z 4.1e-57))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))))
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-8) || !(z <= 4.1e-57)) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.5e-8) || !(z <= 4.1e-57)) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); end return tmp end
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-8], N[Not[LessEqual[z, 4.1e-57]], $MachinePrecision]], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-8} \lor \neg \left(z \leq 4.1 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.4999999999999999e-8 or 4.1000000000000001e-57 < z Initial program 62.9%
associate-/r*71.1%
Simplified88.8%
if -2.4999999999999999e-8 < z < 4.1000000000000001e-57Initial program 97.4%
Final simplification92.7%
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 -2.005e+80)
(/ (+ (* t (* a -4.0)) (/ b z)) c)
(if (<= z 2.35e+24)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(- (+ (* 9.0 (/ (* x y) (* z c))) (/ b (* z c))) (* 4.0 (/ (* t a) c))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.005e+80) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (z <= 2.35e+24) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((9.0 * ((x * y) / (z * c))) + (b / (z * c))) - (4.0 * ((t * a) / c));
}
return tmp;
}
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 <= (-2.005d+80)) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else if (z <= 2.35d+24) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = ((9.0d0 * ((x * y) / (z * c))) + (b / (z * c))) - (4.0d0 * ((t * a) / c))
end if
code = tmp
end function
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 <= -2.005e+80) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (z <= 2.35e+24) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = ((9.0 * ((x * y) / (z * c))) + (b / (z * c))) - (4.0 * ((t * a) / c));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2.005e+80: tmp = ((t * (a * -4.0)) + (b / z)) / c elif z <= 2.35e+24: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = ((9.0 * ((x * y) / (z * c))) + (b / (z * c))) - (4.0 * ((t * a) / c)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.005e+80) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); elseif (z <= 2.35e+24) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))) + Float64(b / Float64(z * c))) - Float64(4.0 * Float64(Float64(t * a) / c))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -2.005e+80)
tmp = ((t * (a * -4.0)) + (b / z)) / c;
elseif (z <= 2.35e+24)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = ((9.0 * ((x * y) / (z * c))) + (b / (z * c))) - (4.0 * ((t * a) / c));
end
tmp_2 = tmp;
end
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, -2.005e+80], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 2.35e+24], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.005 \cdot 10^{+80}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+24}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \frac{x \cdot y}{z \cdot c} + \frac{b}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{c}\\
\end{array}
\end{array}
if z < -2.00500000000000011e80Initial program 37.3%
associate-/r*44.2%
Simplified84.5%
Taylor expanded in x around 0 80.9%
if -2.00500000000000011e80 < z < 2.35e24Initial program 96.9%
if 2.35e24 < z Initial program 58.3%
associate-*l*58.3%
associate-*l*60.2%
Simplified60.2%
Taylor expanded in x around 0 78.1%
Final simplification90.2%
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 y)))
(t_2 (/ (+ b t_1) (* z c)))
(t_3 (* t (* a -4.0))))
(if (<= z -3.2e+16)
(/ (+ t_3 (/ b z)) c)
(if (<= z -3e-50)
t_2
(if (<= z -9.5e-123)
(/ (- b (* 4.0 (* a (* z t)))) (* z c))
(if (<= z 1.25e-21) t_2 (/ (+ t_3 (/ t_1 z)) c)))))))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 * y);
double t_2 = (b + t_1) / (z * c);
double t_3 = t * (a * -4.0);
double tmp;
if (z <= -3.2e+16) {
tmp = (t_3 + (b / z)) / c;
} else if (z <= -3e-50) {
tmp = t_2;
} else if (z <= -9.5e-123) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else if (z <= 1.25e-21) {
tmp = t_2;
} else {
tmp = (t_3 + (t_1 / z)) / c;
}
return tmp;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 9.0d0 * (x * y)
t_2 = (b + t_1) / (z * c)
t_3 = t * (a * (-4.0d0))
if (z <= (-3.2d+16)) then
tmp = (t_3 + (b / z)) / c
else if (z <= (-3d-50)) then
tmp = t_2
else if (z <= (-9.5d-123)) then
tmp = (b - (4.0d0 * (a * (z * t)))) / (z * c)
else if (z <= 1.25d-21) then
tmp = t_2
else
tmp = (t_3 + (t_1 / z)) / c
end if
code = tmp
end function
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 * y);
double t_2 = (b + t_1) / (z * c);
double t_3 = t * (a * -4.0);
double tmp;
if (z <= -3.2e+16) {
tmp = (t_3 + (b / z)) / c;
} else if (z <= -3e-50) {
tmp = t_2;
} else if (z <= -9.5e-123) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else if (z <= 1.25e-21) {
tmp = t_2;
} else {
tmp = (t_3 + (t_1 / z)) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (x * y) t_2 = (b + t_1) / (z * c) t_3 = t * (a * -4.0) tmp = 0 if z <= -3.2e+16: tmp = (t_3 + (b / z)) / c elif z <= -3e-50: tmp = t_2 elif z <= -9.5e-123: tmp = (b - (4.0 * (a * (z * t)))) / (z * c) elif z <= 1.25e-21: tmp = t_2 else: tmp = (t_3 + (t_1 / z)) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(x * y)) t_2 = Float64(Float64(b + t_1) / Float64(z * c)) t_3 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -3.2e+16) tmp = Float64(Float64(t_3 + Float64(b / z)) / c); elseif (z <= -3e-50) tmp = t_2; elseif (z <= -9.5e-123) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); elseif (z <= 1.25e-21) tmp = t_2; else tmp = Float64(Float64(t_3 + Float64(t_1 / z)) / c); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * (x * y);
t_2 = (b + t_1) / (z * c);
t_3 = t * (a * -4.0);
tmp = 0.0;
if (z <= -3.2e+16)
tmp = (t_3 + (b / z)) / c;
elseif (z <= -3e-50)
tmp = t_2;
elseif (z <= -9.5e-123)
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
elseif (z <= 1.25e-21)
tmp = t_2;
else
tmp = (t_3 + (t_1 / z)) / c;
end
tmp_2 = tmp;
end
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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + t$95$1), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+16], N[(N[(t$95$3 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -3e-50], t$95$2, If[LessEqual[z, -9.5e-123], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-21], t$95$2, N[(N[(t$95$3 + N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(x \cdot y\right)\\
t_2 := \frac{b + t_1}{z \cdot c}\\
t_3 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{t_3 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-123}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-21}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3 + \frac{t_1}{z}}{c}\\
\end{array}
\end{array}
if z < -3.2e16Initial program 49.0%
associate-/r*54.2%
Simplified85.0%
Taylor expanded in x around 0 78.2%
if -3.2e16 < z < -2.9999999999999999e-50 or -9.5000000000000002e-123 < z < 1.24999999999999993e-21Initial program 98.2%
associate-/r*90.7%
Simplified89.0%
Taylor expanded in z around 0 88.8%
if -2.9999999999999999e-50 < z < -9.5000000000000002e-123Initial program 93.2%
associate-*l*93.2%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in x around 0 79.5%
if 1.24999999999999993e-21 < z Initial program 67.8%
associate-/r*80.2%
Simplified90.0%
Taylor expanded in x around inf 76.0%
Final simplification82.4%
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.005e+80) (not (<= z 2.9e+62))) (/ (+ (* t (* a -4.0)) (/ b z)) c) (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.005e+80) || !(z <= 2.9e+62)) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
}
return tmp;
}
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 <= (-2.005d+80)) .or. (.not. (z <= 2.9d+62))) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else
tmp = (b + ((x * (9.0d0 * y)) - ((z * 4.0d0) * (t * a)))) / (z * c)
end if
code = tmp
end function
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 <= -2.005e+80) || !(z <= 2.9e+62)) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2.005e+80) or not (z <= 2.9e+62): tmp = ((t * (a * -4.0)) + (b / z)) / c else: tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.005e+80) || !(z <= 2.9e+62)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c)); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -2.005e+80) || ~((z <= 2.9e+62)))
tmp = ((t * (a * -4.0)) + (b / z)) / c;
else
tmp = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
end
tmp_2 = tmp;
end
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.005e+80], N[Not[LessEqual[z, 2.9e+62]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.005 \cdot 10^{+80} \lor \neg \left(z \leq 2.9 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.00500000000000011e80 or 2.89999999999999984e62 < z Initial program 47.8%
associate-/r*58.8%
Simplified85.6%
Taylor expanded in x around 0 77.6%
if -2.00500000000000011e80 < z < 2.89999999999999984e62Initial program 94.7%
associate-*l*94.7%
associate-*l*91.2%
Simplified91.2%
Final simplification86.5%
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 (* t (* a -4.0))))
(if (<= z -2.005e+80)
(/ (+ t_1 (/ b z)) c)
(if (<= z 460.0)
(/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c))
(/ (+ t_1 (/ (* 9.0 (* x y)) z)) c)))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -2.005e+80) {
tmp = (t_1 + (b / z)) / c;
} else if (z <= 460.0) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (t_1 + ((9.0 * (x * y)) / z)) / c;
}
return tmp;
}
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 = t * (a * (-4.0d0))
if (z <= (-2.005d+80)) then
tmp = (t_1 + (b / z)) / c
else if (z <= 460.0d0) then
tmp = (b + ((y * (x * 9.0d0)) - (a * (t * (z * 4.0d0))))) / (z * c)
else
tmp = (t_1 + ((9.0d0 * (x * y)) / z)) / c
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -2.005e+80) {
tmp = (t_1 + (b / z)) / c;
} else if (z <= 460.0) {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
} else {
tmp = (t_1 + ((9.0 * (x * y)) / z)) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if z <= -2.005e+80: tmp = (t_1 + (b / z)) / c elif z <= 460.0: tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) else: tmp = (t_1 + ((9.0 * (x * y)) / z)) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -2.005e+80) tmp = Float64(Float64(t_1 + Float64(b / z)) / c); elseif (z <= 460.0) tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)); else tmp = Float64(Float64(t_1 + Float64(Float64(9.0 * Float64(x * y)) / z)) / c); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = t * (a * -4.0);
tmp = 0.0;
if (z <= -2.005e+80)
tmp = (t_1 + (b / z)) / c;
elseif (z <= 460.0)
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
else
tmp = (t_1 + ((9.0 * (x * y)) / z)) / c;
end
tmp_2 = tmp;
end
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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.005e+80], N[(N[(t$95$1 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 460.0], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -2.005 \cdot 10^{+80}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq 460:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{9 \cdot \left(x \cdot y\right)}{z}}{c}\\
\end{array}
\end{array}
if z < -2.00500000000000011e80Initial program 37.3%
associate-/r*44.2%
Simplified84.5%
Taylor expanded in x around 0 80.9%
if -2.00500000000000011e80 < z < 460Initial program 96.7%
if 460 < z Initial program 64.2%
associate-/r*78.0%
Simplified88.8%
Taylor expanded in x around inf 76.5%
Final simplification89.0%
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 (/ y (/ (* z c) x)))) (t_2 (/ b (* z c))))
(if (<= z -2.6e-8)
(/ (* -4.0 (* t a)) c)
(if (<= z -2.8e-92)
(* (/ 1.0 z) (/ b c))
(if (<= z -5.6e-123)
(* -4.0 (* t (/ a c)))
(if (<= z 1.9e-297)
t_1
(if (<= z 5.7e-260)
t_2
(if (<= z 3.05e-176)
t_1
(if (<= z 2.45e-23) t_2 (* -4.0 (/ a (/ c t))))))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * (y / ((z * c) / x));
double t_2 = b / (z * c);
double tmp;
if (z <= -2.6e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -2.8e-92) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -5.6e-123) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 1.9e-297) {
tmp = t_1;
} else if (z <= 5.7e-260) {
tmp = t_2;
} else if (z <= 3.05e-176) {
tmp = t_1;
} else if (z <= 2.45e-23) {
tmp = t_2;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
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) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (y / ((z * c) / x))
t_2 = b / (z * c)
if (z <= (-2.6d-8)) then
tmp = ((-4.0d0) * (t * a)) / c
else if (z <= (-2.8d-92)) then
tmp = (1.0d0 / z) * (b / c)
else if (z <= (-5.6d-123)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 1.9d-297) then
tmp = t_1
else if (z <= 5.7d-260) then
tmp = t_2
else if (z <= 3.05d-176) then
tmp = t_1
else if (z <= 2.45d-23) then
tmp = t_2
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
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 * (y / ((z * c) / x));
double t_2 = b / (z * c);
double tmp;
if (z <= -2.6e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -2.8e-92) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -5.6e-123) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 1.9e-297) {
tmp = t_1;
} else if (z <= 5.7e-260) {
tmp = t_2;
} else if (z <= 3.05e-176) {
tmp = t_1;
} else if (z <= 2.45e-23) {
tmp = t_2;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (y / ((z * c) / x)) t_2 = b / (z * c) tmp = 0 if z <= -2.6e-8: tmp = (-4.0 * (t * a)) / c elif z <= -2.8e-92: tmp = (1.0 / z) * (b / c) elif z <= -5.6e-123: tmp = -4.0 * (t * (a / c)) elif z <= 1.9e-297: tmp = t_1 elif z <= 5.7e-260: tmp = t_2 elif z <= 3.05e-176: tmp = t_1 elif z <= 2.45e-23: tmp = t_2 else: tmp = -4.0 * (a / (c / t)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(y / Float64(Float64(z * c) / x))) t_2 = Float64(b / Float64(z * c)) tmp = 0.0 if (z <= -2.6e-8) tmp = Float64(Float64(-4.0 * Float64(t * a)) / c); elseif (z <= -2.8e-92) tmp = Float64(Float64(1.0 / z) * Float64(b / c)); elseif (z <= -5.6e-123) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 1.9e-297) tmp = t_1; elseif (z <= 5.7e-260) tmp = t_2; elseif (z <= 3.05e-176) tmp = t_1; elseif (z <= 2.45e-23) tmp = t_2; else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = 9.0 * (y / ((z * c) / x));
t_2 = b / (z * c);
tmp = 0.0;
if (z <= -2.6e-8)
tmp = (-4.0 * (t * a)) / c;
elseif (z <= -2.8e-92)
tmp = (1.0 / z) * (b / c);
elseif (z <= -5.6e-123)
tmp = -4.0 * (t * (a / c));
elseif (z <= 1.9e-297)
tmp = t_1;
elseif (z <= 5.7e-260)
tmp = t_2;
elseif (z <= 3.05e-176)
tmp = t_1;
elseif (z <= 2.45e-23)
tmp = t_2;
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
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[(y / N[(N[(z * c), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-8], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -2.8e-92], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.6e-123], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-297], t$95$1, If[LessEqual[z, 5.7e-260], t$95$2, If[LessEqual[z, 3.05e-176], t$95$1, If[LessEqual[z, 2.45e-23], t$95$2, N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{y}{\frac{z \cdot c}{x}}\\
t_2 := \frac{b}{z \cdot c}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-92}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-123}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-297}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-260}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-176}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-23}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -2.6000000000000001e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
Taylor expanded in t around inf 61.1%
if -2.6000000000000001e-8 < z < -2.8e-92Initial program 94.2%
associate-/r*88.1%
Simplified81.4%
fma-udef81.4%
+-commutative81.4%
add-cube-cbrt80.5%
pow380.5%
+-commutative80.5%
fma-udef80.5%
Applied egg-rr80.5%
Taylor expanded in b around inf 53.1%
associate-/r*53.0%
Simplified53.0%
div-inv53.2%
Applied egg-rr53.2%
if -2.8e-92 < z < -5.5999999999999998e-123Initial program 90.4%
associate-/r*81.3%
Simplified71.3%
Taylor expanded in t around inf 52.5%
associate-/l*71.0%
associate-/r/71.0%
Simplified71.0%
if -5.5999999999999998e-123 < z < 1.90000000000000002e-297 or 5.6999999999999998e-260 < z < 3.0500000000000001e-176Initial program 99.7%
associate-/r*91.6%
Simplified89.9%
Taylor expanded in x around inf 65.4%
associate-/l*62.6%
*-commutative62.6%
Simplified62.6%
if 1.90000000000000002e-297 < z < 5.6999999999999998e-260 or 3.0500000000000001e-176 < z < 2.4499999999999999e-23Initial program 97.6%
associate-/r*88.6%
Simplified88.5%
Taylor expanded in b around inf 64.2%
*-commutative64.2%
Simplified64.2%
if 2.4499999999999999e-23 < z Initial program 67.8%
associate-/r*80.2%
Simplified90.0%
Taylor expanded in t around inf 56.9%
associate-/l*60.9%
Simplified60.9%
Final simplification61.8%
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 (/ b (* z c))))
(if (<= z -3.5e-8)
(/ (* -4.0 (* t a)) c)
(if (<= z -7.2e-93)
(* (/ 1.0 z) (/ b c))
(if (<= z -1.7e-123)
(* -4.0 (* t (/ a c)))
(if (<= z 9.5e-299)
(* 9.0 (/ y (/ (* z c) x)))
(if (<= z 1.18e-259)
t_1
(if (<= z 3e-177)
(* 9.0 (/ (* x y) (* z c)))
(if (<= z 2e-21) t_1 (* -4.0 (/ a (/ c t))))))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -3.5e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -7.2e-93) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -1.7e-123) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 9.5e-299) {
tmp = 9.0 * (y / ((z * c) / x));
} else if (z <= 1.18e-259) {
tmp = t_1;
} else if (z <= 3e-177) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (z <= 2e-21) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
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 = b / (z * c)
if (z <= (-3.5d-8)) then
tmp = ((-4.0d0) * (t * a)) / c
else if (z <= (-7.2d-93)) then
tmp = (1.0d0 / z) * (b / c)
else if (z <= (-1.7d-123)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 9.5d-299) then
tmp = 9.0d0 * (y / ((z * c) / x))
else if (z <= 1.18d-259) then
tmp = t_1
else if (z <= 3d-177) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (z <= 2d-21) then
tmp = t_1
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -3.5e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -7.2e-93) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -1.7e-123) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 9.5e-299) {
tmp = 9.0 * (y / ((z * c) / x));
} else if (z <= 1.18e-259) {
tmp = t_1;
} else if (z <= 3e-177) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (z <= 2e-21) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = b / (z * c) tmp = 0 if z <= -3.5e-8: tmp = (-4.0 * (t * a)) / c elif z <= -7.2e-93: tmp = (1.0 / z) * (b / c) elif z <= -1.7e-123: tmp = -4.0 * (t * (a / c)) elif z <= 9.5e-299: tmp = 9.0 * (y / ((z * c) / x)) elif z <= 1.18e-259: tmp = t_1 elif z <= 3e-177: tmp = 9.0 * ((x * y) / (z * c)) elif z <= 2e-21: tmp = t_1 else: tmp = -4.0 * (a / (c / t)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(z * c)) tmp = 0.0 if (z <= -3.5e-8) tmp = Float64(Float64(-4.0 * Float64(t * a)) / c); elseif (z <= -7.2e-93) tmp = Float64(Float64(1.0 / z) * Float64(b / c)); elseif (z <= -1.7e-123) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 9.5e-299) tmp = Float64(9.0 * Float64(y / Float64(Float64(z * c) / x))); elseif (z <= 1.18e-259) tmp = t_1; elseif (z <= 3e-177) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (z <= 2e-21) tmp = t_1; else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = b / (z * c);
tmp = 0.0;
if (z <= -3.5e-8)
tmp = (-4.0 * (t * a)) / c;
elseif (z <= -7.2e-93)
tmp = (1.0 / z) * (b / c);
elseif (z <= -1.7e-123)
tmp = -4.0 * (t * (a / c));
elseif (z <= 9.5e-299)
tmp = 9.0 * (y / ((z * c) / x));
elseif (z <= 1.18e-259)
tmp = t_1;
elseif (z <= 3e-177)
tmp = 9.0 * ((x * y) / (z * c));
elseif (z <= 2e-21)
tmp = t_1;
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
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[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-8], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -7.2e-93], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.7e-123], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-299], N[(9.0 * N[(y / N[(N[(z * c), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e-259], t$95$1, If[LessEqual[z, 3e-177], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-21], t$95$1, N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-93}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-123}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-299}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z \cdot c}{x}}\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-259}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-177}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -3.50000000000000024e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
Taylor expanded in t around inf 61.1%
if -3.50000000000000024e-8 < z < -7.2000000000000003e-93Initial program 94.2%
associate-/r*88.1%
Simplified81.4%
fma-udef81.4%
+-commutative81.4%
add-cube-cbrt80.5%
pow380.5%
+-commutative80.5%
fma-udef80.5%
Applied egg-rr80.5%
Taylor expanded in b around inf 53.1%
associate-/r*53.0%
Simplified53.0%
div-inv53.2%
Applied egg-rr53.2%
if -7.2000000000000003e-93 < z < -1.7e-123Initial program 90.4%
associate-/r*81.3%
Simplified71.3%
Taylor expanded in t around inf 52.5%
associate-/l*71.0%
associate-/r/71.0%
Simplified71.0%
if -1.7e-123 < z < 9.5000000000000001e-299Initial program 99.8%
associate-/r*92.8%
Simplified90.4%
Taylor expanded in x around inf 58.8%
associate-/l*54.9%
*-commutative54.9%
Simplified54.9%
if 9.5000000000000001e-299 < z < 1.18e-259 or 3.00000000000000008e-177 < z < 1.99999999999999982e-21Initial program 97.6%
associate-/r*88.6%
Simplified88.5%
Taylor expanded in b around inf 64.2%
*-commutative64.2%
Simplified64.2%
if 1.18e-259 < z < 3.00000000000000008e-177Initial program 99.6%
associate-/r*88.6%
Simplified88.7%
Taylor expanded in x around inf 81.4%
if 1.99999999999999982e-21 < z Initial program 67.8%
associate-/r*80.2%
Simplified90.0%
Taylor expanded in t around inf 56.9%
associate-/l*60.9%
Simplified60.9%
Final simplification61.8%
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 (/ (+ b (* 9.0 (* x y))) (* z c))) (t_2 (* t (* a -4.0))))
(if (<= z -1.22e+17)
(/ (+ t_2 (/ b z)) c)
(if (<= z -1e-98)
t_1
(if (<= z -1e-122)
(* -4.0 (* t (/ a c)))
(if (<= z 6.5e-11) t_1 (/ (+ t_2 (* b (/ 1.0 z))) c)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = t * (a * -4.0);
double tmp;
if (z <= -1.22e+17) {
tmp = (t_2 + (b / z)) / c;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 6.5e-11) {
tmp = t_1;
} else {
tmp = (t_2 + (b * (1.0 / z))) / c;
}
return tmp;
}
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) :: t_2
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (z * c)
t_2 = t * (a * (-4.0d0))
if (z <= (-1.22d+17)) then
tmp = (t_2 + (b / z)) / c
else if (z <= (-1d-98)) then
tmp = t_1
else if (z <= (-1d-122)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 6.5d-11) then
tmp = t_1
else
tmp = (t_2 + (b * (1.0d0 / z))) / c
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = t * (a * -4.0);
double tmp;
if (z <= -1.22e+17) {
tmp = (t_2 + (b / z)) / c;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 6.5e-11) {
tmp = t_1;
} else {
tmp = (t_2 + (b * (1.0 / z))) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (z * c) t_2 = t * (a * -4.0) tmp = 0 if z <= -1.22e+17: tmp = (t_2 + (b / z)) / c elif z <= -1e-98: tmp = t_1 elif z <= -1e-122: tmp = -4.0 * (t * (a / c)) elif z <= 6.5e-11: tmp = t_1 else: tmp = (t_2 + (b * (1.0 / z))) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) t_2 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -1.22e+17) tmp = Float64(Float64(t_2 + Float64(b / z)) / c); elseif (z <= -1e-98) tmp = t_1; elseif (z <= -1e-122) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 6.5e-11) tmp = t_1; else tmp = Float64(Float64(t_2 + Float64(b * Float64(1.0 / z))) / c); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (z * c);
t_2 = t * (a * -4.0);
tmp = 0.0;
if (z <= -1.22e+17)
tmp = (t_2 + (b / z)) / c;
elseif (z <= -1e-98)
tmp = t_1;
elseif (z <= -1e-122)
tmp = -4.0 * (t * (a / c));
elseif (z <= 6.5e-11)
tmp = t_1;
else
tmp = (t_2 + (b * (1.0 / z))) / c;
end
tmp_2 = tmp;
end
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[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.22e+17], N[(N[(t$95$2 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -1e-98], t$95$1, If[LessEqual[z, -1e-122], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-11], t$95$1, N[(N[(t$95$2 + N[(b * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
t_2 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+17}:\\
\;\;\;\;\frac{t_2 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-122}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2 + b \cdot \frac{1}{z}}{c}\\
\end{array}
\end{array}
if z < -1.22e17Initial program 49.0%
associate-/r*54.2%
Simplified85.0%
Taylor expanded in x around 0 78.2%
if -1.22e17 < z < -9.99999999999999939e-99 or -1.00000000000000006e-122 < z < 6.49999999999999953e-11Initial program 98.3%
associate-/r*90.8%
Simplified89.2%
Taylor expanded in z around 0 87.4%
if -9.99999999999999939e-99 < z < -1.00000000000000006e-122Initial program 86.3%
associate-/r*73.5%
Simplified59.2%
Taylor expanded in t around inf 59.5%
associate-/l*85.7%
associate-/r/85.8%
Simplified85.8%
if 6.49999999999999953e-11 < z Initial program 65.9%
associate-/r*79.0%
Simplified89.4%
div-inv89.4%
Applied egg-rr89.4%
Taylor expanded in x around 0 73.6%
Final simplification81.7%
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 (/ (+ b (* 9.0 (* x y))) (* z c))) (t_2 (* t (* a -4.0))))
(if (<= z -3.3e+16)
(/ (+ t_2 (/ b z)) c)
(if (<= z -4.2e-48)
t_1
(if (<= z -1e-122)
(/ (- b (* 4.0 (* a (* z t)))) (* z c))
(if (<= z 9.5e-10) t_1 (/ (+ t_2 (* b (/ 1.0 z))) c)))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = t * (a * -4.0);
double tmp;
if (z <= -3.3e+16) {
tmp = (t_2 + (b / z)) / c;
} else if (z <= -4.2e-48) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else if (z <= 9.5e-10) {
tmp = t_1;
} else {
tmp = (t_2 + (b * (1.0 / z))) / c;
}
return tmp;
}
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) :: t_2
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (z * c)
t_2 = t * (a * (-4.0d0))
if (z <= (-3.3d+16)) then
tmp = (t_2 + (b / z)) / c
else if (z <= (-4.2d-48)) then
tmp = t_1
else if (z <= (-1d-122)) then
tmp = (b - (4.0d0 * (a * (z * t)))) / (z * c)
else if (z <= 9.5d-10) then
tmp = t_1
else
tmp = (t_2 + (b * (1.0d0 / z))) / c
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = t * (a * -4.0);
double tmp;
if (z <= -3.3e+16) {
tmp = (t_2 + (b / z)) / c;
} else if (z <= -4.2e-48) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
} else if (z <= 9.5e-10) {
tmp = t_1;
} else {
tmp = (t_2 + (b * (1.0 / z))) / c;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (z * c) t_2 = t * (a * -4.0) tmp = 0 if z <= -3.3e+16: tmp = (t_2 + (b / z)) / c elif z <= -4.2e-48: tmp = t_1 elif z <= -1e-122: tmp = (b - (4.0 * (a * (z * t)))) / (z * c) elif z <= 9.5e-10: tmp = t_1 else: tmp = (t_2 + (b * (1.0 / z))) / c return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) t_2 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -3.3e+16) tmp = Float64(Float64(t_2 + Float64(b / z)) / c); elseif (z <= -4.2e-48) tmp = t_1; elseif (z <= -1e-122) tmp = Float64(Float64(b - Float64(4.0 * Float64(a * Float64(z * t)))) / Float64(z * c)); elseif (z <= 9.5e-10) tmp = t_1; else tmp = Float64(Float64(t_2 + Float64(b * Float64(1.0 / z))) / c); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (z * c);
t_2 = t * (a * -4.0);
tmp = 0.0;
if (z <= -3.3e+16)
tmp = (t_2 + (b / z)) / c;
elseif (z <= -4.2e-48)
tmp = t_1;
elseif (z <= -1e-122)
tmp = (b - (4.0 * (a * (z * t)))) / (z * c);
elseif (z <= 9.5e-10)
tmp = t_1;
else
tmp = (t_2 + (b * (1.0 / z))) / c;
end
tmp_2 = tmp;
end
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[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e+16], N[(N[(t$95$2 + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -4.2e-48], t$95$1, If[LessEqual[z, -1e-122], N[(N[(b - N[(4.0 * N[(a * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-10], t$95$1, N[(N[(t$95$2 + N[(b * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
t_2 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+16}:\\
\;\;\;\;\frac{t_2 + \frac{b}{z}}{c}\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-122}:\\
\;\;\;\;\frac{b - 4 \cdot \left(a \cdot \left(z \cdot t\right)\right)}{z \cdot c}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2 + b \cdot \frac{1}{z}}{c}\\
\end{array}
\end{array}
if z < -3.3e16Initial program 49.0%
associate-/r*54.2%
Simplified85.0%
Taylor expanded in x around 0 78.2%
if -3.3e16 < z < -4.19999999999999977e-48 or -1.00000000000000006e-122 < z < 9.50000000000000028e-10Initial program 98.2%
associate-/r*91.0%
Simplified89.3%
Taylor expanded in z around 0 88.3%
if -4.19999999999999977e-48 < z < -1.00000000000000006e-122Initial program 93.2%
associate-*l*93.2%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in x around 0 79.5%
if 9.50000000000000028e-10 < z Initial program 65.9%
associate-/r*79.0%
Simplified89.4%
div-inv89.4%
Applied egg-rr89.4%
Taylor expanded in x around 0 73.6%
Final simplification81.7%
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 (/ b (* z c))))
(if (<= z -3.7e-8)
(/ (* -4.0 (* t a)) c)
(if (<= z -5.2e-92)
(* (/ 1.0 z) (/ b c))
(if (<= z -1.65e-124)
(* -4.0 (* t (/ a c)))
(if (<= z 1.02e-258)
t_1
(if (<= z 4.6e-189)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= z 4.5e-20) t_1 (* -4.0 (/ a (/ c t)))))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -3.7e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -5.2e-92) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -1.65e-124) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 1.02e-258) {
tmp = t_1;
} else if (z <= 4.6e-189) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (z <= 4.5e-20) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
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 = b / (z * c)
if (z <= (-3.7d-8)) then
tmp = ((-4.0d0) * (t * a)) / c
else if (z <= (-5.2d-92)) then
tmp = (1.0d0 / z) * (b / c)
else if (z <= (-1.65d-124)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 1.02d-258) then
tmp = t_1
else if (z <= 4.6d-189) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (z <= 4.5d-20) then
tmp = t_1
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (z * c);
double tmp;
if (z <= -3.7e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -5.2e-92) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -1.65e-124) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 1.02e-258) {
tmp = t_1;
} else if (z <= 4.6e-189) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (z <= 4.5e-20) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = b / (z * c) tmp = 0 if z <= -3.7e-8: tmp = (-4.0 * (t * a)) / c elif z <= -5.2e-92: tmp = (1.0 / z) * (b / c) elif z <= -1.65e-124: tmp = -4.0 * (t * (a / c)) elif z <= 1.02e-258: tmp = t_1 elif z <= 4.6e-189: tmp = 9.0 * ((y / z) * (x / c)) elif z <= 4.5e-20: tmp = t_1 else: tmp = -4.0 * (a / (c / t)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(z * c)) tmp = 0.0 if (z <= -3.7e-8) tmp = Float64(Float64(-4.0 * Float64(t * a)) / c); elseif (z <= -5.2e-92) tmp = Float64(Float64(1.0 / z) * Float64(b / c)); elseif (z <= -1.65e-124) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 1.02e-258) tmp = t_1; elseif (z <= 4.6e-189) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (z <= 4.5e-20) tmp = t_1; else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = b / (z * c);
tmp = 0.0;
if (z <= -3.7e-8)
tmp = (-4.0 * (t * a)) / c;
elseif (z <= -5.2e-92)
tmp = (1.0 / z) * (b / c);
elseif (z <= -1.65e-124)
tmp = -4.0 * (t * (a / c));
elseif (z <= 1.02e-258)
tmp = t_1;
elseif (z <= 4.6e-189)
tmp = 9.0 * ((y / z) * (x / c));
elseif (z <= 4.5e-20)
tmp = t_1;
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
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[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e-8], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -5.2e-92], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.65e-124], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-258], t$95$1, If[LessEqual[z, 4.6e-189], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-20], t$95$1, N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b}{z \cdot c}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-124}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-258}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-189}:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -3.7e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
Taylor expanded in t around inf 61.1%
if -3.7e-8 < z < -5.2e-92Initial program 94.2%
associate-/r*88.1%
Simplified81.4%
fma-udef81.4%
+-commutative81.4%
add-cube-cbrt80.5%
pow380.5%
+-commutative80.5%
fma-udef80.5%
Applied egg-rr80.5%
Taylor expanded in b around inf 53.1%
associate-/r*53.0%
Simplified53.0%
div-inv53.2%
Applied egg-rr53.2%
if -5.2e-92 < z < -1.64999999999999992e-124Initial program 91.3%
associate-/r*83.0%
Simplified73.9%
Taylor expanded in t around inf 56.8%
associate-/l*73.6%
associate-/r/73.7%
Simplified73.7%
if -1.64999999999999992e-124 < z < 1.02e-258 or 4.5999999999999996e-189 < z < 4.5000000000000001e-20Initial program 98.7%
associate-/r*91.0%
Simplified89.8%
Taylor expanded in b around inf 58.9%
*-commutative58.9%
Simplified58.9%
if 1.02e-258 < z < 4.5999999999999996e-189Initial program 99.7%
associate-/r*85.2%
Simplified85.2%
Taylor expanded in x around inf 82.7%
*-commutative82.7%
times-frac69.7%
Simplified69.7%
if 4.5000000000000001e-20 < z Initial program 67.8%
associate-/r*80.2%
Simplified90.0%
Taylor expanded in t around inf 56.9%
associate-/l*60.9%
Simplified60.9%
Final simplification60.8%
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 (/ (+ b (* 9.0 (* x y))) (* z c))))
(if (<= z -1.86e+81)
(/ (* -4.0 (* t a)) c)
(if (<= z -1e-98)
t_1
(if (<= z -1e-122)
(* -4.0 (* t (/ a c)))
(if (<= z 460.0) t_1 (* -4.0 (/ a (/ c t)))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (z <= -1.86e+81) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 460.0) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
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 = (b + (9.0d0 * (x * y))) / (z * c)
if (z <= (-1.86d+81)) then
tmp = ((-4.0d0) * (t * a)) / c
else if (z <= (-1d-98)) then
tmp = t_1
else if (z <= (-1d-122)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 460.0d0) then
tmp = t_1
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double tmp;
if (z <= -1.86e+81) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 460.0) {
tmp = t_1;
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (z * c) tmp = 0 if z <= -1.86e+81: tmp = (-4.0 * (t * a)) / c elif z <= -1e-98: tmp = t_1 elif z <= -1e-122: tmp = -4.0 * (t * (a / c)) elif z <= 460.0: tmp = t_1 else: tmp = -4.0 * (a / (c / t)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) tmp = 0.0 if (z <= -1.86e+81) tmp = Float64(Float64(-4.0 * Float64(t * a)) / c); elseif (z <= -1e-98) tmp = t_1; elseif (z <= -1e-122) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 460.0) tmp = t_1; else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (z * c);
tmp = 0.0;
if (z <= -1.86e+81)
tmp = (-4.0 * (t * a)) / c;
elseif (z <= -1e-98)
tmp = t_1;
elseif (z <= -1e-122)
tmp = -4.0 * (t * (a / c));
elseif (z <= 460.0)
tmp = t_1;
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
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[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.86e+81], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -1e-98], t$95$1, If[LessEqual[z, -1e-122], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 460.0], t$95$1, N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{if}\;z \leq -1.86 \cdot 10^{+81}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-122}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 460:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -1.86000000000000003e81Initial program 37.9%
associate-/r*42.9%
Simplified84.2%
Taylor expanded in t around inf 69.4%
if -1.86000000000000003e81 < z < -9.99999999999999939e-99 or -1.00000000000000006e-122 < z < 460Initial program 96.6%
associate-/r*90.6%
Simplified89.3%
Taylor expanded in z around 0 83.2%
if -9.99999999999999939e-99 < z < -1.00000000000000006e-122Initial program 86.3%
associate-/r*73.5%
Simplified59.2%
Taylor expanded in t around inf 59.5%
associate-/l*85.7%
associate-/r/85.8%
Simplified85.8%
if 460 < z Initial program 64.2%
associate-/r*78.0%
Simplified88.8%
Taylor expanded in t around inf 59.7%
associate-/l*64.2%
Simplified64.2%
Final simplification76.3%
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 (/ (+ b (* 9.0 (* x y))) (* z c)))
(t_2 (/ (+ (* t (* a -4.0)) (/ b z)) c)))
(if (<= z -9.2e+16)
t_2
(if (<= z -1e-98)
t_1
(if (<= z -1e-122)
(* -4.0 (* t (/ a c)))
(if (<= z 6.6e-11) t_1 t_2))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = ((t * (a * -4.0)) + (b / z)) / c;
double tmp;
if (z <= -9.2e+16) {
tmp = t_2;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 6.6e-11) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
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) :: t_2
real(8) :: tmp
t_1 = (b + (9.0d0 * (x * y))) / (z * c)
t_2 = ((t * (a * (-4.0d0))) + (b / z)) / c
if (z <= (-9.2d+16)) then
tmp = t_2
else if (z <= (-1d-98)) then
tmp = t_1
else if (z <= (-1d-122)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 6.6d-11) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (b + (9.0 * (x * y))) / (z * c);
double t_2 = ((t * (a * -4.0)) + (b / z)) / c;
double tmp;
if (z <= -9.2e+16) {
tmp = t_2;
} else if (z <= -1e-98) {
tmp = t_1;
} else if (z <= -1e-122) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 6.6e-11) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + (9.0 * (x * y))) / (z * c) t_2 = ((t * (a * -4.0)) + (b / z)) / c tmp = 0 if z <= -9.2e+16: tmp = t_2 elif z <= -1e-98: tmp = t_1 elif z <= -1e-122: tmp = -4.0 * (t * (a / c)) elif z <= 6.6e-11: tmp = t_1 else: tmp = t_2 return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)) t_2 = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c) tmp = 0.0 if (z <= -9.2e+16) tmp = t_2; elseif (z <= -1e-98) tmp = t_1; elseif (z <= -1e-122) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 6.6e-11) tmp = t_1; else tmp = t_2; end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = (b + (9.0 * (x * y))) / (z * c);
t_2 = ((t * (a * -4.0)) + (b / z)) / c;
tmp = 0.0;
if (z <= -9.2e+16)
tmp = t_2;
elseif (z <= -1e-98)
tmp = t_1;
elseif (z <= -1e-122)
tmp = -4.0 * (t * (a / c));
elseif (z <= 6.6e-11)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
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[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[z, -9.2e+16], t$95$2, If[LessEqual[z, -1e-98], t$95$1, If[LessEqual[z, -1e-122], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-11], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
t_2 := \frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+16}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-122}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -9.2e16 or 6.6000000000000005e-11 < z Initial program 57.8%
associate-/r*67.2%
Simplified87.3%
Taylor expanded in x around 0 75.8%
if -9.2e16 < z < -9.99999999999999939e-99 or -1.00000000000000006e-122 < z < 6.6000000000000005e-11Initial program 98.3%
associate-/r*90.8%
Simplified89.2%
Taylor expanded in z around 0 87.4%
if -9.99999999999999939e-99 < z < -1.00000000000000006e-122Initial program 86.3%
associate-/r*73.5%
Simplified59.2%
Taylor expanded in t around inf 59.5%
associate-/l*85.7%
associate-/r/85.8%
Simplified85.8%
Final simplification81.7%
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 -2.35e-8)
(/ (* -4.0 (* t a)) c)
(if (<= z -1.38e-87)
(* (/ 1.0 z) (/ b c))
(if (<= z -2.6e-124)
(* -4.0 (* t (/ a c)))
(if (<= z 4.8e-23) (/ b (* z c)) (* -4.0 (/ a (/ c t))))))))assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.35e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -1.38e-87) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -2.6e-124) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 4.8e-23) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
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 <= (-2.35d-8)) then
tmp = ((-4.0d0) * (t * a)) / c
else if (z <= (-1.38d-87)) then
tmp = (1.0d0 / z) * (b / c)
else if (z <= (-2.6d-124)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 4.8d-23) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
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 <= -2.35e-8) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= -1.38e-87) {
tmp = (1.0 / z) * (b / c);
} else if (z <= -2.6e-124) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 4.8e-23) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2.35e-8: tmp = (-4.0 * (t * a)) / c elif z <= -1.38e-87: tmp = (1.0 / z) * (b / c) elif z <= -2.6e-124: tmp = -4.0 * (t * (a / c)) elif z <= 4.8e-23: tmp = b / (z * c) else: tmp = -4.0 * (a / (c / t)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.35e-8) tmp = Float64(Float64(-4.0 * Float64(t * a)) / c); elseif (z <= -1.38e-87) tmp = Float64(Float64(1.0 / z) * Float64(b / c)); elseif (z <= -2.6e-124) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 4.8e-23) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -2.35e-8)
tmp = (-4.0 * (t * a)) / c;
elseif (z <= -1.38e-87)
tmp = (1.0 / z) * (b / c);
elseif (z <= -2.6e-124)
tmp = -4.0 * (t * (a / c));
elseif (z <= 4.8e-23)
tmp = b / (z * c);
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
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, -2.35e-8], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, -1.38e-87], N[(N[(1.0 / z), $MachinePrecision] * N[(b / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-124], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-23], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-8}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{elif}\;z \leq -1.38 \cdot 10^{-87}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{b}{c}\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-124}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-23}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -2.3499999999999999e-8Initial program 51.5%
associate-/r*56.4%
Simplified85.7%
Taylor expanded in t around inf 61.1%
if -2.3499999999999999e-8 < z < -1.3800000000000001e-87Initial program 94.2%
associate-/r*88.1%
Simplified81.4%
fma-udef81.4%
+-commutative81.4%
add-cube-cbrt80.5%
pow380.5%
+-commutative80.5%
fma-udef80.5%
Applied egg-rr80.5%
Taylor expanded in b around inf 53.1%
associate-/r*53.0%
Simplified53.0%
div-inv53.2%
Applied egg-rr53.2%
if -1.3800000000000001e-87 < z < -2.6e-124Initial program 91.3%
associate-/r*83.0%
Simplified73.9%
Taylor expanded in t around inf 56.8%
associate-/l*73.6%
associate-/r/73.7%
Simplified73.7%
if -2.6e-124 < z < 4.79999999999999993e-23Initial program 98.8%
associate-/r*90.2%
Simplified89.2%
Taylor expanded in b around inf 54.5%
*-commutative54.5%
Simplified54.5%
if 4.79999999999999993e-23 < z Initial program 67.8%
associate-/r*80.2%
Simplified90.0%
Taylor expanded in t around inf 56.9%
associate-/l*60.9%
Simplified60.9%
Final simplification58.6%
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.1e-124) (not (<= z 6.6e-20))) (* -4.0 (* t (/ a c))) (/ b (* z c))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2.1e-124) || !(z <= 6.6e-20)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
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 <= (-2.1d-124)) .or. (.not. (z <= 6.6d-20))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = b / (z * c)
end if
code = tmp
end function
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 <= -2.1e-124) || !(z <= 6.6e-20)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = b / (z * c);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2.1e-124) or not (z <= 6.6e-20): tmp = -4.0 * (t * (a / c)) else: tmp = b / (z * c) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2.1e-124) || !(z <= 6.6e-20)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(b / Float64(z * c)); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((z <= -2.1e-124) || ~((z <= 6.6e-20)))
tmp = -4.0 * (t * (a / c));
else
tmp = b / (z * c);
end
tmp_2 = tmp;
end
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.1e-124], N[Not[LessEqual[z, 6.6e-20]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-124} \lor \neg \left(z \leq 6.6 \cdot 10^{-20}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\end{array}
\end{array}
if z < -2.1000000000000001e-124 or 6.6e-20 < z Initial program 65.5%
associate-/r*71.8%
Simplified86.3%
Taylor expanded in t around inf 55.3%
associate-/l*55.2%
associate-/r/53.4%
Simplified53.4%
if -2.1000000000000001e-124 < z < 6.6e-20Initial program 98.8%
associate-/r*90.2%
Simplified89.2%
Taylor expanded in b around inf 54.5%
*-commutative54.5%
Simplified54.5%
Final simplification53.8%
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 -2.9e-124) (* -4.0 (* t (/ a c))) (if (<= z 4.8e-22) (/ b (* z c)) (* -4.0 (/ a (/ c t))))))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -2.9e-124) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 4.8e-22) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
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 <= (-2.9d-124)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 4.8d-22) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (a / (c / t))
end if
code = tmp
end function
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 <= -2.9e-124) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 4.8e-22) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (a / (c / t));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -2.9e-124: tmp = -4.0 * (t * (a / c)) elif z <= 4.8e-22: tmp = b / (z * c) else: tmp = -4.0 * (a / (c / t)) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -2.9e-124) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 4.8e-22) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= -2.9e-124)
tmp = -4.0 * (t * (a / c));
elseif (z <= 4.8e-22)
tmp = b / (z * c);
else
tmp = -4.0 * (a / (c / t));
end
tmp_2 = tmp;
end
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, -2.9e-124], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-22], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-124}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if z < -2.9000000000000002e-124Initial program 63.7%
associate-/r*65.1%
Simplified83.5%
Taylor expanded in t around inf 54.0%
associate-/l*50.8%
associate-/r/50.6%
Simplified50.6%
if -2.9000000000000002e-124 < z < 4.80000000000000005e-22Initial program 98.8%
associate-/r*90.2%
Simplified89.2%
Taylor expanded in b around inf 54.5%
*-commutative54.5%
Simplified54.5%
if 4.80000000000000005e-22 < z Initial program 67.8%
associate-/r*80.2%
Simplified90.0%
Taylor expanded in t around inf 56.9%
associate-/l*60.9%
Simplified60.9%
Final simplification54.9%
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.2e-56) (/ b (* z c)) (/ (/ b c) z)))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= 1.2e-56) {
tmp = b / (z * c);
} else {
tmp = (b / c) / z;
}
return tmp;
}
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.2d-56) then
tmp = b / (z * c)
else
tmp = (b / c) / z
end if
code = tmp
end function
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.2e-56) {
tmp = b / (z * c);
} else {
tmp = (b / c) / z;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= 1.2e-56: tmp = b / (z * c) else: tmp = (b / c) / z return tmp
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= 1.2e-56) tmp = Float64(b / Float64(z * c)); else tmp = Float64(Float64(b / c) / z); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (z <= 1.2e-56)
tmp = b / (z * c);
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
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.2e-56], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2 \cdot 10^{-56}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if z < 1.2e-56Initial program 81.4%
associate-/r*77.3%
Simplified85.9%
Taylor expanded in b around inf 38.5%
*-commutative38.5%
Simplified38.5%
if 1.2e-56 < z Initial program 71.5%
associate-/r*82.5%
Simplified91.1%
fma-udef91.1%
+-commutative91.1%
add-cube-cbrt90.1%
pow390.1%
+-commutative90.1%
fma-udef90.1%
Applied egg-rr90.1%
Taylor expanded in b around inf 21.3%
associate-/r*30.1%
Simplified30.1%
Final simplification36.0%
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 (* z c)))
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
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 / (z * c)
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (z * c)
t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
end
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[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 78.4%
associate-/r*78.9%
Simplified87.5%
Taylor expanded in b around inf 33.3%
*-commutative33.3%
Simplified33.3%
Final simplification33.3%
(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 2023196
(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)))